LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D array sort not working (7.0)

We moved a couple of months from LV 6.0.2 to 7.0. A further update is currently not possible.

I came across an error I never imagined possible. The built in function "1D sort" gives not the correct result for a certain input sequence.

In my program I concatenated two previously sorted arrays ( in the original clusters) and did a resort. In both arrays could be duplicates so this input far from random.

The built in function is doing some sorting but a one point their is a break and than the sorting stops.

Doing the same in LV 6.0.2 works as expected.
Doing a second sort helps (but always ?)

Can someone please confirm this and test it with LV 7.1

Thanks
Gabi
7.1 -- 2013
CLA
0 Kudos
Message 1 of 11
(3,854 Views)
Sorry I forgot to include the program.

The sequence in question is made the default data.

GT
7.1 -- 2013
CLA
0 Kudos
Message 2 of 11
(3,843 Views)
Sorry I forgot to include the program.

The sequence in question is made the default data.

GT
7.1 -- 2013
CLA
0 Kudos
Message 3 of 11
(3,842 Views)
Seems to work good in 7.1
See attachment provided...
0 Kudos
Message 4 of 11
(3,832 Views)


@Maelstrom wrote:
Seems to work good in 7.1
See attachment provided...



Thanks for trying it. I had a doublecheck with a random sequence. Please push the button to use the non-random sequence.

GT
7.1 -- 2013
CLA
0 Kudos
Message 5 of 11
(3,815 Views)
Sure no problem, non-random sequence:
0 Kudos
Message 6 of 11
(3,808 Views)
He instalado tu programa en mi versión de LabView 7 Express y no me ha presentado ningún problema en su ejecución, inclusive ejecutando la función non-random q mencionas. De pronto se puede pensar en limitaciones en la versión q usas, algunas versiones nuevas liberadas no contienen todas las funciones.
0 Kudos
Message 7 of 11
(3,801 Views)
I can confirm this to be abug in LabVIEW 7.0, while in LabVIEW 7.1 it works correctly.

If you add another sort as indicated in the figure, LabVIEW 7.0 also works correctly. Very strange!

Time to upgrade! 😉
0 Kudos
Message 8 of 11
(3,784 Views)
There seems to be a specific problem with your size 744 array (your presorted array). If you either add an element or remove the last element, it behaves correctly.

I have attached an image demonstrating your problem with a minimal VI. Sorting only once scrambles the data above 500 as seen in the second graph.
0 Kudos
Message 9 of 11
(3,779 Views)
Thanks again for your time.
So it is a bug. And I thought that all sorting algorithms were weatherproof since ages.....

I checked again for different behaviour with a different size of the array.
First it seems that if you increase or decrease it works sometimes. But if you change values in the input sequence you run again into errors.

I altered one value to be completly out of sequence from the rest and again I got an error. It is not so obvious to be spotted in the graphs, but my checker that I included afterwards finds it.

Upgrading is not a question of time only. Unfortunatly money is also involved 😉

Gabi
7.1 -- 2013
CLA
0 Kudos
Message 10 of 11
(3,750 Views)