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

Page 92

Advertising
background image

L-force | PLC Designer

We Write a Little Program

90

DMS 3.2 EN 02/2011 TD29



The EXIT transition checks whether the counter is greater than a certain value, for
example 7:

Transition EXIT

At Off the state of both lights is set at 5(OFF), (or each other number not equal 1,2,3

or 4) the COUNTER is reset to 0, and a time delay of 10 seconds is set:

Action Off

5.1.17

The result

In our hypothetical situation, night falls after seven

TRAFFICSIGNAL

cycles, for ten

seconds the

TRAFFICSIGNAL

turns itself off, then we have daylight again, the traffic light

unit turns itself on again, and the whole process starts again from the beginning. If
you like, do another test of the current version of your program in simulation mode
before we go on to create the POU PLC_PRG.

5.1.18

PLC_PRG

We have defined and correlated the time sequencing of the phases for both sets of
traffic lights in the block SEQUENCE. Since, however, we see the traffic lights system
as a module of a bus system, e.g. CAN bus, we have to make input and output
variables available in the block PLC_PRG. We want to start-up the traffic lights system
over an ON switch and we want to send each of the six lamps (each traffic light red,
green, yellow) the corresponding "signal command" for each step of the SEQUENCE.
We are now declaring appropriate Boolean variables for these six outputs and one
input, before we create the programme in the editor, and are allocating them, at the
same time, to the corresponding IEC addresses.

The next step is declare the variables Light1 and Light2 of the type Phases in the
declaration editor.

Advertising