Better to drive an alias tag or the base tag?

TheWaterboy

Lifetime Supporting Member + Moderator
Join Date
May 2006
Location
-27.9679796,153.419016
Posts
1,905
This would likely pertain to any scenario but in case it matters, here's mine:
I have an array of Dints representing alarm bits, (i.e. DintTag[1].7). The array is used in a program that looks for changes in the array to indicate new alarms have occurred since last acknowledged.The array format is needed to make this processing easier than calling a bunch of separate bits by name. But this format is more clumsy for the HMI to deal with.

For example say the DintTag[1].7 is for a pump fail indication. I created an alias tag called Pump Fail and the SCADA and HMI use that tag making the HMI side of things easier to handle.

But within the logic, Is it better to "drive" an OTE representing DintTag[1].7 with a Base tag directly or can I use the Alias tag "Pump Fail"?

I know that the Alias tag references the memory location of the base tag so they are identical. But if I "Drive" the OTE with the Alias tag when writing the logic , the Base tag is also displayed in the ladder making it self documenting and easier to troubleshoot for others in the system after I am gone.

Is there a potential problem writing it this way or should I drive the base tag instead. The end result to the HMI side is the same, the benefit I see on the PLC side is the self documenting property that occurs.

Opinions?
 
Better to use the alias. Granted one could argue it will use more of the PLC memory, but I'll take easier to understand code and quicker development time.

Yes, as you described that is a perfectly reasonable method, and in-fact our "standard" method here. All of our controller-scoped base tags are arrays, well at least when it comes to device control and other standard control methods. Arrays allow us to create standard code and automatic-code generation (via vba and Excel). Plus it enables us to keep HMI tags and related scripts standard as well because we are always referencing the known base array tags.

Digital Output #1 will be the same across all projects. But the device tied to Digital Output #1 will always be different. So we have a generic array of Digital_Outputs[x] as controller scoped tags. Once we get device reference tags we will create the alias tags to make PLC coding easier to develop and manage.

Digital_Output[0] ==> "M1001_Start" and now anyone who reads the code clearly knows that Digital_Output[0] controls.

My example was pretty basic, but start creating a lot of device functionality using AOI's the benefit of alias tags becomes even clearer...

For M1001 I may now have:

M1001.Start
M1001.Stopped
M1001.Running
M1001.Forward
M1001.Reverse
M1001.Speed

Versus:
Motor_AOI_Tag[0].Start
Motor_AOI_Tag[0].Stopped
Motor_AOI_Tag[0].Running
Motor_AOI_Tag[0].Forward
Motor_AOI_Tag[0].Reverse
Motor_AOI_Tag[0].Speed

EDIT: I will note we do not reference device alias' for HMI tags, we have standard integer tags that correlate to the base array tags. This allows us to reduce tag counts as each bit in the integer will correspond to a different status/command to the PLC.
 
Last edited:
What HMI are you using? Because something like ME or SE I wouldn't even use a tag in the HMI....Just point it directly at the DINT array. Creating duplicate tags for HMI purposes seems to be alot of work for little gain. Just wondering.
 
Better to use the alias. Granted one could argue it will use more of the PLC memory, but I'll take easier to understand code and quicker development time.

Yes, as you described that is a perfectly reasonable method, and in-fact our "standard" method here. All of our controller-scoped base tags are arrays, well at least when it comes to device control and other standard control methods. Arrays allow us to create standard code and automatic-code generation (via vba and Excel). Plus it enables us to keep HMI tags and related scripts standard as well because we are always referencing the known base array tags.

Digital Output #1 will be the same across all projects. But the device tied to Digital Output #1 will always be different. So we have a generic array of Digital_Outputs[x] as controller scoped tags. Once we get device reference tags we will create the alias tags to make PLC coding easier to develop and manage.

Digital_Output[0] ==> "M1001_Start" and now anyone who reads the code clearly knows that Digital_Output[0] controls.

My example was pretty basic, but start creating a lot of device functionality using AOI's the benefit of alias tags becomes even clearer...

For M1001 I may now have:

M1001.Start
M1001.Stopped
M1001.Running
M1001.Forward
M1001.Reverse
M1001.Speed

Versus:
Motor_AOI_Tag[0].Start
Motor_AOI_Tag[0].Stopped
Motor_AOI_Tag[0].Running
Motor_AOI_Tag[0].Forward
Motor_AOI_Tag[0].Reverse
Motor_AOI_Tag[0].Speed

EDIT: I will note we do not reference device alias' for HMI tags, we have standard integer tags that correlate to the base array tags. This allows us to reduce tag counts as each bit in the integer will come a different status/command to the PLC.

I do exactly the same in regards to mapping I/O later...I can develop the entire application without knowing a single I/O point. However, I have found Alias's a pain because you can't reassign or change them online. So I create a simple I/O mapping routine for each card/module that maps the card I/O to my realworld tag, just using XIC and OTE. Then I can change any I/O assignment on the fly without having to download the PLC program.
 
What HMI are you using? Because something like ME or SE I wouldn't even use a tag in the HMI....Just point it directly at the DINT array. Creating duplicate tags for HMI purposes seems to be alot of work for little gain. Just wondering.

I used the term HMI generically. In my case I was specifically referring to my SCADA system and my SQL datalogger. Both use the tags in the controller scope and having those with friendly names makes this easier.
 
I do exactly the same in regards to mapping I/O later...
I do that with as well but without using an alias.

Previous versions of logic I have since rewritten used an Alias in an attempt to pseudo-accomplish this bufferring but I have found that an aliased Local tag is not bufferred at all and can still change async to the logic. Thats an unnecessary thing to worry about when if can be fixed with a little work.

I have enough bugs to squash without adding a logic race.
 
Specifically though... should I use the following:
 
XIC(SomeLogicalBit) OTE(AliasTag)

or
 
XIC (SomeLogicalBit) OTE(BaseTag)


Is there a difference except for memory usage.
 
What HMI are you using? Because something like ME or SE I wouldn't even use a tag in the HMI....Just point it directly at the DINT array. Creating duplicate tags for HMI purposes seems to be alot of work for little gain. Just wondering.

If you are referring to my example.....InTouch #hateit.

I agree it's a hassle that are you limited to online edits of alias tags, you can "cheat" the system at times.

Assuming your tag is not being scanned by an HMI..
1 - Rename the alias you wish to change.
2 - Create a new alias with the proper name.
3 - Change all the instances in your program
4 - Delete your original now renamed alias.

If it is on scan...you need to shutdown all HMIs, IO servers and such before you can do this.

We also to the IO mapping so we can build all the code prior to having an IO list finalized. We don't alias the IO directly, just the internal logic.
 

Similar Topics

Good Afternoon , It seems like we always have problems with using Type J Thermocouples with our slip rings . Would using a RTD at 10...
Replies
6
Views
1,622
I am beginner in B&R Automation Studio and TIA Portal. Have an experience in electrical part of PLC cabinets. Now its time to get a new skills...
Replies
8
Views
1,632
Bla Bla Bla, why doesn't it work, l need help and l don't understand PLC's. Or better they understand everything, but can't understand +1 -1 = 6...
Replies
22
Views
5,959
I rarely need to add a network card to the drives we install... very rarely. But my sales-guy said he needs to quote a network-connected ACH580...
Replies
6
Views
2,555
I'm currently on a research project where I can send tag read & write requests to both SLC as well as CLX controllers. Presently, there's no...
Replies
8
Views
2,388
Back
Top Bottom