LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

updating numeric indicators in *cluster* from a subVI

So in my main VI I basically have a cluster of a dozen indicators that display current, temperature, etc of some DUTs. This cluster of indicators is on display in the front panel.. and I want to be able to update these indicator values from a subVI. The tricky thing is, i want to be able to update only a few of the indicators at a time.(for example if only one of the DUTs is enabled I want to update only the indicators pertaining to that DUT).

 

 I've found the follwing solution to update an indicator of a main vi within a subvi using refnum and property node to write...but wondering, how do you handle it with a cluster, especially when you only want to update some of the indicators in a cluster?

http://forums.ni.com/t5/LabVIEW/Update-string-indicator-from-a-sub-VI/m-p/948888/highlight/true#M425...

 

I've gotten to this point so far. I'm not too familiar with working with refnums/property nodes so not sure how exactly to change only one or few of the elements in a cluster this way. Thanks in advnce for any help!

IndicatorCluster.jpg

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

Read the current value wire it to a bundle by name center terminal, bundle the changed values into the cluster you read, write the updated cluster value back to a p-node


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 4
(2,609 Views)

You can right click on an element of a cluster and make a reference of that specific element.

0 Kudos
Message 3 of 4
(2,579 Views)

Generally, it isn't really a good idea to update GUI values from a subVI.  When writing to a poperty node, it causes a thread swap, causing your code to get really slow.  You are better off passing your value out of your subVI and letting the main VI handle the change in the value.

 

Or, what I much prefer, is use a User Event to pass the new value to the Event Structure on your GUI VI.  You can then write directly to the terminal that way.  In your case, you would want to keep the cluster value in a shift register and just use the Bundle By Name to update the value.  Write to the cluster terminal outside of the Event Structure (but inside of the loop the Event Structure is in).


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 4 of 4
(2,539 Views)