04-08-2014 12:46 PM
Im new at using labView and i have a problem.
Im trying to create a VI that searches the values of an input array of numbers of a specified value. If the specified value is found in the array the VI shpuld indicate that by turning on an LED and indicating the corresponding index of the array.
I would really appreciate if someone could help me with my issue.
04-08-2014 12:49 PM
Sounds like homework. Show us your attempt and we'll help you work through it...
04-09-2014 09:45 PM
This is what i have, but i dont think it rigth.
04-09-2014 10:23 PM
Nope. Not right. You are just determining whether the value you are looking for is equal to the length of your array.
Try "Search 1D Array".
04-09-2014 10:33 PM - edited 04-09-2014 10:55 PM
You're not using Search 1D Array Function, rather you're using Array Size function.
Try out attached code, Index of Element output of Search 1D Array Function is -1 if the element is not found in the input array.
04-09-2014 10:37 PM
@moderator1983 wrote:
Try out attached code,
It's generally better to guide them to the solution rather than giving them the answer to their homework.
04-09-2014 10:56 PM
@RavensFan wrote:
@moderator1983 wrote:
Try out attached code,
It's generally better to guide them to the solution rather than giving them the answer to their homework.
I got it...!!
04-09-2014 11:15 PM
okay i found the search 1D array. Do i just add a Equal to function to get to work?
04-10-2014 08:24 AM - edited 04-10-2014 08:26 AM
Yes you need an equal function. Actually, you could also use <0 function to determine if the element was found or not.
If you read the help for Search 1D Array, you'll see that a value of -1 is returned when the element is not found.
04-10-2014 02:48 PM
Thanks for the help i got the VI to work.