Entry type: FAQ Entry ID: 24521805, Entry date: 02/08/2007
(4)
Rate

Why are the bit and byte addresses changed when indirectly addressing a program converted from S5 to S7?

  • Entry
  • Associated product(s)
In STEP 7 addressing is done via double-words, because of the extended address area.

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


Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.