TON, TOF and RTO: which timer, and why it matters
Three timers that look interchangeable and are not. The differences show up in exactly one place: what happens when the rung goes false.
Short answer
All three count while their rung is true and differ entirely in what happens when it goes false. A TON resets to zero. A TOF starts counting down and holds its output on until the preset expires. An RTO keeps its accumulated value and resumes from there, and only clears when explicitly reset.
Every platform gives you at least three timers, and beginners reasonably assume the differences are cosmetic. They are not. All three behave identically while the rung is true, and differ entirely in what happens when it goes false, which is the interesting half.
TON, on-delay
The rung goes true, the timer starts counting, and after the preset the done bit sets. The rung goes false and everything resets: accumulated value back to zero, done bit off.
This is the one you want most of the time. 'Run the fan for three seconds after the heater starts' is a TON.
TOF, off-delay
Reversed. The done bit is on while the rung is true. When the rung goes false the timer starts, and the done bit stays on until the preset expires.
This is how you keep an extractor running for a minute after the machine stops, or hold a lamp lit briefly after a signal clears. The mistake is trying to build it out of a TON and a latch, which works until the rung chatters.
RTO, retentive
Counts like a TON, but does not reset when the rung goes false. The accumulated value stays where it was, and counting resumes from there next time the rung goes true.
It only resets when you explicitly reset it. That is the whole point, and also the trap.
An RTO with no reset instruction anywhere in the program is one of the few bugs that works perfectly during commissioning and fails weeks later, because it takes that long for the accumulator to creep up to the preset.
Use RTO for genuine running totals: motor hours before service, cumulative time above a temperature. Do not use it for sequencing.
The detail nobody mentions
Timers count elapsed time, not scans. A ten second preset takes ten seconds whether your scan is 2 ms or 200 ms.
This sounds obvious and matters because it is the opposite of how a counter behaves, and because a simulator that advances timers once per scan will teach you something false. If your simulated ten-second timer finishes faster when the simulation runs faster, the simulator is lying to you.
Common questions
- When should I use an RTO instead of a TON?
- Use RTO for genuine running totals, such as motor hours before service or cumulative time above a temperature. Never use it for sequencing. An RTO with no reset instruction anywhere works perfectly during commissioning and fails weeks later when the accumulator finally reaches the preset.
- Do PLC timers count scans or milliseconds?
- Milliseconds of elapsed time. A ten second preset takes ten seconds whether the scan is 2 ms or 200 ms. Any simulator whose timers finish faster when it runs faster is counting scans, and is teaching you something that is not true of real hardware.
Keep reading
- Safety
SIL or PL: which one does your machine need?
Two standards, two scales, and one machine. Which one applies, how they map to each other, and why the answer is usually ISO 13849.
- Safety
Categories B, 1, 2, 3 and 4, in plain terms
Five architectures, what a single fault does to each, and the practical wiring that goes with them.
- Safety
Safety relay or safety PLC: how to decide
One is a wiring decision, the other is a programming one. The count of safety functions, not the size of the machine, is what settles it.