Learn PLCs free
Timers & CountersIntermediateSiemens S7-1200/1500

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

Implementation note: This page models Siemens TONR with IN, R, PT, Q and ET. Rockwell Studio 5000 also uses the name TONR, but there it means Timer On Delay with Reset and is documented as non-retentive; use RTO or RTOR for Rockwell retentive timing.

Inputs

NameTypeDescription
INBOOLTimer enable input
PTTIMEPreset time value
RBOOLReset input - clears accumulated time

Outputs

NameTypeDescription
QBOOLTimer done output
ETTIMEAccumulated 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.

TONR accumulated-time timing diagramET 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.INQETenabled time totals PT
Blue is the input, green is the boolean output, and amber is elapsed time or current count. Transitions are shown at task executions; real timing resolution depends on the controller and task.

State table

MomentInputInternal stateOutputEngineering meaning
First run periodIN = TRUE, R = FALSEET increasesQ = FALSE until ET ≥ PTThe first enabled interval contributes to total runtime.
Run pausesIN = FALSE, R = FALSEET holdsQ keeps its current stateNormal enable-cycle retention preserves partial time.
Run resumesIN = TRUE, R = FALSEET continues from held valueQ becomes TRUE at PTSeparate operating periods add to one accumulated total.
Reset requestedR = TRUEET resets to T#0sQ = FALSEReset, 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.

PlatformInstructionWhat maps cleanlyCaveat to verify
Siemens S7-1200/1500TONR time accumulatorET accumulates across multiple IN = TRUE intervals and R clears itEnable-cycle retention does not automatically guarantee retention through STOP, download or power loss; configure the instance DB appropriately.
Rockwell LogixRTO in Ladder or RTOR in FBD/STUse these for retentive accumulated timeRockwell TONR means Timer On Delay with Reset and is explicitly non-retentive. The shared TONR mnemonic is not cross-vendor equivalence.
CODESYS / IEC librariesNo universal standard TONR contractA custom FB can accumulate enabled duration and expose resetDefine 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

  1. 1Accumulate time over at least two separate IN = true intervals.
  2. 2Confirm ET holds during an intervening IN = false period.
  3. 3Reach PT, remove IN and verify Q stays true until R is applied.
  4. 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.

  1. 1Run the pump and record the increase in ET.
  2. 2Stop the pump and confirm ET holds rather than returning to zero.
  3. 3Restart the pump and confirm timing resumes from the held value.
  4. 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.

Platform-Specific Implementation

S

Siemens (TIA Portal)

Native TONR instruction in TIA Portal for S7-1200/1500. Uses IEC_TIMER data type.

AB

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.

C

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.

Free PLC simulator

Wire this block up and run it

Drop the instruction into a rung, hit Run, and watch it execute in your browser. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →