When TestStand passes an ActiveX reference to a LabVIEW code module, the reference automatically closes when the called VI completes executing and returns to TestStand. Wiring the reference to a global variable or to a shift register in another VI does not prevent the reference from closing. Consequently, any subsequent use of the original reference within LabVIEW fails.

Use the LabVIEW Variant to Data function to create a duplicate reference for use after calling a VI. Wire the original reference to the type and variant inputs of the Variant to Data function and wire the data output to a global variable, as shown in the following figure.

The reference in the global variable prevents TestStand from releasing the referenced object until you explicitly close the reference in LabVIEW or until TestStand unloads the code module into which it passed the reference.

When LabVIEW no longer needs the duplicate reference, read the global variable and wire the reference to the LabVIEW Close Reference function to close the reference. Wire the global variable to the LabVIEW Not A Refnum constant to close the global variable, as shown in the following figure.