Back to tutorials
Beginner

PLC Programming Intermediate Instructions – RTO | Retentive Timer

By
Vladimir Romanov
|
August 11, 2018
Table of Contents

Introduction

The RTO, also know as Retentive Timer, an instruction is used to keep track of time just like the TON Instruction. However, there is a key difference between the two. The TON instruction will automatically reset the accumulated time upon a transition from HIGH to LOW. The RTO will simply “pause” the accumulated value during this transition. In other words, the timer will retain the value it currently has until it is energized again or forced to reset. Due to this capability, it’s an excellent tool for a process which may be interrupted but needs to keep track of a continuous event. For example, you can easily create a timer which would allow a certain valve to only open for a certain duration even though it is stopped in between.

The RTO is not a frequently utilized instruction but may come in handy in certain instances. Keep in mind that most programmers would achieve the same effect through the use of a TON or TOF instruction paired with a way to store the value such as a MOV Instruction.

Example & Usage of RTO

Here’s a real-world scenario of an RTO instruction:

  1. A Micrologix 1100 Allen Bradley PLC is used to control a process.
  2. An “Ingredient Pump RUNNING” is indicated by an internal bit B3:0/10.
  3. The bit above is tied to an XIC instruction which enables the RTO instruction.
  4. The RTO instruction specifies a Timer in the PLC: T4:3.
  5. The Time Base of T4:3 is set to 0.001 which translates to the timer counting in milliseconds.
  6. The “Preset” of T4:3 is set to 10000 which translates to the timer counting up to 10 seconds.
  7. The “Accum” of T4:3 is set to 0 which translates to the timer starting to count from 0.
  8. As the timer is initialized by the B3:0/10 XIC which energizes; it starts to count.
  9. As the timer counts, the .EN and the .TT bits are set to HIGH.
  10. As the timer finishes counting, the .TT bit is set to LOW and the .DN bit is set to HIGH.
  11. IF the B3:0/10 bit is set to LOW while the timer is counting, the Accum is set retained at the current value. The .EN, .TT and .DN bits are set to LOW.

Programming example in RSLogix 500:

RTO Retentive Timer Instruction RSLogix 5000

Outcome:

The RTO instruction will begin counting as soon as the B3:0/10 XIC is energized. The timer will begin counting at from 0 until it reaches the value specified by the “Preset” integer. In the example above, this value is set to 10000. It’s important to note that the “Time Base” of our timer is set to 0.001. This translates to a 10000 x 0.001 multiplier for our time. In other words, the timer will count to 10 seconds.

The timer will set different auxiliary bits during operation. These bits are .EN, .TT and .DN. The .EN bit will be set to HIGH if the timer is de-energized by the input instructions leading to it. The .TT bit is set to HIGH while the timer is counting; the “Accum” is less than “Preset”. The .DN bit is set to HIGH once the timer reaches the final value. In other words, when the “Accum” is equal to the “Preset”.

If the B3:0/10 bit is dropped while the timer is counting, the “Accum” value we remain as is. Should the B3:0/10 bit become re-energized again, the timer will resume counting from the retained value.

Data Types Allowed for RTO

The RTO leverages a specific data structure, called the Timer, present in most PLC systems.

  • Timer – The high-level instruction specification of all the inner structures.
  • .PRE – Integer specifying up to which value the timer will count.
  • .ACC – Integer specifying the current time value of the timer.
  • .BASE – Selectable value which specifies the time multiplier for the timer.
  • Note1: This is not available in RSLogix 5000; the timers are specified in milliseconds by default.
  • .EN – Boolean value which is set to HIGH when the timer is energized.
  • .TT – Boolean value which is set to HIGH when the timer is in the process of counting.
  • .DN – Boolean value which is set to HIGH when the timer is finished counting.

Important Notes

  • Note 1 – The RTO instruction uses a timer which is specified internally to the PLC. The user may choose to set the values covered above through the PLC interface instead of working with them in the instruction. Furthermore, the RTO instruction will not display the current set of all the bits discussed above; they will be set on the PLC only.
  • Note 2 – The programmer may choose to leverage any or none of the bits and /or integers described above. For example, a common practice would leverage the LIM instruction to execute something within a window of the timer based on the “Accum” value.

Video Tutorial

Back to tutorials

Related Tutorials

Intermediate

PLC Programming Example Project - Batching Tank Ladder Logic PLC and HMI Tutorial

Generally speaking, there are two types of processes in manufacturing: discrete and analog. A discrete process is a manufacturing methodology that will produce separate widgets. In other words, a production line may output one item, two items, three items, etc. An analog production process is where the plant will create a quantity of product that is quantifiable by weight. Examples include the production of beverages, sauces, raw ingredients, etc. Although it is possible to design a flow that will continuously output the product, such production is often managed in batches. It is important to note that although batches are considered to be analog or continuous flow, most of them end up being packaged for consumption which converts them into a discrete manufacturing process.

September 14, 2020
|
By
Vladimir Romanov
PLC Programming Career

PLC Programming Certification - Complete Guide

You may choose to pursue a traditional college degree, learn through online tutorials, or take a course that will issue a plc programming certification upon completion. However, what is the best option, and what are the best PLC programming certifications?

August 6, 2020
|
By
Vladimir Romanov
Beginner

Opto 22 groov RIO Getting Started

The groov RIO module from Opto 22 has been released only a few months ago. The groov RIO is a feature packed piece of hardware that is easy to install, configure and deploy for many different field applications. The module comes pre-loaded with an array of software tools used across the industry and is ready to hit the floor running out of the box. Furthermore, the module is equipped with user configurable input and output nodes that have the capability unlike anything else on the market.

August 2, 2020
|
By
Vladimir Romanov