Learn PLCs free
Timers & CountersBeginnerIEC 61131-3

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

NameTypeDescription
INBOOLTimer input - output follows immediately when TRUE
PTTIMEPreset off-delay time value

Outputs

NameTypeDescription
QBOOLTimer output - stays TRUE during off-delay
ETTIMEElapsed 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.

TOF off-delay timing diagramQ follows the rising input immediately. Timing begins on the falling edge of IN, and Q stays high until the preset interval PT expires.INQETPT
Blue is the input, green is the boolean output, and amber is elapsed time or current count. Transitions are shown at task executions; real timing resolution depends on the controller and task.

State table

MomentInputInternal stateOutputEngineering meaning
Input activeIN = TRUEET = T#0sQ = TRUEThere is no delay on the leading edge.
Input removedIN changes TRUE → FALSEET starts increasingQ = TRUEThe output is held on for the off-delay interval.
Preset reachedIN remains FALSEET = PTQ = FALSEThe commanded run-on period is complete.
Input returns during timingIN changes FALSE → TRUEET resets to T#0sQ stays TRUEThe 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.

PlatformInstructionWhat maps cleanlyCaveat to verify
Siemens S7-1200/1500TOF with IEC_TIMER instance dataIN falling starts PT; Q remains set during the intervalET display and instance-retention details must be checked in the selected CPU and TIA Portal version.
Rockwell LogixTOF in Ladder; TOFR in FBD/STDN stays set while the off-delay times after a true-to-false rung transitionThe Logix TIMER/FBD_TIMER structures use PRE, ACC and status bits rather than the IEC interface shown here.
CODESYS / IEC librariesTOFCommon IN, PT, Q and ET interfaceA 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

  1. 1Prove the immediate Q response when IN rises.
  2. 2Measure Q while IN remains false for just under and just over PT.
  3. 3Return IN true during the delay and confirm there is no output dropout.
  4. 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.

  1. 1Start the motor and confirm CoolingFan turns on without a 30-second delay.
  2. 2Stop the motor and confirm CoolingFan remains on while ET increases.
  3. 3Restart the motor at 20 seconds and confirm the pending off transition is cancelled.
  4. 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.

Platform-Specific Implementation

S

Siemens (TIA Portal)

Use IEC_Timer (TOF) in TIA Portal. Legacy: SFB 5 (TOF_TIME). Behaves identically to IEC standard.

AB

Allen-Bradley (Studio 5000)

Use TOF instruction in Studio 5000. Timer data type is TIMER. Access .DN, .TT, .ACC bits.

C

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.

Free PLC simulator

Wire this block up and run it

Drop the instruction into a rung, hit Run, and watch it execute in your browser. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →