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

Page 89

Advertising
background image

L-force | PLC Designer

We Write a Little Program



DMS 3.2 EN 02/2011 TD29

87

At Switch2 the STATUS of TRAFFICSIGNAL1 changes to 4 (yellow-red), that of
TRAFFICSIGNAL2 to 2 (yellow). A time delay of 2000 milliseconds is now set.

Action Switch2

With Green1 TRAFFICSIGNAL1 is green (STATUS:=1), TRAFFICSIGNAL2 is red
(STATUS:=3), and the time delay is set to5000 milliseconds.

Action Green1

The first expansion phase of our program is completed.

If you want to do a first test of POU ABLAUF in simulation mode, perform the
following steps:

• Open POU PLC_PRG. Each project starts running with PLC_PRG. In order to be able

to provisionally start POU ABLAUF, insert a box and replace "AND" by "ABLAUF".
Remain the inputs and outputs unassigned for the moment.

• Compile the project via 'Project' 'Build'. In the message window you should get "0

Errors, 0 Warnings". Now check if option 'Online' 'Simulation' is activated and use
command 'Online' 'Login' to get into simulation mode. Start program with 'Online'
'Start'. Open POU ABLAUF by a double-click on entry "ABLAUF" in the Object
Organizer. The program is started now, but to get it run, variable START must be
TRUE. Later this will be set by PLC_PRG but at the moment we have to set it
manually within the POU. To do that, perform a double-click on the line in the
declaration part, where START is defined (START=FALSE). This will set the option
"<:=TRUE>" behind the variable in turquoise color. Now select command 'Online'
'Write values' to set this value. Thereupon START will be displayed in blue color in
the sequence diagram and the processing of the steps will be indicated by a blue
mark of the currently active step.

When you have finished this intermediate test use command 'Online' 'Logout' to leave
the simulation mode and to continue programming.

Advertising