Error -18005 Occurred in TestStand Application Which Contain Two Threads

Updated May 8, 2024

Reported In

Software

  • TestStand
  • LabVIEW

Issue Details

I am running a TestStand 2019 f4 application. The application uses LabVIEW classes which stored as object references in TestStand, and contains two threads. The threads consist of monitoring thread and main execution thread.

Under certain conditions calling a LabVIEW class method, I get a TestStand error as follow:
-18005
"Parameter 'State in':
True
"Error"
""

Error -18005.png
The help manual only describes this as TS_Err_LVTypeConversionError.
I assume the error is from the LabVIEW adaptor, which is configured to use the runtime (2020 f2). It also might related to the lack of atomicity of reading / writing the object reference variable in TestStand due to having two threads.

How to resolve the error?

Solution

There are 2 possible methods to resolve the error.

  •  You can create cloned LabVIEW class objects for TestStand to reference (reference to give each execution its own class object reference to use). 
    This can be accomplished with a simple LV action step that could be called and just branches the class wire to multiple indicators so that TestStand has separate resources to use for each execution thread. Or,

  • You may need to check refnum when you create a constant from a .NET terminal in LabVIEW.
    For this, you need to construct the .NET object from a constructor node in LabVIEW, bundle it into a cluster, and pass that cluster out of LabVIEW.