Popular plc programmingladder logicPLC tutorial for beginnersIEC 61131-3industrial automationPLC timers
Article

Retentive Timers Explained: TONR, RTO and How They Differ From TON

A retentive timer keeps its accumulated time when its input goes false. TONR and RTO explained with a timing diagram, a curing oven and a 500-hour counter.

Retentive Timers TONR and RTO, Bob Teaches Tech featured image

A retentive timer keeps its accumulated time when its input goes false, and carries on from that value the next time the input comes back on; only a separate reset clears it. A normal on-delay timer (TON) starts again from zero every time its input drops. On Siemens PLCs the retentive timer is TONR, on Allen-Bradley Logix it is RTO, and on Mitsubishi FX it is a timer from the retentive range, such as T250.

In this guide I will compare TON and the retentive timer on one timing diagram, show the instruction on each major platform, and build two practical examples: a curing oven that must accumulate 30 minutes at temperature, and a 500-hour service counter.

TON vs retentive timer: the one difference

Feed the same input to both timers: on for 4 s, off for 2 s, on again, with a 6 s preset.

Timing diagram comparing a TON and a retentive timer with a 6 second preset: the TON elapsed time resets each time the input drops and never finishes, the TONR accumulates 4 s plus 2 s and turns on at 8 s until reset
Figure 1. TON vs retentive timer with the same input and a 6 s preset.
  • The TON resets its elapsed time each time the input drops, so it never reaches 6 s. No single on-period is long enough.
  • The retentive timer holds 4 s while the input is off, adds 2 s more when it comes back, and turns its output on at t = 8 s. It then stays done, input or no input, until the reset input clears it.

So use a TON when you want “this condition has been true continuously for X seconds”, and a retentive timer when you want “this condition has been true for X seconds in total”. If TON, TOF and TP are new to you, start with PLC timers: TON, TOF and TP.

The retentive timer on each platform

Platform Instruction Accumulated value Reset
Siemens S7-1200 / S7-1500 TONR (time accumulator) ET output, TIME R input on the same box
Allen-Bradley Logix 5000 RTO (Retentive Timer On) .ACC in milliseconds Separate RES instruction on its own rung
Mitsubishi FX3U OUT T246–T255 (retentive range) Timer current value RST T250 instruction
Generic IEC 61131-3 Not in the standard set Build with an accumulator, or use the vendor library Your own logic

Siemens TONR

TONR has inputs IN, R and PT and outputs Q and ET. While IN is true, ET counts up; when IN goes false, ET holds. Q turns on when ET reaches PT. A true signal on R sets ET to zero and Q to false. Like the other IEC timers in TIA Portal it needs an instance data block, single or multi-instance. The S7-1200 system manual describes all four timer types.

Allen-Bradley RTO

RTO uses a TIMER tag with .PRE (preset), .ACC (accumulated), and the bits .EN, .TT and .DN. When the rung is true, .ACC counts up in milliseconds; when the rung goes false, .ACC is kept. .DN turns on when .ACC reaches .PRE. The only way to clear it is a RES instruction on another rung, addressing the same timer tag. Rockwell’s RTO instruction reference has the full details, including the newer RTOR variant with a built-in reset.

Mitsubishi FX

On the FX3U, timers T246–T249 (1 ms) and T250–T255 (100 ms) are retentive. They are programmed like any other timer, OUT T250 K600 for 60 s, and cleared with RST T250.

Retentive timer vs retentive memory: not the same thing

“Retentive” means two different things in PLC manuals, and mixing them up causes real faults.

  • A retentive timer keeps its accumulated time when its input goes false, while the PLC keeps running.
  • Retentive memory keeps a value through a power cycle or a stop-to-run change.

A TONR does not automatically survive a power cut. On Siemens S7-1200 and S7-1500 you must mark the timer’s instance data as retain, and the amount of retentive memory is limited, so check how much your CPU has. On Logix controllers tag values are normally kept through a power cycle. On the FX3U, the retentive timer range is in latched, battery-backed memory. For an hour meter, test it: run the machine for a while, cut the power, restore it, and check the value is still there.

Worked example 1: a curing oven

Parts must cure for 30 minutes in total at 180 °C or above. If the temperature dips, or someone opens the door, curing pauses but must not start again from zero.

Tag Type Meaning
Temp_OK BOOL Oven temperature at or above 180 °C
Door_Closed BOOL, input Door switch
Batch_Start BOOL, one-shot Operator starts a new batch
T_Cure TONR PT = T#30m
Cure_Done BOOL, output Batch complete lamp

The ladder is one rung for the timer and one for the output:

  • Temp_OK AND Door_Closed → TONR T_Cure, with R connected to Batch_Start and PT = T#30m.
  • T_Cure.Q → Cure_Done.

Walk through a batch. The oven heats up, Temp_OK turns on and ET starts counting. At 12 minutes the door opens: ET holds at 12:00. The door closes and ET continues from 12:00. At 30:00 of total curing time Cure_Done turns on. The next Batch_Start clears ET for the next load. A TON in the same place would have restarted at zero after the door opened, and the batch would have been cured for 42 minutes instead of 30.

Note where the reset comes from: a one-shot at the start of the batch, not the end. That way the completed time stays visible on the HMI until the operator loads the next batch.

Worked example 2: a 500-hour service counter

A pump needs a service every 500 running hours. A single retentive timer cannot do it: a TIME value on Siemens tops out at about 24 days, and a Logix .PRE at 2,147,483,647 ms, also about 24.8 days. 500 hours is fine, but 5000 hours is not, and you also want the count in hours, not milliseconds. The clean answer is a retentive timer for the minutes and a counter for the hours.

Ladder logic for a 500-hour service counter: pump run contact enables a TONR with a one hour preset that resets itself, its output counts up a CTU with preset 500, and the counter output turns on a service due lamp
Figure 2. A retentive timer and a counter together make a running-hours service counter.
  1. Rung 1: the pump’s running feedback enables TONR T_Run with PT = T#1h. Its R input is wired to its own Q, so each time it reaches one hour it resets itself and starts the next hour.
  2. Rung 2: T_Run.Q pulses once an hour into the CU input of CTU C_Hours, PV = 500. Svc_Reset (a key switch or an HMI button) resets the counter after the service.
  3. Rung 3: C_Hours.Q turns on the Service_Due lamp.

Because the timer is retentive, a pump that runs in short bursts still adds up correctly. The self-reset loses at most one scan per hour, which is negligible. Make both the timer and the counter data retentive, or a power cut will wipe the count. Counters are covered in detail in PLC counters: CTU, CTD and CTUD.

Common mistakes with retentive timers

  1. No reset. A retentive timer that is never reset finishes once and stays done for ever. Every RTO needs a RES somewhere, and every TONR needs something on R.
  2. Reset held on. If R stays true, the timer cannot accumulate at all. Drive it from a one-shot or a short pulse.
  3. Using a retentive timer where you need “continuously true”. A low-level alarm that should trip after 10 s of continuous low level needs a TON. A retentive timer would trip after ten separate one-second dips.
  4. Assuming it survives a power cut. See the retentive memory section above, and test it.
  5. Very long presets. Above a day or so, combine a timer with a counter as in example 2, or count seconds in a DINT from a 1 s clock pulse.

Testing it

Build the TON-versus-TONR comparison in the Ladder Lab simulator or your vendor’s simulator, with a 6 s preset. Toggle the input on for 4 s, off for 2 s and on again, and check that the retentive timer finishes at 8 s while the TON never does. Then pulse the reset and watch the accumulated value clear. The PLC timer preset calculator converts times into preset values for 1 ms, 10 ms and 100 ms timers.

For a project that uses ordinary timers in a full sequence, see the traffic light ladder program.

Frequently asked questions

What is a retentive timer in a PLC?

A timer that keeps its accumulated time when its input turns off and continues from that value when the input turns on again. It is cleared only by a separate reset.

What is the difference between TON and RTO?

TON resets its accumulated value whenever its rung goes false. RTO keeps the accumulated value and needs a RES instruction to clear it.

What is TONR in Siemens?

TONR is the Siemens time accumulator, the retentive on-delay timer in S7-1200 and S7-1500. It has IN, R and PT inputs and Q and ET outputs.

How do you reset a retentive timer?

On Allen-Bradley, use a RES instruction with the same timer tag. On Siemens, set the TONR’s R input true. On Mitsubishi FX, use RST with the timer number.

Does a retentive timer keep its value after power loss?

Only if its data is in retentive memory. That depends on the platform and your memory settings, so test it.

Keep going

Want the next tutorial in your inbox? Join the newsletter, or download the free eBook Introduction to Ladder Logic Programming and I/O Configuration from the resources library. For how TIME and DINT values are stored, read PLC data types explained.

About The Author

Stuck on a step? Ask here

Include your PLC model and software version if you can. Your email is never published.