Keeps the output TRUE for a preset duration after the input goes FALSE.
The TOF (Timer Off-Delay) instruction implements a delay-off timer, as defined in IEC 61131-3. When the input .IN becomes TRUE, the output .Q immediately becomes TRUE. When the input .IN goes FALSE, the timer starts counting. The output .Q remains TRUE until the elapsed time .ET reaches the preset time .PT, then it becomes FALSE.
If the input .IN goes TRUE again before the timer expires, the timer resets and the output stays TRUE.
Key behavior:
.Q immediately becomes TRUE, timer resets.Q becomes FALSETRUEThis is useful for keeping an output active for a period after a condition ends, such as a cooling fan that runs for 30 seconds after a motor stops.
{GIF:HERE} - Adding a TOF off-delay timer action to a step with name "timer_name", description "Timer description", instruction set to TOF, and duration of 10000 ms
from automation_machine import ActionInstruction
step.add_action("timer_name", "Timer description", instruction=ActionInstruction.TOF, duration=10000)
ActionQualifier enum (default: ActionQualifier.N, keep timer running while step active)ActionInstruction.TOF10000 for 10 seconds)Each TOF timer instance exposes the following child variables:
| Variable | Type | Description |
|---|---|---|
.IN |
BOOL | Input signal - starts the off-delay when it goes FALSE |
.Q |
BOOL | Output signal - stays TRUE during the off-delay period |
.PT |
TIME | Preset time - the configured off-delay duration |
.ET |
TIME | Elapsed time - the current time since .IN went FALSE |