06-09-2017 01:44 PM
Boolean is 2-state. I just wish I could make it like a stop-light.
Green is "go", yellow is "danger" and red is "stop".
Any suggestions how to do this?
Solved! Go to Solution.
06-09-2017 02:05 PM
Hi EngrStudent,
Unfortunately, LabVIEW does not currently offer support for strict Boolean controls with 3-state capability. However, there are numerous workarounds of varying complexity that will allow you to implement functionality similar to a stop-light.
This thread might be a good place to start:
This problem is also documented in a number of other threads on the forums already. I would recommend a quick Google search if the above thread is unable to help you.
Duncan W.
06-09-2017 03:05 PM
There is an XControl here that is like a tristate boolean (if there is such a thing). Haven't downloaded it to try it out but it looks nice.
06-09-2017 03:16 PM
By definition, a boolean only has two states, so it cannot be a boolean datatype.
LabVIEW has the mixed checkbox that I use occasionally.
in the more general case I would use a colorbox (that can e.g. be made to look like an LED).
... hmmm, I see that the above link already points to my similar response from 9 years ago. Nothing has changed! 😄
But there is also this idea that is worth voting for. 🙂
06-09-2017 04:51 PM
@altenbach wrote:
But there is also this idea that is worth voting for. 🙂
Yes, indeed! Another vote added ...
Bob Schor
06-09-2017 05:01 PM
Another option would be a picture ring.
06-10-2017 08:12 AM
@altenbach,
I didn't like it being a boolean with 3 states. To be a boolean it could have any number. A binomial is intrinsically 2-state, but boolean techniques work with multinomials. I think a trinary indicator is more technically correct, but I couldn't be sure folks would know what I meant.
I was hoping for a built in.
06-10-2017 08:34 AM - edited 06-10-2017 08:36 AM
EngrStudent wrote:
I was hoping for a built in.
well, there exists a "3-Zustands Feld" or "Mixed Checkbox" under
Frontpanel>Elements>System>Mixed Checkbox
http://zone.ni.com/reference/de-XX/help/371361N-0113/lvhowto/configure_mixed_checkbox
06-10-2017 11:38 AM - edited 06-15-2017 10:31 AM
@EngrStudent wrote:
To be a boolean it could have any number.
According to Wikipedia, " the Boolean data type is a data type, having two values (usually denoted true and false),"
So, yes, any set with two possible values can be represented by a boolean (exactly one bit!), e.g. (500, -3), (Red, green), (light, dark).
@EngrStudent wrote:
A binomial is intrinsically 2-state, but boolean techniques work with multinomials. I think a trinary indicator is more technically correct, but I couldn't be sure folks would know what I meant.
Why are you mentioning binominals?
Ternary logic is well defined, but these are not booleans and need more than one bit to represent the value. The mixed checkbox I mentioned earlier is more of a cosmetic thing, because you cannot do ternary logic with its value directly. I typically use it to represent (All, some, none) when selecting other items.
From reading your question, you simply want an indicator with a limited set of values. LabVIEW has plenty of those. Look at rings and enums. In particular you can use a picture ring indicator with three colored images (as I suggested already) and you are already there. You can even give each state a name (e.g. red|green|Yellow). So yes, there are "built-ins" 😄
The color LED is useful for fancier UIs, e.g. when you want the color to change gradually between states.
06-15-2017 10:28 AM
I was thinking of boolean in the sense of binary adder from boolean algebra, from my digital logic class. (link)
I'm sorry for any confusion.