LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a boolean indicator show 3 states instead of 2

Solved!
Go to solution

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?

0 Kudos
Message 1 of 10
(7,702 Views)
Solution
Accepted by topic author EngrStudent

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:

3-State Control w/ Colors

 

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.

Message 2 of 10
(7,684 Views)
Solution
Accepted by topic author EngrStudent

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.

aputman
0 Kudos
Message 3 of 10
(7,657 Views)
Solution
Accepted by topic author EngrStudent

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. 🙂

Message 4 of 10
(7,650 Views)

 


@altenbach wrote:

 

But there is also this idea that is worth voting for. 🙂


Yes, indeed!  Another vote added ...

 

Bob Schor

0 Kudos
Message 5 of 10
(7,631 Views)

Another option would be a picture ring.

0 Kudos
Message 6 of 10
(7,628 Views)

@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. 

0 Kudos
Message 7 of 10
(7,597 Views)

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

 

3-state.png

 

 

 

http://zone.ni.com/reference/de-XX/help/371361N-0113/lvhowto/configure_mixed_checkbox

Message 8 of 10
(7,591 Views)

@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.

 

0 Kudos
Message 9 of 10
(7,581 Views)

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.

0 Kudos
Message 10 of 10
(7,516 Views)