11-30-2012 01:11 PM
I want to create a strategy to sort data into "Buckets'. The immediate need is that I will have a user select a few different analog output channels and I want to sort these out by card. So a list of
Card1_ao1
Card1_ao2
Card3_ao1
Card2_ao5
card1_ao5
card2_ao4
card3_ao4
would become
Card1=ao1,ao2,ao5
Card2=ao4,ao5
Card3=ao1,ao4
Basically I am going through a 2d array and creating a bucket based on the first value, and throwing and sorting out any duplicates into it in the form of a 1D array with a name.
What is the best way to acomplish the task above if the different buckets may be different length arrays? Am I best off using a local variable, a cluster or what? If a cluster is the way to go, does anyone have a good link to a way to programmatically change and bundle by name? I have to think there is a pretty simple way of doing what I want to do. If I were in matlab which is where a mechanical engineer I learned to program I would just declare a variable "Card1" as an array and add to it. If card #2 comes along and I don't have any variable set I would declare a card #2 array and so on. How do I best do this in Labview?
11-30-2012 01:23 PM