01-10-2023 02:31 PM
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
Solved! Go to Solution.
01-10-2023 02:33 PM
You can use a radio button for that. The DMC GUI has nice looking radio buttons that I like to use.
01-10-2023 03:58 PM
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