Loading AILogicHMI...

PLC Retentive Timer Explained with Examples

admin
Aug 26, 2025
9 min read
1 viz
Ladder Logic Visualization
PLC Retentive Timer Explained with Examples PLC Inputs Outputs Tank Sensor RTO Retentive Timer TON On-Delay Timer TOF Off-Delay Timer Industrial Process Input Signal Timer Active Accumulated Value Output Signal AILogicHMI
PLC Retentive Timer Explained with Examples

PLC Retentive Timer Explained with Examples

In the realm of Programmable Logic Controllers (PLCs), timers play a crucial role in automating industrial processes. Among the different PLC timer types, the PLC retentive timer, also known as the RTO timer, stands out due to its unique ability to retain its accumulated value even when the input signal is interrupted. This makes it invaluable in applications where tracking elapsed time across multiple cycles is essential. This article delves into the intricacies of the retentive on-delay timer, exploring its functionality, comparing it to other timer types like the TON (Timer On Delay) and TOF (Timer Off Delay), and providing practical PLC ladder logic retentive timer program examples from Allen Bradley and Siemens.

Understanding the Retentive On-Delay Timer (RTO)

The retentive on-delay timer, or RTO timer in PLC programming, is a type of timer instruction that accumulates time while its input condition is true. Unlike a regular TON timer, the RTO timer retains its accumulated value even when the input goes false. It only resets when a specific reset instruction is executed. This makes the RTO timer perfect for applications where the total elapsed time needs to be tracked over multiple cycles of the input signal. The PLC RTO instruction is commonly used in industrial automation timer functions to measure durations that may be interrupted or sporadic.

Key Insight: The primary advantage of a retentive timer over a non-retentive timer lies in its memory. The RTO remembers the accumulated time, even if the triggering condition is interrupted, making it suitable for applications requiring cumulative timing.

How a Retentive Timer Works

The RTO timer operates on three primary parameters:

  • Preset Value (PV): The target time value that the timer needs to reach.
  • Accumulated Value (ACC): The current accumulated time. This value is retained even when the input signal is false.
  • Enable Bit (EN): This bit is set when the input condition is true, and the timer is enabled.
  • Done Bit (DN): This bit is set when the accumulated value (ACC) equals or exceeds the preset value (PV).

When the input condition becomes true, the EN bit is set, and the ACC value starts incrementing. If the input condition goes false before the ACC reaches the PV, the EN bit is cleared, but the ACC value remains unchanged. When the input condition becomes true again, the timer resumes counting from the retained ACC value. Once the ACC value reaches or exceeds the PV, the DN bit is set. The timer remains in this state until a reset instruction is executed, which sets the ACC value back to zero and clears the DN bit. Resetting RTO timer in PLC can be achieved using a dedicated reset instruction, often triggered by a separate condition or operator input.

Retentive Timer vs. Non-Retentive Timer: TON and TOF

Understanding the difference between TON (Timer On Delay), TOF (Timer Off Delay), and RTO timers is critical for selecting the right timer for a specific application. The key difference between TON and RTO timer lies in how they handle interruptions to the input signal.

TON (Timer On Delay)

A TON timer starts accumulating time when its input condition becomes true. If the input condition goes false before the accumulated value reaches the preset value, the timer resets, and the accumulated value returns to zero. It's a non-retentive timer.

TOF (Timer Off Delay)

A TOF timer starts timing when its input condition goes false. If the input condition becomes true again before the accumulated value reaches the preset value, the timer resets. It's also a non-retentive timer.

Comparison Table: TON, TOF, and RTO

Timer TypeBehaviorRetentive?Resets When Input False?Use Case
TON (Timer On Delay)Starts timing when input is true.NoYesDelaying an action after an event.
TOF (Timer Off Delay)Starts timing when input is false.NoYesExtending an action after an event ends.
RTO (Retentive On Delay)Starts timing when input is true and retains value when input is false.YesNo (requires reset instruction)Accumulating time across multiple cycles.
Important: Choosing the wrong timer type can lead to incorrect timing sequences and potentially compromise the safety and efficiency of your automated process. Always carefully consider the application requirements before selecting a timer.

PLC Ladder Logic Retentive Timer Program Examples

To illustrate the practical application of RTO timers, let's explore PLC ladder logic retentive timer program examples in both Allen Bradley and Siemens platforms. These examples will demonstrate how to implement and reset an RTO timer in a real-world scenario.

Allen Bradley RTO Example

Consider a scenario where you need to track the total time a machine is running over multiple shifts. Here's how you can implement it using an Allen Bradley PLC:

// Ladder Logic for Allen Bradley RTO Timer

// rung 1: Enable the RTO timer when the machine is running
IF Machine_Running THEN
    RTO Timer1 PRE=3600 ACC=? EN DN
END_IF

// rung 2: Reset the RTO timer at the end of the day
IF End_of_Day THEN
    RES Timer1
END_IF

// rung 3: Trigger an alarm if the machine runs for more than the preset time (3600 seconds = 1 hour)
IF Timer1.DN THEN
    Alarm_Trigger = TRUE
END_IF

In this example, 'Machine_Running' is a boolean tag indicating whether the machine is currently operational. The RTO timer 'Timer1' accumulates time as long as 'Machine_Running' is true. The 'RES' instruction resets the timer when 'End_of_Day' is true. The alarm is triggered when the accumulated time exceeds the preset value.

The PLC RTO timing diagram will show the accumulated value rising when the input is true and holding its value when the input goes false, until the reset instruction is executed.

Siemens PLC Retentive Timer Example

Here's how you can achieve the same functionality using a Siemens PLC and the S7-1200 or S7-1500 series:

// SCL Code for Siemens PLC RTO Timer

//Declaration
VAR
    Machine_Running : BOOL;
    Timer1 : TON_R; // Retentive Timer
    End_of_Day : BOOL;
    Alarm_Trigger : BOOL;
END_VAR

//Implementation
#Timer1(IN := Machine_Running, PT := T#1H, R := End_of_Day); //PT is preset time, R is reset
Alarm_Trigger := #Timer1.Q; //Q is the Done Bit (DN)

In this Siemens PLC retentive timer example, the `TON_R` function block represents the retentive timer. The 'IN' input is connected to the 'Machine_Running' signal, the 'PT' input sets the preset time to 1 hour (T#1H), and the 'R' input resets the timer when 'End_of_Day' is true. The 'Q' output represents the Done bit, which triggers the alarm.

Real-World Applications of Retentive Timers

Retentive timers are widely used in various industrial automation applications. Here are a few examples:

  • Total Machine Runtime Tracking: As demonstrated in the previous examples, RTO timers can track the total operating time of a machine across multiple shifts or days.
  • Process Monitoring: Monitoring the total time a chemical reaction takes place, even if the process is interrupted.
  • Maintenance Scheduling: Tracking the cumulative operating hours of equipment to schedule preventative maintenance.
  • Batch Processing: Counting the total time of each batch produced, even with interruptions during the process.
  • Energy Consumption Monitoring: Measuring the total energy consumption of a device or system over a period of time.

Resetting the RTO Timer in PLC

The reset instruction is crucial for an RTO timer to function correctly. Without a reset, the accumulated value will continue to increase indefinitely, and the timer will not be able to accurately track time in subsequent cycles. The method for resetting the RTO timer can vary depending on the PLC brand. In Allen Bradley PLCs, the `RES` instruction is used. In Siemens PLCs, the `R` input of the `TON_R` block is used.

The reset condition should be carefully chosen based on the application requirements. Common reset conditions include:

  • End of Shift: Resetting the timer at the end of each work shift.
  • End of Batch: Resetting the timer after a batch process is complete.
  • Maintenance Completion: Resetting the timer after maintenance is performed on a machine.
  • Operator Input: Allowing an operator to manually reset the timer.

PLC RTO Timing Diagram

A timing diagram visually represents the behavior of the RTO timer over time. It shows the relationship between the input signal, the accumulated value, and the done bit. The diagram illustrates how the accumulated value increases when the input is true and remains constant when the input is false, until the reset instruction is executed.

RTO Timer Timing DiagramInputAccumulated ValueDone BitTimeReset

Common Errors and Troubleshooting

When working with retentive timers, several common errors can occur. Being aware of these potential issues can save time and effort in troubleshooting:

  • Forgetting to Reset the Timer: The most common error is forgetting to include a reset instruction. Without a reset, the timer will continue to accumulate time indefinitely.
  • Incorrect Preset Value: Setting an incorrect preset value can lead to premature or delayed triggering of the done bit.
  • Conflicting Logic: Ensure that the logic controlling the timer and reset instructions does not conflict.
  • Using the Wrong Timer Type: Using a TON or TOF timer instead of an RTO timer when retentive timing is required.

Conclusion

The PLC retentive timer (RTO) is a powerful tool for industrial automation, enabling accurate time tracking across multiple cycles. Understanding its functionality, differences from other timer types, and proper implementation techniques is crucial for successful PLC programming. By mastering the RTO timer, you can enhance the efficiency and reliability of your automated systems. Ready to take your PLC programming skills to the next level? Explore our comprehensive PLC programming tutorial timers series and unlock the full potential of industrial automation timer functions!

Discussion (0)

Start the conversation!
Share your thoughts on this article.