5-6
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01
5.4
Timer Instructions
You can use the timer to implement time-based counting functions. The timer times up while
the enabling input is on. When the enabling input is off, the timer automatically resets. The
timer is best used when you are timing a single interval.
On-Delay Timer
The On-Delay Timer instruction times up to the maximum value
when enabled. The timer resets when disabled, and stops
timing when it reaches the maximum value (3276.7 seconds).
Operands:
Tx:
T0 to T3
PT:
0 (preset value is not used)
Timers in the CPU 210 do not use the preset value. The timer
counts time for as long as it is enabled. Use a Compare Word
instruction to detect the timer value.
Each timer has a 100-ms resolution, with a maximum value of 3276.7 seconds. Once
enabled, the timer counts up to the maximum value and stops, unless it is disabled prior to
reaching the maximum value. Disabling the timer resets the timer value to zero (0).
Understanding How the CPU 210 Updates the Timers
The timers in the CPU 210 have a 100-ms resolution: each timer counts the number of
100-ms intervals that have elapsed since the timer was last updated. The timer is updated by
adding the accumulated number of 100-ms intervals (since the beginning of the previous
scan) to the current value (for that timer) when the timer instruction is executed.
The update of the timers is not automatic, since the current value of a timer is updated only if
the timer instruction is executed. Consequently, if a timer is enabled but the timer instruction
is not executed each scan, the current value for that timer will not be updated, and it will lose
time. Likewise, if the same 100-ms timer instruction is executed multiple times in a single
scan, the number of 100-ms intervals will be added to the timer’s current value multiple
times, and it will gain time. For this reason, you should use timers only where the timer
instruction will be executed exactly once per scan.
Note
The process of accumulating 100-ms intervals is performed independently of the enabling
and disabling of timers, so a given 100-ms timer will be enabled at a point somewhere
within the current 100-ms interval. This means that a timed interval for a given 100-ms
timer can be up to 100 ms short. Set the parameter for the Compare Word instruction for a
value of one greater than the minimum desired timed interval. For example, to guarantee
a timed interval of at least 2100 ms, set the value of the Compare Word instruction to 22
(2100 ms equals 21 100-ms units, plus 1 100-ms unit equals 22 100-ms units).
Instruction Set
L
A
D
S
T
L
TON
Tx, 0
TON
IN
PT
Tx
Summary of Contents for Simatic S7-200 CPU 210
Page 10: ...x S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Contents ...
Page 116: ...A 16 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 CPU 210 Data Sheets ...
Page 126: ...F 2 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 CPU 210 Order Numbers ...
Page 138: ...Index 12 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Index ...