Share this

Indirect addressing function of S7-200 SMART series PLC

2026-04-06 07:22:38 · · #1

Addressing methods used in PLCs are divided into two types: direct addressing and indirect addressing. Direct addressing uses the element name and address number of the memory area or register to find the data. Indirect addressing, on the other hand, does not directly provide the address of the memory area or register, but accesses the data in the memory area by accessing the address of the address. Simply put, this address is a number or code, similar to a student ID number. When a teacher calls roll, they can call out the name or the student ID number. Calling out the name is like direct addressing, and calling out the student ID number is like indirect addressing. Whether you call out the name or the student ID number, it refers to the same person. (See the diagram below.)

VB0: Just like a person's name, the address 16#08000000 is equivalent to a student ID. The CPU allocates a 32-bit value as the memory address for each memory area.

Whether using indirect or direct addressing, all methods access the same memory or register.

Different PLCs have different addressing methods. Here, we will introduce the indirect addressing method of Siemens series PLCs. First, we will introduce the indirect addressing process of Siemens S7-200 series PLCs.

In the S7-200 series PLC, the memory that can be accessed indirectly includes: input process image area (I), output process image area (Q), bit memory (M), global variable memory area (V), sequential control status relay (S), and timer (T) and counter (C).

The use of indirect addressing in S7-200 series PLCs mainly involves three steps:

(1) Create pointers

When reading or writing to a memory location using indirect addressing, an address pointer must first be created. The pointer is two words long. The memory locations that can serve as pointers are the global variable memory area (V), the local variable memory area (L), and the accumulator (AC1AC2AC3) . Creating the pointer requires using a double-word transfer instruction (MOVD) to load the address of the memory location to be accessed into the memory location or register used as the pointer. As shown in the previous diagram, if the address of VB0 needs to be extracted, the symbol "&" needs to be added before VB0, i.e., &VB0. &VB0 does not represent the value of VB0, but rather the address of VB0, i.e., 16#08000000 . See the diagram below:

VD100 represents a pointer used to store the memory address VB0.

(2) Modify pointers

When storing data consecutively, the data immediately following it can be easily stored by modifying the pointer. Simple mathematical operation instructions, such as addition, subtraction, increment, and decrement instructions, can be used to modify the pointer. When modifying the pointer, it is necessary to distinguish the length of the data being accessed. When storing a byte, the pointer is incremented by 1; when storing a word, the pointer is incremented by 2; and when storing a double word, the pointer is incremented by 4. As shown in the following program, the address of memory address VB0 is used as the pointer, and then the pointer is moved to the address pointing to memory address VB2.

(3) Use pointers to store data

Adding an asterisk (*) before an operand indicates that the operand is a pointer. For example, *AC1 means that AC1 represents a pointer that stores a memory address. Adding an asterisk (*) before an operand, such as *AC1, means using the data in AC1 as the memory address to access the value in the memory corresponding to that address. The following program illustrates this:

Read next

CATDOLL Hanako Soft Silicone Head

You can choose the skin tone, eye color, and wig, or upgrade to implanted hair. Soft silicone heads come with a functio...

Articles 2026-02-22