02-18-2015 01:15 AM
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 ![]()
Can someone explain how to set the parameters and etc?
02-18-2015 02:10 AM
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
02-18-2015 05:16 PM
Thank you Norbert
Now I just need to wire the DLL to the correct one. Can you help me with this?
02-19-2015 02:20 AM
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