plc timers
ladder logic
iec 61131-3
TON vs TOF vs TP: PLC Timer Comparison

Every PLC programmer uses TON. Fewer reach for TOF intentionally, and TP trips up even experienced engineers the first time they try it. The three timer types defined in IEC 61131-3 cover almost every timing need in industrial automation, but they behave in ways that are not obvious from the names alone. Get the wrong one and your logic either never fires or fires at the wrong moment, and that kind of bug is painful to track down on a running machine.
What Are TON, TOF and TP Timers in a PLC?
TON (on-delay timer), TOF (off-delay timer) and TP (pulse timer) are the three standard timer function blocks defined by IEC 61131-3. TON delays the rising edge of an output relative to its input. TOF delays the falling edge. TP generates a fixed-duration output pulse on a rising input edge and cannot be interrupted or retriggered during that pulse. All three share the same basic parameters: a boolean input (IN or Enable), a preset time (PT or PRE) and a boolean output (Q or DN), plus an elapsed-time output (ET or ACC).
TON: The On-Delay Timer
TON is the timer you reach for automatically. The input goes TRUE, the timer starts counting, and the output goes TRUE only after the elapsed time reaches the preset. If the input drops before the preset is reached, elapsed resets to zero and the output never energizes. The moment the input goes FALSE after the output is already on, the output drops immediately and elapsed resets.
The classic application is a confirmation delay: a guard door must be closed for two full seconds before a conveyor can start. Wire the door-closed contact to TON, and if the door bounces or someone leans on it briefly, the timer resets. No false start. You can see a worked example of exactly that pattern in the S7-1200 Timers in TIA Portal guide. The broader behavioral differences between TON, TOF and TONR are also covered in TON, TOF and TONR Timers: What Actually Differs if you need the retentive angle too.
TOF: The Off-Delay Timer
TOF is the one people get backwards. When the input goes TRUE, the output goes TRUE immediately, no delay. The timer starts counting only when the input goes FALSE. The output stays TRUE for the preset duration after the input drops, then goes FALSE. If the input goes TRUE again while the timer is still running, the timer resets and the output stays on.
The textbook application is a fan purge: a motor runs, and when it stops you need the cooling fan to keep running for 30 more seconds. TOF handles that cleanly. In Studio 5000, the rung condition drives TOF.Enable. TOF.DN is TRUE while the motor is running AND for 30 seconds after it stops. No extra seal-in latch needed. This is the exact pattern used in spray dryer exit ducts and in VFD-driven fans after a controlled stop, which is something worth checking against your VFD fault code troubleshooting workflow too.
.DN (Done bit) for both TON and TOF. For TOF, .DN is TRUE when the rung is TRUE OR when the off-delay is still counting. .TT (Timer Timing) is TRUE only during the countdown phase, which is useful if you want to indicate that the fan is purging rather than running normally.TP: The Pulse Timer
TP fires a fixed-duration output pulse on a rising input edge. The output goes TRUE, runs for exactly the preset time, then goes FALSE, regardless of what the input does during that time. Here is the critical part: TP cannot be retriggered while it is running. A new rising edge on the input while Q is still TRUE is completely ignored. The timer must finish and Q must drop to zero before a new pulse can start.
This makes TP ideal for single-shot outputs: energize a pneumatic valve for exactly 200 ms to eject a part, regardless of how long the operator holds the button. You do not need an OSR (one-shot) in front of it. TP is the one-shot, and it is non-retriggerable by design. TIA Portal includes TP as a standard block. Studio 5000 does not have a native TP, so Rockwell engineers typically build it with an OSR feeding a TON whose DN bit drives the output. Omron and CODESYS both implement TP directly.

Side-by-Side Comparison
| Property | TON | TOF | TP |
|---|---|---|---|
| Output energizes | After preset elapses | Immediately when input goes TRUE | Immediately when input goes TRUE |
| Output de-energizes | Immediately when input goes FALSE | After preset elapses post-input drop | After preset elapses (ignores input) |
| Timer resets on input drop? | Yes, immediately | No, only resets if input goes TRUE again during timing | No, runs to completion regardless |
| Retriggerable? | Yes (any TRUE input extends timing) | Yes (TRUE input cancels countdown) | No (new edges ignored during Q=TRUE) |
| Native in Studio 5000? | Yes | Yes | No (build with OSR + TON) |
| Native in TIA Portal? | Yes | Yes | Yes |
Choosing the Right Timer: Decision Framework
Ask yourself one question: which edge do you need to delay? If you need to delay the output turning ON, use TON. If you need to delay the output turning OFF, use TOF. If you need a fixed-duration pulse that cannot be extended or interrupted, use TP.
- Delay before an action starts: TON. Guard door confirmation, debounce on a noisy proximity sensor, startup delay before a heater enables.
- Keep something running after a command stops: TOF. Fan purge, conveyor coast-out, alarm horn that stays on for 10 seconds after a fault clears.
- Single fixed-duration output regardless of input: TP. Pneumatic ejector pulse, HMI lamp flash on button press, one-shot alarm acknowledgment signal.
- Accumulated run-time across power cycles: TONR (Rockwell) or a retentive timer variant. Neither TON, TOF nor TP retains elapsed time across a power loss.
A Real Application: Packaging Ejector Valve
I commissioned a high-speed blister pack line where a vision system triggered a reject ejector. The first version used a TON with a seal-in latch on the output to hold the valve open for 150 ms. It worked fine at 60 parts per minute. At 120 parts per minute the part spacing was 500 ms, and occasionally a new reject signal arrived while the valve was still retracting. The seal-in latch saw the new trigger and extended the valve dwell, which caused a double-eject and jammed the chute.
Swapping to a TP block (CODESYS platform on that machine) fixed it instantly. The valve fired for exactly 150 ms, the timer ran to completion, and any new reject signal during that window was queued in a one-shot flip-flop that waited for Q to drop before triggering again. Clean, predictable, no jams. That experience is why I now reach for TP immediately on any ejector or stamping application, rather than building a seal-in with TON.
Platform Notes: Studio 5000 and TIA Portal
In Studio 5000, timers are instruction-based and use DINT tags for PRE and ACC (both in milliseconds). The .EN, .TT and .DN bits are embedded in the timer structure. Rockwell's PLC Scan Cycle troubleshooting guide covers why very short presets (under 2x scan time) can cause one-scan misses with TON and TOF. If your scan is 10 ms and your preset is 10 ms, the output may never latch on because ACC reaches PRE and resets within the same scan. Use a minimum preset of 3x your worst-case scan time.
In TIA Portal, timers use IEC TIME data type (T#200ms, T#30s) and are instance data blocks. TON, TOF and TP are all available as both LAD blocks and in Structured Text in TIA Portal. The .Q output replaces Rockwell's .DN, and .ET (elapsed time) replaces .ACC. One thing that catches people on S7-1200 specifically: if you call a timer FB without a dedicated instance DB, TIA Portal will create one automatically, but you lose the ability to reset it externally with a RESET input. Assign an explicit instance DB when you need external control.
TP Pulse Timer: Reject Ejector Valve with Queue (CODESYS / Generic). Ladder logic (3 rungs): Rung 0: examine if Vision_RejectTrigger is on (XIC), then examine if Ejector_TP.Q is off (XIO), then examine if Reject_OneShot is on (XIC), then latch output Reject_Queued (OTL). Rung 1: examine if Reject_Queued is on (XIC), then examine if Ejector_TP.Q is off (XIO), then unlatch output Reject_Queued (OTU), then either TP on Ejector_TP. Rung 2: examine if Ejector_TP.Q is on (XIC), then energize output Ejector_Sol_Out (OTE). Rising edge from the vision system latches Reject_Queued only when the TP timer is idle. When the TP finishes and Q drops, Reject_Queued fires the next pulse and immediately unlatches. The ejector solenoid is driven directly from TP.Q for exactly 150 ms per cycle. New triggers during an active pulse are held in Reject_Queued and released on the next idle window.
Common Mistakes to Avoid
- Using TON where you need TOF: A common mistake on motor cooling fans. Engineers wire the run command to a TON thinking it will keep the fan running after the motor stops. TON output drops the instant the input drops. Use TOF.
- Forgetting TOF resets on a new TRUE edge: If a signal toggles rapidly, the TOF timer keeps resetting and the off-delay never completes. Add a minimum ON-time filter upstream if the input is noisy.
- Trying to retrigger TP mid-pulse: The new edge is ignored. If you need a retriggerable one-shot, build it with TON and a seal-in, not with TP.
- Short presets near scan time: For TON and TOF, always set PRE to at least 3x worst-case scan time. For TP, the same applies because a pulse shorter than one scan may never be seen by downstream logic.
- Not assigning a dedicated instance DB in TIA Portal: Timers without explicit instance DBs are harder to monitor, reset and back up. Always assign one. See TIA Portal Data Blocks guide for the full picture.
Timers in the Wider Context
Timers rarely work alone. Most real sequences combine a timer with a counter, an interlock or a state bit. The PLC Counter Instructions guide shows how CTU, CTD and CTUD pair with TON to build timed batch logic. If you are building a full sequence, you can see timers and counters working together in the PLC Bottle Filling Machine project and the Car Wash PLC Exercise. Both use TON for step dwell times and TOF-style hold logic for gate interlocks.
If you are working through interview prep, the Ladder Logic Interview Questions guide includes timer behavior questions that interviewers love to use as differentiators. The TOF retrigger behavior and the TP non-retriggerable pulse are both on that list.
Keep Learning
If you want to go deeper on how Siemens implements all three timer types with real TIA Portal screenshots and a worked sequence, start with S7-1200 Timers in TIA Portal: TON, TOF and TONR. For the retentive timer (TONR in Rockwell, keeping elapsed time through power loss), the full behavioral breakdown is in TON, TOF and TONR Timers: What Actually Differs. And if scan-cycle timing is causing your timers to misbehave, PLC Scan Cycle Problems: Logic and Timing Faults will walk you through diagnosing it.




