User Manual

Programming made easy
6.6 High-speed counter (HSC)
Easy Book
Manual, 03/2014, A5E02486774-AF
121
Selecting the functionality for the HSC
All HSCs function the same way for the same counter mode of operation. Counter mode,
direction control, and initial direction are assigned in the CPU device configuration for HSC
function properties.
There are four basic types of HSC:
Single-phase counter with internal direction control
Single-phase counter with external direction control
Two-phase counter with 2 clock inputs
A/B phase quadrature counter
You can use each HSC type with or without a reset input. When you activate the reset input
(with some restrictions, see the following table), the current value is cleared and held clear
until you deactivate the reset input.
Frequency function: Some HSC modes allow the HSC to be configured (Type of
counting) to report the frequency instead of a current count of pulses. Three different
frequency measuring periods are available: 0.01, 0.1, or 1.0 seconds.
The frequency measuring period determines how often the HSC calculates and reports a
new frequency value. The reported frequency is an average value determined by the total
number of counts in the last measuring period. If the frequency is rapidly changing, the
reported value will be an intermediate between the highest and lowest frequency
occurring during the measuring period. The frequency is always reported in Hertz (pulses
per second) regardless of the frequency measuring period setting.
Counter modes and inputs: The following table shows the inputs used for the clock,
direction control, and reset functions associated with the HSC.
The same input cannot be used for two different functions, but any input not being used
by the present mode of its HSC can be used for another purpose. For example, if HSC1
is in a mode that uses two built-in inputs but does not use the third external reset input
(default assignment at I0.3), then I0.3 can be used for edge interrupts or for HSC 2.
Table 6- 30 Counting modes for HSC
Type
Input 1
Input 2
Input 3
Function
Single-phase counter with
internal direction control
Clock -
-
Count or frequency
Reset
Count
Single-phase counter with
external direction control
Clock Direction
-
Count or frequency
Reset
Count
Two-phase counter with 2
clock inputs
Clock up Clock down
-
Count or frequency
Reset
Count
A/B-phase quadrature
counter
Phase A Phase B
-
Count or frequency
Reset
1
Count
1
For an encoder: Phase Z, Home