Controller/program scope RsLogix 5000

Adam303

Lifetime Supporting Member
Join Date
Aug 2009
Location
Chicago
Posts
587
Hi guys, as I'm new to the Logix 5000 world I have a question about controller and program scoped tags. I understand that a scope of a tag must be declared when a tag is created. I understand that a scope defines where a tag can be accessed, but how do I know if I want the Tag to be controller or program scoped?
For example if I wanted to used the same tag in another program than the tag would be controller scoped? and if I want to use a tag in a routine would the tag be program scoped?

Thanks
 
Last edited:
How you know a tag is controller or program scoped? Easiest way when you get cursor on tag you'll see an info bar. Or you can list all tags by scope.
You can use controller scoped tags in all routines under all programs. But if you created a program tag, you can use it only routines under the same program.

tag_info.jpg
 
One time to use program scoped tags would be if you are going to develop a program and then want to duplicate that program in the same processor.

Since program tags are tied to a specific program you will have a separate set of program tags for each program.
This means that the tags in program 1 can be identical to the tags in program 2. (makes duplicating programs very quick)

If you tried to duplicate a program with your tags in the controller scope your program will not work because two separate programs would be accessing the same tags.
 
I sometimes make the analogy that a Logix5000 "Program" is in many respects similar to a "PLC", (eg. PLC5 or SLC), since each program has its own set of routines, and it's own data-storage area (Program-Scoped Tags).

And since a ControlLogix processor can have 100 Programs in the Continuous Task, you could, in effect combine the controlling functions of up to 100 separate PLC's into one ControlLogix processor.

You can reference the I/O data for each program using Alias tags, aliased to the Module-Defined tags in the Controller-Scope
 
If you will write small projects. If you will not be creating 1 program then duplicating it many times within the project, then go ahead and make them all Controller scoped.

Doug2 in his first paragraph mentioned the only reason I have seen so far to insist on program scoped tags, and then only for the specific tags used by that program.

In general, when a tag is mentioned within a program, the compiler looks first to local program tags to see if its there then to Controller tags.
 
If you will write small projects. If you will not be creating 1 program then duplicating it many times within the project, then go ahead and make them all Controller scoped.
I would advocate the opposite, use Program-Scoped tags unless they have to be Controller-Scoped.


Doug2 in his first paragraph mentioned the only reason I have seen so far to insist on program scoped tags, and then only for the specific tags used by that program.
Another reason is that you can re-use the program code in another project more easily if the program has its own tags. It is quite likely that different projects will have a substantial amount of "glue-logic" that will be common, and the projects will only differ in the function or process.


In general, when a tag is mentioned within a program, the compiler looks first to local program tags to see if its there then to Controller tags.
Presumably, then, access time would be faster if the controller looks in the Program Tags first ?
 
I think I'm back to square one with this. Please can you guys explain this in the easiest way you can to me.
Thanks
 
This is how I see this, please correct me if I’m wrong.
A program scoped tag can be accessed by all routines within a single program.
A controller scoped tag can be accessed by all the programs and it’s routines.
 
A program scoped tag can be accessed by all routines within a single program.
correct ...

A controller scoped tag can be accessed by all the programs and it’s routines.
close ... the following would be a little better in my opinion:

A controller-scoped tag can be accessed by any program and its routines ...

but with a somewhat rare exception:

if there is a program-scoped tag with a certain name – and a controller-scoped tag with an IDENTICAL name – then the program and its routines can NOT access the controller-scoped tag ...

example: suppose that you have a controller-scoped tag named MUTT – and you also have a program-scoped tag named MUTT ... that particular program can access its own programmed-scoped MUTT – but NOT the controller-scoped MUTT ...

workaround: you could make a controller-scoped alias for the controller-scoped MUTT – (and call it for example: NEW_MUTT) ... your program could then access its own MUTT tag – and also access the NEW_MUTT tag ...
 
Last edited:
My choice for a smal program would be to make all the tags program scoped. That way I find that the IO is the only thing in the controller tag database and makes it a bit quicker to scroll to.
Regards Alan case
 

Similar Topics

Hi, Please bear with this RS5000 newbie.📚 Just to clarify - In the PLC efficiency perspective is there any disadvantages using...
Replies
8
Views
12,495
Hello, I am attempting to download a program someone else created to an existing PLC (1769-L24ER-QB1B CompactLogix5370 Controller). However, when...
Replies
3
Views
1,095
I have a PLC program for a 1769-L24ER PLC and would like to test it out on a 1756-L73 PLC in the office that is just for testing. The test PLC is...
Replies
0
Views
964
Hi, I have a program I need to modify offline and test prior to commissioning. Its developed in Logix V30. I have no L8x controllers available...
Replies
15
Views
4,940
Hi all, i have a 1756-L62 processor, it keeps going into fault mode when i put it into run. I went to check major faults and i see the program...
Replies
23
Views
4,589
Back
Top Bottom