Siemens TIA: Application of Memory Indirect Addressing

Publisher:jingyanLatest update time:2024-07-26 Source: elecfansKeywords:Siemens Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In STL, the following options are available for indirect addressing:

Memory Indirect Addressing


Register indirect internal area addressing

Register indirect cross-region addressing

Memory Indirect Addressing

For memory indirect addressing, you store the address in a variable. The variable can be of the WORD or DWORD data type. The variable can be located in the memory area "Data" (DB or DI), "Bit memory" (M) or "Temporary local data" (L). In the S7-1500, FB parameters can also be used to save addresses. If the variable is located in a data block, this must be a general access data block.

The following examples show the application of memory indirect addressing:

Addressing in STL illustrate
UE [MD 2] // Perform an AND logic operation on the variable input bits. The address of the input bits is located in memory double word MD2.
=DIX[DBD 2] // Assign the RLO to the variable data bit. The address of the data bit is located in the data double word DBD2.
L EB [DID 4] // Load variable input bits into ACCU 1. The input byte address is located in instance double word DID4.
AUF DB [LW 2] // Open a variable data block. The number of the data block is located in the local data word LW2.

Register indirect internal area addressing

Register indirect addressing uses one of the address registers (AR1 or AR2) to obtain the address of the operand.

In case of register indirect internal area addressing, the bit address and byte address are only indexed by the address register (such as P#10.0). The storage area to which the address in the address register applies is not entered before the instruction is written. The address in the address register is then moved to the storage area specified in the instruction.

Possible memory areas are "Input" (I), "Output" (Q), "I/O" (PI or PQ), "Bit memory" (M), "Temporary local data" (L) and "Data" (DB or DI). If the operand is located in a data block, this must be a general access data block.

When register indirect internal area addressing is input, an offset is specified after the address register is specified. This offset is added to the contents of the address register without changing the address register. The offset also has the format of a pointer. A pointer must be specified and must be entered as a constant (such as P#0.0 or P#2.0).

The following example shows the application of register indirect internal area addressing:

STL illustrate
LAR1 P#10.0 // Load the pointer (P#10.0) into address register 1
L IW [AR1, P#2.0] //Increase the data in address register 1 (P#10.0) by the value in offset P#2.0.
//Load the contents of input word IW12 into accumulator 1
L IW [AR1, P#0.0] //Increase the data in address register 1 (P#10.0) by the value in offset P#0.0.
//Add the contents of input word IW10 to accumulator 1

Register indirect cross-region addressing

In case of register-indirect cross-area addressing, the address register is used to index the entire address of the operand. That is, the bit address and byte address, as well as the memory area. Possible memory areas are "Input" (I), "Output" (Q), "I/O" (P), "Bit memory" (M), "Temporary local data" (L) and "Data" (DB or DI). If the operand is loaded into a data block, then the data block must be accessed normally, otherwise the operand must have the reservation setting "Set in IDB".

In the instruction, only the operand width is written. Possible operand widths are bit, byte, word and doubleword.

The following example shows the application of register indirect cross-region addressing:

LAR1 P#M10.0 // Load the cross-area pointer (P#M10.0) into address register 1
LW [AR1, P#2.0] //Increase the data in address register 1 (P#M10.0) by the value in offset P#2.0.
//Load the contents of memory word "MW12" into accumulator 1
LAR1 P#A10.0 // Load the cross-area pointer (P#A10.0) into address register 1
LW [AR1, P#2.0] //Increase the contents of address register 1 (P#A10.0) by the value in offset P#2.0.
//Load the contents of output word QW12.0 into accumulator 1
Description
of the special features in the S7-1500
In the S7-1500, special rules apply to data exchange via address registers and data block registers:
Outside the block, the values ​​in the registers no longer exist. The registers are also reset when the language in the block is changed.
If you access operands of the BYTE, WORD or DWORD type via register indirect addressing, the address must start with a byte limit.
Example:
LAR1 P#0.0
L MW [AR1, P#0.0] // P#0.0 + P#0.0 = P#0.0 - Addressing is permitted, because P#0.0 points to the byte limit.
L MW [AR1, P#2.1] // P#0.0 + P#2.1 = P#2.1 - Addressing is not permitted, because P#2.1 does not point to the byte limit.


Keywords:Siemens Reference address:Siemens TIA: Application of Memory Indirect Addressing

Previous article:Siemens TIA Portal: How to record signal status in LAD interlocking
Next article:Siemens TIA Portal: Overview of the GRAPH programming window

Recommended ReadingLatest update time:2024-11-16 09:35

Samsung and Lenovo Complete Industry's First Joint Validation of 128GB CMM-D CXL Memory Modules
On October 21, according to a Samsung Semiconductor technology blog on the 17th of this month, local time in South Korea, Samsung Electronics and Lenovo completed the industry's first 128GB CMM-D CXL memory module joint verification. The CMM-D module tested this time is equipped with Samsung Electronics'
[Semiconductor design/manufacturing]
Motorola's new phone appears with 100GB RAM and twice the memory of the previous generation
       Recently, a new Motorola phone named E7 Plus appeared on GeekBench, which is expected to be released soon. This phone is an upgraded version of Motorola E7. GeekBench data shows that the running memory of this phone is 4GB, which is twice that of Motorola E7.   Motorola E7 Plus scored 1152 points in single-co
[Mobile phone portable]
Motorola's new phone appears with 100GB RAM and twice the memory of the previous generation
OK6410 bare metal on-chip memory relocation code
start.S source code: .globl _start _start: // Hardware related settings      // Peri port setup      ldr r0, =0x70000000     orr r0, r0, #0x13     mcr p15,0,r0,c15,c2,4       @ 256M(0x70000000-0x7fffffff)      // Turn off the watchdog      // Write 0 to WTCON (0x7E004000)      ldr r0, =0x7E004000     mov r1, #0     st
[Microcontroller]
Siemens launches 155/165KW string inverter using silicon carbide transistors
Kaco New Energy, a well-known inverter manufacturer and subsidiary of the well-known German industrial group Siemens, recently launched two new string inverters for large-scale photovoltaic projects. The two transformerless inverters are named blueplanet 155 TL3 and 165 TL3, with rated output power of 155kW and
[New Energy]
S3C2440 memory composition
Hello everyone, we are back to discuss the memory composition of S3C2440. Let’s take a picture first: figure 1 S3C2440 is a 32-bit microcontroller (please allow me to call it a microcontroller, because I think it is really not fundamentally different from an ordinary microcontroller), so it stands to reason that its
[Microcontroller]
Detailed explanation of Modbus communication between Siemens PLC S7-200 SMART and G120 inverter
1. System Configuration 1.1 Software A PC with Step7 Micro/Win SMART software (including Modbus protocol library) installed. In this example, Step7 Micro-Win SMART V2.0 is used. 1.2 Hardware G120 is equipped with a CU240E-2 control unit inverter, an asynchronous motor, an S7-200 SMART PLC, a stan
[Embedded]
Detailed explanation of Modbus communication between Siemens PLC S7-200 SMART and G120 inverter
Explain the key points of learning Siemens PLC
Learning Siemens PLC is not as difficult as you think. It can be summarized in one sentence: for beginners, it is enough to roughly grasp the hardware composition, programming software, system instructions and program structure of PLC! Next, let us explain the key points of PLC learning one by one.
[Embedded]
Red Magic 6 gaming phone will be equipped with RAM Boost technology: 12GB memory will be turned into 18GB in seconds
      During this period of time, not only traditional mass-market Snapdragon 888 flagships have been released one after another, but well-known gaming phone manufacturers represented by brands such as Black Shark, ASUS, and Nubia have also begun to warm up their new generation of gaming phones equipped with Snapdrago
[Mobile phone portable]
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号