Error 1 Occurred at Incorrect Function When Using TestStand API in LabVIEW

Updated Nov 6, 2023

Reported In

Software

  • TestStand
  • LabVIEW

Issue Details

My TestStand sequence has a LabVIEW action step that calls another VI asynchronously while passing a Sequence Context reference to it, as shown in the image below.
 
image.png

The asynchronous VI is meant to use several TestStand API functions, like the TestStand – Start Modal Dialog VI. Nonetheless, when executing the TestStand sequence, I observe the error shown below. How can I solve this issue?
 
image.png
 
Error 1 occurred at Incorrect function.
in TestStand - Start Modal Dialog (Sequence Context).vi->Main.vi->Main.vi.ACBRProxyCaller.41000066

Solution

This issue happens because TestStand ActiveX references, including the Sequence Context one, close automatically when a VI code module finishes executing and returns to TestStand. To keep an ActiveX reference around, you can wire it to a Variant to Data function, as shown in the image below. 
 
image.png
 
A detailed explanation of the behavior can be found in the TestStand Help resource: Duplicating COM References in LabVIEW.