LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI retain control values from previous call

Hey !

 

I have a subVI in my code which is being called again and again for the new data. I want the subVI to retain the control values (other than data) from the previous call. There is no while loop, code in subVI only run once. Flow is simple. Data comes in, based on other controls an output is generated and passed back to orignal code.

 

Problem i am facing is that the controls in SubVI get initialized to default values at each call. What can i do about it?

Message Edited by Alann on 02-08-2010 11:17 PM
0 Kudos
Message 1 of 4
(3,583 Views)

Hi

For doing this put your code in while loop and connect true boolean to stop terminal, for making sure you are running loop only one time

Use shift registers for passing the data so that will save the previous values.

 

Hope this helps

Regards

Santosh

 

 

Message 2 of 4
(3,572 Views)

can you be a more specific on the question?

 

Is your subvi is called by other vi's? (thats what i understand). would like to have the values in the controls to be the same everytime? if this is so then change those "controls" to "constants" with the data or pass constant values to the controls (using the connector Pane) when this subvi is called from other vi.

Regards
Guru (CLA)
0 Kudos
Message 3 of 4
(3,563 Views)

If the sub vi's controls are wired to changing variables in the calling vi then they should be updated with each call.  However check the vi's properties (Menu -> File -> VI properties).  Look at the execution properties and see if it is re-entrant, often re-entrant vi's are set such that they will not show panel updates etc if they are sharing memory / debugging is turned off even though they are still doing what you would expect of them.

 

Craig

LabVIEW 2012
0 Kudos
Message 4 of 4
(3,548 Views)