LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to have an indicator show how old its value is?


@VictorClaessen wrote:

Sounds good, but you've lost me. So what you are showing now is the subVI. (The bundling remark I get.)

 

The best I've come up with so far is that you want me to to call this subVI, from the main loop of the parentVI, for all the indicators I have on the front panel of the parent? [by passing them as a reference?] But then the parentVI will have to check wether the value has been updated? Why not do that in the subVI?

 

BTW Would it be possible to attach your VI to this post? I'm using 2011 so I can't import your snippet as is.


Yes, what I put up was a suggestion for a subVI using the code in your post as a starting point.  I don't know how many indicators you have on your front panel, nor how many you want to show their update age. What I am suggesting is that you stick this in between the point where the indicator value can be changed and the indicator itself. You don't have to pass things as references, just wire the data you need to the connector pane of the subVI.

 

Thinking about it further (I have slow neurons sometimes), scratch the last snippet I posted. You don't even need a loop at all. All you need is the information of when the indicator was last updated available (you could record that in the mainVI). Remember, your indicator could have been updated resulting in the same value as the previous one, so just checking numbers for change won't do what you want.

 

Whenever you refresh the indicator(s), you don't need any "Update?" control - just feed the lastUpdate value into the subVI and you'll get the right color number, which you can feed directly into a property node for the main VI FP indicator. Since you are just calculating a number, you don't even need to use the indicator itself in the subVI, as long as you remember which one it was (this is where the array of clusters in the mainVI comes in, to permanently link the two: indicator + lastUpdateTimestamp). Just remember to update your timestamp in the mainVI if you are updating this indicator. That simplifies it even further.

 

So, here's the (greatly simplified) snippet, 1 input, 1 output:

 

original.png

 

I don't have LV 2011, but it's so small (and you've got 90% of it in the VI you uploaded), it's probably quicker just to wire it up, anyway.

 

Good luck,

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 11 of 14
(438 Views)

I really didn't want to have to change the parent program a lot, so what I've come up with now is the following. [I suppose I could work a bit more on the names of the VI's].

 

"value age.vi" is the parent, which calls the subVI "parentcontrols2.vi" every main loop iteration

 

On the first execution, parentcontrols2.vi scans its parent for digital indicators, and registers an 'value change' event for each. Each time that event fires, the last-update-timestamp is reset. In case of a timeout, the background becomes increasingly red.

 

Seems to work (I will have to see how well this scales). Only caveat is that now the parent will have to use the value-change-(signalling)-property-node to update indicator values, or else the value-change-event in the subVI won't fire. But it seems less screen-cluttering this way than keeping track of changes of each indicator in the parent VI.

Download All
0 Kudos
Message 12 of 14
(407 Views)

VictorClaessen wrote:
  • The XControl way seems very flexible, but also a lot of work.

Not if you know what you're doing. The attached example only took a few minutes. I used the actor framework because it's faster to write the code, but the entire AF code could also be replaced with code that's easier to understand in just a few minutes more. You basically need to launch a copy of reentrant VI and communicate with it. Pretty much all the actual code in this example is contained in the facade VI and the daemon class.

 

 

Cameron, the Code Capture Tool can back-save snippets and it doesn't mess up your property nodes when creating them.


___________________
Try to take over the world!
Message 13 of 14
(377 Views)

Thanks, tst. I haven't used the LAVA or OpenG tools much yet, I know I need to get to know them better because I'm certain I'm reinventing the wheel often.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 14 of 14
(344 Views)