Controllogix How Set constant values

Abn

Member
Join Date
Nov 2019
Location
Fl
Posts
37
Hi,

How can I make some tags values as constants?

I have some values in tags that shouldn't change. I tried using the check mark on the controller tag page but still can change the values.

I have some add instructions where i have to add a constant to a tag.

thanks
 
You can change the value of a tag declared as a constant when monitoring the tag thru the tag browser but a logic instruction that tries to modify it will generate a compiler error "Routines can not write Constant tags".
 
This is easily accomplished by adding a MOV instruction and move your value that you want into your tag; therefore if anyone tries to change it they have to change the value at the MOV instruction or it will never change.
 
This is easily accomplished by adding a MOV instruction and move your value that you want into your tag; therefore if anyone tries to change it they have to change the value at the MOV instruction or it will never change.

Yes but the program will have to go through another scan to get around to re-asserting the value. So the value could be different for one scan and that's enough to screw things up. I can see why RA made constant types, the compiler can check and throw up an error if a write operation is attempted.
 
Yes but the program will have to go through another scan to get around to re-asserting the value. So the value could be different for one scan and that's enough to screw things up. I can see why RA made constant types, the compiler can check and throw up an error if a write operation is attempted.

Put the MOV instruction on a rung just before the rung that uses it. When I force things I usually put them on the first few rungs of the main routine, a habit I got into with older platforms.

Also, if it is something that will be a constant, in your compare instruction compare to a number, not a tag.

Something like:
LEQ Conveyor_PV 1200 instead of LEQ Conveyor_PV Conveyor_SP
 
Put the MOV instruction on a rung just before the rung that uses it. When I force things I usually put them on the first few rungs of the main routine, a habit I got into with older platforms.

Also, if it is something that will be a constant, in your compare instruction compare to a number, not a tag.

Something like:
LEQ Conveyor_PV 1200 instead of LEQ Conveyor_PV Conveyor_SP

Right, if its not going to change use direct versus indirect.
 
In versions 20 and above you can make a tag a "constant" value that can only be changed by the programming software.

Or just use a literal in the code, no need to use a tag value....
 

Similar Topics

I have an array of UDTs in which is located a timer. I have made a page where I wish for the timer preset to be adjusted. There's just zeroes on...
Replies
0
Views
1,067
My new friend Ron Beaufort got me thinking about the issues with using OTL's in regards to a power cycle. While you can use a first scan bit...
Replies
10
Views
4,637
Hey everyone, i have problem with L35E CPU, is any possibility to restore CPU to factory state? I'm asking because of password in "Logix CPU...
Replies
1
Views
3,531
I have problem to set wallclock for controllogix by using SSV.
Replies
4
Views
2,772
Currently I use an MRP (Motion Redefine Position) to adjust position. Is there an SSV where I can directly change the absolute feedback offset...
Replies
1
Views
1,934
Back
Top Bottom