02-08-2010 11:14 PM - edited 02-08-2010 11:17 PM
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?
02-09-2010 12:00 AM
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
02-09-2010 12:41 AM
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.
02-09-2010 05:31 AM
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