Learn › Instructions
TON: Timer On Delay
A TON waits. Its done bit turns on only after its rung has been true, without a break, for the preset time. It's the most used timer in ladder logic, for delays, debouncing and stepping through sequences.
The parts of a timer
A TON writes to a tag of type TIMER. A TIMER tag is a small structure with two numbers and three status bits:
| Member | Meaning |
|---|---|
PRE (preset) | How long to time. You type it in seconds in the Playground (the PLC stores it in milliseconds). |
ACC (accumulator) | How much time has built up so far. |
EN (enable) | On while the timer's rung is true. |
TT (timer timing) | On while the rung is true and ACC hasn't reached PRE yet. |
DN (done) | On once ACC has reached PRE, as long as the rung stays true. |
You read the bits anywhere in the program with a dotted name, such as XIC T1.DN or XIO T1.TT. The tags and data types lesson covers TIMER tags in more detail.
How a TON behaves
Every scan, the TON looks at its rung:
- Rung true: EN turns on and the time since the last scan is added to ACC (it never goes past PRE). When ACC reaches PRE, DN turns on and TT turns off.
- Rung false: the timer resets straight away. ACC goes back to 0 and EN, TT and DN all turn off.
That second point is the key to the TON: the rung has to stay true for the whole preset. If it drops out for a single scan at 4.9 seconds of a 5 second timer, ACC goes back to zero and timing starts over. If you need time to build up across interruptions, use an RTO instead.
A timeline
Here's a TON named T1 with a preset of 5.0 seconds, driven by a button that's held for 7 seconds, released, then pressed again briefly.
| Time | Rung | ACC | EN | TT | DN |
|---|---|---|---|---|---|
| 0.0 s (button pressed) | true | 0.0 s | 1 | 1 | 0 |
| 2.5 s | true | 2.5 s | 1 | 1 | 0 |
| 5.0 s | true | 5.0 s | 1 | 0 | 1 |
| 7.0 s (released) | false | 0.0 s | 0 | 0 | 0 |
| 8.0 s (pressed) | true | 0.0 s | 1 | 1 | 0 |
| 10.0 s (released) | false | 0.0 s | 0 | 0 | 0 |
Between 5 and 7 seconds the timer is done and simply waits with ACC held at PRE. The second press only lasts 2 seconds, so DN never comes on.
Common uses
A delayed start. Sound a horn for 3 seconds before a conveyor starts, so people know it's about to move:
| RunCmd |
|----] [------------------------------[TON StartT PRE 3.0s]--|
| |
| RunCmd StartT.DN Horn |
|----] [---------]/[------------------------( )----|
| |
| StartT.DN Conveyor |
|----] [------------------------------------( )----|
Filtering a noisy signal. Put the sensor contact in front of a short TON (say 0.2 s) and use .DN instead of the sensor itself. A flicker shorter than the preset never gets through.
Sequences. Chain timers so each one's DN bit starts the next. The traffic light tutorial builds a full green, yellow, all-red cycle this way.
A repeating pulse. A TON that resets itself makes a pulse every few seconds:
| Pulse.DN |
|----]/[------------------------------[TON Pulse PRE 2.0s]--|
Every rung that reads Pulse.DN sees it on for exactly one scan, which is handy for driving a counter or a spawner. Rungs below the timer see it on the scan where it finishes; rungs above it see it on the next scan, just before the timer resets. That's the scan order at work.
Try it in the Playground
- Open the Playground. Add a push button with the tag
Go. - Build a rung:
XIC GothenTON T1. A new timer starts with a 5.0 s preset; change it to 3.0 in the instruction's properties. - Add a second rung:
XIC T1.DNthenOTE Lamp. - Press Run and hold the button. Watch
T1count up in the Tags panel (it shows ACC / PRE), and Lamp turn on at 3 seconds. Let go early and see ACC snap back to zero. - You can change the preset while the program runs, like an online edit on a real PLC.
Key points
- DN means "the rung has been true for at least PRE". Any break resets the timer.
- TT is on only while timing; it's useful for "waiting" indicators.
- Timing comes from real elapsed time, not from counting scans, so a slower or faster screen doesn't change how long a timer takes.
- Use TOF to delay turning something off, and RTO when time must add up across stops.