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

Page 169

Advertising
background image

L-force | PLC Designer - SoftMotion

The SM_CNC.lib library

SMC_NCDecoder

169

L

DMS 5.2 EN 03/2011 TD17

7.1

SMC_NCDecoder

The SMC_NCDecoder program organisation unit (SM_CNC.lib) converts a CNC program

created in the CNC editor into a list of SoftMotion GEOINFO structure objects. One program

line is decoded per cycle.

Input/output (VAR_IN_OUT)
ncprog: SMC_CNC_REF
The CNC program (structure SMC_CNC_REF of SM_DriveBasic.lib) is shown in this IN_OUT

variable. This program may either have been generated by the IEC program or programmed

in the CNC editor.

Inputs (VAR_IN)
bExecute: BOOL
The program organisation unit executes a reset and starts the decoding procedure 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.
bStepSuppress: BOOL
If this input is set to TRUE, lines of the CNC program starting with "/" will be ignored. If it is

FALSE (default), they will be processed regardless.
piStartPosition
Position of the point to be moved at the beginning of the path. Here, the current setpoint

positions of the axes should always be used. Use of the actual positions can lead to an

additional revolution, especially in the case of modulo axes.
nSizeOutQueue: UDINT
Here, the POU is informed of the size of the data buffer into which the list of GEOINFO

structure objects is written. The buffer must be five times bigger than a GEOINFO

structure. If this is not the case, the SMC_NCDecoder does not perform any actions. It is

permissible to set the value but it is only permissible to alter it subsequently during a reset.

It is advisable to create the actual buffer as described below e.g. as an example: Array of

SMC_GeoInfo. The corresponding buffer size then results from sizeof(Example).
pbyBufferOutQueue: POINTER TO BYTE
This input must point to the first byte of the memory area created for the OUTQUEUE

structure. This memory area must be at least as large as defined in nSizeOutQueue. It is

typically assigned in the declaration part of the IEC program by means of an array of

SMC_GeoInfo (e.g. BUF: ARRAY[1...50] OF SMC_GEOINFO; for a buffer that can store 50

path elements). In respect of this value as well, it is permissible to set the value but it is only

permissible to alter it subsequently during a reset.

Advertising