Sequence" second expansion level, L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 90

Advertising
background image

L-force | PLC Designer

We Write a Little Program

88

DMS 3.2 EN 02/2011 TD29



5.1.16

"SEQUENCE" second expansion level

In order to ensure that our diagram has at least one alternative branch, and so that we
can turn off our traffic light unit at night, we now include in our program a counter
which, after a certain number of

TRAFFICSIGNAL

cycles, turns the unit off.

At first we need a new variable COUNTER of the type INT. Declare this as usual in the
declaration part of SEQUENCE, and initialize it in Init with 0.

Action Init, Second Version

Now select the transition after Switch1 and insert a step and then a transition. Select
the resulting transition and insert an alternative branch to its left. After the left
transition insert a step and a transition. After the resulting new transition insert a
jump after Switch1.

Name the new parts as follows: the upper of the two new steps should be called

"Count" and the lower "Off". The transitions are called (from top to bottom and from
left to right) EXIT, TRUE and DELAY.OK.

Advertising