This timer function block realizes an off-delay timing.
If the input IN changes from TRUE to FALSE, switching off is delayed for the time interval set at the input PT. After the delay time set at PT has elapsed, Q is set to FALSE. The already elapsed time is indicated at ET.
The function block is available as standard function block TOF and safety-related function block TOF_S.
TOF
Parameter |
Data types |
Description |
IN |
BOOL |
If a falling edge is detected, the off-delay timing is started. |
PT |
TIME |
Preset time interval for the delay |
Q |
BOOL |
TRUE if IN = TRUE and ET < PT. FALSE if IN = FALSE or ET >= PT. |
ET |
TIME |
Elapsed time interval |
TOF_S
Parameter |
Data types |
Description |
IN |
SAFEBOOL |
If a falling edge is detected, the off-delay timing is started. |
PT |
SAFETIME |
Preset time interval for the delay |
Q |
SAFEBOOL |
TRUE if IN = TRUE and ET < PT. FALSE if IN = FALSE or ET >= PT. |
ET |
SAFETIME |
Elapsed time interval |
NOTE:
Function blocks have to be instantiated. Like variables, instances have to be declared before they can be inserted in a code body. Instances must be unique within the POU. In the following example, the instance name 'DELAY_TIMER' is used.
Timing diagram
NOTE:
If the value applied at PT (Preset Time) is 0 or lower than the system's cycle time and a falling edge occurs at input IN, output Q is not reset to FALSE until the next cycle.
Example for safety-related function block declaration TOF_S
Variables declarations in this example
NOTE:
If you want to use the standard function block TOF in your code worksheet, you have to select the data type 'TOF' for the function block instance in the local variables worksheet. Accordingly, the data types 'BOOL' and 'TIME' must be used instead of 'SAFEBOOL' and 'SAFETIME'.