Specifications

SIMATIC Instructions
9-36
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Addressing the High-Speed Counters (HC)
To access the count value for the high-speed counter, you specify the address of
the high-speed counter, using the memory type (HC) and the counter number
(such as HC0). The current value of the high-speed counter is a read-only value
and can be addressed only as a double word (32 bits), as shown in Figure 9-17.
Format: HC
[high-speed counter number]
HC2
HC 2
HC2
31
MSB
0
LSB
High-speed counter number
Area identifier (high-speed counter)
Least significantMost significant
Byte 0Byte 1Byte 2Byte 3
Figure 9-17 Accessing the High-Speed Counter Current Values
Understanding the Different High-Speed Counters
All counters function the same way for the same counter mode of operation. There
are four basic types of counter modes as shown in Table 9-5. Note that every
mode is not supported by every counter. You can use each type: without reset or
start inputs, with reset and without start, or with both start and reset inputs.
When you activate the reset input, it clears the current value and holds it cleared
until you de-activate reset. When you activate the start input, it allows the counter
to count. While start is de-activated, the current value of the counter is held
constant and clocking events are ignored. If reset is activated while start is
inactive, the reset is ignored and the current value is not changed. If the start input
becomes active while the reset input is active, and the current value is cleared.
You must select the counter mode before a high-speed counter can be used. You
can do this with the HDEF instruction (High-Speed Counter Definition). HDEF
provides the association between a high-speed counter (HSCx) and a counter
mode. You can only use one HDEF instruction for each high-speed counter. Define
a high-speed counter by using the first scan memory bit, SM0.1 (this bit is turned
on for the first scan and is then turned off), to call a subroutine that contains the
HDEF instruction.