Why create Alias tags - RSLogix 5000

Mstachura

Member
Join Date
Jun 2014
Location
calgary
Posts
5
Why do we create Alias tags? For example "PIT_190_I" for an input.

Can't you just use "PIT_190" for the input and logic?

What is the benefits to aliasing? I have read online but i am lacking to find the reason "Why".

Very beginner question here, and would appreciate any feedback on this.

Thanks
 
suppose that you have a "real-world" input address such as:

Local:1:I.Data.0 ...

saying that out loud gets old pretty fast ... (Local-Colon-1-Colon-I-Dot-Data-Dot-Zero) ...

so let's make up a new name – for example: Start_Button – and use that name in our program instead ...

will the processor work any better? ... nope, but the shorter "sensible" name (the alias) might make our lives a little bit easier while working with the system ...
 
Last edited:
On the older style processors that use RSLogix500, we often write special routines that "map" real world I/O to internal bits, and then use those internal bits throughout the program. So for instance you'll see a routine with a bunch of these:

   I:0/0                                   B3:0/0
----| |-------------------------------------( )-----



The reason for doing this is because every once in a while one channel of an input or output card will go bad, and the card can't always be replaced right away. This gives us an advantage when we move a wire to a different channel temporarily. Instead of having to search through an entire program, we can just change the address that internal bit is mapped to in one, central location.

The purpose of this in RSLogix5000 is the same, to allow you to be able to remap inputs and outputs to allow faster physical I/O reassignment as well as what Ron talked about above: some default tags really aren't that descriptive and this allows you to use tags that make more sense without having to write code. Except in RS5000, we don't have to code it manually anymore. In your specific example, PIT_190_1 isn't all that different from PIT_190, so aliasing in that case wouldn't be of any advantage.
 
Last edited:
One advantage for me is that I can have multiple tag names and descriptions for a given input. We have presses that we exchange sometimes 4 or 5 dies, each die having multiple prox switches and photo eyes. The function of the sensor connected to an input for die 1, usually won't serve the same function as a sensor connected to the same input for die 2. The ability to alias the inputs allows me to give each input for each die a unique tag name as well as a unique description as to its function, all while "re-using" the same inputs.
 
We put all of our tags into arrays.

PLC_Tag[0]
PLC_Tag[1]
PLC_Tag[2]
.
.
.
PLC_Tag[n]

This makes it easy to generate files/code for the PLC in another piece of software like Excel. This also aligns with how we do SCADA tags which make some scripting easier if we have a "fixed" format for a tag.

Of course this makes it harder to "decode" so we put aliases on our arrays.


PLC_Tag[0]: FT101
PLC_Tag[1]: LT901
PLC_Tag[2]: FV878
.
.
.
PLC_Tag[n]: FTxyz
 
Interestingly, people coming from other platforms might think Aliases are pointers. They are not pointers, but are instead like the #define from C; a simple find and replace type of thing. That's also why they can't be added to user defined datatypes; they aren't actual locations in memory, so it would get weird.
 
Interestingly, people coming from other platforms might think Aliases are pointers. They are not pointers, but are instead like the #define from C; a simple find and replace type of thing. That's also why they can't be added to user defined datatypes; they aren't actual locations in memory, so it would get weird.

Agreed, they are not "actual locations in memory", but only in the sense that there is no data stored in an alias tag.

The database entry for an alias tag simply redirects the processor to read or write the base tag, where the data is stored. In that sense, an alias tag is much like a "pointer". I can't see how "find and replace" comes into this.

And you are also confusing what you "add to user-defined data-types". You add named members, not tags. You can certainly create a udt member with the same name as an alias tag, (or any other tag-name), but that does not mean the alias tag is part of the udt.
 
Interestingly, people coming from other platforms might think Aliases are pointers. They are not pointers, but are instead like the #define from C; a simple find and replace type of thing. That's also why they can't be added to user defined datatypes; they aren't actual locations in memory, so it would get weird.

Agreed, they are not "actual locations in memory", but only in the sense that there is no data stored in an alias tag.

The database entry for an alias tag simply redirects the processor to read or write the base tag, where the data is stored. In that sense, an alias tag is much like a "pointer". I can't see how "find and replace" comes into this.

And you are also confusing what you "add to user-defined data-types". You add named members, not tags. You can certainly create a udt member with the same name as an alias tag, (or any other tag-name), but that does not mean the alias tag is part of the udt.

Daba, When CapinWinky means by "Find and replace" is about how a C compiler works. One of the first processes that the compiler does is to find all cases of any #define parameters and replace them with their value. So for instance if you had some code like this:

Code:
#include <stdio.h>
#define number 3

int main (void)
{
    a = number;
    printf("%d",a);
    return 0;
}

The first step the compiler execuites is to replace number wherever it is found with 3 so the code would look like this:

Code:
#include <stdio.h>

int main (void)
{
    a = 3;
    printf("%d",a);
    return 0;
}

(For a full explanation see this video short from Harvards CS50)

This is effectively what the PLC does aswell, it takes the alias and "replaces" it with the original tag. However inside C code you cannot modify the value of a #define where as you can modify the value of an Alias tag. To me its kind of neither of the two. Its not a true pointer but at the same time it is not like a #define either. But if you want to start talking about the differences between C and PLC code we could be here for hours. Things that are taken for granted in C code like recursion are unavailable in AB PLCs which makes implementing something like Heap sort very difficult. In the end they are intended for different things and both do their jobs well.
 
Does the discussion whether to use an Alias for a physical IO location come into play here? Since I/O is Async to the ladder, there is the potential for data changing between the beginning and ending of a scan. If you are running some tight code that could be an issue.
Which of course opens the mapping of IO to bits war which seems to be the "Mac vs PC" argument of the PLC world. :)
 
Another reason for creating Alias tags is that often the final IO address is unknown when program development is started. The programmer can go ahead and create the program using base tags, which can then be easily converted into an alias once the actual IO addresses are known.

Aliases also provide a layer of abstraction between a device and an HMI. You might have HMI screens that are designed to provide a consistent look and feel across the entire line and between lines, however the actual equipment may be different. For example, one line might have a drive from AB and the other might have a drive from ABB. Aliases are one tool that can allow the same HMI app to function with both.
 
Hi

For me it's a case of what is done on site already and I follow that.
If I have a choice I just map to bits as an Alias can't be changed without downloading and in most cases for me this not always possible.

Waterboy

Please correct me if I am wrong but does the plc not update the inputs at the start of the scan and not again until the start of the next scan unless a update I/o instruction or the like are added in to the code.
I may be way of the mark but open to correction

Donnchadh

Ps I have been away from the site for a while but great to be back
 
Hi

For me it's a case of what is done on site already and I follow that.
If I have a choice I just map to bits as an Alias can't be changed without downloading and in most cases for me this not always possible.

Waterboy

Please correct me if I am wrong but does the plc not update the inputs at the start of the scan and not again until the start of the next scan unless a update I/o instruction or the like are added in to the code.
I may be way of the mark but open to correction

Donnchadh

Ps I have been away from the site for a while but great to be back

Donnchadh

In Logix 500 the Inputs are updated at the start of the scan and the outputs are updated at the end of the scan.

In Logix 5000 the Inputs and outputs are updated Asynchronasly to the scan. They are updated at that particular modules RPI rate. This could potentially cause problems if say for instance you had an XIC of an input on one line and on the next line an XIO of the same input as in theory the PLC could update the inputs between the two lines so you could end up execuiting both or neither of the lines depending on the input states. Thats why generally people either specifically plan for this or else copy the Inputs into an input mask and then use those throughout the program.

Regards
Ian
 
Does the discussion whether to use an Alias for a physical IO location come into play here? Since I/O is Async to the ladder, there is the potential for data changing between the beginning and ending of a scan. If you are running some tight code that could be an issue.
Which of course opens the mapping of IO to bits war which seems to be the "Mac vs PC" argument of the PLC world. :)

If Async I/O is an issue for your application then you should be buffering the I/O but the OP is asking about Alias tags. You can have alias tags without buffering the I/O for Async issues in Controllogix. In older Rockwell platforms to get an alias you had to buffer the I/O in some regard but not in controllogix

There are many methods to buffer I/O also and each depends on the situation at hand. I normally use CPS to buffer an entire card but you can do it rung by rung which is helpful if the expect bubba to swap over a failed I?O point on a card at 3:00 AM. As always it just depends.
 
Are you sure about that? Since an alias is little more than a pointer I can't envision the isolation from the module's RPI.
It's a little less than a pointer, as I mentioned. A pointer is a variable that stores a memory address. In the case of ControlLogix, a memory address would be a UDINT, so each pointer would actually consume 32bits of memory to store the address for the memory location it is pointing to.

An alias does not exist after compile time and so does not take up space in memory. All references to it are replaced with the base tag when the code is compiled. The CPU in the PLC has no idea an alias ever existed.

Also, to be clear, your RSLinx/Studio 5000 project is compiled into machine code for the PLC to run it. The source code (ladder, ST, UDTs, tag lists, etc) is stored completely separately and is only read or written to when you upload/download the project. The PLC has no use for it. When you make an online edit, that routine is re-compiled and replaces the running one. Any edit you are blocked from making online is because it would change the location of variable data in memory and rather than deal with this, AB has simply decided to block it from happening.
 

Similar Topics

Hello, I've been trying to learn this a while now and still have not found out how this works. I have an Omron CJ2M PLC and an ABB ACS 355 VFD...
Replies
1
Views
218
Hello, I have to deal with iFix again and am looking at the most efficient way to create alarms to display in iFix, i.e. not creating an...
Replies
0
Views
147
Good morning to all, I have the following issue, I installed everything of intouch including the patch, it is the 2023 version. The...
Replies
0
Views
318
So, I finally got versioin 27 installed on my Windows 10 VM. However, now I can't upload a project from my lab controller. I have the above error...
Replies
0
Views
1,124
Hi all, I have few GB of logged data created by RS View 32 Works, it is all in .DBF format. At the moment, my company wants to shift all data to...
Replies
14
Views
1,432
Back
Top Bottom