Sysmac Studio TOF Timer (Off-Delay): Complete Programming Guide

Master the TOF (Off-Delay) timer in Omron Sysmac Studio: Ladder Diagram and Structured Text execution, timing diagrams, runtime PT changes, and safety field notes.

Control & Automation Engineer6 min readUpdated:

The TOF (Off-Delay Timer) instruction in Sysmac Studio delays deactivating an output signal for a preset duration (PT) after its execution condition transitions from TRUE to FALSE. Fully compliant with the IEC 61131-3 standard on Omron NJ/NX series machine automation controllers, TOF is fundamental in industrial machinery for post-cycle lubrication, cabinet cooling fan overrun, conveyor bottle clear-out routines, and pneumatic exhaust delays.


Technical Specifications and Timer Matrix

Parameter / FeatureValue / SpecificationNotes
Controller FamiliesOmron NJ101, NJ301, NJ501, NX102, NX1P2All Sysmac MAC platforms
Instruction StandardIEC 61131-3 Standard TimerOff-Delay Function Block
Languages SupportedLadder Diagram (LD), Structured Text (ST)Deterministic task execution
Input Variable (In)BOOLStarts timing on falling edge (TRUE → FALSE)
Preset Time (PT)TIME (T#0ms to T#106751d_23h_47m_16s_854.775807ms)Resolution: 1 ns (evaluated per task period)
Output Variable (Q)BOOLStays TRUE during timing; drops to FALSE upon expiration
Elapsed Time (ET)TIMEReal-time accumulator from T#0s to PT

IEC 61131-3 Timer Comparison Matrix

Timer TypeOutput Turn-ON ConditionOutput Turn-OFF ConditionTypical Industrial Use Case
TON (On-Delay)Delays ON by PT after In goes TRUEImmediately when In goes FALSESensor debouncing, motor star-delta transitions
TOF (Off-Delay)Immediately when In goes TRUEDelays OFF by PT after In goes FALSECooling fan overrun, conveyor clearing, vacuum bleed
TP (Pulse Timer)Immediately on rising edge of InFixed duration PT, regardless of In stateStrobe cameras, solenoid pulse ejection

Programming TOF: Ladder Diagram vs. Structured Text

Sysmac Studio allows instantiating the TOF function block inside graphical ladder networks or Structured Text code blocks:

Ladder Diagram Representation

In a ladder rung, assign a unique instance tag of type TOF (e.g., TOF_Instance):

TOF Timer Ladder Diagram

Structured Text (ST) Syntax

Inside ST programs or function blocks, invoke the instance by passing parameters:

// TOF Timer Invocation in Structured Text
TOF_Instance(
    In := Start_Signal,     // BOOL: Input trigger condition
    PT := T#5s,             // TIME: 5 seconds off-delay duration
    Q  => Motor_Output,     // BOOL: Output delayed state
    ET => Current_Elapsed   // TIME: Elapsed time monitor
);

Parameter Reference Table

VariableDirectionData TypeMeaningOperational Rule
InInputBOOLTimer InputTRUE keeps Q ON and resets ET. FALSE initiates the timer countdown.
PTInputTIMEPreset TimeTarget off-delay duration. Format: T#500ms, T#3s, T#1m.
QOutputBOOLTimer OutputStays TRUE while In = TRUE and throughout the timing cycle. Drops to FALSE when ET = PT.
ETOutputTIMEElapsed TimeTracks duration elapsed since In transitioned to FALSE.

Operational Modes and Runtime Behavior

Understanding how the internal accumulator responds to input transitions is critical for machine sequence design:

Mode 1: Standard Off-Delay Sequence

When input contact A turns TRUE, output abc energizes immediately. When contact A opens (FALSE), the 5-second preset countdown begins. Output abc remains continuously energized for 5 seconds, after which it drops to FALSE.

Sysmac Studio TOF Timer standard sequence

Mode 2: Re-Triggering During the Timing Phase

If contact A turns TRUE again while the timer is actively counting down (before ET reaches PT), the timer resets immediately: ET returns to zero, counting halts, and output abc stays continuously TRUE without dipping.

Sysmac Studio TOF Timer re-trigger reset

Mode 3: Pulse Triggering via Rising Edge

If input contact A is fed by a rising edge one-shot pulse (@ or R_TRIG), the input stays TRUE for exactly one program scan and then immediately transitions to FALSE. The TOF timer triggers its countdown on scan cycle 2, maintaining output abc for the duration of PT completely independent of contact A.

Sysmac Studio TOF Timer rising edge trigger

Detailed Timing Diagram

The timing chart below illustrates the exact relationship between input In, output Q, and accumulator ET:

TOF Timer Timing Diagram

Key timing points:

  1. When In transitions to TRUE, Q goes TRUE immediately and ET is set to 0.
  2. When In transitions to FALSE, ET begins incrementing each task period.
  3. When ET reaches PT, Q transitions to FALSE and ET stops incrementing.
  4. If In transitions to TRUE while ET < PT, ET resets to 0 and Q remains TRUE.

Dynamic Preset Time (PT) Modification

You can adjust PT dynamically from an HMI or recipe database while In is FALSE:

Timer StateOutput Q StateNew PT ValueController Action
Timing Complete (ET = PT)FALSEAny valueQ remains FALSE. ET remains frozen at original PT.
Actively Timing (ET < PT)TRUEPT_new >= ETCounting continues uninterrupted until reaching PT_new.
Actively Timing (ET < PT)TRUEPT_new < ETOutput Q drops to FALSE immediately; ET freezes.

Field Notes & Safety Practices (“Saha Notu”)

Practical engineering lessons from factory automation:

  • Power Cycle & First Scan Behavior: When an NJ/NX controller experiences a power failure, CPU reset, or transition from Program to Run mode, ET initializes to T#0ms. If the logic preceding In does not actively hold it FALSE, or if state flags are uninitialized, output Q may pulse or behave unexpectedly on first scan. Always gate equipment outputs with _IsRunMode or system ready flags.
  • Master Control (MC/MCR) Reset: If a TOF instruction is enclosed within a Master Control region and the region is reset, the instruction resets: ET becomes 0 and Q transitions to TRUE if In is active.
  • Safety Interlocking: Never rely solely on a standard software TOF timer to maintain personnel safety delays (such as guard locking or deceleration before unlocking a gate). Use safety-rated hardware or an Omron G9SP / NX-SL functional safety controller adhering to ISO 13849-1 (Cat 4 / PL e).
  • PLC Diagnostics: In case of task cycle overruns or function block compilation errors, cross-reference the error code using the Sysmac Studio Error Code Lookup.

Frequently Asked Questions

How does the TOF timer work in Sysmac Studio?

The TOF (Off-Delay Timer) activates its output (Q = TRUE) immediately when input In becomes TRUE. When In turns FALSE, the timer begins counting; output Q remains TRUE until the elapsed time (ET) reaches preset time (PT), after which Q drops to FALSE.

What happens if the input turns TRUE again while the TOF timer is timing?

If input In transitions back to TRUE while the timer is actively counting, the elapsed time (ET) resets to zero immediately and counting halts. Output Q continues to stay TRUE without dropping.

What is the main difference between TON, TOF, and TP timers?

TON delays turning ON after an input signal is applied. TOF delays turning OFF after an input signal is removed. TP produces a fixed-duration pulse regardless of whether the input signal stays ON or turns OFF.

Can preset time (PT) be changed dynamically while TOF is running?

Yes. If the new PT is greater than or equal to current ET, timing continues normally until the new PT. If the new PT is less than current ET, output Q drops to FALSE immediately.