Indirect adressing S7

Thim

Member
Join Date
Mar 2008
Location
Belgium
Posts
392
Hi folks,

I have a little question sure some of you will know this.

Example

Declaration
stats:
Adres1 "int"

Temp
Adres2 dword



Program

L 2
T adres1

L adres1
L 8
*I
T adres2

Opn DB200
L dbd[adres2]

So what i do is open DB200.DBD2

I use this alot but isn't there another way to make from the INT"adres1" a DWORD"adres2" except from multipling with 8


Ok

Probably alot of you would think why doesnt he program the following

L p#2.0
t adres2
opn db200
l dbd[adres2]

just because i want to explain it but then i would need to write a book why

Thanks in advantage
 
Last edited:
thx alot


SLD 3 means Shift left double 3 times i understand that

But yes there is allways a but
What is the relation between the Dword and the INT ?
or maybe it is a bad question how do you link the Dword to this one
0000_0000_0000_0010 in INT =2
SLD 3 gives i think this one
0000_0000_0000_0000_0000_0000_0001_0000 =2.0??
Or something else
I actually want to know how i can read the binary code and transformer in to a DWORD is there any rule to do this out of the head without using any program

Sorry for the stupid questions but i'm not a prof. programmer i learned this by myself and really want to understand this very good since i have noticed the power of indirect adressing.
And maybe i'm a guy how doesn't take an answer without explaination
What is a better solution of the both

The "multipling" or the "SLD3"

Are there any advantages or disadvantages ??

Thx alot allready
 
Last edited:
The shift takes less instructions and is quicker to execute than the multiply.

Sorry but I don't understand the other questions you are raising. Use a specific example to illustrate what you want to know. (and keep the font size down !)
 
What is the format the PLC expects?

X.y

X = Byte offset
y = Bit offset

In binary that translates to:

0000_0000_0000_0000_0000_0000_0000_0000

The red is reserved for the bit offset. Bit offset can't be higher then 7, thus 3 bits reserved, hence the x8 or SLD 3. Rest is used for byte offset => your Int.

Why a Dword u ask? Well simple. If you should use Word for this your offset range would be limited to 8191.7 (full use of the 16 available bits)
Siemens uses Dword so u can use the full range of your DB's in indirect adressing.

Well thats what they made me believe...:D

Hope this helps
 
Oh ok i think i understand it

0000_0000_0000_0000_0000_0000_0000_1110= 1.6???
and
0000_0000_0000_0000_0000_0000_0001_0111=2.7??

Thx alot bot of you


 
yes,you are right.S7 have Signal word point and Double word point.The diffirent between these two point is ,
Signal poion is memery area numbering not include bit(0---65535) so it is only used for T C DB FC FB;
Double word point is include bit so it is can be used for bit addressing.if you want use double word point to area ex bit you must make sure the 0---2bit is zero.
 

Similar Topics

Gents, I've not had much dealings with indirect addressing, but I'm troubleshooting a program now, and I just wanted to verify that I've come to...
Replies
9
Views
2,976
Hi everyone. I need some help with a problem I'm having. Any help is greatly appreciated. situation: I need a way to program a data table of...
Replies
2
Views
1,458
No clue on indirect adressing any smart people that can help on pointers and indirect adressing using Allen Bradley Contrologix. Please help.
Replies
1
Views
1,837
Im getting a little more involved in programming using AB Contrologix, I can not understand what is indirect adressing or how to use it, is there...
Replies
2
Views
2,365
Hi In a program i'm addig code to, the following is found to compare a constant to a value stored in N51 EQU #N51:[N51:0] 14 What use is the...
Replies
6
Views
2,606
Back
Top Bottom