01-30-2017 02:02 PM - edited 01-30-2017 02:08 PM
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.
Solved! Go to Solution.
01-30-2017 02:09 PM
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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-30-2017 02:15 PM
Like Hooovahh mentioned, it is easy enough to have this functionality with an enum.
01-30-2017 02:18 PM - edited 01-30-2017 02:20 PM
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.
01-30-2017 02:37 PM
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.
01-30-2017 02:39 PM
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?
01-30-2017 02:44 PM
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
01-30-2017 02:53 PM - edited 01-30-2017 02:55 PM
@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)?
01-31-2017 01:50 AM
@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.
01-31-2017 06:53 AM
You can use an enum, or a ring, or a combo box, or one of the attached controls.