LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

resetting data in a sub vi?

I've been working on a master program that will call sub-vis based on input from the user. My sub vi's are excecuted multiple times throughout the program and all of them use shift registers and/or feedback nodes. In the past hooking up a blank constant to the initilizer terminal has worked for me in order to clear data between excecutions but for some reason in this larger program its not working. I think Labveiw may be treating each call of the sub vi as part of the same excecution. Is there a way around this?

"There will be water if God wills it"
0 Kudos
Message 1 of 4
(2,584 Views)

If the shift registers are initialized, the will reset the shift regsiter data with each call. If you use a globally initialized feedback node, it will only be initialzed on first run and not between calls. That might be your problem. (In both cases it will still initialize between executions).

 

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

Thank you I'll give that a try... I also found an optionin the configuration of my Feedback node that says intialization and has two options: First call or  compile or load. Any idea if that will also work?

"There will be water if God wills it"
0 Kudos
Message 3 of 4
(2,574 Views)

Create a new input to your subVI called Initialize? (F).  Boolean that is False by default.  It controls a case structure which either uses the shift register as is (in False case), or has the initialized constants (true case).

 

Now if you need to Reinit your subVI,  wire a True constant into that terminal of the subVI.

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