EasyManua.ls Logo

Siemens Simatic S7 Series

Siemens Simatic S7 Series
726 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
PLC concepts
4.2 Accessing data
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
71
Entering an asterisk (*) in front of an operand for an instruction specifies that the operand is
a pointer. As shown in the following figure, entering *AC1 means that AC1 stores 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.
MOVD &VB200, AC1
Creates the pointer by moving the address of VB200 (initial byte of VW200) to AC1
MOVW *AC1, AC0
Moves the word value referenced by the pointer in AC1
Figure 4-7 Creating and using a pointer
As shown in the following figure, you can change the value of a pointer. Since pointers are
32-bit values, use double-word instructions to modify pointer values. Simple mathematical
operations, such as adding or incrementing, can be used to modify pointer values.
MOVD &VB200, AC1
Creates the pointer by moving the address of VB200 (initial byte of VW200) to AC1
MOVW *AC1, AC0
Moves the word value referenced by the pointer in AC1
+D +2, AC1
Adds 2 to the accumulator to point to the next word location
MOVW *AC1, AC0
Moves the word value referenced by the pointer in AC1
Figure 4-8 Modifying a pointer

Table of Contents

Other manuals for Siemens Simatic S7 Series

Related product manuals