L-force | plc designer - softmotion – Lenze PLC Designer PLC-Designer (R2-x) SoftMotion User Manual

Page 209

Advertising
background image

DMS 5.2 EN 03/2011 TD17

L

209

L-force | PLC Designer - SoftMotion

The SM_CNC.lib library

Structures of SM_CNC.lib

Structure initialisation
The SMC_NCDecoder, SMC_SmoothPath, SMC_RoundPath, SMC_AvoidLoop and

SMC_ToolCorr SoftMotion program organisation units, which provide a pointer to an

internally managed OutQueue structure, will automatically initialise the structure. The

SMC_SmoothPath, SMC_RoundPath, SMC_ToolCorr, SMC_AvoidLoop and

SMC_Interpolator program organisation units need a pointer to a correct OutQueue list in

the form of an input. If this list is programmed and filled "manually", correct initialisation

also needs to be performed manually. The first two variables (buffer, size) must be set. It is

also strongly recommended that the above functions are used when working with an

SMC_OUTQUEUE and that, if at all possible, the other variables are not modified following

initialisation.

Structure components
pbyBuffer: POINTER TO BYTE
This variable contains the address of a coherent memory area, which is allocated for saving

GEOINFO objects. This memory must be assigned in the IEC program and its address then

written to this variable. The assignment in the declaration part can be performed by means

of a byte array, for example (BUF: ARRAY[1..10000] OF BYTE; for a 10,000 byte memory

area).
nSize: UDINT
The size of the memory area reserved for the buffer must appear here.
nReadPos: UDINT
This variable contains the address of the first list element relative to the first byte of the

reserved memory area.
nWritePos: UDINT
This variable contains the address of the first free byte following the list relative to the first

byte of the reserved memory area.
bFull: BOOL
If the list is full, with space only left for three further GEOINFO structures (safety buffer),

this variable will be set to TRUE by the APPENDOBJ function. DELETEOBJ will reset it to

FALSE if elements are deleted from the list.
bEndOfList: BOOL
The SoftMotion program organisation units that have an OutQueue structure as an input

always wait until the queue is completely full before processing it, in order to avoid a data

underrun (SMC_Interpolator), for example. As the OutQueue will no longer be full when it

comes to the last SMC_GEOINFO objects of a path, this variable must be set to TRUE once

the last SMC_GEOINFO object has been stored, in order to keep processing going. If the list

then becomes empty and needs to be filled again, EndOfList must be reset to FALSE.

Advertising