3/7/2011 7:56 AM | |
Joined: 1/28/2009 Last visit: 9/2/2024 Posts: 6846 Rating:
|
Dear bezout |
3/7/2011 9:09 AM | |
Joined: 10/7/2005 Last visit: 9/5/2024 Posts: 3018 Rating:
|
Hello bezout The S5-S7 converter does unfortunately makes a bit of a messwhen it comes to converting the DO command related indirect addressing (it does so "to be sure to be sure"). You'll find that the original S5 logic is typically much easier to understand than the rather convoluted converted S7 logic (even the S5 to S7 converter manual states that: "Processing functions such as DO FW, DO DW are partially converted; however, in this case you can save memory by reprogramming the functions in S7.") Anyway, what your logic generally does is this: Based on the value of #STNR, the value of DB16.DBWx is loaded. This DB16.DBWx value is essentiallya bitindex number (value range should be 1-8). It is then decremented by 1 (to make it 0-7), shifted into the high byte and a fixed Byte address of 58 hex (=88 decimal) is added to it (what you have now is the S5 "KY Bit.Byte"format for indirect addressing of bits). This"KY = Bit.Byte" value isthen converted into the S7 pointer format and a bit is set if #LARMis on. Example: If #STNR =10,DB16.DBW20 =7 --> M 88.6 is set if #LARMis on.
|
Cheers |
|
This contribution was helpful to
1 thankful Users |
Follow us on