Program instructions
7.6 Counters
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
265
HDEF instruction sets the counting mode
The HDEF instruction assigns HSC counter mode. The following table shows the physical
inputs assigned for clock, direction control, and reset functions. The same input cannot be
used for two different functions, but you can use any input not being used by the present
mode of its high-speed counter for another purpose. For example, if the present mode of
HSC0 is mode 1, which uses I0.0 and I0.4; then you can use I0.1, I0.2, and I0.3 for edge
interrupts, HSC3, or motion control inputs.
Note
All counting modes of HSC0 always use I0.0 and all counting modes of HSC2 always use
I0.2, so you cannot use these inputs for other purposes when these counters are in use.
Mode Description
Input assignment
HSC0
I0.0
I0.1
I0.4
HSC1
I0.1
HSC2
I0.2
I0.3
I0.5
HSC3
I0.3
HSC4
I0.6
I0.7
I1.2
HSC5
I1.0
I1.1
I1.3
0 Single-phase counter with internal direction
control
Clock
1
Clock
Reset
3
Single-phase counter with external direction
control
Clock
Direction
4
Clock
Direction
Reset
6
Two-phase counter with 2 clock inputs
Clock Up
Clock Down
7
Clock Up
Clock Down
Reset
9
AB quadrature phase counter
Clock A
Clock B
10
Clock A
Clock B
Reset