beautypg.com

L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 943

background image

L-force | PLC Designer

Device Editors

DMS 4.1 EN 03/2011 TD29

941

Program a state machine, which in the initial state activates control for the axis:

CASE iStatus OF
0:
Power(Enable:=TRUE, bRegulatorOn:=TRUE, bDriveStart:=TRUE, Axis:=Drive);
IF Power.Status THEN
iStatus := iStatus + 1;
END_IF

In the subsequent state by use of module MC_MoveAbsolute the axis will be driven to
position p:

... (* continuation of the program shown above *)
1:
MoveAbsolute(Execute:=TRUE, Position:= p, Velocity:=100, Acceleration:=100,
Deceleration:=100, Axis:=Drive);
IF MoveAbsolute.Done THEN
MoveAbsolute(Execute:=FALSE, Axis:=Drive);
iStatus := iStatus + 1;
END_IF

In the last step the axis will be moved back to position 0:

... (* continuation of the program shown above *)
2:
MoveAbsolute(Execute:=TRUE, Position:= 0, Velocity:=100, Acceleration:=100,
Deceleration:=100, Axis:=Drive);
IF MoveAbsolute.Done THEN
MoveAbsolute(Execute:=FALSE, Axis:=Drive);
iStatus := 1;
END_IF

Subsequently there is a jump back to state 1. This effects a pendular movement
between the positions p and 0.
This program can be built and loaded to the controller after that has been started and
the correct address has been configured in the communication settings dialog.