|
Best way to check multiple Boolean values?
In your program you need to check which button out of a couple of buttons, say, on a joystick, is currently pressed. Depending on which one it is you return a different value. So basically checking which of the multiple boolean values is true. What are some ways to do this, specifically in LabVIEW?
There's always the old "check one, if false, check the next, repeat." (a whole bunch of if...else statements in C). But in LabVIEW this means putting a lot of Case structures within themselves, which is a major pain especially if there are a lot of values/buttons to check.
Is there maybe a way to put all the button values into an array, search for a true or 1, and return which index it was? I don't think there's a "search array" VI.
|