TOF (Off-Delay Timer)
Keeps the output TRUE for a preset duration after the input goes FALSE.
Description
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:
- Input goes TRUE: output
.Qimmediately becomesTRUE, timer resets - Input goes FALSE: timer starts counting down the off-delay
- Elapsed time reaches preset: output
.QbecomesFALSE - Input goes TRUE again during delay: timer resets, output stays
TRUE
This 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.
Syntax
Sequence Visual Editor

Click the PT chip to change the off delay.
Python
from automation_machine import ActionInstruction
step.add_action("timer_name", "Timer description", instruction=ActionInstruction.TOF, duration=10000)
Parameters
- name: the name of the timer instance
- description: human-readable description
- qualifier:
ActionQualifierenum (default:ActionQualifier.N, keep timer running while step active) - instruction: must be
ActionInstruction.TOF - duration: the off-delay duration in milliseconds (e.g.,
10000for 10 seconds)
Timer Variables
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 |
See Also
- TON (On-Delay Timer): delays turning on
- TP (Pulse Timer): fixed-duration pulse
- RTO (Retentive On-Delay Timer): remembers elapsed time
- Action Qualifiers Overview
- Instructions Overview