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.
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.
01-31-2017 09:38 AM
I've effectively done this with a Boolean Control and some code. Indeed, my favorite Boolean Control to use for this is the Boolean Indicator (the round dark-green button that "lights up" when pressed to be bright green). I'm not looking at existing code right now (I did this several years ago, am sitting in an airport, so this is coming off the top of my head) ...
This solution uses code, but it is fairly straight-forward. Furthermore, you can easily create a Quad-State (or even more) Button.
I've also used this scheme to code Status Registers, particularly for multiple units, such as the condition of a dozen sensors (Off, Initializing, Active, Shutting Down, Error). I create an Array of Booleans (1D or 2D), which when combined with resizing the Indicators, makes a compact display, and signal the Status by "coloring" the Control. [Oops -- I realize I just mis-spoke -- you can't set individual properties of Boolean Controls in an array. So How Did I Do That? Hmm, I think I may have made an array of tiny Color Boxes, and simply set the individual Indicator to the Color I chose for that Status].
Bob Schor
01-31-2017 09:47 AM
To make an array of things where I want to be able to make individual elements different colors, I make an array of the clusters; the cluster containing the control that I want, set to transparent, and behind it a color box.
02-07-2017 08:40 AM
I've used a radio control with 'tailored' controls for just that purpose. It is NOT a tristate LED but I think it's better. A tristate LED used as a control to select On, Off and Don't care (as you indicated) would not be intuitive to the user. I like my solution much better - but I'm a little biased 🙂
I'm not sure why the Radio Button didn't make it into the Silver palette. You can find Radio Button controls on the Modern, Classic and System palette under Boolean controls. The Modern and System radio button are , "misplaced" in that their types are uInt32 however not boolean. The Modern and System radio buttons have an advantage over the Classic radio button in that you can add as many 'radio knobs' as you like. The greatest advantage, one which I've leveraged, is that you can replace the control to whatever you like. You can even mix them! For my solution I dropped a radio button from the Modern palette, right clicked on the radio knobs and replaced with square buttons. I then set the colors in such a way to illustrate On (bright green), Off (dark green), and Don't Care (dark grey). This, with proper labels, clearly indicates to the user the usage of the control and the chosen state.
02-07-2017 09:05 AM - edited 02-07-2017 09:07 AM
There is nothing misplaced about the Modern and System radio buttons datatype. A single radio button, by itself, does have a boolean datatype. If you are looking at the radio buttons group, which has more than one radio button, this datatype cannot be represented by a 0 or 1 alone so, yes, it does have a uInt datatype.
Edit: I now see what you mean by misplaced, being in the boolean pallete rather than the numeric pallete.
What would you want the Silver radio button to look like? You can make one by replacing the radio buttons in any of the other versions with Silver LEDs.