Hide thumbs Also See for S7-1200:
Table of Contents
Basic instructions
7.2 Timer operations
Note
In the CPU, no dedicated resource is allocated to any specific timer instruction. Instead,
each timer utilizes its own timer structure in DB memory and a continuously-running internal
CPU timer to perform timing.
When a timer is started due to an edge change on the input of a TP, TON, TOF, or TONR
instruction, the value of the continuously-running internal CPU timer is copied into the
START member of the DB structure allocated for this timer instruction. This start value
remains unchanged while the timer continues to run, and is used later each time the timer is
updated. Each time the timer is started, a new start value is loaded into the timer structure
from the internal CPU timer.
When a timer is updated, the start value described above is subtracted from the current
value of the internal CPU timer to determine the elapsed time. The elapsed time is then
compared with the preset to determine the state of the timer Q bit. The ELAPSED and Q
members are then updated in the DB structure allocated for this timer. Note that the elapsed
time is clamped at the preset value (the timer does not continue to accumulate elapsed time
after the preset is reached).
A timer update is performed when and only when:
● A timer instruction (TP, TON, TOF, or TONR) is executed
● The "ELAPSED" member of the timer structure in DB is referenced directly by an
instruction
● The "Q" member of the timer structure in DB is referenced directly by an instruction
216
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Table of Contents
loading

Table of Contents