Learn › Instructions
RTO: Retentive Timer On
An RTO times like a TON while its rung is true, but it doesn't forget when the rung goes false. Its accumulated time is kept until a RES instruction clears it, so it can add up time across many starts and stops.
How an RTO behaves
An RTO writes to a TIMER tag, with the usual PRE, ACC, EN, TT and DN members (see the TON lesson for what each one means).
- Rung true: EN turns on and ACC builds up, just like a TON. TT is on while timing; DN turns on when ACC reaches PRE.
- Rung false: EN and TT turn off, but ACC and DN stay exactly as they were. The timer pauses.
- Rung true again: timing carries on from where it stopped.
- Only a RES clears it. A RES with the same timer tag, on a true rung, sets ACC back to 0 and turns DN off.
Once DN is on, it stays on, even if the rung goes false, until you reset the timer. That's a big difference from a TON, where DN always drops out with the rung.
A timeline
An RTO named RunT with a 10.0 second preset, timing how long a pump has run. The pump runs in three bursts, and an operator presses Reset at the end.
| Time | Rung (Pump) | ACC | EN | TT | DN |
|---|---|---|---|---|---|
| 0 s (pump on) | true | 0 s | 1 | 1 | 0 |
| 4 s (pump off) | false | 4 s | 0 | 0 | 0 |
| 9 s (pump on) | true | 4 s | 1 | 1 | 0 |
| 13 s (pump off) | false | 8 s | 0 | 0 | 0 |
| 20 s (pump on) | true | 8 s | 1 | 1 | 0 |
| 22 s | true | 10 s | 1 | 0 | 1 |
| 25 s (pump off) | false | 10 s | 0 | 0 | 1 |
| 30 s (Reset pressed) | false | 0 s | 0 | 0 | 0 |
A TON on the same rung would never have finished: none of the three bursts lasted 10 seconds on its own. The RTO added them together and reached its preset 2 seconds into the third run.
A maintenance reminder
The textbook use for an RTO is tracking run time for maintenance. Here, a conveyor needs inspecting after a set amount of running. The RTO totals up run time, a lamp comes on when it's due, and a maintenance button resets it.
| Conveyor |
|----] [------------------------------[RTO RunT PRE 60.0s]--|
| |
| RunT.DN Service |
|----] [------------------------------------( )----|
| |
| ServiceDone |
|----] [------------------------------------(RES RunT)--|
On a real machine the preset would be hundreds of hours, but a minute is easier to watch in a simulator. Everything else works the same way.
Other uses
- Total time in a state, such as how long a sensor has been blocked during a shift, across many separate blocks.
- Process steps that can pause. A mixer that must mix for 30 seconds in total, even if an operator pauses it partway through, should use an RTO for the mix time so pausing doesn't restart the step.
- A timer you want to stay done. Because DN holds until reset, an RTO can act like a timer and a latch in one: "once this has been true for 5 seconds, remember it".
Where to put the reset
The RES can go on its own rung, as above, or right after the condition that finishes the job. Two details matter:
- While the RES rung is true, the timer is held at zero. If the RTO's own rung is true at the same time, the order of the rungs decides what you see. A RES below the RTO wins at the end of each scan, so ACC stays at 0 until the reset button is let go.
- A self-resetting RTO (its own DN resetting it) behaves like a repeating timer that pauses, rather than restarts, when its rung goes false.
See how the scan cycle works for why rung order decides these cases.
Try it in the Playground
- Open the Playground and add two push buttons:
PumpandReset. - Build rung 0:
XIC PumpthenRTO RunT, preset 10.0 seconds. - Build rung 1:
XIC RunT.DNthenOTE Due. Build rung 2:XIC ResetthenRES RunT. - Press Run. Hold Pump for a few seconds at a time and watch ACC pause between presses in the Tags panel. When it reaches 10.0 s, Due turns on and stays on. Press Reset to start again.
- Now type over the RTO to make it a TON (double-click it) and try the same presses. The time no longer adds up.
Key points
- RTO = TON that remembers ACC and DN when the rung goes false.
- Every RTO needs a RES somewhere, or it can only ever finish once.
- DN stays on after the rung goes false, so don't use an RTO where you want the output to drop out with the rung.