Siemens OPN DB[MW]?

ylade

Member
Join Date
Sep 2007
Location
Ireland
Posts
23
Hi All,

I wish to Open a DB that will be constantly changing.
Eg OPN DB [MW] My code will look at the data words/Dwords/Stings from this DB. However, I also need the Data locations to change for example
L 10
T MW 20
L 44
T MW 30

OPN DB [MW20] // Opn Data Block 10 ----THis Seems possible
L DBD [MW 30] // L Double Word 44 ----- THis does no?

Any Ideas?
THankso_O
 
Try this

L 44
SLD 3
T MD 30

L DBD[MD30]

Be carefull MW32 can't be used somewhere else in the program
 
Last edited:
Stl

U need to use the adress register.

Some SLD3 stuff.

L MW30
SLD3
LAR 1
L [AR1,p#0.0]


I think it's something like that, if not, STL specialists on this forum will help you further.



Hi All,

I wish to Open a DB that will be constantly changing.
Eg OPN DB [MW] My code will look at the data words/Dwords/Stings from this DB. However, I also need the Data locations to change for example
L 10
T MW 20
L 44
T MW 30

OPN DB [MW20] // Opn Data Block 10 ----THis Seems possible
L DBD [MW 30] // L Double Word 44 ----- THis does no?

Any Ideas?
THankso_O
 
kay

yes, but I do like your indirect code more. (sounds *** kissing) 🍑

I don't use indirect adressing much as you all can see :).
 
I just used the code like he did :)
I don't really prefer one or the other.
I would say it depends on what his is triing to do. ;-)
 

Similar Topics

Hello, I have a CPU 317-2DP Firmware Version V2.1.8. In TIA Portal only V2.6 is available, and there is no option to upgrade FW. Then I open it...
Replies
2
Views
97
HI everyone, i am new to Siemens plc programming and i am in need of some help. yesterday we had an S7-1200 CPU 1214C fail to turn on an output to...
Replies
9
Views
298
Hi PLC people, think about this scenario: The PLC is somehow connected to the same network with the facilities` network. Then someone connects to...
Replies
2
Views
105
Hello everyone, I've had this issue for the last 2 days where I try to assign the profisafe address to an IO block (6ES7 146-6FF00-0AB0) but when...
Replies
5
Views
160
Hello, good morning, I have been having two problems with the Tia Portal software. The first is that I have installed it on my computer and...
Replies
5
Views
197
Back
Top Bottom