Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing cluster from visual c# to/from LV dll

Hi,

I would like to know the best way to pass a cluster from a visual c# program to a LabVIEW compiled dll that requires it as input.  Also, how to send cluster from the LV dll to the c# program.

Thank you
0 Kudos
Message 1 of 2
(3,092 Views)

Hello Swhich79,

are you already a little familiar with calling DLLs in LabVIEW? It is done via a "Call library function node" which you find on the functions palette. Here you can select a DLL (hopefully with typelibrary) and configure the parameters and the return value.

Concerning the data types that are stored in your cluster you won't face any serious problems as long as it simply consists of scalars and booleans. In this case you simply select 'adapt to type' in the call library function node. In the case of arrays and strings that are contained within the cluster you can't select this option, as the definition of a string and array in C# and LabVIEW are different. The only workaround for this would be to create some kind of wrapper or to split up the cluster (only input).

Yet another question that arises is: Why don't you use .NET assemblies? This is the most convenient way to pass data between your code and LabVIEW. Everything is completely integrated in LabVEW already.

Please let me know which modus operandi you prefer and if there are still some doubts.

Regards,

Christoph L.

NI Applications Engineer - Germany

0 Kudos
Message 2 of 2
(3,071 Views)