08-28-2017 12:26 PM
In LabVIEW, a Boolean actually can be in three states: TRUE, FALSE, or NOT EXECUTED. How can I make an indicator that shows that data it is displaying is not yet valid?
Thanks
Solved! Go to Solution.
08-28-2017 12:31 PM
NaN works in floating point indicators.
You could also disable-gray out indicators until they are written to.
Ben
08-28-2017 12:58 PM - edited 08-28-2017 12:59 PM
Similar to Ben's, you can change the color using a property node. At a point where the the indicator has not been updated, make the colors grey and grey. Then later, change them back to dark green and bright green, or red and green, or whatever you want to use for False and True.
Also, it might be a good idea to write to the Caption.Text property (and make sure the caption is visible). Some people have trouble distinguishing colors of the Boolean, so if you add some text like "Test Failed/Passed" it could be helpful.
08-28-2017 01:03 PM
Thank you so much for replying. A particular indicator has a "property" of disable/greyed out. I can see that one may write a vi to set this property, given the label of the indicator. How might one determine if a particular node has actually been executed, to trigger this Vi? A comparison to TRUE "ored" with a comparison to FALSE? Do you think that would work?
08-28-2017 01:20 PM
Simple data flow with the error cluster is the most common way. You could also just have a simple boolean control on your VI but just not use it. That would also be enough for data flow to dictate when your subVI will run.
08-28-2017 01:26 PM
File under completely correct but the very definition of Over-kill...
Create an X-Control that disables the indicator when it starts and changes the disable state the first time it is executed.
Ben
08-28-2017
01:28 PM
- last edited on
12-14-2025
05:03 PM
by
Content Cleaner
@cliff1001 wrote:
In LabVIEW, a Boolean actually can be in three states: TRUE, FALSE, or NOT EXECUTED. How can I make an indicator that shows that data it is displaying is not yet valid?
No, a boolean can only be in two states, true or false. An indicator has it's own memory and the current state remains until a new value is written. When opening the VI from disk, the initial value will be the default value for the indicator. If you need three state, you could e.g. use the mixed checkbox. You could also use a colorbox indicator and display one of three colors, depending on state. Make sure the "Not executed" is written as a first step when the code is run.
Yes, as others have said, you can also disable/grey it (but be careful, this can still show true or false even if greyed, possibly leading to confusion!). It might be better to change the visibility with a property node and hide it until it gets new data.
Often I use arrays of booleans. here you can have a default of "empty array" and it will show greyed until the array has a nonzero number of elements. No proerty node needed.
08-28-2017 01:31 PM
@cliff1001 wrote:
In LabVIEW, a Boolean actually can be in three states: TRUE, FALSE, or NOT EXECUTED.
Not true. A boolean can be in three states: Enabled, Disabled, or Disabled/Grayed. This is not the same as the value it holds. The value can only be true or false. If it hasn't been "executed", as you call it, its value is whatever you set as the default value.
You can turn this functionality that you are looking for, into an XControl and if you aren't familiar with XControls yet, this might be a simple example to learn with. On init, the boolean is disabled and greyed. When its value is updated, the state can be changed to Enabled.
08-28-2017 01:35 PM
Sorry if I am asking stupid questions, but when I create a property node for an indicator, it allows only reading the property, not writing of the property. When I create a property node for a control, I am allowed to enable or disable it. Does this seem correct?
08-28-2017 01:51 PM
Right click the property node and Change to Write.
Then right click on the input to that property and create a constant so you'll get the right typedef value for Enabled, Disabled, or Disabled and Greyed that you can set.