LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Pre-Load/Run VI in background (hidden)

Hey all,

 

I have a tree control that I populate with hundreds of URLs.  Even after I deferr panel updates it still takes 5 to 10 seconds to finish loading.  I need to pre-load this VI in the background and then show it when ready.  This way everything will appear responsive.  Also, When I preload the VI I need to "call by reference" so I can pass a few parameters to it.  I have attached code but you won't be able to run it because there are too many VIs involved and I didn't want to get into all that.  Anyway, the hidden function, when inserted before the "call by reference" does nothing.  When the code hits the call by reference, it shows the front panel.  I can't put the hidden property after the "call by reference" bacause the front panel is a user interface (tree) so it needs user input to finish.  How can I do this?

 

Thanks

Matt

0 Kudos
Message 1 of 3
(2,619 Views)
0 Kudos
Message 2 of 3
(2,618 Views)

mattyk,

 

What you can do is branch the reference wire coming out of Open VI Reference then one branch will excecute the Call By Reference early in your code so it starts loading the tree. Then to make the front panel not pop up and make things hang is use Invoke node to close the front panel. The subVI won't be cleared from memory when closing though if you still have it waiting on user input, like an event structure. Also make sure this subVI's properties are not set to load the front panel when called or loaded. This setting is located under File>>VI Properties>>Window Appearance>>Customize.

 

Then in the main calling VI the other branch will go to what ever code needs to be running then when needed use the invoke node to set the subVI front panel to Standard to display the VI. I've attached a modified version of your code to show the basic architecture that I've explained here.

 

Regards,

Danny F 

Danny Funk -- Senior Group Manager -- Software R&D -- NI
0 Kudos
Message 3 of 3
(2,557 Views)