beautypg.com

Lenze PLC Designer PLC-Designer (R2-x) SoftMotion User Manual

Page 276

background image

L-force | PLC Designer - SoftMotion

SoftMotion programming examples

Drive control with the aid of the CNC editor

276

L

DMS 5.2 EN 03/2011 TD17

3. Creating the IEC program IPO (CFC):

– You first have to activate the drives via the MC_Power program organisation unit.

– Another essential element is the SMC_Interpolator program organisation unit. This

receives the address of the created CNC program as its poqDataIn input. The IEC task

cycle also has to be written to dwIpoTime. You can either enter this as a constant

value at the dwIpoTime input or use the dwCycle variable of the axis group structure

from the PLC configuration. The latter has the advantage that, if you change the task

cycle time, the correct time will be used for the interpolator input automatically.

– In this example, you want to control a gantry system. For this reason, insert an

instance of the forwards and reverse transformation POUs from the SM_Trafo.lib

library. The forwards transformation POU receives the drives as its inputs (the Z drive

is assigned the dummy variable of type AXIS_REF, which is not otherwise used); the

reverse transformation POU must receive the set position of the interpolator.