Enable the Reserve Loaded VIs for Execution option in the LabVIEW Adapter Configuration dialog box to reserve any VIs TestStand loads for calling with the LabVIEW Adapter.

Use this option to avoid reloading VIs when they are used and to make references you create in a VI you call from TestStand—such as I/O, ActiveX, and synchronization references—persist across calls to other VIs. You can store these references in a TestStand property and pass them to subsequent VIs you call from TestStand.

Editing a Reserved VI

When you open a reserved VI in LabVIEW, the Run arrow indicates the VI is reserved, and you cannot edit the VI.
To edit a VI TestStand has reserved, click the Edit VI button on the LabVIEW Module tab in the TestStand Sequence Editor or on the Module tab of the Edit LabVIEW VI Call dialog box in a TestStand User Interface. You can also right-click the step and select Edit Code from the context menu to open the VI in TestStand.

You can also select File»Unload All Modules in the TestStand Sequence Editor before you open the VI in LabVIEW.

Closing References to a Reserved VI

You must close any references you create to VIs. When TestStand loads and reserves VIs, LabVIEW does not automatically close the references until TestStand unloads the VIs that created the references. Failing to close the references might result in a memory leak in the test system.

Reserving VIs Affects the LabVIEW VI Server Run VI Method

By default, TestStand enables the Reserve Loaded VIs for Execution option in the LabVIEW Adapter Configuration dialog box so that all VIs TestStand loads remain in memory. Enabling this option improves execution time because TestStand does not need to load and unload VIs.

When running a VI reserved for execution, LabVIEW creates a proxy VI to call the VI configured in the TestStand step as a subVI of the proxy. Therefore, LabVIEW considers VIs called from TestStand as subVIs.

When you open and run a subVI as a top-level VI in LabVIEW, LabVIEW returns error code 1000. Additionally, if you use the Open VI Reference function to open a VI that TestStand marks as reserved for execution, the VI opens as a top-level VI, and you then use the VI Server Run VI method, LabVIEW returns error 1000.

You can use the following techniques to work around this LabVIEW behavior:

  • Create a wrapper VI that calls the VI as a subVI. You can then use the Open VI Reference function to open the wrapper VI and run it with the Run VI method of the VI Server.
  • Make the VI re-entrant.
  • On the Run Options panel of the Step Settings pane of the LabVIEW step that calls the VI, change the Load Option setting to Load dynamically and the Unload Option setting to Unload after step executes.