Logix 5000 Tag Sorting by Name

AMarks95

Member
Join Date
Jul 2018
Location
South Dakota
Posts
224
I'm trying to be smart about naming my tags so things automatically group together alphabetically, but for some reason it doesn't work like I expected.

Equipment have 5-digit ID tags that I'm using as a tag prefix. I've named them so that every number has 5-digits, even if the leading 4 are 0's. I would expect the tags to number numerically the, but that seems to not be the case.

For example the tags e09111 and e0911X should be before e10111 and after e07523, but this is how Logix decides to sort them:

e0911X
e1011X
e1012X
e07523
e09111
e10111

should it not be sorted like so, alphabetically?:

e07523
e09111
e0911X
e10111
e1011X
e1012X

Any way to make it sort correctly?
 
what happens if you click on the header bar above the names column? sometimes that will sort the rows by the values in the column.
 
what happens if you click on the header bar above the names column? sometimes that will sort the rows by the values in the column.

If I right click and sort column (twice, first time sorts reverse alphabetical, second time sorts back to alphabetical), it's in the same order.
 
Bummer, because RSLogix Micro Starter Lite does it right, even though it does not have tag names per se.

Here is sorted by address:
Untitled.png
Here is is sorted by description:
Untitled2.png
 
I created controller tag names exactly as yours in Logix5000 20.04.01 and it sorts them in the exact wrong order that you are seeing. It looks like it is ignoring the leading e and trailing X and sorting the resulting "strings" numerically. Weird.
 
sorting the resulting "strings" numerically. Weird.
This does indeed seem to be what's going on.

Based on my own testing in v32, it seems like any series of numerals is evaluated as a unit based on its value instead of being checked character by character in a standard alpha-numeric sort.

Thus 'e0911X' comes before 'e07523' because 911 < 7523. It is not so much that the leading e and trailing X are 'ignored' as that they don't matter with the provided tag names -- they all share the leading e and the X will only be a determining factor if everything preceding it matches.

Weird indeed.

I don't see any way to get it to sort correctly while fully preserving your current naming pattern; the issue is that the trailing 'X' is not a numeral so the preceding number is 1/10 the value of what it needs to be for it to sort correctly (or in other words, contrary to your statement of 'every number has 5-digits' you instead have some numbers with 5-digits and some with 4-digits+X).
 
It's an ASCII sort and in the ASCII code Number come before letters
do an internet search for the ASCII code it only contains 256 characters 0-255
 
sorting the resulting "strings" numerically. Weird.

This is a handy feature when sorting
Valve1
Valve2
Valve10
Valve40
Valve99
Valve100

because someone didn't zero-pad their numbers. I've always hated it when Valve2 comes after Valve100 in a normal sort.

You can't please everybody.
 
Little off topic...

...but remember to put as many tags as you can tags inside UDTs.
You can end up reducing your individual tags by 90%+, so less need to ordering and grouping.
 
I like to be able to make folders, drag tags in there, sort them alphabetically, then drag some of them to some other order, have the software remember all that and keep it how I left it. But that is just one of many things Red Lion Crimson does right and everyone else needs to copy.
 
...but remember to put as many tags as you can tags inside UDTs.
You can end up reducing your individual tags by 90%+, so less need to ordering and grouping.

That would be great, but UDTs are not editable online. I have dozens of different equipment that are related to the same area that I want grouped by their tag ID (the 5-digit code after "e"). So this kind of breaks that grouping because all of the "e15XXX" may not be in the same place, but at least the search/filter will be able to quickly filter down to each group. If I put them all in one UDT, every change would require a download. That's just not going to work.
 
I like to be able to make folders, drag tags in there, sort them alphabetically, then drag some of them to some other order, have the software remember all that and keep it how I left it. But that is just one of many things Red Lion Crimson does right and everyone else needs to copy.

Absolutely. I should be able to group/sort tags however I want without it affecting how it is addressed within the PLC. If I want to bury a tag "test" 3 folders down, I should be able to and still call it via just "test".
 
Absolutely. I should be able to group/sort tags however I want without it affecting how it is addressed within the PLC. If I want to bury a tag "test" 3 folders down, I should be able to and still call it via just "test".

Well, even Crimson can't do that!

You still have to specify the path to the tag, but if you use it in twenty places and then move it, Crimson does fix all the references for you so nothing gets broken.
 
If you use it in twenty places and then move it, Crimson does fix all the references for you so nothing gets broken.

Well, even Logix 5000 can do that! (when renaming an already used tag, provided it's not being referenced by FT)

Really, it wouldn't be very difficult it's just a different implementation of the same concept. Each tag name would still have to be unique, regardless of the path. The approach Crimson has is still better than what I have to use with Logix.
 

Similar Topics

Is there any way to use a tag value in the Instance Name field? I would like to have an array of strings with my module names that I can loop...
Replies
2
Views
956
I know the syntax for local tags on various processors varies, but I'm not familiar enough with all of the different PLCs to know which ones will...
Replies
11
Views
2,049
I know tags can be im/exported from/to an L5K. Wondering if IO tags (Local:1:I) can be overwritten in the same way. For example, if I have an L5K...
Replies
1
Views
777
I want to ask about this tag that is in RSLogix 5000: datatype: AB:PowerFlex525V_EENET_Drive:I:0 and I want to create a new tag(instance of...
Replies
10
Views
2,348
Has anyone experienced the following issue on RSLogix5000 (currently on V16) I have a PLC program that has been running on a site for a number...
Replies
5
Views
1,603
Back
Top Bottom