LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Boolean like control that can report back third error state

I have an array where each element is a cluster of five controls. One of the five controls in the cluster is a Boolean control button. In actuality I am using a Square LED indicator that I converted to a control since it has color and text string properties. In the application the user will press the Boolean control to open or close a physical hardware switch. However instead of just having the control change text and color based on what state the user inputs using the mouse I want to have a DMM confirm the open or closed state of the switch and update the control appropriately. This is easy enough to do with just the two states. However even though the user can only select one of two states the result from the DMM will be tri-state. Less than 5 Ohms is definitely a short. Greater than 100K Ohms definitively an open. Impedances in between will be returned with a warning since there may be a hardware issue. Without the array and just a single cluster alone I can easily do this by changing the background color of the control to red and the text to the warning. The True or False state of the Boolean isn't important when there is a warning so I just set it to False for simplicity.

 

With no array this is easy to do but once I put the cluster in an array I can't really do this trick anymore since each similar control in the array must have the same ON/OFF colors and text strings. I have fifteen clusters in the array each controlling independent functions. Most if not all will be properly reporting there actual state.

 

I am considering replacing the Boolean control with a Ring with which I can create three states with. However when I use a ring I come to the problem that only the DMM should be able to place the control in the red warning state while the operator should only be allowed to choose from the two valid states. However as far as I can tell if I disable one of the states of the ring control it disables it not only for a user but also from it being set programmatically. It seems like the only way to do this is to create two separate controls. Is there a better way? Thanks.

0 Kudos
Message 1 of 4
(1,275 Views)

Because an array has to have only different values and not properties, I've had a similar problem before.

 

What I did is that I made a cluster that didn't look like a cluster, type defined it, and made an array of that instead.  The cluster was:

* On top, the control that can be manipulated by the user

* In the middle, a "flat box" decoration stretched beyond the borders of the cluster, colored transparent

* On the bottom, a color box that was also stretched beyond the borders of the cluster.

 

Then, you read the state of the control, but write the color as a variable instead of a property.  The transparent flat box is there so that if the user clicks it, it doesn't click all the way through to the bottom and open up a color chooser window, it just does nothing.

 

I've attached an example VI showing the idea.

 

If that's what you're looking for, just go from there.  Stick a text box under the flat box too if you want a text string readout, etc.

0 Kudos
Message 2 of 4
(1,249 Views)

Use a colorbox, where the color is the value (It can be made to look exactly as an LED!) You easily assign a color for each possible state. No property nodes needed.

0 Kudos
Message 3 of 4
(1,240 Views)

I appreciate the responses. What I ended up doing was taking a suggestion made by PhillipBrooks in the topic "limiting visible enum choices"

 

 
and typecasted the Boolean button ("set state") the user presses to the tristate ring control ("get state"). This immediately updates the ring control to the desired state with a pale yellow background to indicate to the user the desired setting has been read and then once the DMM makes its reading it overwrites the ring control with the actual reading and appropriate background color. Similar to Kyle97330's recommendation above I overlapped the Boolean button on top of the ring control and made the button transparent. I didn't add a middle layer as a barrier though which I might do if it makes it more robust. I'm concerned that even though I physically placed the button on top of the ring that the layer order might not always be guaranteed and the user might inadvertently interact with the ring control. Thanks again.
0 Kudos
Message 4 of 4
(1,194 Views)