RSLOGIX 5000 Tag Scope Change

M

Thread Starter

Mike McMillan

Is it possible to change the Scope of a Contrologix tag after it has been created without deleting and re-entering?
 
Short answer: No.
This is because it is possible to have a tag named TAG1 that is global in scope and have another tag also named TAG1 that is local in scope (the local tag takes precedence in the routine in which it was defined). You need not delete all instructions with the tag, just delete the tag from the database, re-enter it with the proper scope, and re-verify. Or you can try aliasing (I havent tried this, I dont know if you can change scope with aliasing, but its worth a try), or use a MOV instruction to copy to a global tag. Depending on what you are doing, you might also be able to use subroutine parameter passing to pass the local value in and out of the subroutine to a global tag.
 
B

Benoit Galarneau

> Is it possible to change the Scope of a Contrologix tag after it has been created without deleting and re-entering?

<<Short answer: No.
This is because it is possible to have a tag named TAG1 that is global in scope and have another tag also named TAG1 that is local in scope (the local tag takes precedence in the routine in which it was defined). You need not delete all instructions with the tag, just delete the tag from the database, re-enter it with the proper scope, and re-verify>>

I think "Anonymous" first solution is the best for you to try.
 
C

Casey Heater

I found a work around for this. The steps are as follows:

1) Export your tag base under the Tools menu.
2) Open the CSV file and replace the scope references.
3) Import the tags. You will have two sets of tags.
4) In the tag browser, select the un-needed scope.
5) Select all tags and delete.
6) You will receive a message that the tags will be replaced.

Voila!

One item of note. I did this replacing a program scope with a controller scope (leaving the scope BLANK makes it a controller scope). I have not tried the other direction.

I offer no guarantee that this won't bork your system. It did, however, save me a LOT of time. I had coded with "default" settings and didn't catch that my tags were not being generated in the Controller Scope. Grr....

As always, <b>BACKUP YOUR PROGRAM</b> before attempting this.
 
C

Casey Heater

>I found a work around for this.

---- snip ----

>I offer no guarantee that this won't bork your system. It did, however, save
> me a LOT of time. I had coded with "default" settings and didn't catch that
> my tags were not being generated in the Controller Scope. Grr....

> As always, <b>BACKUP YOUR PROGRAM</b> before attempting this.

<EDIT> One item of note. The resultant tags will not keep the prior values.
 
Top