LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Construct

Solved!
Go to solution

I am new to Labview and having a hard time connecting the dots to make programs work. What I am trying to do now is construct a vi that searches the values of an input array of numbers for a specified value. If the specified value is found in the array, the vi should indicate that by turning on an led and by indicating the corresponding index of the array. Any help would be greatly appreciated. Thank you.

0 Kudos
Message 1 of 3
(1,515 Views)
Solution
Accepted by topic author Golfnut

You're looking for Search 1D Array. As long as this does not return -1, it found the element (turn LED on using this), and then assign the index to the correct location using the index it specifies.

 

http://zone.ni.com/reference/en-XX/help/371361G-01/glang/search_1d_array/

0 Kudos
Message 2 of 3
(1,502 Views)

While it's not a sexy as Search 1D Array, you could "do it manually" with a For loop, testing the values one at a time.  If you've looked carefully at the LabVIEW Help for a For Loop, you'll see you can even stop the loop when you find the match.  

 

If you cannot do this on your own (even if crude and slow), spend more time with the Tutorials and find yourself a LabVIEW Guru (or good instructor) to mentor you.

 

Bob Schor

0 Kudos
Message 3 of 3
(1,472 Views)