LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

choose which boolean value is true

I was wondering if someone had a slick way of doing this. I have 4 boolean inputs on the front panel and I want to determine which was clicked to true and then to output the one that was. Thanks

Derek Tucker
Derek Tucker
derek@ponengineering.com
0 Kudos
Message 1 of 8
(3,289 Views)
Derek,

The Event structure will do what you want. Set an event for value change on each control. The output from each case can the identifier of the true value.

Lynn
0 Kudos
Message 2 of 8
(3,279 Views)
this is actually occuring in a sub vi, forgot to mention that sorry, how does the event structure handle when being called from a sub vi? Thanks

Derek Tucker
Derek Tucker
derek@ponengineering.com
0 Kudos
Message 3 of 8
(3,276 Views)
It should work, as long as the subVI is acting as a dialog box where the user click the boolean button.
www.vartortech.com
0 Kudos
Message 4 of 8
(3,276 Views)
okay I will give it a try, thanks

dt
Derek Tucker
derek@ponengineering.com
0 Kudos
Message 5 of 8
(3,269 Views)
It seems that vi just hangs with the event structure in the subvi. Is there another way? Thanks
Derek Tucker
derek@ponengineering.com
0 Kudos
Message 6 of 8
(3,266 Views)
Are you passing Boolean values in a main to an event structure in a subVI? That won't work. If you do pass the values to a subVI, in your subVI, all you have to do is use a Build Array and then a Search 1D Array. With the element set to a True Boolean constant, the function will return the index number of the first True it finds in the array.
 

Message Edited by Dennis Knutson on 02-21-2006 03:25 PM

0 Kudos
Message 7 of 8
(3,258 Views)
sweet, thanks for answering the stupid newbie question. Just getting started here.
Derek Tucker
derek@ponengineering.com
0 Kudos
Message 8 of 8
(3,251 Views)