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

Page 85

Advertising
background image

L-force | PLC Designer

We Write a Little Program



DMS 3.2 EN 02/2011 TD29

83

5.1.12

"WAIT" body

In order to create the desired timer, the body of the POU must be programmed as
follows:

Function Block WAIT, Instruction Part

At first it is checked whether Q has already been set at TRUE (as though the counting
had already been executed), in this case we change nothing with the occupation of
ZAB, but we call the function block ZAB without input (in order to check whether the
time period is already over).

Otherwise we set the variable IN in ZAB at FALSE, and therefore at the same time ET at
0 and Q at FALSE. In this way all variables are set at the desired initial condition. Now
we assign the necessary time from the variable TIME into the variable PT, and call ZAB

with IN:=TRUE. In the function block ZAB the variable ET is now calculated until it
reaches the value TIME, then Q is set at FALSE.

The negated value of Q is saved in OK after each execution of WAIT. As soon as Q is

FALSE, then OK produces TRUE.

The timer is finished at this point. Now it is time to combine our two function blocks
WAIT and SEQUENCE in the main program PLC_PRG.

Advertising