LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to initialize the variables in the subvi when the main vi running?

Hi, friends!
 
Now I am working on a project with labview. I make a main vi  including many subvis.
 
When the main vi running, I want to reinnitialize the variables in the subvi to zero.
 
I know that I can realize that  using the local variable when I enter the subvi,
 
but I want to keep the the values when I left the subvi and saw them when I
 
click in this subvi again. So, I do not reinitialize the subvi when it runs. But, I
 
don not know how to reinitialize the indicators in the subvi when I run the main
 
VI in the first instance. I try to use the global variables, but it seems do not work
 
well. Would you like to give me some advice? Thanks a lot!
 
 
 
0 Kudos
Message 1 of 3
(3,090 Views)

Hi dec,

      If I understand your question, try using the "First Call?" node in your Sub-VI - to initialize values the first time the VI executes every time the top-level VI is Run.

If this doesn't work for you, just post again!

Cheers.

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 2 of 3
(3,086 Views)
Thank you for your helpful reply
 
The First call.vi works well.Smiley Very Happy
0 Kudos
Message 3 of 3
(3,068 Views)