Timers (output instruction)
RTO: Retentive Timer On
Accumulates time while the rung is true, and keeps the accumulated value when it goes false.
Also called: TONR, retentive timer, accumulating timer, run hours.
RTO(timer, preset, base)Arguments
| Name | What it is | Accepts | Default |
|---|---|---|---|
| destination | What the instruction acts on | a timer | required |
| preset | Preset (ms) | a whole number | 1000 |
| base | Time base (ms) | a whole number | 1 |
Arguments are positional and this table is generated from the simulator's own instruction registry, so it always matches what the engine accepts.
What it does
RTO is a TON that remembers. When the rung goes false the accumulator holds its value instead of dropping to zero, and when the rung goes true again it carries on from where it stopped.
That is what you need for anything cumulative: total running hours on a pump, time a heater has spent above a threshold, how long a filter has been in service. A TON cannot do it, because a single stop wipes the value.
Because nothing about a false rung resets it, an RTO can only be cleared with a RES instruction. That is not an oversight, it is the point: the value has to survive everything except a deliberate reset.
A rung you can run
A pump service interval with an operator reset
XIC(Pump_Running)RTO(Pump_Hours,36000000)
XIC(Pump_Hours.DN)OTE(Service_Due_Lamp)
XIC(HMI_Service_Done)RES(Pump_Hours)36000000 ms is ten hours of accumulated running, counted across as many stops and starts as it takes. The lamp stays on until a maintainer resets it.
Run this rung in the simulatorWhat it is called on other controllers
| Platform | Equivalent |
|---|---|
| Rockwell (Studio 5000) | RTO |
| Rockwell (older) and IEC libraries | TONR |
| Siemens (TIA Portal) | No single retentive on-delay; built from a TON and a retentive memory value |
| Mitsubishi (GX Works) | Retentive timer, the T range configured as retentive |
Common mistakes
- Forgetting the RES. An RTO with no reset counts up once and stays done for ever.
- Putting the RES on a rung that is true more often than intended, which silently turns the retentive timer back into a TON.
- Using milliseconds for very long periods without checking the range. Run-hours counted in milliseconds gets large quickly; 1000 hours is 3.6 billion, past a 32-bit signed integer.
Practise it
Interactive exercises that use RTO. Each one checks your ladder against a real scan.
