LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indicating that the node has not executed

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 16
(3,210 Views)

NaN works in floating point indicators.

 

You could also disable-gray out indicators until they are written to.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 16
(3,207 Views)

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.

0 Kudos
Message 3 of 16
(3,191 Views)

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?

0 Kudos
Message 4 of 16
(3,186 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 16
(3,172 Views)

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.

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 16
(3,167 Views)

@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.

0 Kudos
Message 7 of 16
(3,165 Views)

@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.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 8 of 16
(3,163 Views)

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?

0 Kudos
Message 9 of 16
(3,160 Views)

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.

0 Kudos
Message 10 of 16
(3,146 Views)

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.

0 Kudos
Message 11 of 16
(648 Views)

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. Smiley Frustrated

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 12 of 16
(643 Views)

@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.  Smiley Wink

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 13 of 16
(637 Views)

I appreciate all the ideas and discussion.  I will work on designing a solution based on these ideas.  Thanks

 

0 Kudos
Message 14 of 16
(627 Views)

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

 

 

Download All
0 Kudos
Message 15 of 16
(581 Views)
Solution
Accepted by topic author cliff1001

Create a reference to the indicator and pass that into your subVI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 16 of 16
(564 Views)