Technology instructions
10.1 Counting (High-speed counters)
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
573
The following table provides an overview of what inputs and outputs are available for each
configuration:
Table 10- 8 Counting modes for HSC
Single-phase
with internal
direction
control
Clock - - - - - Count, Fre-
quency, or
Sync Gate Capture Compare Count
Single-phase
with external
direction
control
Clock Direction - - - - Count, Fre-
quency, or
Two-phase Clock up Clock down - - - - Count, Fre-
quency, or
A/B counter Phase A Phase B - - - - Count, Fre-
quency, or
1
A/B counter
fourfold
Phase A Phase B - - - - Count, Fre-
quency, or
1
1
For an encoder: Phase Z, Home
There are four types of counting or modes. When you change the mode, the available
configuration options for that HSC also change:
● Count: Counts the number of pulses and increments or decrements the count value,
depending on the state of the direction control. External I/O can reset the count, disable
counting, initiate a capture of the current count, and produce a single pulse on a specified
event. The output values are the current count value and the count value at the moment a
capture event occurs.
● Period: Counts the number of input pulses over a specified time period. Returns the pulse
count and time duration in nanoseconds (ns). Values are captured and calculated at the
end of the time period specified by Frequency measuring period.
● Frequency: Measures the input pulses and time duration and calculates the frequency of
the pulses. The program returns the frequency as a signed double integer in units of Hz.
The value is negative if the counting direction is down. Values are captured and
calculated at the end of the time period specified by the Frequency measuring period.
● Motion control: Used by the motion control technology object and not available to the
HSC instructions. Refer to "Motion control (Page 653)" for further information.