LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Application Reference to Restore Defaults

I have a simple Matrix operation that will find the values of rank, eigenvalue,inverse, etc. of my Matrix A
 
I used a while loop so that I can easily change my entries of Matrix A, and observe the associated parameters like inverse, rank etc.
 
Normally, when I click the stop button, the VI will stop and retain the values in the control and indicators. Hence, when I click on run again, it will start with the last values of the control and indicators.
 
However, I want a situation whereby, when I click the stop button,the control and indicators will attain thier default values.
 
Of course one obvious way is to wire the default value to the property node value or local variable of each control or indicator, using stack sequence.
 
Is there a way to let the entire control and indicator take on their default values, once the STOP button is pressed, without individually wiring default values to the local variable or property node value of each control and indicators.
 
I have attached the VI.
 
Thank you.
0 Kudos
Message 1 of 4
(2,878 Views)

Yes, create an reference to the current VI and use an "invoke node" with method "Default values.Reinit all". I added an event case that performs this operation if the VI is stopped or the reset button is pressed.

Attached is a quick modification. You should really use an event structure instead of a loop without wait. Currently, your VI recalculates the same results with the same old input array millions of times per second, consuming all CPU in the process. You only need to calculate the results (1) when the VI starts and (2) if the input matrix changes.

You might also want to use a matrix control (instead of a 2D array) to avoid all these coercion dots.

Message 2 of 4
(2,870 Views)

Of course you don't even need to create the reference to the current VI, simply place an invoke node, select the right class (see image) and the right method.

Message Edited by altenbach on 08-26-2007 11:21 AM

Message 3 of 4
(2,866 Views)

Thank you very much Altenbach.

Very instructive and concise.

0 Kudos
Message 4 of 4
(2,853 Views)