Indirect addressing in S7-300

Join Date
Dec 2019
Location
Hansi
Posts
13
Hi All,

As i am new to STL programming I am facing a problem with the code below

OPN DB 103
A M [DBD 140]
= M 206.0
A M [DBD 384]
= M 206.2
OPN DB 104
A M [DBD 20]
= M 206.1

what i understood from the code above is that

1) open db 103

2) Load the value of db103.dbd140 in the memory bit. Let say value of dbd140 is 10.0

3) Now if M10.0 is high then it will make M 206.0 high.

Am i right??

Best Regards
Mohit_kataria
 
Yes correct, The value in DB103 DBD140 will contain a M bit pointer i.e. 10.0 so it equates to M10.0
ignoring the indirect it is the same as
A M 10.0 // A M[DBD140] contains 10.0
= M206.0
 
Thanks Parky for the quick response!!!

Could you please explain what does indirect mean??
Please see the attached Picture.
If i make M 250.0 high then M 206.1 is still LOW:confused:
Please Explain......

Snip.JPG
 
The address in DB14.dbd20 is P#31.2 - the address is bit based so

250 decimal = (byte 31 * 8) + 2


If you want to address M250.0 then the number required in DB14.DBD20 is (250*8) + 0 = 2000
 
Thanks for the reply!! @L D[AR2,P#0.0]

Bit confusing pointer in general is P#byte.bit as in Memory indirect addressing
Here Let say i want to point M 31.2 for that i have to make it in pointer format that P#byte.bit. but what is the reason behind multiplying 31 with eighto_O
Is it because of 1byte =8 bits.
 
Thanks for the reply!! @L D[AR2,P#0.0]

Bit confusing pointer in general is P#byte.bit as in Memory indirect addressing
Here Let say i want to point M 31.2 for that i have to make it in pointer format that P#byte.bit. but what is the reason behind multiplying 31 with eighto_O
Is it because of 1byte =8 bits.

Exactly.
You can also shift 3, as it is same than multiply by 8
 
Thanks Lare:beerchug:

But in my above attachment under the standard tab it is showing 250 for M 31.1,M 31.2 & M 225.1. However I know the address are right as db's contain different value so why only 250 is shown under the Standard tab not the other different values as per addresses?
 
Last edited:
ohhh(y)

Also db103.dbd384 contains 1815 (DW16#00000717) if i divide it by 8 address comes out to be M 226.7.
1815=226*8 +7. why it is pointing to address 225.1???o_O

please see the attachment.

snip1.JPG Snip.JPG
 
@ L D[AR2,P#0.0]

You are right :)the value is 1801 in decimal format and which gives an address of M 225.1. But in my db value is 1815 then how it is loading 1801??
 
Hi Lare,

You were right the address is written two times.I have attached screenshot of both the places.Please have a look. And according to Program cycle it will first execute network 2 & 4(SNIP2) after that it will execute Network 33 & 34(SNIP3) that is why DB is showing value 1815(db103.dbd384).


Thanks:geek::site:

snip2.JPG snip3.JPG
 
Last edited:
Thanks Everyone !!!:)
for your support @ Parky i have no idea of S5 indirect addressing not even S7 indirect addressing. Being a newbee in STL programming i am learning new things.:):)
 

Similar Topics

I have spent a couple of weeks now hunting around for information to step7 indirect addressing. There are many, many discussions relating to this...
Replies
5
Views
10,364
So far all the code i've written for PLC's has been simple ladder logic and I'm sure this will be simple once i know how. I have an s7-300 setup...
Replies
9
Views
13,847
Sorry if that has been posted before, but I cannot find an answer to my problem. I am trying to access a Flag Byte MBXX in a Function call. My...
Replies
5
Views
4,331
Hello all, I'm new to indirect addressing in siemens controller. I know the basic idea but I'm having issues with coding it. I basicly have 50...
Replies
8
Views
11,936
Hello, I would like to know if there is and equivalent to the follow AB indirect addressing technique available with S7-300 N19:[N7:91]/15 I use...
Replies
1
Views
8,136
Back
Top Bottom