Using The High-Speed Counter; Understanding The Detailed Timing For The High-Speed Counters; Operation Example With Reset And Without Start - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

SIMATIC Instructions

Using the High-Speed Counter

Typically, a high-speed counter is used as the drive for a drum timer, where a shaft
rotating at a constant speed is fitted with an incremental shaft encoder. The shaft
encoder provides a specified number of counts per revolution and a reset pulse
that occurs once per revolution. The clock(s) and the reset pulse from the shaft
encoder provide the inputs to the high-speed counter. The high-speed counter is
loaded with the first of several presets, and the desired outputs are activated for
the time period where the current count is less than the current preset. The counter
is set up to provide an interrupt when the current count is equal to preset and also
when reset occurs.
As each current-count-value-equals-preset-value interrupt event occurs, a new
preset is loaded and the next state for the outputs is set. When the reset interrupt
event occurs, the first preset and the first output states are set, and the cycle is
repeated.
Since the interrupts occur at a much lower rate than the counting rates of the
high-speed counters, precise control of high-speed operations can be implemented
with relatively minor impact to the overall scan cycle of the programmable logic
controller. The method of interrupt attachment allows each load of a new preset to
be performed in a separate interrupt routine for easy state control, making the
program very straightforward and easy to follow. Of course, all interrupt events can
be processed in a single interrupt routine. For more information about the interrupt
instructions, see Section 9.15.

Understanding the Detailed Timing for the High-Speed Counters

The following timing diagrams (Figure 9-10 through Figure 9-16) show how each
counter functions according to mode. The operation of the reset and start inputs is
shown in a separate timing diagram and applies to all modes that use reset and
start inputs. In the diagrams for the reset and start inputs, both reset and start are
shown with the active state programmed to a high level.
Reset (Active High) 0
Counter Current Value
Figure 9-10
9-28
1
+2,147,483,647
0
-2,147,483,648
Counter value is somewhere in this range.

Operation Example with Reset and without Start

Reset interrupt generated
S7-200 Programmable Controller System Manual
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents