I try to achieve something like a .NET event handler, e.g. a .NET class that receives simple data during the run of a call to a LabView Interop assembly.
I'm not a LabView expert so i tried the following:
1. Create a singleton .NET class TestAttendant with some methods
2. Create a VI with a .NET Refnum as input and select the class TestAttendant, added the VI to Interop Build
> Build Error: Unable to identify/generate type information of a .NET refnum
3. Use a general .NET Refnum as input solved the problem. Resulting CLR signature is
public static void SetAttendant(NationalInstruments.LabVIEW.Refnums.LVBaseRefnum attendant)
4. Don't know which of the 279 derived types from LVBaseRefnum I should use to pass my TestAttendant singleton instance. I expect to do something with MarshalByRefObject?
5. Tried the other way around and called the singleton constructor twice, from .NET unit test and from LabView. Of course, both calls are done in different app domains, "IsolatedAppDomainHost: MyCompany.UnitTests" and "MyCompany.Interop.dll for Run"
Maybe my approach is not the best, I don't have to stick to the TestAttendant class. I only need some simple data during the LV run in the assembly from which i called the Interop.
Thanks in advance, Jonas