tia portal Siemens rewire db address

Yeah that sound nice, but tell what is "robot 4 enable" plus 5?
Math based offsets don't work with tags.

They do... but the tags must be arrays.

The problem is the paradigm shift from Siemens and the fact that so much still depends on absolute addressing to work that they can't just make it disappear.

I agree that it is dysfunctional at times, but I think it's a "temporary" thing as far as temporary is in automation.

If you want to complain, complain about the byte order being swapped when copying between optimised and non-optimised DBs.
 
Last edited:
You can use The OpennessScripter (free download from siemens website) to export your blocks as xml, edit the xml and then import the blocks. I tested this with a simple ladder block and changed an address and it does work.


Script as follows:

script.jpg
 
As I see it, you want to change the addressing drastically in an existing program.
For example DB200.DBB5 to DB300.DBB12, so both the DB and the addresses within the DB.
Should be doable without much effort.

As for the addresses within the DB, then I am certain that you can do as described earlier. TIA seems to use symbolic priority also for S7-300. I cannot find anywhere to select absolute address priority.

As for the DB addresses, then you can keep the symbolic name, and only change the DB no. Open the properties of the DB select manual DB numbering, and change the 200 to 300. The change takes effect instantly (edit: in STEP7 Classic, the change would not take effect in any open windows. You had to close all windows and do a consistency check,. In TIA it seems that the changes are updated instantly also in already open Windows). You have to compile again of course.

If you want to change the addressing only partly (leaving some places in the program unaffected), then it gets complicated.



You can do a lot with arrays. You can make arrays of multi-instance blocks.
Are you talking about editing the program the easiest way, or do you mean to dynamically address objects at runtime ?

As long as your DB blocks are non-optimised, and compiled, then change to absolute address display and do just that. See picture below.



Thanks Jesper this is what I am doing. The thing that makes it complex is that I have to go to each rung and evaluate the existing code to see if it needs to be changed and edit each place in addition to the symbol change.

Yes I was referring to changing the address dynamically at runtime using a numerical offset. I use a pointer to reference the location of the first tag then pull the DBB number out of the pointer then offset that address by X and load the next data. Since the source is symbolic, this allows me to use numerical offsets. But you can't just add 5 offset to "pump motor run" without deconstructing a pointer to it and then building a new pointer. (As far as I know)

I wrote a block to numerically select an element in an array in Step7. I could then have a DB with an array of UDT and select the 4th set of data for instance. Nice for using one HMI screen to display multiple machine sections with one screen. "Next" or "previous" increments the index of the array.

... MyArray.[variable]

I have heard TIA does the variable offset select in an array natively like RS5000 does. But I haven't tried it yet.

Thanks again for all your help.
 
They do... but the tags must be arrays.

The problem is the paradigm shift from Siemens and the fact that so much still depends on absolute addressing to work that they can't just make it disappear.

I agree that it is dysfunctional at times, but I think it's a "temporary" thing as far as temporary is in automation.

If you want to complain, complain about the byte order being swapped when copying between optimised and non-optimised DBs.

"byte order being swapped when copying between optimised and non-optimised DBs"????????????

Oh jeez, I haven't even gotten to that yet.

I am not using optimized blocks. No benefit for me and only limitations.

Robots and other equipment want all the bytes in a specific order and for those to stay there and I am not aware of all the interactions and limitations of optimized DBs, so just not going to use them.

I have read that TIA can do a numerical index of an array using a variable, but haven't tried it yet.
 
That seems complex, can't we just export from the project directly to text and use a text editor?

I am not at my machine with TIA, I will check tomorrow.

Thanks for the script and suggestion, this would be nice.
 
Here's a snippet from the xml file:

That seems complex, can't we just export from the project directly to text and use a text editor?

I am not at my machine with TIA, I will check tomorrow.

Thanks for the script and suggestion, this would be nice.
 
I have heard TIA does the variable offset select in an array natively like RS5000 does. But I haven't tried it yet.

Note that newer features like indirectly addressing arrays in LAD are only for the newer CPU's like the 1200 & 1500. If you're using the older 300/400 CPUs (including WinAC RTX), then most of the new features in Portal get thrown out the window. Array handling is still easy in SCL, though.

LAD isn't really built for Pointer based programming. If you want to do that, then STL is usually your best bet. You can load a pointer to the beginning of the UDT, and then just reference fixed offsets from there.
 
That seems complex, can't we just export from the project directly to text and use a text editor?

I am not at my machine with TIA, I will check tomorrow.

Thanks for the script and suggestion, this would be nice.

It is stupidly complex. I think the thought process in Germany was "I thought of a really powerful way to do just about anything possible (Openness). Why would anyone else want another option?". Despite the fact that most of NA already uses a tool with an export options that fall somewhere in the middle.

However, there IS another way. Sometimes.

Portal only lets you export text based blocks (SCL or STL) to source file. In the older CPUs (300/400/etc), you have the ability to change LAD into STL and back. You can highlight ALL your blocks, change to STL (via right click menu), and then Generate Source (also via right click menu). That creates a source file you can mess with in a text editor. Then you l

If you can, the easiest way to generate one big source file would be to generate source of OB1 "including all dependent blocks", assuming your code is all called out of OB1. The including dependents option is relatively new in Portal, not sure what version that appears.

If you're using a 1200/1500, then you can't cange your LAD into text based programming, and you're pretty much SOL.
 
It is stupidly complex. I think the thought process in Germany was "I thought of a really powerful way to do just about anything possible (Openness). Why would anyone else want another option?". Despite the fact that most of NA already uses a tool with an export options that fall somewhere in the middle.

However, there IS another way. Sometimes.

Portal only lets you export text based blocks (SCL or STL) to source file. In the older CPUs (300/400/etc), you have the ability to change LAD into STL and back. You can highlight ALL your blocks, change to STL (via right click menu), and then Generate Source (also via right click menu). That creates a source file you can mess with in a text editor. Then you l

If you can, the easiest way to generate one big source file would be to generate source of OB1 "including all dependent blocks", assuming your code is all called out of OB1. The including dependents option is relatively new in Portal, not sure what version that appears.

If you're using a 1200/1500, then you can't cange your LAD into text based programming, and you're pretty much SOL.

I thought generate source would output a text file of any code block.

Pretty sure I did this in the past with all FC and FBs.
 
Note that newer features like indirectly addressing arrays in LAD are only for the newer CPU's like the 1200 & 1500. If you're using the older 300/400 CPUs (including WinAC RTX), then most of the new features in Portal get thrown out the window. Array handling is still easy in SCL, though.

LAD isn't really built for Pointer based programming. If you want to do that, then STL is usually your best bet. You can load a pointer to the beginning of the UDT, and then just reference fixed offsets from there.

The customer package doesn't have SCL. (and if the end user doesn't have SCL the STL code that results is impossible to read, even if you know what it does.

I have used pointers in LAD and it works just fine. Even with ANY pointers and passing parameters to BLKMOV,all in LAD. Mainly because someone said you can't do it and I am stubborn.

I am using STL for most of the heavy lifting and then LAD outside of functions to tie simple things together. I don't think the customer can read STL.
They have no Siemens experience and a plant full of SCADA and TIA Portal.
 
"byte order being swapped when copying between optimised and non-optimised DBs"????????????
I was reviewing some alarms and at first had issues with a converter to talk between PLC5 and the Siemens CPU... then realised that some alarms were still swapped. Reviewed and tested that again and started digging in the code and lo and behold, it was the copy between optimised and non-optimised DBs.

In the older CPUs (300/400/etc), you have the ability to change LAD into STL and back. You can highlight ALL your blocks, change to STL (via right click menu), and then Generate Source (also via right click menu). That creates a source file you can mess with in a text editor.

You can mess with them, but the code isn't necessarily understandable (unless one truly, truly knows STL) and any minor thing you may forget will void that bit of the block. So while the function was there, it's not like it was fantastically straightforward either.

The customer package doesn't have SCL. (and if the end user doesn't have SCL the STL code that results is impossible to read, even if you know what it does.

This is strange... is the customer running Step7? If I remember correctly, SCL comes by default in TIA Portal whilst that was not the case in Step7.
 
I thought generate source would output a text file of any code block.

Pretty sure I did this in the past with all FC and FBs.

Well, if it does, then that would be the easy way to go. It might have in Simatic Manager, but I don't think it does in TIA Portal.

The customer package doesn't have SCL. (and if the end user doesn't have SCL the STL code that results is impossible to read, even if you know what it does.

I have used pointers in LAD and it works just fine. Even with ANY pointers and passing parameters to BLKMOV,all in LAD. Mainly because someone said you can't do it and I am stubborn.

I am using STL for most of the heavy lifting and then LAD outside of functions to tie simple things together. I don't think the customer can read STL.
They have no Siemens experience and a plant full of SCADA and TIA Portal.

Yeah, not saying pointers are impossible in LAD, just saying STL has more ways to take advantages of them.

If your customer has TIA Portal, then they definitely have SCL. Unless they have a super old version (V11?), maybe, in which case all bets are off for everything.

If your customer is using Simatic Manager, where SCL is optional, then mixing TIA portal and Simatic Manager is a big nono. If nothing else, the project archives aren't compatible, and the upload is a nightmare.
 
That seems complex, can't we just export from the project directly to text and use a text editor?

I am not at my machine with TIA, I will check tomorrow.

Thanks for the script and suggestion, this would be nice.


The xml is text, I opened it with the default editor for xml, you can open in notepad if you want.
 

Similar Topics

Hi everyone I've created an FC that includes the blocks TCON, TDISCON, TSEND and TRCV. This block has to be as generic as possible across...
Replies
15
Views
1,410
Hello, i can find the CPU when searching for it. But when I go Online i just get the icon for "Not compatible" everywhere. I get no additional...
Replies
4
Views
877
Hi, I want to initialise some tags on first scan only. As they are related to wall-clock time, I want to do the initialisation when the PLC first...
Replies
4
Views
967
good , how do i calculate the instantaneous flow according to the flow totalizer in the tia portal ? 1 pulse = 1m3/h
Replies
18
Views
1,405
Good, Code Totalizer: IF ( Hour = 23) and ( Minute = 59) and ( Second = 59) THEN totalizerDay_previous : = totalizerDay; totalizerDay= 0; End_IF...
Replies
8
Views
1,515
Back
Top Bottom