Why are the bit and byte addresses changed when indirectly addressing a program converted from S5 to S7?
-
Entry
-
Associated product(s)
Description
When calculating the address in STEP 5, bits 12 to 15 are used for the interim results. But these bits are not needed for indirect addressing in STEP 5. Unlike DO instructions (e.g. "B MW") in STEP 5, in STEP 7 addressing is via double-words, because of the extended address area. With the instruction in STEP 7, an area (E, A, M), an access range (bit, byte, word and double-word) and an address are specified. The address contains the byte number.
The structure of the address register must be observed when an address is preset via the Accu:
- RRR: area identifier
- B...B: byte address
- XXX: bit address

Fig. 1
If the program is now converted to STEP 7, then when bits 12 to 15 are used by STEP 7 the system changes the addresses.
Fig. 2 shows an example of a bit pattern "W#16#221". After conversion, the address "33.2" is calculated.

Fig. 2
Fig. 3 shows the same program, but with the bit pattern"W#16#1221". The leading "1" is not evaluated by STEP 5. After conversion, however, the address "35.2" is calculated by STEP 7. The reason for this is that the leading "1" at the bit point is placed by the system in the byte address with value 2.

Fig. 3
Remedy
If you can't ensure that bits 12 to 15 are not used, then change the two move commands as follows.
- SLW 5 to SLW 12.
- SRW 5 to SRW 12.
After conversion, however, the correct address "33.2" is calculated in STEP 7.

Fig. 4
Further Information
you will find in the FAQ
Keywords
S5/S7 converter
- German
- Spanish
- Chinese
Entry belongs to product tree folder(s):
- Automation Technology Automation Systems Industrial Automation Systems SIMATIC Software for SIMATIC Controller STEP 7 V5.x STEP7 basic software and editors STEP 7
- Automation Technology Automation Systems Industrial Automation Systems SIMATIC Software for SIMATIC Controller STEP 7 V5.x STEP7 basic software and editors STEP 7 Professional
- You have a technical question / problem: Ask the Technical Support
- You want to discuss in our forum and exchange experiences with other users
- You want to create CAx data for one or more products
- You would like to send us feedback on this Entry