6 the organization unit wait, The organization unit wait, Drive plc developer studio – Lenze DDS v2.3 User Manual
Page 28

Drive PLC Developer Studio
Program example
3-6
l
DDS EN 2.3
24.Use the above procedures and commands to complete the organization unit as follows:
The first organization unit is complete. TRAFFICLIGHT controls the traffic light colours depending
on the input of value STATE.
3.2.6
The organization unit WAIT
The organization unit WAIT is to be a timer to control the duration of the different traffic light phases.
25.To edit the organization unit WAIT, activate its editor window by selecting
Object Organizer,
tab
Organization units and double-clicking WAIT.
3.2.6.1
Declaration
26.In the declaration editor, declare
– as input variable (between the keywords VAR_INPUT and END_VAR) a variable named
SETTIME
of type TIME.
– as output variable (between the keywords VAR_OUTPUT and END_VAR) a variable named
OK
of type BOOL.
27.Pre-assign the output variable OK with FALSE by inserting “ :=FALSE” at the end of the
declaration (but before the ;).
The output variable OK is to output the value TRUE as soon as the time specified with SETTIME has
expired. For this function use the organization unit TP, a pulse encoder.
Show/Hide Bookmarks