Alphabetize UDT by one of the Data Types

javaninger

Member
Join Date
Mar 2010
Location
mo
Posts
10
I am trying to alphabetize a list (the array) of UDT's that I am showing on a PanelView.

Currently I can only sort by default (the array number). I would like to sort by the below "Material_Number_String" as below.

UDT.jpg
 
I would export them and do the sort in excel. You can also copy and past this list
 
I am actually looking for this to auto sort somehow. We are allowing the customer to change the field, and based on that change, I would like them to sort in the PanelView alphabetically. This eliminates sorting them in Excel, or any other external method.
Thanks!
 
don't know of a way to sort them in the HMI. I thought you where looking to sort them in the RS5k.
 
A caution as sorting by a number which is stored in a string will give you an ASCII order sort. You may not get the results you want and will take longer for a full sort. If the numbe strings are carefully regulated to be the same number of characters (with leading zeroes if needed) then the results will be more predictable.

But if Material_Number_String is a true number then why not store it as that? Much easier and faster to sort by.

Once the array is sorted then a simple insert/delete type action will keep it sorted, though you may have the option for a full sort as needed.
 
The Material_Number_String is alpha-numeric, not just a number. They will all be the same (13 characters). The array of this UDT is 1400, and currently the only way we know to sort them is by the array number Material_Number_UDT[0], Material_Number_UDT[1], etc.
 

Similar Topics

Afternoon all, I'm working on setting up a large excel recipe table for porting updates through the Linx Gateway RTD/DDE function into my recipe...
Replies
2
Views
96
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
200
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
124
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
300
Hello, I have been looking for a reference for the order that a UDT is copied in the COP instruction. More specifically - I have a set of code...
Replies
5
Views
544
Back
Top Bottom