TONR Timer in PLC: Retentive Timing and Reset
Quick answer
On Siemens S7-1200/1500, TONR accumulates elapsed time while IN is TRUE, holds ET when IN becomes FALSE, and resumes on the next TRUE period. Q becomes TRUE at PT and remains TRUE until R resets the instance. The mnemonic means something different in Rockwell Logix.
TONR is the Siemens S7-1200/1500 time-accumulator instruction. It accumulates ET while IN is TRUE, holds that elapsed value when IN becomes FALSE, resumes on a later TRUE interval, and sets Q when the combined time reaches PT. The R input clears ET and Q. Do not map the mnemonic by name alone: Rockwell Studio 5000 also calls an instruction TONR, but documents it as a non-retentive Timer On Delay with Reset; Rockwell retentive timing uses RTO or RTOR.
Reviewed
Parameters
Inputs
| Name | Type | Description |
|---|---|---|
| IN | BOOL | Timer enable input |
| PT | TIME | Preset time value |
| R | BOOL | Reset input - clears accumulated time |
Outputs
| Name | Type | Description |
|---|---|---|
| Q | BOOL | Timer done output |
| ET | TIME | Accumulated elapsed time |
How TONR retentive time accumulator works scan by scan
Read the waveforms and state table together. The diagram shows the sequence; the table states what the program should observe at each execution.
TONR accumulated-time timing diagram
ET rises during two separate TRUE intervals and holds between them. Q turns on when the combined elapsed time reaches PT, then R clears ET and Q.
State table
| Moment | Input | Internal state | Output | Engineering meaning |
|---|---|---|---|---|
| First run period | IN = TRUE, R = FALSE | ET increases | Q = FALSE until ET ≥ PT | The first enabled interval contributes to total runtime. |
| Run pauses | IN = FALSE, R = FALSE | ET holds | Q keeps its current state | Normal enable-cycle retention preserves partial time. |
| Run resumes | IN = TRUE, R = FALSE | ET continues from held value | Q becomes TRUE at PT | Separate operating periods add to one accumulated total. |
| Reset requested | R = TRUE | ET resets to T#0s | Q = FALSE | Reset, not an IN drop, clears the accumulated result. |
Ladder and Structured Text examples
Accumulate pump runtime to a service interval
|----[ Pump_Running ]----[ TONR ServiceTime ]----|
| PT: T#200h |
| R: Service_Reset |
|----[ ServiceTime.Q ]-------( Filter_Change_Due )|This is the Siemens-style behavioral model. Treat Service_Reset as a controlled maintenance action and log it; a casual reset destroys service-history evidence.
Siemens SCL-style call
VAR
ServiceTime : TONR;
PumpRunning : BOOL;
ServiceReset : BOOL;
FilterChangeDue : BOOL;
END_VAR
ServiceTime(
IN := PumpRunning,
R := ServiceReset,
PT := T#200h,
Q => FilterChangeDue
);TONR availability and named-parameter syntax are platform specific. In CODESYS, use a reviewed custom accumulator or library block; in Logix, use RTO/RTOR for retentive timing.
Vendor compatibility
A shared mnemonic does not guarantee an identical interface or state machine. Confirm the instruction help for the controller, firmware, language and library version used on the project.
| Platform | Instruction | What maps cleanly | Caveat to verify |
|---|---|---|---|
| Siemens S7-1200/1500 | TONR time accumulator | ET accumulates across multiple IN = TRUE intervals and R clears it | Enable-cycle retention does not automatically guarantee retention through STOP, download or power loss; configure the instance DB appropriately. |
| Rockwell Logix | RTO in Ladder or RTOR in FBD/ST | Use these for retentive accumulated time | Rockwell TONR means Timer On Delay with Reset and is explicitly non-retentive. The shared TONR mnemonic is not cross-vendor equivalence. |
| CODESYS / IEC libraries | No universal standard TONR contract | A custom FB can accumulate enabled duration and expose reset | Define reset priority, saturation, task behavior and RETAIN/PERSISTENT storage explicitly, then test them. |
Failure modes and edge cases to test
IN becomes FALSE after Q is TRUE
For the Siemens TONR model, Q remains TRUE until R resets the instance.
R and IN are TRUE together
Reset clears ET and Q; verify the exact restart behavior on the following task execution in the target platform.
CPU power is removed
Do not infer power-cycle retention from “retentive timer.” It depends on the configured memory/instance retention.
The program is ported to Rockwell
Map the behavior to RTO/RTOR, not Logix TONR, and retest reset and done-bit semantics.
Evidence and review status
Siemens S7-1200/1500 accumulated-time behavior was checked against current V20/V21 documentation. The Rockwell mnemonic collision was checked against current Studio 5000 help.
Technical review date:
Critical behavior
- Siemens TONR adds elapsed time only while IN is true and holds ET when IN becomes false.
- After accumulated ET reaches PT, Q remains true until the R input resets the timer.
- R clears the accumulated time and done state; an ordinary IN falling edge does not.
- Retention across enable cycles is not the same as retention through STOP, download or power loss; instance-memory configuration controls that behavior.
Verification checklist
- 1Accumulate time over at least two separate IN = true intervals.
- 2Confirm ET holds during an intervening IN = false period.
- 3Reach PT, remove IN and verify Q stays true until R is applied.
- 4Test STOP/RUN and power-cycle behavior only after documenting the instance DB retention settings.
Worked test
Accumulate 200 hours of pump runtime
Use PumpRunning for IN, T#200h for PT and an authorized maintenance acknowledgement for R.
- 1Run the pump and record the increase in ET.
- 2Stop the pump and confirm ET holds rather than returning to zero.
- 3Restart the pump and confirm timing resumes from the held value.
- 4After Q indicates service due, perform the maintenance workflow and pulse R.
Expected result: Separate pump runs add to one service total, Q latches at the interval, and only the controlled reset clears the accumulated result.
Technical sources
The target controller's version-specific instruction help remains authoritative.
- IEC timer operation: TONR time accumulator
Siemens S7-1200 V20 documentation — Accumulation over multiple timing periods
- Timer On Delay with Reset (TONR)
Rockwell Automation Studio 5000 — Documents the non-retentive Rockwell instruction with the same mnemonic
- S7-1200 retentive memory areas
Siemens STEP 7 V21 documentation — Power-cycle retention configuration
Platform-Specific Implementation
Siemens (TIA Portal)
Native TONR instruction in TIA Portal for S7-1200/1500. Uses IEC_TIMER data type.
Allen-Bradley (Studio 5000)
Use RTO in Ladder or RTOR in Function Block/Structured Text for retentive timing. Rockwell TONR is a different, non-retentive Timer On Delay with Reset instruction.
CODESYS
No universal standard TONR contract. Use a reviewed library block or custom function block with explicit reset, task and RETAIN/PERSISTENT behavior.
Common Applications
- Filter change intervals
- Lubrication schedules
- Equipment run-hour tracking
- Preventive maintenance alerts
Common Mistakes to Avoid
- Using TONR on platforms that do not support it natively
- Forgetting the reset input after maintenance is performed
Frequently Asked Questions
What is TONR (Timer On-Delay Retentive) in PLC programming?
Siemens time accumulator that retains ET across enable cycles until its reset input is applied. TONR is the Siemens S7-1200/1500 time-accumulator instruction. It accumulates ET while IN is TRUE, holds that elapsed value when IN becomes FALSE, resumes on a later TRUE interval, and sets Q when the combined time reaches PT.
What are common applications of TONR (Timer On-Delay Retentive)?
TONR (Timer On-Delay Retentive) is commonly used for: Filter change intervals, Lubrication schedules, Equipment run-hour tracking, Preventive maintenance alerts.
How do I use TONR (Timer On-Delay Retentive) in different PLC platforms?
Siemens: Native TONR instruction in TIA Portal for S7-1200/1500. Uses IEC_TIMER data type. Allen-Bradley: Use RTO in Ladder or RTOR in Function Block/Structured Text for retentive timing. Rockwell TONR is a different, non-retentive Timer On Delay with Reset instruction. CODESYS: No universal standard TONR contract. Use a reviewed library block or custom function block with explicit reset, task and RETAIN/PERSISTENT behavior.
Related Function Blocks
RTO (Retentive Timer On)
Timer retains accumulated value when input goes FALSE; requires manual reset.
View Reference →TON (Timer On-Delay)
Starts timing on rising edge, output activates after preset delay.
View Reference →TOF (Timer Off-Delay)
Output stays TRUE for preset time after input goes FALSE.
View Reference →TP (Timer Pulse)
Generates a fixed-duration pulse on rising edge of input.
View Reference →RTOR (Retentive Timer On with Reset)
Retentive on-delay timer with integrated reset input for accumulated time clearing.
View Reference →