LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

urgent help on array

The easiest way I know to sort multiple arrays in the same fashion is to use an array clusters.  Bundle the arrays element by element into a cluster, with the array you want to sort by as the first element.  Sort this using Sort 1D Array, then overwrite your original data with the new, ordered, data (saves a data copy).  You could sort the original arrays in-place, as well, but this would require knowledge of sorting algorithms.  Here are two implementations of this algorithm.  The first if for older versions of LabVIEW, the second for newer.  Both attachments are LabVIEW 2009.

 

SortByColumn.png

 

SortByColumn2.png

 

Download All
0 Kudos
Message 11 of 13
(684 Views)

It is not really a sorting problem, because we already have the sort key. All we need is to read the key out and rebuild the output.

 

Here's what I would do (Attached VI is downconverted from 2009 to LabVIEW 8.0, hopefully it still works ;)).

 

See if it makes sense.

 

Download All
Message 12 of 13
(665 Views)

Thanks people , i've found the solution.

 

0 Kudos
Message 13 of 13
(644 Views)