LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

only one Boolean button can be latched at a time

Solved!
Go to solution

when one of these buttons is pressed they latch and turn green. I'm new to lab-view and cant figure out how to make sure only one button can be activated at a time. for example if the storage button is activated and the user presses the pretest button the storage button should unlatch and the pretest button should be activated

0 Kudos
Message 1 of 3
(923 Views)
Solution
Accepted by topic author amthonys777

You can use a radio button for that. The DMC GUI has nice looking radio buttons that I like to use.

Message 2 of 3
(919 Views)
Solution
Accepted by topic author amthonys777

Be careful with the word "Latch" when describing LabVIEW Boolean Controls.  Boolean Controls have "mechanical actions", such as "Switch when Pressed" or "Switch when Released".  The "Rectangular" buttons on the Boolean Palette have the action "Latch when Released", which means two things: (a) its value doesn't change (say from False to True) when it is released, and (b) the value is latched (meaning it stays the same) until it is read, at which time it changes back to its default value (i.e. to False).  [I actually missed that last part about the default value for a few years until I realized why some of my code was behaving "strangely"].  This (default) behavior of the Rectangular Boolean Controls make them useful for Front Panel Start/Stop-style Controls.

 

As @Gregory mentions, when you want "exactly one" (or maybe none) of a set of buttons to be on at a time, the Radio Button is the way to go.  It is actually a Cluster of Booleans with a little programming "behind the scenes" that makes sure turning one button On turns the rest of them Off.  I suspect it would not be too difficult (in fact, I think I've actually done this without realizing it) by creating a Cluster of identical Booleans (any size or shape), making them all "Switch when Pressed" or "Switch when Released".

 

Bob Schor

Message 3 of 3
(894 Views)