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.

New Here? Please read this important info!!!


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

Reply
 
Thread Tools Display Modes
Old November 23rd, 2021, 12:53 PM   #1
Colt Hero
Member
United States

Colt Hero is offline
 
Join Date: Apr 2015
Location: USA - Southeast
Posts: 87
ControlLogix: Dynamically Change Tag Names?

Is it possible to dynamically change Tag Names (in real-time) on these PLCs? I'm guessing the answer is "NO", right? Just externally, then re-save, correct?

I've got multiple applications that are all pretty similar that are currently separate apps. They all differ here and there, but not substantially. I'd like to make them ONE application, fully configurable at start-up, but the "gotcha" is - the Tags to the Historian have to be unique. The Historians are running on separate Servers, but in one case, two of these apps write to the same Historian, so that eliminates the possibility of using (somewhat) "generic" tagnames.

So the workaround would be to have a routine that just reads and writes from/to the respective data sets based on the System selected at Startup, but it would be much cleaner if the tag names themselves could be modified at Start-Up after the System Selection is made.

Someone's probably gonna chime in and say, "You want a self-modifying program". Yeah - but only because these PLCs are so "name" driven, instead of memory-location driven. Or ... maybe it's because of the way their data exchange works (OPC). If this was a "conventionally-designed" system, it would just be data buffers with implied data positions. You could name the cells of the buffer anything you wanted in your local program.

Could the data be sent another way ... say ... in a block? The Historian is "PI", BTW.
__________________
!! WARNING !! I am not a PLC programmer ... just learning as I go ...

Last edited by Colt Hero; November 23rd, 2021 at 01:01 PM.
  Reply With Quote
Old November 23rd, 2021, 01:03 PM   #2
plvlce
Lifetime Supporting Member
United States

plvlce is offline
 
Join Date: May 2017
Location: Michigan
Posts: 360
Quote:
Originally Posted by Colt Hero View Post
Is it possible to dynamically change Tag Names (in real-time) on these PLCs?
Yes, with a couple caveats.

iirc you cannot change a tag that is (currently) being accessed externally.

You cannot edit AOIs online; this includes their tag names.

EDIT: Unless I initially misread your question and by 'dynamically change' you mean have the program itself modify the name, in which case afaik it is not possible.

Last edited by plvlce; November 23rd, 2021 at 01:08 PM.
  Reply With Quote
Old November 23rd, 2021, 01:07 PM   #3
harryting
Lifetime Supporting Member
United States

harryting is offline
 
harryting's Avatar
 
Join Date: May 2002
Location: Puget Sound
Posts: 2,417
Ok, I'm familiar with PI. I'm guessing you are using OPC DA Interface?

I'm not getting why you need to modify tag name since your OPC topic will be different.

Let's say you have PLC1 and PLC2, both 99% identical. Your PI "Instrument Tag" for the a temp probe TT101 that's coming from the same OPC server will be something like...

ServerA.ChannelA.PLC1.TT101

and

ServerA.ChannelB.PLC2.TT101

there's no worry about mistaken the two not to mention you can further define the tag with Asset Framework.
  Reply With Quote
Old November 24th, 2021, 08:27 AM   #4
mad4x4
Member
United Kingdom

mad4x4 is offline
 
mad4x4's Avatar
 
Join Date: Mar 2009
Location: ST CYrus
Posts: 166
One thing I found was that you could not dynamically address arrays so have an array UDT
called SMC[0..12] and another variable called SMC_Addr and ref as SMC[SMC_Addr] in the code.

But you could not do the same with Alias they seem to be fixed at download. Like a #define Carrot 12 in C++
  Reply With Quote
Old November 24th, 2021, 03:03 PM   #5
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 281
What I've done in "identical programs that have different tag names" is to make all the controller-scoped tags called "PLC_A_Thing1", "PLC_A_Thing2", etc. in PLC_A, and "PLC_B..." tags in PLC_B. This handles the historian uniqueness.

But I also have program-scoped tags called "Thing1", "Thing2", etc., as aliases to the controller scoped tags. Then when coding, ALWAYS use the local alias, not the controller tag. This way, if I make a change to a routine in PLC_A, I can blow away the routine in PLC_B and copy the entire routine into it, sight unseen, even online. The alias tags in the logic simply resolve to the different tag names. If they don't, it's probably because the base tag was part of the change.

Where there are differences in the code, these go into their own routine, so are never copied, at least not blindly.

I can even do spot checks on sameness. Copy the PLC_B program offline, search/replace the controller tags to make them PLC_A's, then us the compare tool to show the differences. The only place it should find are the places that are intentionally different and have their own routines.
  Reply With Quote
Old November 24th, 2021, 11:33 PM   #6
Colt Hero
Member
United States

Colt Hero is offline
 
Join Date: Apr 2015
Location: USA - Southeast
Posts: 87
Quote:
Originally Posted by harryting View Post
Ok, I'm familiar with PI. I'm guessing you are using OPC DA Interface?

I'm not getting why you need to modify tag name since your OPC topic will be different.

Let's say you have PLC1 and PLC2, both 99% identical. Your PI "Instrument Tag" for the a temp probe TT101 that's coming from the same OPC server will be something like...

ServerA.ChannelA.PLC1.TT101

and

ServerA.ChannelB.PLC2.TT101

there's no worry about mistaken the two not to mention you can further define the tag with Asset Framework.
Oh ... Wait! You made me realize: I can make all of this a single program with one set of generic tagnames and load it to every application because the PI Historian can do the name translation for me! The PI Tag will have the unique name (with the identifying Equipment Tag), but the "Instrument Tag" field will hold the generic Tag Name in the PLC, differentiated by the PLC Topic Name (which specifies the unique PLC application).

Problem solved, right?

So to make every one of these very similar programs instead use a singular (the same) application, I don't use the actual Instrument and Device tagnames as my Tagnames in the application (as is currently done ... making the programs different from one another). I give generic names in the program, and then create the unique tags only in PI, translating each one via the "InstrumentTag" field, which specifies the Topic Name (which is the unique PLC).

I guess the one last question is: What if the Historian were to change from PI to some other product? I believe Rockwell uses PI as their Historian, correct (??) ... but what about other platforms like Emerson and Siemens? Do they have their own embedded Historians, and if so - can they do this kind of tag-mapping like PI does, or do the Tagnames have to be unique (and specific) in the PLC program?
__________________
!! WARNING !! I am not a PLC programmer ... just learning as I go ...

Last edited by Colt Hero; November 24th, 2021 at 11:37 PM.
  Reply With Quote
Old November 24th, 2021, 11:42 PM   #7
Colt Hero
Member
United States

Colt Hero is offline
 
Join Date: Apr 2015
Location: USA - Southeast
Posts: 87
Quote:
Originally Posted by plvlce View Post
EDIT: Unless I initially misread your question and by 'dynamically change' you mean have the program itself modify the name, in which case afaik it is not possible.
Yes - I was talking about the program modifying the tagname ... but it turns out it's not necessary because the PI Historian can do it for me (see my Reply #6)
__________________
!! WARNING !! I am not a PLC programmer ... just learning as I go ...
  Reply With Quote
Old November 24th, 2021, 11:49 PM   #8
Colt Hero
Member
United States

Colt Hero is offline
 
Join Date: Apr 2015
Location: USA - Southeast
Posts: 87
Quote:
Originally Posted by mad4x4 View Post
One thing I found was that you could not dynamically address arrays so have an array UDT
called SMC[0..12] and another variable called SMC_Addr and ref as SMC[SMC_Addr] in the code.

But you could not do the same with Alias they seem to be fixed at download. Like a #define Carrot 12 in C++
Did you mis-type that? I think what you were saying is you CAN index an array with an integer variable tag, but NOT with an Alias ... correct?

So accessing array "SMC[SMC_Addr]" works as long as SMC_Addr is an Integer and NOT an Alias, right? Or would it still work as long as it's an Alias to an Integer tag?
__________________
!! WARNING !! I am not a PLC programmer ... just learning as I go ...
  Reply With Quote
Old November 24th, 2021, 11:57 PM   #9
Colt Hero
Member
United States

Colt Hero is offline
 
Join Date: Apr 2015
Location: USA - Southeast
Posts: 87
Quote:
Originally Posted by Aardwizz View Post
What I've done in "identical programs that have different tag names" is to make all the controller-scoped tags called "PLC_A_Thing1", "PLC_A_Thing2", etc. in PLC_A, and "PLC_B..." tags in PLC_B. This handles the historian uniqueness.

But I also have program-scoped tags called "Thing1", "Thing2", etc., as aliases to the controller scoped tags. Then when coding, ALWAYS use the local alias, not the controller tag. This way, if I make a change to a routine in PLC_A, I can blow away the routine in PLC_B and copy the entire routine into it, sight unseen, even online. The alias tags in the logic simply resolve to the different tag names. If they don't, it's probably because the base tag was part of the change.

Where there are differences in the code, these go into their own routine, so are never copied, at least not blindly.

I can even do spot checks on sameness. Copy the PLC_B program offline, search/replace the controller tags to make them PLC_A's, then us the compare tool to show the differences. The only place it should find are the places that are intentionally different and have their own routines.
I get what you're describing here, but that's not quite what I was looking to do. See my Reply #6 above.

I have 7 Packaging Systems that may, or may not, use a few different optional equipments. Each program is currently written uniquely with the specifically-named tags in them. And some are coded for the optional equipments, and some aren't. But then, Operations have moved some of these optional equipments around from Packaging System to Packaging System, so these programs were subsequently modified (over time) to control these options. So now, the programs are similar, but not the same, and they each have the unique tagnames. And there are other issues, too, which cause aggravating "on-call" calls that I'd like to eliminate. It would just be better to have ONE application, generically-written, that is loaded to ALL OF THEM. Then, the Operators can choose what options are actually installed and run with it ... and Automation will have ONE application to maintain for all of them!
__________________
!! WARNING !! I am not a PLC programmer ... just learning as I go ...
  Reply With Quote
Old November 26th, 2021, 03:11 PM   #10
harryting
Lifetime Supporting Member
United States

harryting is offline
 
harryting's Avatar
 
Join Date: May 2002
Location: Puget Sound
Posts: 2,417
If you change to a different historian, your OPC tag will still be different even though your PLC programs are all identical.
  Reply With Quote
Old November 26th, 2021, 07:26 PM   #11
Saffa
Member
New Zealand

Saffa is offline
 
Join Date: Feb 2012
Location: Bay of Plenty
Posts: 1,280
Like Harryting, I'm not quite sure why there would be an issue with just having the identical program in each PLC. The OPC server will have different topics for each PLC. So the tags in the historian can be easily identified as MachineA.tag, MachineB.tag etc.

If you need some way to know if tag data is valid, have "Option Enabled" tags for each option, then in your reporting just cross reference that. May even be able to enable or disable data capture based on that tag value, I'm not sure if Pi supports that or not it's been 6 years since i last looked at anything Pi.
  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
Logix/Studio 5000 - Change pop-up tag editor default data type BAJ LIVE PLC Questions And Answers 14 June 17th, 2020 06:39 PM
ControlLogix Download without changing tag values or upload only tag values. CapinWinky LIVE PLC Questions And Answers 4 September 16th, 2019 12:53 PM
FactoryTalk View Studio- Change ALL of the tag names for new PLC? MomentaryPushButton LIVE PLC Questions And Answers 10 September 5th, 2019 07:25 PM
ControlLogix Tag Updating Question jkerekes LIVE PLC Questions And Answers 7 February 17th, 2015 02:21 AM
Show Tag names at runtime in FactoryTalk View ME xzen LIVE PLC Questions And Answers 5 September 5th, 2013 05:34 AM


All times are GMT -4. The time now is 08:15 PM.


.