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. |
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
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University Hall----Live Replay: Internet of Everything-Shijian Company and Microchip experts jointly discuss IoT solutions
- [Discussion] I'm looking at a product recently, a 400x400 camera for car use
- DSP Power Budget Digital Output Voltage Regulation
- Selling some components
- Detailed introduction to crystal oscillators and crystal parameters
- Timing Analysis of TB5128FTG’s Decay Action
- Wi-Fi sensor network forms and related typical applications
- How to correct the scale of glass rotor flowmeter when in use
- msp430 button control LED light
- MATLAB simulation model for online parameter identification of permanent magnet synchronous motor based on MRAS