tia portal Siemens rewire db address

dahnuguy

Member
Join Date
Mar 2007
Location
SC
Posts
720
I think the answer is just no, but....

I have a program that I need to make a couple hundred changes to.
The data is in DBs.
I need to either rewire DB200.DBB5 to DB300.DBB12 for example. Globally in all FC and FB and OBs

Allen Bradley has "find and replace" and a selection for "current subroutine" or "all".

The select tag right click menu, "rewire function" is grayed out for DB addresses in TIA. I seem to recall rewire is not possible for DB addresses in Step 7 5.5.

A global find and replace would also work.

Right now I going through the cross reference for DB200 and going down one variable a time. I have over 600 variables in one part of the program to do and I don't see any quick way to do it. And there is another part that will be about the same as this one.

Days of copy paste find next.
 
Generally, I would recommend symbolic programming (DBName.TagName, instead of DB#.DB#address). However, I don't think that helps you here one way or the other. Based on this question and the other thread, I'm assuming you're programming an S7-300 (possibly WinAC RTX)?

There is a global find, but no global replace. There IS a per block find & replace, but that gets tedious when you need to do it in many blocks.

I'm curious why you need to do the rewire. What's wrong with the current place the value is stored? Not trying to be antagonistic, just trying to understand.
 
The rewire function in TIA Portal may be deactivated for non-optimised blocks...

I am just confused as to why you need to do this...

If your code is in STL (I know it's a stretch), Step7 would allow you to export to text and then import back, which would make things a whole lot easier for replacing. I did this in the past for IO buffering in the past, for example.
 
As with mk42, go back to original post, why are you having to make your couple of hundred changes?
 
Not sure if there is a selection for absolute or symbolic address priority in TIA when you program an S7-300. In STEP7 v5 there is such a selection and it makes a big difference.
I dont use TIA for S7-300, so I dont know if you can chose symbolic address priority, but if that is possible you can do like this:


Go back to a backup of your program from before you made the change to DB200.
Save under a new name.
Make sure that symbolic address priority is selected.
Compile all software.
If you have to change names of symbols in DB200, then do that, and then compile all.
If you have to add or remove symbols in DB200, then do that, and then compile all.
Dont do both at the same time (changing names and adding or removing symbols).
Do some random checks if the changes are implemented correctly.
Save.
Done.
 
Generally, I would recommend symbolic programming (DBName.TagName, instead of DB#.DB#address). However, I don't think that helps you here one way or the other. Based on this question and the other thread, I'm assuming you're programming an S7-300 (possibly WinAC RTX)?

There is a global find, but no global replace. There IS a per block find & replace, but that gets tedious when you need to do it in many blocks.

I'm curious why you need to do the rewire. What's wrong with the current place the value is stored? Not trying to be antagonistic, just trying to understand.

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

Yes everyone uses symbolic. Except when it is not best to use symbolic.

Also, I am not going to click through a maze of symbols that are always reordered the wrong way nor am I going to type 40 characters when I just want the next word in the DB.
Switch to absolute and change the 4 to 6 and hit enter, done.


Ok here ya go.

Machine A exists and has 2 robots.
Machine will be updated with new robot software and interface.
Interface A is nothing like Interface B.

Machine has around 700 to 1000 pieces of code that reference ease robot in various different FBs and FCs.

The tags are not the same or similar and the byte locations in each interface are not similar in any way.

I would LOVE to just do :

Find DB2000.DBW44 and
Replace with DB4000.DBW102
Replace all
next
and even that would be tedious and time consuming.

And if you want to use tags and symbolic you can and it doesn't change the issue at all. Except using symbols in find and replace might replace something you don't want replaced.

Every system in the machine interfaces the robots , currently I am doing a cross reference on the old DB robot interface and then going down the list one at a time and reading through the code to find what the old bit references and then changing it to a bit in the new interface with a similar function.

With no where near enough time to do it all one at a time by hand.

Now you tell me why you think symbolic addressing is better in this case?
The ONLY real advantage to symbolic addressing is being able to shuffle bytes around and not break associations inside the code.

I use both, each when it works best, not one or the other.
 
The rewire function in TIA Portal may be deactivated for non-optimised blocks...

I am just confused as to why you need to do this...

If your code is in STL (I know it's a stretch), Step7 would allow you to export to text and then import back, which would make things a whole lot easier for replacing. I did this in the past for IO buffering in the past, for example.

Ah there we go, I forgot about export find and replace import.

It is not my code
It is in graph, STL and LAD, was originally written by a German and is also recently translated from Italian into English by an American who doesn't speak Italian.

I am confused why so many people are confused and why the programming software finds it so outlandish to want to change A to B globally.
 
As with mk42, go back to original post, why are you having to make your couple of hundred changes?

Machine A exists and has 2 robots.
Machine will be updated with new robot software and interface.
Interface A is nothing like Interface B.

Machine has around 700 to 1000 pieces of code that reference each robot in various different FBs and FCs.

The tags are not the same or similar and the byte locations in each interface are not similar in any way.

I would LOVE to just do :

Find DB2000.DBW44 and
Replace with DB4000.DBW102
Replace all
next
and even that would be tedious and time consuming.

And if you want to use tags and symbolic you can and it doesn't change the issue.

Every system in the machine interfaces the robots , currently I am doing a cross reference on the old DB robot interface and then going down the list one at a time and reading through the code to find what the old bit references and then changing it to a bit in the new interface with a similar function.

With no where near enough time to do it all one at a time by hand.
 
Not sure if there is a selection for absolute or symbolic address priority in TIA when you program an S7-300. In STEP7 v5 there is such a selection and it makes a big difference.
I dont use TIA for S7-300, so I dont know if you can chose symbolic address priority, but if that is possible you can do like this:


Go back to a backup of your program from before you made the change to DB200.
Save under a new name.
Make sure that symbolic address priority is selected.
Compile all software.
If you have to change names of symbols in DB200, then do that, and then compile all.
If you have to add or remove symbols in DB200, then do that, and then compile all.
Dont do both at the same time (changing names and adding or removing symbols).
Do some random checks if the changes are implemented correctly.
Save.
Done.

I have done this in S7 5.5 with success, but it doesn't look like it would work in TIA. (Still new to TIA, so not sure. So far it seems TIA is AMAZING one minute and then just remarkably dysfunctional the next)

Might look into this method some more but I haven't found the setting to change symbol priority in TIA like there is in S7 5.5.

Not all the elements in A are represented in B but this might work for some of the common bits.

At least it is only 2 robots per machine and at least the part I am doing is modular and will be easily used on the next one.
 
Thanks to everyone, I truly appreciate all your help, if I find anything that works, I will post it.
 
Shooting crazy ideas:


For your example of replacing DB2000.DBW44 with DB4000.DBW102, leave the code as is and add at the start/end depending on the access:


//Start

L DB4000.DBW102
T DB2000.DBW44






//end
L DB2000.DBW44
T DB4000.DBW102


Another question, are all the entries in DB2000 being removed and replaced so the DB could be deleted, or are only a selection being removed? - thinking here is that you could delete DB2000 and then when the error OB runs you could examine the DB/address and use substitute addresses instead, a programmatic re-wire.
 
Last edited:
Shooting crazy ideas:


For your example of replacing DB2000.DBW44 with DB4000.DBW102, leave the code as is and add at the start/end depending on the access:


//Start

L DB4000.DBW102
T DB2000.DBW44






//end
L DB2000.DBW44
T DB4000.DBW102


Another question, are all the entries in DB2000 being removed and replaced so the DB could be deleted, or are only a selection being removed? - thinking here is that you could delete DB2000 and then when the error OB runs you could examine the DB/address and use substitute addresses instead, a programmatic re-wire.

The load A transfer to B is a bit of a patch but I did consider it, sort of like making an input buffer from hardware to marker bits.

While it would work, I think it is a bit patchy. I want it to seem as though it was designed this way from the start and not add another layer of abstraction.

And not every function or bit in B is represented in A. And not all the functions currently being done by A will continue in B.

It looks like TIA is defaulted to prioritize symbolic addressing even if the DB is not "optimized". So I am going to go through DB(original) and just rename all the common functions to the new symbol names. That will effectively "re-wire" those in the code. Then change the DB block number in the old block to match the new block, then delete the old block and import the new block.

Then all I have to do is go through the faulted code that wont compile and find something to fix it or eliminate the code if it is not used in the new interface.

The new interface doesn't just replace the old one, the new interface changes how the proceeds works and uses different methods. SO it isn't just a matter of moving old bit A to new bit B.


I think that's the best I can hope for.

I have one more day on the "scheduled programming time" to do about 4 days work.

This is one place where Allen Bradley KILLS Step7.

But if the original person had written the code differently, it would be less of a hassle.

Find / replace global of anything should be in every PLC software. It is all just text at some point.


Thanks again for all the help guys.
 
I really don't understand how going through find/replace beats simple changing the symbols address and hitting compile?
Seriously, I usually have small projects (logix500 or CCW) with AB so I just go with manual change, but is there a simple way to just rewire an input? Or is the find/replace how it is suposed to be done?
Because I am used to just changing declarations and not worrying about the code.
 
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.

dahnuguy said:
Yeah that sound nice, but tell what is "robot 4 enable" plus 5?
Math based offsets don't work with tags.
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 ?

dahnuguy said:
Also, I am not going to click through a maze of symbols that are always reordered the wrong way nor am I going to type 40 characters when I just want the next word in the DB.
Switch to absolute and change the 4 to 6 and hit enter, done.
As long as your DB blocks are non-optimised, and compiled, then change to absolute address display and do just that. See picture below.

TIA_absloute_addressing.png
 
Last edited:

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
881
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
968
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,411
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