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

Page 273

Advertising
background image

DMS 5.2 EN 03/2011 TD17

L

273

L-force | PLC Designer - SoftMotion

SoftMotion programming examples

Cam drive control with the aid of a virtual time axis

3. The "Ipo" program is created in FBD and contains the calls of the program organisation

units below:

After the Power program organisation unit for the slave axis, the first program

organisation unit to be called will be TimeAxis. A period (fPeriod) of 10 seconds is specified

for this POU, as the cam is also configured for this time. The task cycle time must be

entered manually. TableSelect will select the required cam and CamIn will implement it.

The Tappet program organisation unit checks the position of the tappet. As the tappet has

been programmed "inverted", it will switch every 10 seconds.
The program can now be compiled and started on the control.
To check the set or actual position, create another visualisation, which you can use to check

the individual program organisation units and the position of the axes.
Please note that as well as being a virtual time axis, the cam master can also be any

AXIS_REF data structure. Setpoints are taken into account for drives that are being

controlled, with actual values being taken into account for drives that are not being

controlled.

PROGRAM Ipo
VAR
Power: MC_Power;
TimeAxis : SMC_TimeAxisFB;
TableSelect: MC_CamTableSelect := (SlaveAbsolute:=TRUE);
CamIn: MC_CamIn:=(StartMode:=ramp_in, VelocityDiff:=100, Acceleration:=100,
Deceleration:=100);
Tappet: SMC_GetTappetValue;
END_VAR

Advertising