Dynamically Load and Run Another VI in Parallel to My Main VI

Updated Nov 6, 2023

Reported In

Software

  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

I am using a Call By Reference Node to dynamically load and run a pop-up VI from my main VI. While the pop-up VI is running, the main VI will not run in parallel and is stuck because it appears to be dependent on the Call By Reference Node. How can I dynamically load and run another VI in parallel to my main VI without blocking its execution?

Solution

When you use the Call By Reference node to run a VI, the VI does not run under its own execution. The main VI will be dependent on the Call By Reference Node and will not run in parallel.  

LabVIEW 2011 and later:
In LabVIEW 2011, you can use the Start Asynchronous Call and Wait On Asynchronous Call nodes to easily run subVIs in parallel with the main VI. Refer to the Asynchronously Calling VIs for additional details and examples. 

LabVIEW 2010 and earlier:
In LabVIEW 2010 and earlier, to dynamically load and run a second VI in parallel to the main VI, you must call the VI using an Invoke Node with the Run method. You must set the Wait until done option to FALSE to eliminate the data dependencies of this VI as shown in the Community Examples linked below. If you want to display the front panel of the called VI, you must use a Property Node with the property Front Panel Open. This will allow the main VI to continue to run in parallel after the pop-up VI is running.

You can also use Set Control Value and Get Control Value methods to pass data back and forth between the main and pop-up VIs.

The Community Examples in the Related Links section demonstrate using Invoke Nodes, Methods, and Property Nodes to call and run subVIs in parallel.