Addressing The Counter (C) Memory Area; Accessing The Simatic Counter Data - Siemens SIMATIC S7-200 System Manual

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

Advertisement

CPU Memory: Data Types and Addressing Modes

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:
C3
I2.1
Figure 5-4
5-8
C [counter number]
Counter number (bit address)
Area identifier (counter)
MOV_W
EN
ENO
IN
OUT
C3
VW200
Counter number
(current value address)
Area identifier (counter)

Accessing the SIMATIC Counter Data

Current Value
C0
C1
C2
C3
Current Value
MSB
(Read/Write)
15
C0
C1
C2
C3
S7-200 Programmable Controller System Manual
C20
Counter Bits
(Read/Write)
C0
C1
C2
C3
Counter
LSB
Bits
0
C0
C1
C2
C3
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents