Old S7-300 SLC code - what's going on ??

Holmux

Lifetime Supporting Member
Join Date
Oct 2013
Location
Aalborg
Posts
279
HI

My SLC understanding is not perfect yet, and have been over the manuals again and again, but I am digging true some old code and I have this little section that I am not totally sure about:

L DBW 5
SLW 3
LAR1
L DBW [AR1,P#0.0]
T MW 5

Does this make sense to anyone ? :unsure:

If we for example say the value of DBW 5 = 2

How would this workout ?

/Holmux
 
Hello ,
The code is not complete, but I will try to explain the meaning.

Code:
L DBW 5                  // Load the value of db? .dbw5 opened before.
SLW 3                    // Shift it left by 3. If for you the value of dbw5 is 2 the risult is 2 slw3 = 16 decimal
LAR1                     // Load the result into the register AR1 like address.In our case is 2.0
L DBW [AR1,P#0.0]        // Load the value of db?.dbw2.0
T MW 5                   // Trasfert it to merker word 5
 
Siemens indirect addressing

1. load value from DBxx.DBW5 ()Is there earlier command OPN DBxx? on code)
2. SHL 3 (SHIFT LEFT 3 -> INT to pointer format conversion, same as multiple with 8, pointer has 8bits and word address -> so now we look word address. ex. DBW5 = 2 -> SHL 3 -> 16 (Pointer points to second word, if you don't SHL3/multiple8 then pointer points to 2nd bit...)
3. Load pointer to AR1
4. Load from DBW address with pointer , P#0.0 is offset (ex. AR1 =16 + offset 0.0 => Load pointer = 16 (points 2nd word)-> load DBW2)
5. transfer loaded value to MW5

same if DBW5 has value 3 or 4, now we load indirectly 3rd and 4rd word to MW5
 
Last edited:
Thanks for the help

I have been searching high and low for some more detailed information on the "Offset" function, but reading the Siemens help file convinced me that they drink a lot of beer in Germany, very confusing :)

To be honest I don't have a clear view of the basic's of the Offset function, :( I remember reading a good article about the function way back, but can't seem to find it again.

Can you point me in the right direction ?

/Holmux
 

Similar Topics

Hi, I have a few questions in relation to a new project I must design. Sorry if a little vague on existing hardware, but it's all the information...
Replies
14
Views
13,992
This is one for the siemens crowd. We want to replace a S5 95U connected to 3 banks of I/O I am not kidding when I say lots of I/O. All I/O are 8...
Replies
6
Views
3,113
is it possible to get the old type s7-300 cpu download password? I know we can get password from the mmc card, but the old cpu(6es73152af03...)...
Replies
0
Views
1,650
This is admittedly a pretty obscure problem, but maybe someone else has run into it, or at least something similar. For reasons I won't get into...
Replies
3
Views
132
Does Rockwell still offer reset codes for old school Master Disk floppy's? In a bind and need to reset the activation disk soon and to be pointed...
Replies
9
Views
230
Back
Top Bottom