TONR
TONR
Description
The instruction "Time accumulator" is used to accumulate time values within a period set
by the parameter PT. When the signal state at the IN input changes from "0" to "1" (positive
signal edge), the instruction is executed and time PT starts. While the time PT is running,
the time values are accumulated that are recorded when the IN input has signal state "1".
The accumulated time is written to the ET output and can be queried there. When the dura-
tion PT expires, the output Q has signal state "1". The Q parameter remains set to "1",
even when the signal state at the IN parameter changes from "1" to "0" (negative signal
edge).
The R input resets the ET and Q outputs regardless of the signal state of the start input.
Each call of the "Time accumulator" instruction must be assigned an IEC timer in which the
instruction data is stored.
Parameters
The following table shows the parameters of the "Time accumulator" instruction:
I, Q, M, I, Q, M, D,
IN Input BOOL BOOL D, L or L, P, or Start input
constant constant
-1-
TONR: Time accumulator (S7-1200, S7-1500)
I, Q, M, I, Q, M, D,
R Input BOOL BOOL D, L or L, P or Reset input
constant constant
Maximum dura-
tion of time re-
I, Q, M, I, Q, M, D, cording
TIME,
PT Input TIME D, L or L, P or
LTIME The value of the
constant constant
PT parameter
must be positive.
Output that is set
I, Q, M, I, Q, M, D,
Q Output BOOL BOOL when time PT
D, L L, P
expires.
TIME, I, Q, M, I, Q, M, D, Accumulated
ET Output TIME
LTIME D, L L, P time
Example
The following example shows how the instruction works:
-2-
TONR: Time accumulator (S7-1200, S7-1500)
The following table shows how the instruction works using specific operand values:
See also
Overview of the valid data types
Memory areas (S7-1500)
Basic information on LAD
Memory areas (S7-1200)
-3-