LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C# DLL import

Hello there,

 

I have a third-party C++ DLL that I cannot directly import into LabVIEW 8.5 because it incluses a function pointer, which is - from what I could see on the forum - not handled by LabVIEW.

So I have made a C# (.NET) DLL to handle this callback function (function pointer) so I can interface it with LabVIEW (hoped so). I have made a C# Test application and confirmed that my C# Dll is operational.

Unfortuenatly, I tried today to use that C# DLL into LabVIEW without any success.

From what I could read, only C++ DLLs can be imported (with "Call library function node").

There is also a .NET palette, but looks like (I am not sure about this) it can only handle .NET controls and not .NET DLL functions.

 

So, do I have no other choice than making the DLL in C++, or is there a way that I can use my C# DLL into LabVIEW ?

 

Thanks

Raphael

0 Kudos
Message 1 of 3
(4,951 Views)

Raphael,

 

You can certainly use your C# .NET DLL in LabVIEW.  The Call Library Function node is just for traditional DLLs, although .NET assemblies use the same extension they are quite different in the way they are implemented.

 

The functions you need are in the .NET subpalette of the Connectivity palette.  You'll want to start with a constructor node and then use an invoke node to call your function.

 

Here's the relevant help link:

 

http://zone.ni.com/reference/en-XX/help/371361D-01/lvcomm/dotnet_pal/

 

Good luck!

 

~Simon

Message 2 of 3
(4,945 Views)

Hi Simon,

 

Thanks a lot, I missed that "Constructor node" and therefore could not see my functions in "Invoke node" ...

It is working fine now 🙂

0 Kudos
Message 3 of 3
(4,935 Views)