FUNCTION_BLOCK SMC_OUTQUEUE
This function block is designed to manage SMC_GEOINFO objects in a list of defined size.
The SoftMotion function block SMC_NCDecoder, SMC_SmoothPath, SMC_RoundPath, SMC_AvoidLoop (FB) and SMC_ToolCorr - providing a pointer to an internally handled SMC_OUTQUEUE-structure - will initialize this structure automatically.
The function blocks SMC_SmoothPath, SMC_RoundPath, SMC_ToolCorr, SMC_AvoidLoop and SMC_Interpolator have to be passed a pointer on a correct SMC_OUTQUEUE list. If this list is programmed and filled "manually", then the correct initialization has to be done manually also. For this purpose the first two variables (pbyBuffer, size) have to be assigned.
Note
It is strictly recommended to use the functions described above for working with a SMC_OUTQUEUE structure, and to avoid any modifications of the other parameters after initialization.
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Input |
wOUTQUEUEStructID |
WORD |
16#9878 |
The fix value of this variable allows to check if the provided structure variable is of type SMC_OUTQUEUE. |
pbyBuffer |
POINTER TO ARRAY [0..0] OF SMC_GeoInfo |
Address of coherent memory buffer allocated for SMC_GEOINFO objects. The variable pbyBuffer has to be assigned in every cycle within the IEC program allocating the buffer. The allocation is done within the declaration part, e.g. by using an array (BUFFER: ARRAY [0..99] OF SMC_GEOINFO for a memory area large enough to hold 100 SMC_GEOINFO objects). |
||
nCapacity |
UDINT |
Contains the capacity in multiples of SMC_GEOINFO objects (The number OF SMC_GEOINFO objects that fit into pbyBuffer). The function SMC_SetQueueCapacity initializes this field. |
||
nReadPos |
UDINT |
Contains the position in multiples of SMC_GEOINFO objects of the first object in the list. |
||
nWritePos |
UDINT |
Contains the next free position in multiples of SMC_GEOINFO objects. |
||
bFull |
BOOL |
By function block SMC_AppendObj, this variable will be set to TRUE as soon as the list has been filled up apart from the safety buffer, i.e. there is space left for three further SMC_GEOINFO objects only. After some elements have been removed from the list, SMC_DeleteObj will reset the value of bFull to FALSE. |
||
bEndOfList |
BOOL |
In order to avoid a buffer underrun ( SMC_Interpolator), the SoftMotion function block being passed an SMC_OUTQUEUE structure will not start with the processing of this queue, until it has been filled up completely. However, when working on the last SMC_GEOINFO objects of a path, SMC_OUTQUEUE is no longer complete. Hence, in order to keep the processing going on, bEndOfList has to be set to TRUE as soon as the last SMC_GEOINFO object has been stored. In case that the list will be empty hereafter, but should be filled up again, bEndOfList has to be reset to FALSE. |
||
byGenerator |
BYTE |
250 |
Originator of the queue. The interpolator will use this information for verifying that SMC_CheckVelocities has been processed as prescribed. Valid values are:
|
|
bReCheckVelocities |
BOOL |
Internal variable |
||
strProgramName |
STRING |
Name of the CNC program |
||
xPartofLM |
BOOL |
If the input, generated by programming system, is TRUE, the function block is maintained by managers. |
||
nNumReservedEntries |
UDINT |
The number of reserved entries: if this number of free entries is reached, bFull is set. Must be at least 3 and at most nCapacity-1. |
||
nPastMarker |
DINT |
Points to the first element that has been stored in the queue (if any) and has not yet been overwritten. So the elements from nPastMarker to nReadPos-1 are the "past" of the current queue. nPastMarker equals -1 if (and only if) no element has been appended to the queue yet. |