FUNCTION_BLOCK SMC_CheckForLimits
The function block checks whether a path leaves its specific, rectangular range.
Example
Assignment of input poqDataIn
Typically, poqDataOut of the previous function block is fed to the input poqDataIn. That can be an instance of the function block SMC_NCDecoder or SMC_SmoothPath.
Allocating memory for the preprocessing of the path elements
If the function block is executed, memory is needed, in which the processing elements are copied. The buffer must be able to hold at least five SMC_GEOINFO objects. If the structure is too small, the function block performs no actions. The memory is declared in the IEC program as an array of objects of type SMC_GEOINFO.
PROGRAM Path
VAR
buf2: ARRAY[1..50] OF SMC_GeoInfo;
END_VAR
Determining the size of the allocated memory area
The size of the memory is determined by the operator SIZEOF in the implementation of the IEC program and is fed to the input nSizeOutQueue. The address of the memory is defined with the operator ADR and is fed to the input pbyBufferOutQueue.
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Input |
bExecute |
BOOL |
FALSE |
Execution starts on the rising edge. |
bAbort |
BOOL |
FALSE |
TRUE: Aborts the processing of the function block |
|
poqDataIn |
POINTER TO SMC_OUTQUEUE |
NULL |
Pointer to data of structure SMC_OUTQUEUE containing the path objects of type SMC_GEOINFO. |
|
wAddAxis |
WORD |
Bit field of the axes that will be tested
Example: 16#104 causes test of Z and U |
||
piMin |
Lower edge of permissible range |
|||
piMax |
Upper edge of permissible range |
|||
d3dCheckDistance |
LREAL |
In case of an 3D-object, the distance between the points that are checked. If 0, the number of points per object will be the object's length divided by 10, plus start- and end-position. |
||
diMinNoPoints |
DINT |
5 |
Apart from start- and end-position, the minimal number of points per object that are checked. |
|
diMaxNoPoints |
DINT |
100 |
Analogously. -1 means that there is no maximum number. |
|
Output |
bBusy |
BOOL |
FALSE |
TRUE: Function block in execution |
bError |
BOOL |
FALSE |
TRUE: Error has occurred |
|
wErrorID |
SMC_ERROR |
SMC_NO_ERROR |
Error identification |
|
wAxisOutOfLimits |
WORD |
Axes that have left the boundary |
||
iSourceLine_No |
DINT |
-1 |
Line number of the object that has exceed the limit |
|
poqDataOut |
POINTER TO SMC_OUTQUEUE |
NULL |
Pointer to data of structure SMC_OUTQUEUE containing the path elements of type SMC_GEOINFO that has been checked |
|
wLimitSwPositive |
WORD |
Axes that have exceeded the upper limit |
||
wLimitSwNegative |
WORD |
Axes that have exceeded the lower limit |