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.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


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

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old January 8th, 2014, 09:57 AM   #1
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 788
Better to drive an alias tag or the base tag?

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?
  Reply With Quote
Old January 8th, 2014, 11:25 AM   #2
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,039
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 by Paully's5.0; January 8th, 2014 at 11:28 AM.
  Reply With Quote
Old January 8th, 2014, 11:27 AM   #3
robertmee
Member
United States

robertmee is offline
 
robertmee's Avatar
 
Join Date: Feb 2008
Location: NC
Posts: 1,428
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.
  Reply With Quote
Old January 8th, 2014, 11:29 AM   #4
robertmee
Member
United States

robertmee is offline
 
robertmee's Avatar
 
Join Date: Feb 2008
Location: NC
Posts: 1,428
Quote:
Originally Posted by Paully's5.0 View Post
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.
  Reply With Quote
Old January 8th, 2014, 12:13 PM   #5
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 788
Quote:
Originally Posted by robertmee View Post
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.
  Reply With Quote
Old January 8th, 2014, 12:19 PM   #6
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 788
Quote:
Originally Posted by robertmee View Post
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.
  Reply With Quote
Old January 8th, 2014, 12:23 PM   #7
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 788
Specifically though... should I use the following:
 
XIC(SomeLogicalBit) OTE(AliasTag)

or
 
XIC (SomeLogicalBit) OTE(BaseTag)


Is there a difference except for memory usage.
  Reply With Quote
Old January 8th, 2014, 02:48 PM   #8
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,039
Quote:
Originally Posted by robertmee View Post
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.
  Reply With Quote
Old January 8th, 2014, 02:50 PM   #9
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,039
Quote:
Originally Posted by TheWaterboy View Post
Specifically though... should I use the following:
 
XIC(SomeLogicalBit) OTE(AliasTag)

or
 
XIC (SomeLogicalBit) OTE(BaseTag)


Is there a difference except for memory usage.
No difference.
  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
1336 impact drive going to default parameters careed_25 LIVE PLC Questions And Answers 10 August 18th, 2010 10:33 AM
ultraware - enable input active ubuandy LIVE PLC Questions And Answers 2 October 25th, 2009 05:08 PM
alias RSLogix 5000 AGENTTINFOIL LIVE PLC Questions And Answers 28 November 20th, 2007 11:22 AM
AC Drive troubles OkiePC LIVE PLC Questions And Answers 25 September 8th, 2005 10:21 AM
Servo drive failures rsdoran LIVE PLC Questions And Answers 17 May 5th, 2004 11:06 PM


All times are GMT -5. The time now is 10:45 PM.


.