In STEP 7 (TIA Portal), how can you implement indirect addressing in an SCL program?
With the SIMATIC S7-300/S7-400 you have the option of indirect addressing:
- Indirect addressing of tags
- Indirect addressing of data blocks
Indirect addressing of tags is like absolute addressing. Instead of the address, you specify an offset in parentheses. For the indirect addressing of data blocks you can also use the "WORD_TO_BLOCK_DB" conversion function.
Fig. 1 shows an example of how to use indirect addressing to access a memory area of a data block in the S7-300/S7-400.
If you want to access markers, inputs and outputs in S7-300/S7-400 using indirect addressing, you need the instructions "%MX()", "%MB()", "%MW()", "%EX()", "%EB()", "%EW()", "%AX()", "%AB()" and "%AW()". Here it is obligatory to enter the percent symbol prefix. The following figure shows you some examples.
More information is available in the manual under
- Indirect Addressing of Tags (S7-300, S7-400)
- Basics of Indirect Addressing (S7-1200, S7-1500)
- How do you implement an array access with an S7-1200/S7-1500 with variable index?
- How do you address securely and indirectly in STEP 7 (TIA Portal)?
The screens in this FAQ response were created with STEP 7 (TIA Portal) V15.