LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

re-seting "first call?" in sub VI

 I am trying to use the 'first call?" thinger in a sub-VI.  I thought it would re-set when the sub-VI was closed, but when it is called again, the "first call?" thing does not give me a true.  Is there any way of correcting this?
0 Kudos
Message 1 of 7
(4,170 Views)

The first call does not get reset because your subvi is still in memory even when it is closed. Post an example of what you are trying to do and a brief explanation and i can help you out.

 

 

 

 

 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 7
(4,165 Views)

Sorry, can't post the code.  However, can you give me a hint on how to remove it from memory, or is that not practical.

PS.  I think I may just use a whole bunch of variables, and do it all manually.

0 Kudos
Message 3 of 7
(4,161 Views)
The state has nothing to do with the visibility of the front panel, it will reset every time you newly start the toplevel VI.
 
For any given run (not subVI call!), "first call?" will be true exactly once.
 
 
If you want your case to be true every time the subVI is called, replace it with a TRUE boolean diagram constant 😉 Another option would be an initialized shift register. It really depends on the details of your code.
0 Kudos
Message 4 of 7
(4,161 Views)
That's what I figured.  Do it it manualy seems rather archaic though.
 
Thanks
0 Kudos
Message 5 of 7
(4,158 Views)
If you are likely to need to reset a VI more than once during a run, it is useful to put an Initialize control on it. Inside a case structure has Initialize and Run cases (or more if you need them).

Lynn
0 Kudos
Message 6 of 7
(4,140 Views)

I saw it is an old thread but if somebody needs it here is the solution. Replace the "First Call?" function with a Shift register and different states.

Download All
0 Kudos
Message 7 of 7
(2,791 Views)