beautypg.com

2 online decoding with the use of variables, Online decoding with the use of variables – Lenze PLC Designer PLC-Designer (R2-x) SoftMotion User Manual

Page 278

background image

L-force | PLC Designer - SoftMotion

SoftMotion programming examples

Drive control with the aid of the CNC editor

278

L

DMS 5.2 EN 03/2011 TD17

13.5.2

Online decoding with the use of variables

Tip!
See also the example project CNConline.pro provided with SoftMotion.

6. Creating the CNC program in the CNC editor:

– As in the previous example, we create a CNC program and use two global variables

g_x and g_y for it, e. g.:

– As compilation mode, however, this time we select "Generate program variable

during compilation", as we use variables in our program.

7. Drive Interface, PLC configuration:

– The drive structure corresponds to that of the previous example.

8. Creating the IEC program:

– As we have selected the other compilation mode this time, we have to carry out the

decoding and path preprocessing in the IEC program. As this process which is rather

runtime-consuming does not have to be effected in the interpolator cycle (at every

decoder call one path object is generated, which typically lasts for many interpolator

calls), it is often swapped out into a task with a lower priority that is called less

frequently:

VAR_GLOBAL
g_x: REAL:=100;
g_y: REAL:=50;
END_VAR