From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Front panel control with 3 states?

Solved!
Go to solution

This may be an odd question but is there a front panel control for a button (and indicator) that has 3 states?  I don't mean a radio button. I am looking for a single control, let's say a button, that when you click it changes from On (bright green), to Off (dull green) to Inactive or Don't Care (grey).  The usage is "wait for inputs" User control (typedef) that will let the user select which inputs must be on, which must be off and which they don't care. I could use a Ring or Enum control but this is not ideal.

0 Kudos
Message 1 of 14
(4,706 Views)

Mixed Checkbox does this.  You could also use an enum with three states.  Theres also has been lots of discussion on tri state booleans on the forums.

 

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Tri-State-Boolean/idi-p/1139952

Message 2 of 14
(4,697 Views)

Like Hooovahh mentioned, it is easy enough to have this functionality with an enum.

 

Tristate.png

0 Kudos
Message 3 of 14
(4,686 Views)

I would like to use it at a typedef control... and so I don't think that the solution can have any code behind it. I thought of an X-control but not sure if this can be included in a typedef. I'm sorry I did not think to search for the term "tristate" or "tri-state". I will check out the Mixed Check box.

0 Kudos
Message 4 of 14
(4,678 Views)

I don't think you can typedef an x control... but I don't see how you would need to.  If you change the x control's facade or data type, it will change all instances of it throughout the application same way that a typedef would.

0 Kudos
Message 5 of 14
(4,665 Views)

I looked at the System Mixed Checkbox. Unfortunately I cannot change the appearance. I would like it to look like a button (or LED). Even if I accepted the system appearance of the mixed checkbox, since the data type of the Mixed Checkbox is unsigned 8-bit and my inputs are boolean, how would I compare the two?

0 Kudos
Message 6 of 14
(4,663 Views)

In the Idea Exchange post that Hoovah linked to, there is an XControl posted with 3 states that correspond to error wires (no error, warning, error).  Play with that and see if it works for you.

 

http://forums.ni.com/t5/Example-Program-Drafts/Simple-Error-Out-XControl/ta-p/3492791

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 7 of 14
(4,652 Views)

@BowenM wrote:

... but I don't see how you would need to.


Because of how I am using the control in application I need to define a data type with typedef. I will have several of this tri-state controls in a user control, typdef'd to ensure the correct data type is being passed into various places in the code. I am also using it with a ToVariant and Variant to Data function and so I believe the Variant To Data vi needs to have a Type (i.e. my typdef) as an input.

I might live with the look of the Mixed Checkbox. Again, though, how would I compare the Uin8 to the boolean of my digital input and mask out the Don't care (uint=2)?

0 Kudos
Message 8 of 14
(4,645 Views)

@EduNI wrote:

@BowenM wrote:

... but I don't see how you would need to.


Because of how I am using the control in application I need to define a data type with typedef. I will have several of this tri-state controls in a user control, typdef'd to ensure the correct data type is being passed into various places in the code.


Define your enum somewhere as a typedef. Then simply drag the typedef into the XControl's data element, which will set the type of the XControl. The data type of the XControl will be your typedef, but places which need just the data won't rely on the XControl.


___________________
Try to take over the world!
Message 9 of 14
(4,605 Views)

You can use an enum, or a ring, or a combo box, or one of the attached controls.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 10 of 14
(4,584 Views)