LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to design and list out in ascending order from minimum to maximum with 6 inputs

Solved!
Go to solution

hi,

How to design and list out in ascending order from minimum to maximum with 6 inputs in Labview? 

This is easy to write it in C++, but not in Labview,may be I am new to Labview. i manage to get the 1st and the 6th after compared, but i cant get 2nd, 3rd, 4th, 5th.

and can i write c++ language in Labview VI ?

thanks.

0 Kudos
Message 1 of 16
(3,896 Views)
Solution
Accepted by topic author Staffs

Try this:

sort.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 16
(3,890 Views)

Hi staffs,

 

ever tried to use some array functions?

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 16
(3,888 Views)

Here you go.

 

You can write code in C++ and call it from within LabView using a Code Library function, but it is totally unnecessary and more difficult.

0 Kudos
Message 4 of 16
(3,885 Views)

..or put your list of competitors into a cluster:

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 5 of 16
(3,878 Views)

Thank a lots  

 

0 Kudos
Message 6 of 16
(3,866 Views)

Hi Staffs,

 

When I was a wee G-babe I was still thinking in C so I coded up a bubble sort that rated as "Ugly" for the first The Good The Bad and the Ugly" show from years ago.

 

LV will also sort arrays of clusters using the first element in the cluster to do the sort and tie-breakers are handled by the second element in the cluster etc.

 

A lot cleaner than a bubble sort.

 

ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 16
(3,846 Views)

Hi, 

how to make this Vi, can show the name and time by ascending order ? eg. 1st Competitor A  15133 

how to make it to show Name and time , ( time already have but how to show name )? 

sort.png

 like this one only show time , how to show the competitor that finish 1st by ascending order ?

 

0 Kudos
Message 8 of 16
(3,789 Views)

Hi Staffs,

 

have you read any of the answers given before? Use an array of cluster of [score, name]!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 16
(3,779 Views)


Hi,

I read before , but I don't understand about cluster. But never mind, I will have look on cluster. Thanks A lot!

 

Regards, 

Sam

0 Kudos
Message 10 of 16
(3,758 Views)