4 smc_avoidloop, Smc_avoidloop, L-force | plc designer - softmotion – Lenze PLC Designer PLC-Designer (R2-x) SoftMotion User Manual
Page 176

DMS 5.2 EN 03/2011 TD17
L
176
L-force | PLC Designer - SoftMotion
The SM_CNC.lib library
SMC_AvoidLoop
7.4
SMC_AvoidLoop
This POU might be used to address the problem described in the section on the
SMC_ToolCorr program organisation unit, for example.
The SMC_AvoidLoop program organisation unit functions as follows:
The program organisation unit runs through all the SMC_GEOINFO objects found in the
input SMC_OUTQUEUE structure. If bit 7 of the Intern_Mark variable is set in one of these
objects, the "avoid loop" function will be activated. The program organisation unit will now
start to check whether the current object intersects with the subsequent SMC_GEOINFO
objects that come before an SMC_GEOINFO object in which bit 6 of the Intern_Mark
variable is set, thus deactivating the avoid loop function. If no intersections are found, the
object will be copied to the output SMC_OUTQUEUE unchanged, otherwise the first of the
intersecting objects will be cut at the intersection point, the SMC_GEOINFO objects
positioned between the intersecting objects will be removed and the new path will be
resumed at the intersection point, starting with the second of the two intersecting objects.
SMC_NCDecoder will set bit 6 and bit 7 of Intern_Mark as a response to commands G61/
G60.
A decisive factor here is how many objects are contained in the input SMC_OUTQUEUE, i.e.
how it has been dimensioned. If a loop contains more objects than can be stored in the
SMC_OUTQUEUE, that particular loop will not be detected.
Inputs (VAR_IN)
bExecute: BOOL
The program organisation unit executes a reset and starts the tool radius correction if a
rising edge is detected at this input.
bAppend: BOOL
If this input is set to FALSE, the DataOut queue will be cleared on each reset. If it is TRUE,
new data will be written at the end of the DataOut queue.
poqDataIn: POINTER TO SMC_OUTQUEUE
This input points to the SMC_OUTQUEUE structure object that contains the
SMC_GEOINFO objects of the path, typically to the DataOut output of the preceding POU
(e.g. the SMC_NCDecoder). It must be of a corresponding size.
The SMC_AvoidLoop program organisation unit (SM_CNC.lib) can be used
for path preprocessing: it creates a loopless copy of a defined path. If an
intersection is detected in the original path, the path will be cut at this point,
the loop will be removed and the residual path will be followed. This results
in a loopless, continuous path.