Accessing The High-Speed Counter Current Values; Understanding The Different High-Speed Counters - Siemens SIMATIC S7-200 System Manual

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

Advertisement

SIMATIC Instructions
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]
HC 2
High-speed counter number
Area identifier (high-speed counter)
Figure 9-17

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, 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.
9-36
MSB
31
Most significant
Byte 3

Accessing the High-Speed Counter Current Values

HC2
Byte 2
Byte 1
S7-200 Programmable Controller System Manual
HC2
LSB
0
Least significant
Byte 0
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents