TOF Timer in PLC: Off-Delay Timing and Examples
Quick answer
A TOF timer delays an output turning off. Q becomes TRUE immediately while IN is TRUE. When IN changes to FALSE, ET increases and Q stays TRUE for PT; Q becomes FALSE when ET reaches PT. If IN returns TRUE during the delay, the off-delay is cancelled.
The TOF (Timer Off-Delay) function block provides a delayed turn-off behavior. When the input (IN) goes TRUE, the output (Q) immediately goes TRUE. When IN transitions from TRUE to FALSE, the timer begins counting. Q remains TRUE until the elapsed time (ET) reaches the preset time (PT), at which point Q goes FALSE. If IN goes TRUE again before the timer expires, the timer resets and Q stays TRUE. TOF timers are commonly used for keeping outputs active for a period after an input condition is removed, such as cooling fan run-on, conveyor coast-down delays, and light-off timers.
Reviewed
Parameters
Inputs
| Name | Type | Description |
|---|---|---|
| IN | BOOL | Timer input - output follows immediately when TRUE |
| PT | TIME | Preset off-delay time value |
Outputs
| Name | Type | Description |
|---|---|---|
| Q | BOOL | Timer output - stays TRUE during off-delay |
| ET | TIME | Elapsed time since IN went FALSE |
How TOF off-delay timer works scan by scan
Read the waveforms and state table together. The diagram shows the sequence; the table states what the program should observe at each execution.
TOF off-delay timing diagram
Q follows the rising input immediately. Timing begins on the falling edge of IN, and Q stays high until the preset interval PT expires.
State table
| Moment | Input | Internal state | Output | Engineering meaning |
|---|---|---|---|---|
| Input active | IN = TRUE | ET = T#0s | Q = TRUE | There is no delay on the leading edge. |
| Input removed | IN changes TRUE → FALSE | ET starts increasing | Q = TRUE | The output is held on for the off-delay interval. |
| Preset reached | IN remains FALSE | ET = PT | Q = FALSE | The commanded run-on period is complete. |
| Input returns during timing | IN changes FALSE → TRUE | ET resets to T#0s | Q stays TRUE | The pending turn-off is cancelled without an output dropout. |
Ladder and Structured Text examples
Cooling-fan run-on after a motor stops
|----[ Motor_Running ]----[ TOF FanRunOn ]----|
| PT: T#30s |
|----[ FanRunOn.Q ]----------( Cooling_Fan )---|FanRunOn.Q is TRUE while the motor runs and for 30 seconds after Motor_Running becomes FALSE. Confirm that this is process run-on logic, not a safety stop path.
IEC-style Structured Text call
VAR
FanRunOn : TOF;
MotorRunning : BOOL;
CoolingFan : BOOL;
END_VAR
FanRunOn(IN := MotorRunning, PT := T#30s);
CoolingFan := FanRunOn.Q;The output assignment reads the function-block state after the instance call. If MotorRunning returns TRUE before 30 seconds, ET resets and CoolingFan remains TRUE.
Vendor compatibility
A shared mnemonic does not guarantee an identical interface or state machine. Confirm the instruction help for the controller, firmware, language and library version used on the project.
| Platform | Instruction | What maps cleanly | Caveat to verify |
|---|---|---|---|
| Siemens S7-1200/1500 | TOF with IEC_TIMER instance data | IN falling starts PT; Q remains set during the interval | ET display and instance-retention details must be checked in the selected CPU and TIA Portal version. |
| Rockwell Logix | TOF in Ladder; TOFR in FBD/ST | DN stays set while the off-delay times after a true-to-false rung transition | The Logix TIMER/FBD_TIMER structures use PRE, ACC and status bits rather than the IEC interface shown here. |
| CODESYS / IEC libraries | TOF | Common IN, PT, Q and ET interface | A PT below the task period may not clear Q until the next task cycle. |
Failure modes and edge cases to test
IN starts FALSE after download or restart
Do not assume Q is initially TRUE. Validate startup behavior and initialize the surrounding command logic.
IN returns TRUE just before PT
The pending off transition is cancelled; Q remains TRUE and ET returns to zero.
PT is zero or below the task period
The visible Q transition is task-resolution limited and may occur on the next execution.
TOF is used in a safety circuit
A standard timer is not a certified safety function. Use the approved safety block and validated architecture.
Evidence and review status
The IEC-style IN, PT, Q and ET behavior was checked against current Siemens and Schneider Electric documentation. Controller-family execution, timing resolution and safety-library behavior remain version specific.
Technical review date:
Critical behavior
- Q becomes true immediately when IN is true; TOF delays only the falling output transition.
- When IN falls, ET increases and Q remains true until the preset time has elapsed.
- If IN returns true before PT expires, the pending off transition is cancelled and ET resets.
- A standard TOF is process logic, not a certified safety delay or emergency-stop function.
Verification checklist
- 1Prove the immediate Q response when IN rises.
- 2Measure Q while IN remains false for just under and just over PT.
- 3Return IN true during the delay and confirm there is no output dropout.
- 4Test startup, task-resolution and zero-preset behavior on the target controller.
Worked test
Verify a 30-second cooling-fan run-on
Call FanRunOn(IN := MotorRunning, PT := T#30s) and drive CoolingFan from FanRunOn.Q.
- 1Start the motor and confirm CoolingFan turns on without a 30-second delay.
- 2Stop the motor and confirm CoolingFan remains on while ET increases.
- 3Restart the motor at 20 seconds and confirm the pending off transition is cancelled.
- 4Stop again, leave IN false for the full interval and record the Q falling transition.
Expected result: CoolingFan is on whenever MotorRunning is true and stays on for one complete 30-second interval after the final falling edge.
Technical sources
The target controller's version-specific instruction help remains authoritative.
- TOF: Generate off-delay
Siemens STEP 7 V21 documentation — Instance, Q and ET behavior
- TOF / TOF_S off-delay function block
Schneider Electric — IEC-style interface and task-cycle caveat
- IEC 61131-3:2025 publication record
IEC
Platform-Specific Implementation
Siemens (TIA Portal)
Use IEC_Timer (TOF) in TIA Portal. Legacy: SFB 5 (TOF_TIME). Behaves identically to IEC standard.
Allen-Bradley (Studio 5000)
Use TOF instruction in Studio 5000. Timer data type is TIMER. Access .DN, .TT, .ACC bits.
CODESYS
Standard TOF in Standard library. Fully IEC 61131-3 compliant.
Common Applications
- Cooling fan run-on after motor stops
- Conveyor coast-down delay
- Light-off timer (stairwell lights)
- Lubrication pump run-on
- Exhaust fan delay
Common Mistakes to Avoid
- Confusing TOF with TON behavior
- Forgetting that Q goes TRUE immediately when IN is TRUE
- Not understanding that the timer only counts when IN is FALSE
Frequently Asked Questions
What is TOF (Timer Off-Delay) in PLC programming?
Output stays TRUE for preset time after input goes FALSE. The TOF (Timer Off-Delay) function block provides a delayed turn-off behavior. When the input (IN) goes TRUE, the output (Q) immediately goes TRUE.
What are common applications of TOF (Timer Off-Delay)?
TOF (Timer Off-Delay) is commonly used for: Cooling fan run-on after motor stops, Conveyor coast-down delay, Light-off timer (stairwell lights), Lubrication pump run-on, Exhaust fan delay.
How do I use TOF (Timer Off-Delay) in different PLC platforms?
Siemens: Use IEC_Timer (TOF) in TIA Portal. Legacy: SFB 5 (TOF_TIME). Behaves identically to IEC standard. Allen-Bradley: Use TOF instruction in Studio 5000. Timer data type is TIMER. Access .DN, .TT, .ACC bits. CODESYS: Standard TOF in Standard library. Fully IEC 61131-3 compliant.
Related Function Blocks
TON (Timer On-Delay)
Starts timing on rising edge, output activates after preset delay.
View Reference →TP (Timer Pulse)
Generates a fixed-duration pulse on rising edge of input.
View Reference →RTO (Retentive Timer On)
Timer retains accumulated value when input goes FALSE; requires manual reset.
View Reference →TONR (Timer On-Delay Retentive)
Siemens time accumulator that retains ET across enable cycles until its reset input is applied.
View Reference →RTOR (Retentive Timer On with Reset)
Retentive on-delay timer with integrated reset input for accumulated time clearing.
View Reference →