PLC Simulator
PLC Timer instructions

PLC Timer Instructions Explained: TON, TOF, TP and RTO

The four timer instructions every PLC programmer needs (on-delay, off-delay, pulse and retentive) with timing diagrams, ladder rungs, Structured Text, common mistakes, and a browser simulator where you can run TON, TOF and TP yourself.

Join 13000+ learners practicing PLC programming

Foundations

What is a PLC timer?

A PLC timer is an instruction that delays an action by a preset time. The three IEC 61131-3 standard types are TON (on-delay), which turns its output on after the input has been true for the preset; TOF (off-delay), which keeps the output on for the preset after the input drops; and TP (pulse), which outputs a fixed-length pulse.

If you remember one line, make it this: TON delays ON, TOF delays OFF, TP makes a fixed pulse. Allen-Bradley adds a fourth, the RTO retentive timer, for totaling time across interruptions.

Unlike a mechanical or electronic timer relay, a PLC timer exists entirely in the controller's memory. There are no physical contacts to wear out, no coil to burn, and the preset value is a number you can change from an HMI or SCADA without rewiring anything.

Every PLC timer, regardless of brand or dialect, has at least three parameters: a preset time (PT / PRE), an accumulated time (ET / ACC), and one or more status bits. Understanding these three elements is the foundation for everything else.

Preset time (PT / PRE). The target duration. When ACC reaches PRE, the timer signals completion. The units depend on the platform. In Allen-Bradley Logix (Studio 5000), PRE is a DINT in milliseconds, so 5000 means 5 seconds. In Siemens TIA Portal and other IEC 61131-3 platforms, you use a TIME literal such as T#5S. In RSLogix 500 / SLC-500, PRE is an integer count of timebase ticks.

Accumulated time (ET / ACC). The running total of time the timer has been timing. Each time the timer instruction executes while enabled, the controller adds the time elapsed since it last executed. Reading ACC in your logic lets you create sub-preset triggers, for example switching on a warning light at 80% of the preset before the final done signal.

Status bits. The bits you actually use in your logic to act on the timer's state. The standard set is:

  • .EN / EN — Enable bit. TRUE whenever the rung condition is TRUE and the timer is running (or done).
  • .TT / TT — Timer Timing bit. TRUE while the timer is actively counting, FALSE once DN is set or once the rung goes FALSE.
  • .DN / Q — Done bit (Allen-Bradley .DN; IEC Q). The bit your output logic usually reads. Its behavior differs between timer types, and that is the key difference between TON, TOF, TP, and RTO.
  • .PRE / PT — Readable preset value. You can address this to compare or modify the preset dynamically.
  • .ACC / ET — Readable accumulator. Use it to display progress or create cascaded timing logic.

The single most common beginner bug is reading the enable (IN / .EN) in downstream logic when you meant the done bit (Q / .DN). The enable turns on the instant the rung is TRUE, so the "delayed" output fires with no delay at all. Always drive the timed action from Q or .DN.

Timebase matters for inter-operability. Legacy platforms such as Mitsubishi FX and Omron CPM use 100 ms timers by default, while Logix works in milliseconds. Always check your hardware manual: a PRE of 50 on a 100 ms timebase is 5 seconds, but only 50 ms on a 1 ms timebase. The IEC 61131-3 standard avoids this ambiguity with TIME literals (T#5S, T#500MS) rather than raw integers.

IEC 61131-3 timer pins: IN, PT, Q and ET

In IEC 61131-3 (Siemens TIA Portal, CODESYS, OpenPLC), TON, TOF and TP are function blocks with the same two inputs and two outputs. Only when Q turns on and off changes between them. Here is how each pin maps to an Allen-Bradley TIMER tag:

IEC pinTypeDirectionMeaningAllen-Bradley equivalent
INBOOLInputEnable (TON, TOF) or trigger on the rising edge (TP)Rung condition, mirrored by .EN
PTTIMEInputPreset time, e.g. T#5s.PRE (DINT, milliseconds)
QBOOLOutputDone / timed output bit.DN
ETTIMEOutputElapsed time so far.ACC (DINT, milliseconds)
———No IEC equivalent.TT (timing bit)

Every timer is its own instance

A timer is not a shared clock. Each one is an instance with its own stored state (its elapsed time and done bit), and that state persists from one scan to the next. Two independent delays need two instances, such as StartDelay and FanRunOn. They can share the TON type, but each keeps its own accumulator.

How the instance is stored depends on the platform. In Allen-Bradley Logix it is a tag of type TIMER with .PRE, .ACC, .EN, .TT and .DN members. In an IEC program it is a variable declared as TON, TOF or TP. In Siemens TIA Portal it lives in an instance data block, or as a multi-instance inside the calling function block.

Writing the preset: IEC TIME literals

IEC 61131-3 presets use the TIME data type, written as T# followed by a value and a unit: d (days), h (hours), m (minutes), s (seconds) or ms (milliseconds). Examples: T#500ms, T#5s, T#1m30s, T#2h.

For a preset an operator can change at runtime, wire PT to a TIME variable instead of a literal:

VAR
    ConveyorDelay : TIME := T#2s;   (* default 2 s, adjustable from the HMI *)
    ConveyorTimer : TON;
END_VAR

ConveyorTimer(IN := SensorActive, PT := ConveyorDelay);
PLC timer instruction parameters preset accumulator bits table
Every PLC timer shares the same three core parameters — preset, accumulator, and status bits — regardless of brand.
PLC TON timer animation — the accumulated time (ACC / ET) bar ramps up toward the preset (PRE / PT) and the done (DN / Q) bit turns on the instant the accumulator reaches the presetA TON on-delay timer: the accumulated time bar ramps up toward the preset value, and the done (DN) bit turns on when the accumulator reaches preset.TONPRE 5000ACCACC ramps to PREPREDNdone bit
A timer in motion: ACC ramps toward PRE, and the DN bit fires the moment the accumulator reaches the preset.
PLC scan cycle and timers — every scan reads inputs, solves logic and updates each timer accumulator by the elapsed scan time, then writes outputs, which is why timer accuracy depends on the system timebaseThe repeating PLC scan cycle: read inputs, execute the ladder logic, update outputs, then housekeeping, looping continuously.1Read Inputs2Execute Logic3Update Outputs4HousekeepingSCANCYCLE
Why timers tick: the PLC updates every timer accumulator once per scan cycle, against the system timebase.

On-delay timer

TON — on-delay timer

The TON (on-delay timer) is the most common PLC timer instruction. It delays the activation of an output — the done bit does not turn on until the rung has been continuously TRUE for the full preset duration.

How it works, step by step (Allen-Bradley Logix bits). When the enable rung goes TRUE, EN is set, TT is set, and ACC begins counting up from zero. When ACC reaches PRE, DN is set and TT is cleared. If the rung goes FALSE at any point before ACC reaches PRE, EN, TT and ACC all reset to zero immediately, so the timer has no memory of partial timing. If the rung goes FALSE after DN is already set, DN also clears and ACC resets.

An IEC 61131-3 TON behaves the same way with different names: Q turns on when ET reaches PT, ET holds at PT while IN stays TRUE, and both Q and ET reset the moment IN goes FALSE.

This "forgets immediately if interrupted" behavior is the defining characteristic of TON, and the key reason you use RTO instead when run time must accumulate across interruptions.

TON on-delay timer timing diagram ladder logic
TON timing: DN turns on only after ACC reaches PRE. If the rung drops FALSE before PRE, ACC resets to zero.
PLC TON timer ladder rung example with preset and done bit
A TON rung: a Start contact enables the timer; the Timer1.DN bit drives the output contactor only after the preset delay.
TON on-delay timer ladder rung — a Start contact enabling a TON timer block whose done (DN) bit then drives the output coil only after the preset time has elapsedA basic ladder logic rung between two power rails: an examine-if-closed contact (XIC) in series driving an output coil (OTE).L1L2] [StartXIC I:0/0LampOTE O:0/0
The TON rung in ladder form: the enable contact feeds the timer, and the DN bit gates the output coil.

Real-world uses of the TON timer

Motor start delay. Large motors draw high inrush current at startup. A TON of 3–5 seconds between energizing the contactor and enabling downstream equipment (conveyors, pumps, fans) gives the motor time to reach running speed and current to stabilize before load is applied. This is one of the most common TON applications in manufacturing.

Input debounce. Mechanical push-buttons and proximity sensors produce contact bounce — rapid toggling between 0 and 1 that lasts a few milliseconds. A short TON (5–50 ms) on the sensor input, with only the DN bit driving subsequent logic, ignores transient noise and only responds to a signal that has been stable for the full preset. This is software debouncing in ladder logic.

Alarm delay. Rather than alarming the moment a temperature or pressure goes out of range (which generates nuisance alarms on brief spikes), a TON gate ensures the condition must persist for, say, 10 seconds before an alarm is raised. This dramatically reduces false alarms in process control.

Sequence step timeout. In a multi-step machine sequence, a TON started at the beginning of each step can generate a fault if the step has not completed within its expected window. The TT bit lets you detect "step is running" and the DN bit lets you detect "step has overrun".

Try it live

See a TON timer run in the browser

Drop a TON instruction on a rung, set the preset, energize the input, and watch the elapsed time count up to the preset.

Off-delay timer

TOF — off-delay timer

The TOF (off-delay timer) is the mirror of TON. Where TON delays the turn-on of an output, TOF delays the turn-off. The done bit (DN / Q) is TRUE whenever the enable rung is energized, and stays TRUE for the preset duration after the rung goes FALSE. Only then does DN drop.

How it works (Allen-Bradley Logix bits). When the enable rung goes TRUE, EN and DN are set immediately, with no delay on the leading edge. When the rung goes FALSE, EN clears, TT sets, and ACC begins counting. When ACC reaches PRE, TT clears and DN clears. If the rung goes TRUE again before ACC reaches PRE, ACC resets to zero and DN remains TRUE, so the off-delay starts over from the next falling edge. The IEC TOF is identical with Q in place of DN and ET in place of ACC.

A common point of confusion: the TOF done bit is TRUE during normal operation and only drops after the delay. This means you use the DN bit to keep equipment running, not to start it, which is the opposite polarity to how you use a TON. The most common timer mix-up of all is using a TON where you need a TOF. Ask yourself: do you want a delay before the output turns on (TON) or before it turns off (TOF)?

TOF off-delay PLC timer timing diagram
TOF timing: DN is immediately TRUE when the rung energizes, and stays TRUE for the full preset after the rung de-energizes.

Real-world uses of the TOF timer

Fan run-on (motor cooling). After a motor stops, its windings retain heat. A cooling fan driven by a TOF keeps running for 60–300 seconds after the motor de-energizes, preventing heat soak that shortens winding insulation life. The motor-run bit enables the TOF; the TOF DN bit keeps the fan on.

Door-seal alarm. A door-open sensor starts a TOF when the door closes. If the door opens again within the preset window, the timer resets — the system assumes the door is in normal use. Only if the door stays open past the preset does DN drop and trigger an alarm. This prevents nuisance alarms from brief access events.

Lubrication purge. After a conveyor stops, a lubrication pump continues running for a fixed period to flush debris from the lube lines. The TOF done bit keeps the pump on; when it drops, the pump stops.

Signal debounce on the falling edge. Where TON debounces the rising edge, TOF can debounce the falling edge — ignoring brief dropout events on a sensor that may flicker off momentarily during vibration. The DN bit stays TRUE through the flicker, only dropping if the sensor is consistently off for the preset duration.

Pulse timer

TP — pulse timer

The TP (pulse) timer fires a fixed-duration output pulse on the rising edge of its enable input. Once triggered, the output Q remains TRUE for exactly the preset duration — it cannot be shortened by removing the input, and it cannot be extended by holding or re-applying the input during the pulse.

How it works. On a rising edge of IN, Q is immediately set TRUE and ET begins counting. IN is ignored while the pulse runs. When ET reaches PT, Q is cleared. ET then holds at PT until IN goes FALSE, and only a new rising edge after the pulse has finished starts another pulse. This non-retriggerable behavior is what separates TP from TON.

TP is an IEC 61131-3 function block, so you will find it in Siemens TIA Portal, CODESYS and OpenPLC. Allen-Bradley Logix has no TP instruction. Allen-Bradley programs build the same fixed pulse from a one-shot (ONS / OSR) that sets a latched bit, plus a TON whose done bit unlatches it.

TP pulse timer timing diagram PLC ladder logic
TP timing: Q fires for exactly PT on the rising edge. Removing or re-applying the input during the pulse has no effect — the pulse runs to completion.

How TP differs from TON

The critical difference is input control during timing. With a TON, dropping the input before PRE is reached cancels the timer and resets ACC. With a TP, the input is locked out during the pulse — the output runs for the full preset regardless. This makes TP better for:

  • Solenoid pulse actuation. Energizing a solenoid for exactly 500 ms to actuate a cylinder, regardless of how long the operator holds the button.
  • Glue or paint gun burst. Dispensing a fixed volume of adhesive or paint on each part, triggered by a part-present sensor. The pulse length sets the dispense volume.
  • Single-shot alarm acknowledgment delay. After an alarm is acknowledged, disable re-acknowledgment for a fixed window to prevent accidental rapid acknowledgment of subsequent faults.
  • Heartbeat generation. A TP can generate a periodic pulse when combined with a self-resetting logic structure, though a dedicated clock bit is cleaner in practice.
Retentive on-delay timer

The RTO (Allen-Bradley's retentive on-delay timer) behaves like a TON in the forward direction, counting while the rung is TRUE. Unlike a TON, it retains its accumulated value when the rung goes FALSE. The accumulator only resets when a dedicated RES (reset) instruction is explicitly triggered on a separate rung.

How it works. When the enable rung goes TRUE, EN is set, TT is set, and ACC increments. When the rung goes FALSE, EN and TT clear, but ACC holds its value. When the rung goes TRUE again, timing resumes from the held ACC value. When ACC finally reaches PRE, DN is set and TT clears. A separate RES rung — typically connected to a reset push-button or an automatic reset condition — clears ACC and DN, allowing the cycle to begin again.

Because only RES clears it, an RTO suits long-term accumulation across multiple machine cycles or shift changes. Whether the accumulated value also survives a power cycle depends on the controller's retentive memory.

The IEC 61131-3 standard defines no retentive timer. Siemens TIA Portal adds TONR for the S7-1200 and S7-1500, which works like RTO but is reset through its own R input. On a pure IEC platform you get the same result by adding each run's elapsed time into a retained variable.

Simulator note: the browser simulator runs TON, TOF and TP. It does not run RTO or TONR yet, so treat this section as a reference for real hardware.

RTO retentive timer PLC timing diagram accumulator
RTO timing: ACC holds its value when the rung drops FALSE, resuming from the same point on the next TRUE edge. A RES instruction is required to reset.
RTO retentive timer ladder rung with reset instruction
The RTO requires two rungs: one with the RTO instruction (enable) and a second with a RES instruction (reset) connected to a Reset push-button.

When to use RTO instead of TON

Use RTO whenever you need to accumulate runtime across interruptions. Common applications:

  • Motor run-time maintenance counter. Track total motor operating hours across all start/stop cycles since the last service. When ACC reaches PRE (e.g. 2,000 hours), a maintenance-required bit triggers a service reminder on the HMI.
  • Batch processing time. Accumulate total agitator run time across pauses for ingredient additions. The batch recipe requires exactly 45 minutes of mixing — even if the mix is paused for 10-minute ingredient loading steps.
  • Shift production timer. Accumulate actual production time within a shift, excluding planned downtime. The RES is triggered at shift end to reset for the next shift.
  • Filter service life. Count total airflow time through a filter. Reset at filter change. Trigger a change reminder when accumulated time exceeds the manufacturer's service interval.

The common thread: whenever the total accumulated time matters more than any single continuous run, choose RTO over TON.

Side-by-side

The four standard PLC timer types differ on three axes: which edge starts timing, whether the accumulator is kept when the input drops, and whether the input can interrupt a timing cycle in progress. For the two you will reach for most, see the full TON vs TOF breakdown with timing diagrams.

PLC timer types comparison TON TOF TP RTO
Comparison of TON, TOF, TP, and RTO across the key behavioral dimensions.
BehaviorTON (on-delay)TOF (off-delay)TP (pulse)RTO (retentive)
Done bit (Q / DN) turns ONPreset time after the input goes TRUEImmediately when the input goes TRUEImmediately on the rising edge of the inputWhen total accumulated time reaches the preset
Done bit turns OFFImmediately when the input goes FALSEPreset time after the input goes FALSEAfter exactly the preset, whatever the input doesOnly when RES resets the timer
Elapsed time (ET / ACC) resetsImmediately when the input goes FALSEWhen the input goes TRUE againWhen the input is FALSE after the pulse endsOnly on RES
Explicit reset neededNoNoNoYes (RES)
Typical useStart delays, debounce, alarm delaysFan run-on, purge cycles, off-edge debounceSolenoid pulses, dispense burstsMotor hours, batch time, filter life
Allen-Bradley LogixTONTOFNone (ONS + TON)RTO + RES
IEC 61131-3 / SiemensTONTOFTPNot in IEC; Siemens TONR

Which timer should you use?

Ask what you need relative to the input: a delay before the output turns on (TON), a delay after the input drops (TOF), a fixed pulse that ignores how long the input lasts (TP), or a total of time across interruptions (RTO). That one question picks the timer almost every time.

how to choose a PLC timer TON TOF TP RTO decision guide
Decision guide: start with this flowchart when choosing a timer type for a new application.
Naming conventions

The PLC industry never settled on a single set of timer names, so the same behavior carries different mnemonics depending on your vendor. The IEC 61131-3 standard (first published in 1993, third edition in 2013) unified the names for TON, TOF and TP, and modern platforms largely follow it. Allen-Bradley's own instruction set remains widely used in North American industry.

The practical impact: if you can program a TON in Allen-Bradley, you can program one in Siemens TIA Portal, CODESYS, OpenPLC or Mitsubishi GX Works with little more than a naming lookup. The preset / elapsed-time model is the same everywhere. What changes is the instruction names, how the preset is written, and which status bits you get.

Allen Bradley IEC Siemens PLC timer names comparison table
Timer instruction names and parameters in Allen-Bradley Logix, the IEC 61131-3 standard, and Siemens TIA Portal.

Allen-Bradley (RSLogix / Studio 5000)

  • TON — on-delay timer. A TIMER tag with PRE and ACC (ms) and EN, TT and DN bits.
  • TOF — off-delay timer. Same tag members as TON.
  • RTO — retentive on-delay. ACC survives the rung going FALSE; needs RES to reset.
  • RES — reset instruction. Clears ACC and the status bits of a timer (or counter) tag.
  • No TP instruction. Build a pulse from a one-shot (ONS / OSR) and a TON.
  • In Logix Structured Text and function block diagrams, the timers are TONR, TOFR and RTOR, which use FBD_TIMER tags with a TimerEnable input.

IEC 61131-3 (CODESYS, OpenPLC)

  • TON — on-delay. Inputs IN (BOOL) and PT (TIME); outputs Q (BOOL) and ET (TIME).
  • TOF — off-delay. Same interface as TON.
  • TP — pulse. Same interface; non-retriggerable fixed-duration pulse.
  • No retentive timer or reset instruction in the standard set. A timer restarts through IN; vendors add their own retentive blocks.

Siemens (TIA Portal, S7-1200 / S7-1500)

  • TON, TOF, TP — the IEC timers, each with its own instance data block (or multi-instance).
  • TONR — retentive on-delay (time accumulator) with an R input to reset it.
  • RT — resets an IEC timer; PT loads a new preset into one.
  • Legacy S7-300/400 programs use the older SIMATIC timers: S_PULSE (SP), S_PEXT (SE), S_ODT (SD), S_ODTS (SS) and S_OFFDT (SF), with S5TIME presets. S_ODT is the on-delay and S_OFFDT the off-delay.
Mitsubishi note. GX Works uses OUT T (output timer coil) with a K-value preset entered separately — e.g. LD X0 / OUT T1 K50 (T1, 5.0 seconds on a 100 ms timebase). Timer numbers determine the timebase: T0–T199 are 100 ms; T200–T245 are 10 ms on many FX series models. The concept is identical to IEC TON; only the syntax differs.
PLC timer programming examples

The following examples cover the four most common timer applications in industrial ladder logic. Each maps to a specific timer type and explains why that type is the right choice. The TON, TOF and RTO examples use Allen-Bradley mnemonics (XIC, OTE, RES).

1. Conveyor start delay (TON)

A packaging conveyor must not start instantly when the operator presses Run. The downstream accumulation table needs 3 seconds to clear before the conveyor loads it with product. A TON with a 3,000 ms preset handles this cleanly.

Rung 1: XIC RunPB — XIC OL_OK — TON Conveyor_Start_Timer PRE=3000 ms
Rung 2: XIC Conveyor_Start_Timer.DN — OTE Conveyor_Motor

The Run push-button energizes the TON. After 3 seconds of continuous Run input (operator did not release early), DN fires and the motor output energizes. If the operator releases and re-presses before 3 seconds, ACC resets — the delay restarts. This is intentional: the full 3-second window must elapse from the last press.

2. Fan run-on after motor stop (TOF)

A motor-driven pump generates heat. A cooling fan must continue running for 90 seconds after the pump stops to prevent heat soak in the motor windings. A TOF on the motor-run bit provides this automatically.

Rung 1: XIC Pump_Motor — TOF Cooling_Fan_Timer PRE=90000 ms
Rung 2: XIC Cooling_Fan_Timer.DN — OTE Cooling_Fan

When Pump_Motor is TRUE, the TOF DN is immediately TRUE and the fan runs. When Pump_Motor goes FALSE, TOF begins timing. The fan continues running (DN stays TRUE) for 90 seconds, then DN drops and the fan stops. If the pump restarts within the 90-second window, ACC resets and DN stays TRUE — the fan never stopped, which is correct behavior.

3. Alarm acknowledgment pulse (TP)

When an operator acknowledges an alarm, a one-second pulse should flash the panel acknowledge light and momentarily silence the horn. The pulse must be exactly one second regardless of how long the operator holds the acknowledge button.

Network 1: NO contact Ack_PB — TP Ack_Pulse_Timer, PT := T#1S
Network 2: NO contact Ack_Pulse_Timer.Q — coil Ack_Light
Network 3: NO contact Ack_Pulse_Timer.Q — coil Horn_Silence

This one is written in IEC / Siemens LAD terms because Allen-Bradley Logix has no TP instruction. In Logix, use an ONS on Ack_PB to latch a bit and a 1,000 ms TON to unlatch it.

The TP fires on the rising edge of Ack_PB. For exactly one second, Q is TRUE, illuminating the light and silencing the horn. After one second, Q drops regardless of whether Ack_PB is still pressed. This prevents the operator from silencing alarms indefinitely by holding the button.

4. Batch agitator total run time (RTO)

A chemical batch process requires 45 minutes of agitation across a multi-step recipe. The agitator is paused for 5-minute ingredient loading steps three times during the batch. A TON would reset each time the agitator pauses — after 45 minutes of wall-clock time, only 30 minutes of actual agitation would have accumulated. An RTO solves this by retaining ACC through the pauses.

Rung 1: XIC Agitator_Running — RTO Agitator_Run_Timer PRE=2700000 ms (45 min)
Rung 2: XIC Agitator_Run_Timer.DN — OTE Batch_Mix_Complete
Rung 3: XIC Batch_Reset — RES Agitator_Run_Timer

ACC accumulates only while Agitator_Running is TRUE, holding its value during each pause. When the total reaches 2,700,000 ms, DN sets, triggering the batch-complete signal. Rung 3 resets everything at batch start or operator reset. This is the quintessential RTO application.

Structured Text

In Structured Text, you declare one instance per timer, call it with IN and PT on every scan, and read its Q output. The same three delays from the ladder examples look like this in IEC 61131-3:

VAR
    StartDelay   : TON;
    CoolingDelay : TOF;
    ValvePulse   : TP;
END_VAR

(* TON: start the conveyor 5 s after a part is detected *)
StartDelay(IN := PartDetected, PT := T#5s);
ConveyorMotor := StartDelay.Q;

(* TOF: keep the cooling fan running 60 s after the motor stops *)
CoolingDelay(IN := MotorRun, PT := T#60s);
FanMotor := CoolingDelay.Q;

(* TP: 500 ms dosing pulse on each rising edge of CycleStart *)
ValvePulse(IN := CycleStart, PT := T#500ms);
DoseValve := ValvePulse.Q;

Assign ConveyorMotor := StartDelay.Q; rather than writing IF StartDelay.Q THEN ConveyorMotor := TRUE; END_IF;. The IF version never turns the motor off again.

Siemens SCL (TIA Portal)

The call is the same IEC syntax. Declare the timer in the block's Static section as a multi-instance (or give it its own instance DB) and prefix local names with #:

#StartDelay(IN := "PartDetected",
            PT := T#5S);
"ConveyorMotor" := #StartDelay.Q;

Allen-Bradley Logix Structured Text

Logix ST does not accept the ladder TON. Use TONR (or TOFR / RTOR) on an FBD_TIMER tag, which takes a TimerEnable input and a millisecond PRE:

StartDelay.PRE := 5000;   (* ms *)
StartDelay.TimerEnable := PartDetected;
TONR(StartDelay);
ConveyorMotor := StartDelay.DN;
Troubleshooting

Most timer "faults" on a real machine are one of these. Almost all of them come back to the PLC scan cycle: a timer's enable drops for a scan, or its done bit is read on a different scan from the one you expected.

  1. Reading the enable instead of the done bit. IN / .EN is TRUE the moment the rung is, so logic driven from it has no delay. Drive the timed action from Q / .DN.
  2. A TON that never finishes. If the enable drops for even one scan (a flickering sensor, a one-shot used as the enable, or logic that resets the timer every scan), a TON resets its elapsed time and never reaches the preset. If a momentary signal should start a delay, latch or seal in the enable first.
  3. Preset in the wrong units. In Logix, PRE is milliseconds, so PRE 5 is 5 ms, not 5 seconds. On SLC-500 and Mitsubishi FX the preset counts timebase ticks. In IEC, write the unit explicitly: T#5s.
  4. Expecting a TOF to remember time. A TOF delays the output turning off; it does not keep elapsed time across cycles. If the total time matters, you need a retentive timer (RTO or Siemens TONR).
  5. Forgetting to reset a retentive timer. Without a RES (or the TONR R input), an RTO's done bit stays on after the first cycle, and every later cycle looks instantly complete.
  6. Using one timer instance for two jobs. Each timer tag or instance holds one elapsed time. Program the same TIMER tag on two rungs, or call the same IEC instance twice in one scan, and the calls fight over it. Give each delay its own instance.
  7. Calling a timer conditionally. A timer only updates when its instruction executes. In Structured Text, a TON called inside an IF block never sees IN go FALSE while the IF is skipped. The same applies to a timer in a subroutine that is not called every scan. Call timers unconditionally and put the condition on IN.

Timers measure duration; they do not catch a single-scan transition on their own. When the requirement is to act once on a rising or falling edge, use a one-shot or edge-detection instruction, and for counting events rather than time, see PLC counters (CTU / CTD).

Live browser simulator

Try a live PLC timer — no install, no license

Drop into a scenario, place a TON or TOF on a rung, set the preset, energize the input, and watch the elapsed time count up in real time. The simulator grades your solution automatically.

Beginner

TON: Start Delay

Drop a TON on a rung, set a preset, and energize the input — watch ACC count toward DN.

Open scenario →
Curriculum

Curriculum: TON timer

A graded curriculum scenario building a motor start-delay circuit with a TON.

Open scenario →
Curriculum

Curriculum: TOF timer

Build a fan run-on circuit with a TOF off-delay timer. Auto-graded.

Open scenario →
Beginner

Conveyor Stop Delay

Use a TOF to keep a conveyor running for 5 seconds after the Stop signal arrives.

Open scenario →

Watch the elapsed time climb in real time, not just a static timing diagram
See exactly what happens when you drop the input before PRE is reached
Immediately observe the TOF "DN is already TRUE" behavior that trips most beginners
Fire a TP pulse and confirm the input is ignored until the pulse ends
Get auto-graded feedback — know whether your timer logic is correct
Practice in Allen-Bradley dialect or switch to IEC 61131-3 names

Practice PLC timers free — in your browser.

Free auto-graded scenarios, including a TON start-delay lab, unlock immediately. No credit card. No install. Works on Mac, Windows, Linux and Chromebook.

Questions

PLC timer FAQ

IEC 61131-3 defines three standard timer function blocks: TON (on-delay), TOF (off-delay) and TP (pulse). Allen-Bradley Logix ladder uses TON, TOF and RTO (retentive on-delay) with a RES instruction to reset them, and has no TP. Siemens TIA Portal on the S7-1200 and S7-1500 provides TON, TOF, TP and the retentive TONR.

Watch a TON timer count in your browser today

No license. No install. No credit card. Just ladder logic.

Create free account →

Technical reference and worked-example guide

PLC timer guide: field reference

Direct answer

The reader can choose the timing contract, identify instance state and test exact preset, reset, dropout, restart and task-period boundaries.

Written for pLC learners and maintainers comparing delay-on, delay-off and retentive timing across scan cycles and vendor platforms.

an automation engineer correlating PLC state, scan evidence and a controlled conveyor response at a logic diagnostics workstation while studying PLC TON, TOF and retentive timer selection and tests
System map / 02

NODE 01observable

Definition

Target platform, timer type, enabling condition, instance, time base, preset, elapsed value, status outputs, reset authority, task period, retentive state and restart.

NODE 02observable

Signal path

Field condition through rung or code execution, timer state update, threshold comparison, downstream decision, physical result and independent elapsed measurement.

NODE 03observable

Worked example

TON, TOF and retentive examples each executed before, at and after preset from a known state.

NODE 04observable

Limits

Brief input change, repeated call, skipped call, reset at preset, task jitter, maximum preset, overflow, mode change, download and power return.

NODE 05observable

Common mistake

An instruction-type, enable, instance, time-base, scan, reset, retention, threshold, downstream-owner or restart mismatch.

NODE 06observable

Verification

The selected timer verified in current official target documentation and measured representative runtime tests.

Answer surface / 07

What are the main PLC timer types?

Common types include delay-on, delay-off and retentive on-delay behavior, but instruction names, stored state, outputs and reset rules vary by platform.

How accurate is a PLC timer?

Observed timing depends on task scheduling, scan period, instruction execution, time representation, I/O update and output latency; measure the complete required path.