LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize Many SubVIs dynamically

I am writing drivers for instruments and creating a cache in each subVI to store the data it is writing to the instrument. Is there someway that I could initiate the initialize or clear case of these subVIs dynamically... I guess I just don't want to have to put all of the subVIs for each driver on a block diagram to initialize and/or clear them all. Is there some other clever way to do this? I was thinking of using First Call? Is there some variable or something that I could put inside of each SubVI that would cause them all to initialize and clear when I send the command? Thanks for your help

0 Kudos
Message 1 of 6
(3,372 Views)

If I understand the question right, First Call sounds like a good choice.

 

If you want to "send a command" then you could consider using a notifier.

0 Kudos
Message 2 of 6
(3,368 Views)

I don't think First Call? would work that well because, I may continually run different test phases, and at the onset of each test phase I may want to re-initialize everything. The only thing with the notifier is that there will be no way to tell when all of the SubVIs have initialized, because they will only initialize when they happend to be called for something else. So I won't know when to change the notification to something else... Hmmmm.. Maybe the best way is just to explicitly initialize each VI 

0 Kudos
Message 3 of 6
(3,364 Views)

Invoke node -> Reinitialize to default.

 

If you use sub-vi's as cache i can recommend to make them as AE's (Action Engines) where you have an Initialize-command that calls the above node.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(3,343 Views)

Thanks for your reply Yamaeda,

 

They actually are AE's, and there is a action called initialize. I have never used invoke node before, I just checked it out but still a bit unclear on how I could use this to reinitialize all my VIs...

0 Kudos
Message 5 of 6
(3,335 Views)

The invoke node only applies to the VI in question, but i dont really see how it could be useful to reinitialize all VI's, as most (usually) is some kind of calculation from an input. 🙂

The AE's need an initialize command, but i usually send an empty array or a constant to the shift register.

What's the goal of this reinit?

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 6
(3,307 Views)