Siemens Simatic S7-200 System Manual page 204

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Instruction Set
Updating Timers with 100-ms Resolution
Most of the timers provided by the S7-200 use a 100-ms resolution. These timers count the
number of 100-ms intervals that have elapsed since the 100-ms timer was last updated.
These timers are updated by adding the accumulated number of 100-ms intervals (since the
beginning of the previous scan) to the timer's current value when the timer instruction is
executed.
The update of 100-ms timers is not automatic, since the current value of a 100-ms timer is
updated only if the timer instruction is executed. Consequently, if a 100-ms timer is enabled
but the timer instruction is not executed each scan, the current value for that timer is not
updated and it loses time. Likewise, if the same 100-ms timer instruction is executed multiple
times in a single scan, the number of 100-ms intervals are added to the timer's current value
multiple times, and it gains time. Therefore, 100-ms timers should only be used where the
timer instruction is executed exactly once per scan. A reset of a 100-ms timer sets its current
value to zero and clears its T-bit.
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. You should program the preset time value to a value 1
greater than the minimum desired timed interval. For example, to guarantee a timed
interval of at least 2100 ms using a 100-ms timer, the preset time value should be set to
22.
Updating the Timer Current Value
The effect of the various ways in which current time values are updated depends upon how
the timers are used. For example, consider the timer operation shown in Figure 10-4.
In the case where the 1-ms timer is used, Q0.0 is turned on for one scan whenever the
timer's current value is updated after the normally closed contact T32 is executed and
before the normally open contact T32 is executed.
In the case where the 10-ms timer is used, Q0.0 is never turned on, because the timer bit
T33 is turned on from the top of the scan to the point where the timer box is executed.
Once the timer box has been executed, the timer's current value and its T-bit is set to
zero. When the normally open contact T33 is executed, T33 is off and Q0.0 is turned off.
In the case where the 100-ms timer is used, Q0.0 is always turned on for one scan
whenever the timer's current value reaches the preset value.
By using the normally closed contact Q0.0 instead of the timer bit as the enabling input to the
timer box, the output Q0.0 is guaranteed to be turned on for one scan each time the timer
reaches the preset value (see Figure 10-4). Figure 10-5 and Figure 10-6 show examples of
the Timer instructions for ladder logic and statement list.
10-16
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02

Advertisement

Table of Contents
loading

Table of Contents