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 - edited 08-28-2017 01:32 PM
@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.
08-28-2017 01:51 PM
A few properties are Read-Only but generally you right click the property node and choose Change To Write. If this option is greyed out then it is read-only.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-28-2017 01:53 PM - edited 08-28-2017 01:55 PM
Some properties are read/write and some are read-only. You can right-click the property and change from read to write if it's allowed for that property. You can also right-click the property node itself and toggle all properties that allow it at once.
EDIT: Must learn to type faster.
08-28-2017 01:57 PM
@Ben wrote:
File under completely correct but the very definition of Over-kill...
Spoiler
Create an X-Control that disables the indicator when it starts and changes the disable state the first time it is executed.
It may be overkill for one indicator but a BD-saver for many.
08-28-2017 02:40 PM
I appreciate all the ideas and discussion. I will work on designing a solution based on these ideas. Thanks
09-06-2017 11:17 AM
Hello: I created a vi that consists of an LED that is greyed out or is not greyed out, using a property node. This works fine.
I create a sub-vi from this vi and it no longer works. I guess that my property nodes are not referencing the Boolean indicator of the calling VI.
How should this be done correctly?
The indicator vi that works is "indewenable.vi" and the calling program is "tester.vi".
Thanks for your help
Cliff
09-07-2017 04:21 AM
Create a reference to the indicator and pass that into your subVI.