4. Configuration
215
Figure 4-109. TON_RET Block Graphic Behavior
Utilization example in ST language:
PROGRAM MainPrg
VAR RETAIN
bStart : BOOL;
TON_RET : TON_RET;
END_VAR
// When bStart=TRUE starts counting
TON_RET( IN := bStart,
PT := T#20S);
// Actions executed at the end of the counting
IF (TON_RET.Q = TRUE) THEN
bStart := FALSE;
END_IF
TP_RET
The TP_RET function block works as a trigger. The timer which starts when the IN input has its state
changed from FALSE to TRUE, that is, a rising edge, it is increased until the PT time limit is
reached. During the counting, the Q output is TRUE, otherwise it is FALSE. The PT time can be
changed during the counting as the block assumes the new value if the counting has not finished.
Figure 4-110 depicts the TP_RET and Figure 4-111 shows its graphic behavior.
Figure 4-110. TP_RET Function Block
This variable, when receives a rising edge,
enables the function block counting.
This variable specifies the function block
counting limit (time delay).
Table 4-155. TP_RET Input Parameters
This variable is true during the counting,
otherwise is false.
This variable shows the current time delay.
Table 4-156. TP_RET Output Parameters