Studio 5000 add prefix to all tags

I cant use the .csv/l5k files and find/replace text as that is not quite what I want to do, the tags do not all begin with the same letter/symbol.

Don't use find and replace ;).... Use the power of Excel to CONCAT Cells :nodi:


Write formula to in A1 as take ="PLC1_"+B1 and then pasted down column A:A and then once updated all cells Copy the Column A:A and Paste back into Column A:A as Values .. Delete Column B:B
 
As i understood it, controller tags are your inputs and outputs, (please do not hate me if i do not understand the complete picture). This said, would it not be a disadvantage to have duplicate tags referencing the controller tags?
Tags, controller or otherwise, are just reserved pieces of memory. A set of controller tags are automatically generated when you add a module to the I/O tree, but user-generated tags are only inputs/outputs if you make them such by aliasing or mapping them to inputs or outputs.

No-one has said anything about duplicating actual tags. Program-scoping tags allows you to re-use tag names, but the two tags are entirely separate. Having duplicate tags is done by aliasing.
 
I have 2 identical machines that are residing in one PLC.
I created the first machine, with PLCA_ as the tag prefix for controller tags. Parameter tags have a l_ as prefix (taken from old coding days for local instead of p_parameters)
I exported the programs then imported them back in, using replace in the import dialog box to change PLCA_ to PLCB_
Works great.
HMI, I used parameters to display either - PLC#1_tag
 
I have 2 identical machines that are residing in one PLC.
I created the first machine, with PLCA_ as the tag prefix for controller tags. Parameter tags have a l_ as prefix (taken from old coding days for local instead of p_parameters)
I exported the programs then imported them back in, using replace in the import dialog box to change PLCA_ to PLCB_
Works great.
HMI, I used parameters to display either - PLC#1_tag

With program scoped you wouldn't have to worry about the prefixing... and the HMI could take in the program name as a parameter either way.
 
Fully agree.
I like to split out IO from the main task and have that as a tag IO buffer (since AB PLC's like to update anytime).
Two reasons:
1 - Different scan rates
2 - Simple ability to inhibit the entire task so you can check IO

For the above reason (might not be the best way for anyone, but its the way I have done it for years and I like my reasons) I need to have some tags as controller tags, so I created rules to ensure that controller and program tags obey.
If its a temp tag that it only used in that routine (timer, etc) then its a program tag (l_ prefix which probably should be p_
If its a tag that used somewhere else (different routine, etc) then its a controller tag

I like rules to define the way I code, so if people understand the rules, they have incite into how I program.
My rules might (probably are) be different rules to everyone else, and I'm quite sure I have a different mindset, but that why we are all different.
 
Answering what I think was the original question...If you just want to prepend something onto all tagnames, open the tag export .csv in MS Excel and use a formula like: =IF(A8="TAG","PLC1_"&C8,C8)

Explanation: If the item in the Type column (column A) is "TAG", prepend PLC1_ to the name (column C), else keep the name as is. Put the formula in an unused column and then fill down to the end of the data. Then copy the new column and paste the values into the Name column. Then delete the new column, save the .csv and import it back in to Logix.

EDIT: I think you will also have to modify the SPECIFIER column in a similar way. This should work: =IF(F8="",F8,"PLC1_"&F8).
EDIT 2: Also, you probably don't want to prepend the tag name to any AOIs, so stop filling down when you get to any tag names that end in :AOI.
You say to modify the tag names in the CSV file, will that not make all points where each tag is used within the program to become wrong? as in - they would need redefining?

What I was originally going to do was convert the file to an .L5K and find/replace, changing the points where the tag are also used in the code at the same time.
 
Using CSV export and opening file in excel it is possible to add a prefix to names using the Concatenate function
I have included an example. once you have first row then you smart fill your way down the list.

I searched on:
how can i add a prefix to excel tags that have different names?
and watched an excel video to confirm how to accomplish

hope helps
 
Using CSV export and opening file in excel it is possible to add a prefix to names using the Concatenate function
I have included an example. once you have first row then you smart fill your way down the list.

I searched on:
how can i add a prefix to excel tags that have different names?
and watched an excel video to confirm how to accomplish

hope helps
Thanks for the example! However, I did manage to do this, the issue I now have is that the tags being called throughout my program also need replacing to match the new prefix tags, currently they are still matching the old tags.
 
Thanks for the example! However, I did manage to do this, the issue I now have is that the tags being called throughout my program also need replacing to match the new prefix tags, currently they are still matching the old tags.

Export your program to an L5K file-type, then you can open that up in a word processor (like notepad or wordpad) and use search/replace (carefully!)

EDIT : remember to save your file as a backup in case you screw-up !!!
 
When I started out with Logix5000, back when I had hair and at least some level of fitness, all my code was using Controller-Scoped tags.

The very first time I had to do a job that smelled of "same - repeat - n times", I realised that Program-Scoping was the way forward.

I had to write code for a number "n" of fermenting vessels, and each would be identical in function. Before anyone interjects and shouts "Add-On Instructions" at me, this was before those were available....

I quickly realised that Program-Scoping my tags would make it a breeze to make duplicates of the one program I had written, debugged, and witness-tested to the client.

Program "FV1" - copy
Program-paste - becomes "FV11"

Program-"FV11" - rename to "FV2"
etc.



Job done, except all that was left to do was to remap the programs' inputs and outputs to physical I/O. Not that hard to do.

It then dawned on me that each "Program" was akin to a separate PLC or SLC, you can have up to 100 of them in one Logix5000, and the Controller-Scoped tags were just the communication to the outside world, or communication between programs. Imagine ! my tiny Logix5000 CPU is effectively up to 100 SLCs !! Impressive ....

I cannot see the problem with Bubba seeing tags with the same name.... On code screens the tool-tip shows their scope, and in the tag databases you know which scope you are in, so multiple instances of "Run_Hours" shouldn't be an issue. Perhaps Bubba needs a little training or re-training .... I'll leave that there.
 
Before anyone interjects and shouts "Add-On Instructions" at me, this was before those were available....

An AOI for a reaction vessel would be an idiotic decision either way, regardless of availability and ability to modify.

It then dawned on me that each "Program" was akin to a separate PLC or SLC, you can have up to 100 of them in one Logix5000, and the Controller-Scoped tags were just the communication to the outside world, or communication between programs. Imagine ! my tiny Logix5000 CPU is effectively up to 100 SLCs !! Impressive ....

I take it you don't read the manual? This is how Rockwell explains the use of programs and comms between them. :p
 
With program scoped you wouldn't have to worry about the prefixing... and the HMI could take in the program name as a parameter either way.
You mentioned about the HMI, I am using AB HMIs, do you know how I would reference program scoped tags? usually for controller scoped it would be something along the lines of {[<PLC Name>]<Tag>}
 

Similar Topics

Hello Everyone, I have about 135 controller PIDE loops that I need to add to my Studio 5000 and that means I will probably have to create about...
Replies
8
Views
1,920
Hi All, On my site, the standard template for storing recipes in the PLC is to create a tag called PartRecipe which is an 2D array - for example...
Replies
4
Views
1,476
Is it possible to add Rung Comments or Tag Descriptions when creating rungs with a text file? I think not but just checking.
Replies
5
Views
1,641
Hello, I just installed Studio 5000 V34 and when I try to create the project (with Compact logix Cpu), I get the below picture error message. I...
Replies
5
Views
2,920
Can you add a MicroLogix 1400 to the IO Tree in Studio 5000? I can't find an entry for it or anything that is 1762 for that mater. I just want to...
Replies
5
Views
2,317
Back
Top Bottom