LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help loading DLL in labVIEW project

I have a DLL that was written in C# that I want to load it to my labVIEW project. I have never done this before, so I need help. I chose Connectivity-Call Library Function Node then loaded my DLL. After, under function name, I typed in the function name from the code. I don't know what to do with other like Parameters.

 

They don't let me attach dll file Smiley Sad

 

Can someone explain how to set the parameters and etc?

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

Whilst C# also uses the file ending "DLL", it is not an ANSI C DLL. The CLFN (call library function node) is meant to call ANSI C DLLs.

 

That being said, you have to use the .NET API in LV to call your C# DLL (assembly!). Use a .NET constructor node to create your top level object and then use properties and methods to navigate in the tree of objects a available in the .NET assembly.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(3,071 Views)

Thank you Norbert

 

Now I just need to wire the DLL to the correct one. Can you help me with this?block diagram.jpg

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

Well, it seems that you really need to learn quite a bit about .NET (ActiveX is very similar!) first.

The constructor node in your code creates an object in your .NET CLR (Common Language Runtime). This object exposes properties and/or methods. Use Property Node(s) and Invoke Node(s) to access these. Usually, you get references to other objects which you can work this.

 

Remember the golden rule for ActiveX and .NET:

Close all references you created in your LabVIEW code on your own (using Close Reference)!

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 4
(3,024 Views)