From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I allow a single true boolean value at a time in a boolean array?

Solved!
Go to solution

I am trying to control voltage with a boolean array, but I do not want the user to be able to select increase and decrease at the same time.  If the increase switch is activated, then the decrease switch is deactivated.

0 Kudos
Message 1 of 4
(2,626 Views)
Solution
Accepted by topic author Michael_Williston

Hi Michael,

 

use Radiobuttons!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,624 Views)

GerdW,

 

Thank you so much!

 

 

0 Kudos
Message 3 of 4
(2,621 Views)

I assume you have three "states": [increase, decrease, idle]. If you only have two states (increase, decrease), a single boolean is sufficient to represent all choices. No array needed.

 

If you actually have three states, make sure the radiobutton control is configured to "allow no selection".

 

We don't know enough about how you are using this "array", but if the increase/decrease action is just temporary, you could set the mechanical action to switch until released (like a car horn). Now it will increase or decrease only while you are holding the button down and you can naturally only interact with one at any given time.

 

Feel free to show us a simplified version of your code. Maybe there are even better solutions. 🙂

0 Kudos
Message 4 of 4
(2,582 Views)