You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 19th, 2018, 06:54 PM   #1
dahnuguy
Member
United States

dahnuguy is offline
 
Join Date: Mar 2007
Location: SC
Posts: 616
tia portal Siemens rewire db address

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.
  Reply With Quote
Old September 19th, 2018, 10:17 PM   #2
mk42
Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 1,965
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.
  Reply With Quote
Old September 20th, 2018, 03:05 AM   #3
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,119
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.
  Reply With Quote
Old September 20th, 2018, 03:55 AM   #4
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,583
As with mk42, go back to original post, why are you having to make your couple of hundred changes?
  Reply With Quote
Old September 20th, 2018, 04:04 AM   #5
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: Copenhagen.
Posts: 13,445
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.
__________________
Jesper
3 strikes and you're out
  Reply With Quote
Old September 20th, 2018, 06:12 PM   #6
dahnuguy
Member
United States

dahnuguy is offline
 
Join Date: Mar 2007
Location: SC
Posts: 616
Quote:
Originally Posted by mk42 View Post
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.
  Reply With Quote
Old September 20th, 2018, 06:15 PM   #7
dahnuguy
Member
United States

dahnuguy is offline
 
Join Date: Mar 2007
Location: SC
Posts: 616
Quote:
Originally Posted by cardosocea View Post
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.
  Reply With Quote
Old September 20th, 2018, 06:17 PM   #8
dahnuguy
Member
United States

dahnuguy is offline
 
Join Date: Mar 2007
Location: SC
Posts: 616
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
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.
  Reply With Quote
Old September 20th, 2018, 06:23 PM   #9
dahnuguy
Member
United States

dahnuguy is offline
 
Join Date: Mar 2007
Location: SC
Posts: 616
Quote:
Originally Posted by JesperMP View Post
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.
  Reply With Quote
Old September 20th, 2018, 06:26 PM   #10
dahnuguy
Member
United States

dahnuguy is offline
 
Join Date: Mar 2007
Location: SC
Posts: 616
Thanks to everyone, I truly appreciate all your help, if I find anything that works, I will post it.
  Reply With Quote
Old September 20th, 2018, 07:04 PM   #11
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,583
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 by L D[AR2,P#0.0]; September 20th, 2018 at 07:08 PM.
  Reply With Quote
Old September 20th, 2018, 10:30 PM   #12
dahnuguy
Member
United States

dahnuguy is offline
 
Join Date: Mar 2007
Location: SC
Posts: 616
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
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.
  Reply With Quote
Old September 21st, 2018, 01:07 AM   #13
m_turk
Member
Croatia

m_turk is offline
 
Join Date: Jan 2008
Location: ZG
Posts: 176
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.
  Reply With Quote
Old September 21st, 2018, 01:24 AM   #14
chud
Member
South Africa

chud is offline
 
chud's Avatar
 
Join Date: Oct 2007
Location: KALAHARI
Posts: 891
Found this on Siemens forum. Mentions a few things people already suggested.
Attached Images
File Type: jpg tia.JPG (71.4 KB, 65 views)
  Reply With Quote
Old September 21st, 2018, 04:56 AM   #15
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: Copenhagen.
Posts: 13,445
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.

Quote:
Originally Posted by dahnuguy
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 ?

Quote:
Originally Posted by dahnuguy
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.
Attached Images
File Type: png TIA_absloute_addressing.png (13.0 KB, 55 views)
__________________
Jesper
3 strikes and you're out

Last edited by JesperMP; September 21st, 2018 at 04:59 AM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Siemens TIA Portal V13 Help Nan LIVE PLC Questions And Answers 7 May 18th, 2017 01:40 PM
S7 300 with Profibus communication jayasiri LIVE PLC Questions And Answers 26 August 27th, 2015 06:00 AM
ModBus TCP connection between Siemens CP443-1 and VBA Excel => Using TIA Portal YELO GSD LIVE PLC Questions And Answers 9 June 5th, 2015 01:46 PM
Siemens TIA portal V12 - Complete Manuals - alanyap LIVE PLC Questions And Answers 5 August 6th, 2014 01:32 AM
Siemens TIA portal V12 - HMI Alarms - alanyap LIVE PLC Questions And Answers 0 July 31st, 2014 05:12 AM


All times are GMT -5. The time now is 09:17 PM.


.