Siemens SIMATIC S7-200 System Manual page 48

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

Advertisement

S7-200 Programmable Controller System Manual
Figure 4-11 provides an example of the I/O numbering for a particular hardware configuration. The
gaps in the addressing (shown as gray italic text) cannot be used by your program.
CPU 224XP
I0.0
Q0.0
Module 0
I0.1
Q0.1
I2.0
I0.2
Q0.2
I2.1
I0.3
Q0.3
I2.2
I0.4
Q0.4
I2.3
I0.5
Q0.5
I2.4
I0.6
Q0.6
I2.5
I0.7
Q0.7
I2.6
I1.0
Q1.0
I2.7
I1.1
Q1.1
I1.2
Expansion I/O
Q1.2
I1.3
Q1.3
I1.4
Q1.4
I1.5
Q1.5
I1.6
Q1.6
I1.7
Q1.7
AIW0
AQW0
AIW2
AQW2
Local I/O
Figure 4-11
Sample I/O Addresses for Local and Expansion I/O (CPU 224XP)
Using Pointers for Indirect Addressing of the S7-200 Memory Areas
Indirect addressing uses a pointer to access the data in memory. Pointers are double word
memory locations that contain the address of another memory location. You can only use
V memory locations, L memory locations, or accumulator registers (AC1, AC2, AC3) as pointers.
To create a pointer, you must use the Move Double Word instruction to move the address of the
indirectly addressed memory location to the pointer location. Pointers can also be passed to a
subroutine as a parameter.
The S7-200 allows pointers to access the following memory areas: I, Q, V, M, S, AI, AQ, SM,
T (current value only), and C (current value only). You cannot use indirect addressing to access
an individual bit or to access HC or L memory areas.
To indirectly access the data in a memory address, you create a pointer to that location by
entering an ampersand (&) and the memory location to be addressed. The input operand of the
instruction must be preceded with an ampersand (&) to signify that the address of a memory
location, instead of its contents, is to be moved into the location identified in the output operand of
the instruction (the pointer).
Entering an asterisk (*) in front of an operand for an instruction specifies that the operand is a
pointer. As shown in Figure 4-12, entering *AC1 specifies that AC1 is a pointer to the word-length
value being referenced by the Move Word (MOVW) instruction. In this example, the values stored
in both VB200 and VB201 are moved to accumulator AC0.
V199
V200
1 2
3 4
V201
5 6
V202
7 8
V203
Figure 4-12
Creating and Using a Pointer
34
4 In / 4 Out
8 In
Module 1
Q2.0
I3.0
Q2.1
I3.1
Q2.2
I3.2
Q2.3
I3.3
I3.4
Q2.4
I3.5
Q2.5
I3.6
Q2.6
I3.7
Q2.7
AC1
address of VW200
AC0
1 2 3 4
4 Analog In
8 Out
1 Analog Out
Module 2
Module 3
AIW4
AQW4
Q3.0
AIW6
Q3.1
AQW6
AIW8
Q3.2
AIW10
Q3.3
Q3.4
Q3.5
Q3.6
Q3.7
MOVD &VW200, AC1
Creates the pointer by moving the address of VB200
(address of the initial byte for VW200) to AC1.
MOVW *AC1, AC0
Moves the word value pointed to by AC1 to AC0.
4 Analog In
1 Analog Out
Module 4
AIW12
AQW8
AIW14
AQW10
AIW16
AIW18

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents