From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a .NET reference from C# to called VI

I have a .NET application written in C#.
I wish to call a LabVIEW VI from my application. I'm using VirtualInstrument.Call to call the VI.
 
The question:
Has anybody managed to do the same AND pass a .NET object reference to the VI (and maybe also return one)?
 
I have searched the entire internet for a solution, but with no luck. I will extremely happy if anybody could help me with this.
 
(I'm using LV8.2 and .Net 2.0)
 
Cheers,
Jan
0 Kudos
Message 1 of 4
(2,544 Views)
Have you tried using the SetControlValue method?  You have the data as "flatted data".  I've never used this, but it seems to be the answer to your problem.

Yohan
0 Kudos
Message 2 of 4
(2,542 Views)

Yohan,

As I see it the parameter types are just the same as in the Call(2) method? - the value is a Variant and: "The values of parameters can be numeric, Boolean, string, or array." (from LV doc).

So how do you mean a .NET System.Object reference can be flattened (in C#) and passed through a Variant?

/Jan

0 Kudos
Message 3 of 4
(2,537 Views)
I'm sorry but I have no experience in C#... so I really don't know how you could proceed to flatten the .NET reference.
0 Kudos
Message 4 of 4
(2,520 Views)