4. Configuration
195
TOF_RET
The function block TOF_RET implements a time delay to disable an output. When the input IN has
its state changed from TRUE to FALSE (falling edge), the specified time PT will be counted and the
Q output will be driven to FALSE at the end of it. When input IN is in logic level 1 (TRUE), output
Q remains in the same state (TRUE), even if this happened in the middle of the counting process. The
PT time can be changed during the counting, as the block takes the new value if the counting has not
finished.
Figure 4-62 depicts TOF_RET block and Figure 4-63 shows its graphic behavior.
Figure 4-62. TOF_RET Functional Block
Input Parameters
Type
Description
IN
BOOL
This variable, when receives a falling edge, enables the
block counting.
PT
TIME
This variable specifies the block counting limit (time
delay).
Table 4-137. Input Parameters
Output Parameters
Type
Description
Q
BOOL
This variable executes a falling edge as the PT variable
(time delay) reaches its maximum value.
ET
TIME
This variable shows the current time delay.
Table 4-138. Output Parameters
Figure 4-63. TOF_RET Function Block Graphic Behavior
Example in ST:
PROGRAM UserPrg
VAR RETAIN
bStart : BOOL := TRUE;
TOF_RET : TOF_RET;
END_VAR
// When bStart=FALSE starts counting
TOF_RET(IN := bStart,
PT := T#20S);