LadderLogicOnline

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:

MemberMeaning
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:

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.

TimeRungACCENTTDN
0.0 s (button pressed)true0.0 s110
2.5 strue2.5 s110
5.0 strue5.0 s101
7.0 s (released)false0.0 s000
8.0 s (pressed)true0.0 s110
10.0 s (released)false0.0 s000

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   |
 |----] [------------------------------------( )----|
The horn sounds while the timer runs; the conveyor starts when it's done.

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]--|
When DN turns on, the XIO opens, the rung goes false and the timer resets. DN is on for exactly one scan every 2 seconds.

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

  1. Open the Playground. Add a push button with the tag Go.
  2. Build a rung: XIC Go then TON T1. A new timer starts with a 5.0 s preset; change it to 3.0 in the instruction's properties.
  3. Add a second rung: XIC T1.DN then OTE Lamp.
  4. Press Run and hold the button. Watch T1 count 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.
  5. You can change the preset while the program runs, like an online edit on a real PLC.

Key points