SMC_AvoidLoop (FB)ΒΆ
FUNCTION_BLOCK SMC_AvoidLoop
SMC_AvoidLoop removes loops from the path.
It copies the input path, but cuts out the loops created by
self-intersections. The resulting output path is free of
self-intersections.
For a typical application see SMC_ToolRadiusCorr.
This function block needs to be activated/deactivated in the G-Code with G61/G60.
Note
The effectiveness and efficiency of SMC_AvoidLoop depend on the appropriate size of the input queue
poqDataIn. A loop containing more objects than can be stored inpoqDataInis not detected. On the other hand, for each element, an intersection check is executed with all following elements of the queue. If the queue is large, completing these checks may take a long time.SMC_AvoidLoop does not support ellipses (G08/G09). An error is reported if an ellipse element is detected while loop avoidance is active.
SMC_AvoidLoop only works in 2.5D mode (see G15). An error is reported if elements with full 3D mode (such as G10 elements) are detected while loop avoidance is active.
- InOut:
Scope
Name
Type
Comment
Input
bExecuteBOOLExecution starts on the rising edge.
bAbortBOOLIf
TRUE, the current processing of this function block is abortedbAppendBOOLAs long as this input remains
FALSE,poqDataOutis cleared at each reset. As long as it remainsTRUE, newly incoming data is written to the end ofpoqDataOut.poqDataInPOINTER TO SMC_OUTQUEUE
This variable points to the SMC_OUTQUEUE structure which contains the SMC_GEOINFO objects of the path. Typically it points on the output
poqDataOutof the preceding function block (e.g. the SMC_NCInterpreter ).nSizeOutQueueUDINTThis variable contains the size of the data buffer in bytes. This buffer must be able to hold at least five SMC_GEOINFO objects. It is recommended to create the buffer as described by the example below.
ExampleBuf: Array[1..50] of SMC_GeoInfoThe appropriate buffer size can then be computed using
SIZEOF(ExampleBuf).pbyBufferOutQueuePOINTER TO ARRAY [0..0] OF SMC_GEOINFO
This input must point to the first byte of the memory area that is allocated for the SMC_OUTQUEUE structure. This area must be at least as big as defined in
nSizeOutQueue. Typically the allocation of the memory buffer is done in the declaration part of the IEC-program by defining an array of SMC_GEOINFO e.g.BUF: ARRAY[1..50] OF SMC_GEOINFO; for a buffer that can store 50 path elements).Output
bDoneBOOLSet if the entire path has been processed
bBusyBOOLTRUE, while execution of function block is not finishedbErrorBOOLSignals, that an error has occurred within the function block
wErrorIDSMC_ERRORError identification
poqDataOutPOINTER TO SMC_OUTQUEUE
This variable points to a SMC_OUTQUEUE structure, which manages the SMC_GEOINFO objects of the output path.
iStatusThis enum variable shows the current state of the function block.
Structure: