Passing .NET Object Reference Between TestStand and LabVIEW

Updated Feb 13, 2025

Reported In

Software

  • LabVIEW
  • TestStand

Issue Details

I am observing Error 1172 with the following description after passing a .NET object between TestStand and LabVIEW and then try calling a method:

 

Error Calling method (…) object passed in does not match the type expected OR if the object you are passing is from another app domain, the object could not be marshalled to LabVIEW. For possible reasons see :Info code goes here, (System.Reflection.TargetException: Object does not match target type.) System.Reflection.TargetException in (…).

LabVIEW: (Hex 0x494) A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.

 

Is it possible to pass a .NET object reference from TestStand to LabVIEW and vice versa?

Solution

It is not currently possible to pass .NET references between the TestStand .NET adapter and LabVIEW. Both environments create separate application domains in which they operate. Therefore, references created in LabVIEW cannot be used with the TestStand .NET adapter and vice versa.

You can pass .NET references from LabVIEW into TestStand and store these in object reference variables to then pass back into other LabVIEW code modules. 

When supported, you may use .NET Remoting to share .NET objects between TestStand and LabVIEW.