Specifications
CPU Memory: Data Types and Addressing Modes
5-8
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Addressing the Counter (C) Memory Area
In the S7-200 CPU, counters are devices that count each low-to-high transition
event on the counter input(s). The CPU provides three types of counters: one type
counts up only, one type counts down, and one type counts both up and down.
There are two variables that are associated with a counter:
Current value: this 16-bit signed integer stores the accumulated count.
Counter bit: this bit is set or cleared as a result of comparing the current and
the preset value. The preset value is entered as part of the counter instruction.
You access both of these variables by using the counter address (C + counter
number). Access to either the counter bit or the current value is dependent on the
instruction used: instructions with bit operands access the counter bit, while
instructions with word operands access the current value. As shown in Figure 5-4,
the Normally Open Contact instruction accesses the counter bit, while the Move
Word (MOV_W) instruction accesses the current value of the counter. For more
information about the S7-200 instruction set, see Chapter 9 for SIMATIC
instructions and Chapter 10 for IEC 1131-3 instructions.
Format: C
[counter number]
C20
Current Value
C0
C3
C0
Counter Bits
(Read/Write)
C1
C2
C1
C2
C3
I2.1
MOV_W
EN
OUT VW200INC3
C3
Counter number
(current value address)
Area identifier (counter)
15
MSB
LSB
0
Current Value
(Read/Write)
C0
C3
C0
Counter
Bits
C1
C2
C1
C2
C3
Counter number (bit address)
Area identifier (counter)
ENO
Figure 5-4 Accessing the SIMATIC Counter Data