LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I call DLL written by C#?

I have a DLL which is generatedowever by using C# net . However, when I try to access the function in the DLL using LabIEW. There is no sub function shown up. Any suggestions? Thanks a lot
0 Kudos
Message 1 of 10
(19,147 Views)
You need to use the .NET Palette of nodes. You can check the LV help files on them, the examples/comm/dotnet examples or search this forum for .NET.

Let me know if you have any trouble.
0 Kudos
Message 2 of 10
(19,137 Views)
If you have a constructor for your .NET assemblies, go to Connectivity --> .NET --> Constructor Node. When you get the constructor node, browse and locate your DLL. You should be able to see your classes. Select the class you want. Then connect an invoke node to your constructor node. Now you should be able to select the methods in your classes (public). Hope this helps. If you have a dummy DLL, I can post an example for you.


Kudos are the best way to say thanks 🙂
Message 3 of 10
(19,130 Views)

Thank a lot. Get it work.

PS. 1. I reinstall .Net framework 2.0.

       2. DLL file should be in the same directory as the LV application caller.

 

 

0 Kudos
Message 4 of 10
(19,109 Views)
Hello,
 
If I want to use a DLL file that I'll generate by using c# (.net)  what I have to know about this and how the file has to see, so I'll can call this DLL with LabView?
and use the constructor node, browse and locate my DLL?
 
What I have to do  that I'll be able to see my classes, select the class that I want, and connect an invoke node to my constructor node. 
And what I have to do that I should be able to select the methods in my classes?
 
(My questions refer to how I have to write it at the c#).
 
Thank's
Ziv 
 
0 Kudos
Message 5 of 10
(18,405 Views)

Hi Ziv,

The solution is not specific to which language you choose to use within .NET i.e. VB.NET, C#, J#, C++, etc. Each of these languages allows you to select a 'Project Type' called 'Class Library'. The class library is a project specifically designed to allow you to use your .NET classes within other applications including LabVIEW.  You will simply locate the class/classes you want to add to reference in LabVIEW and add them to your project.  Please let me know if you have anymore questions.

0 Kudos
Message 6 of 10
(18,370 Views)
Hi all,
Who can explain me how to handle "PositionUpdateEventArgs" in the GPS toolkit dll.
Regard,
 
0 Kudos
Message 7 of 10
(18,125 Views)
This is a very specific question and is a non-sequitur for this thread. You should start a new thread with your question.
0 Kudos
Message 8 of 10
(18,089 Views)

Hi all 

 I created two dll's, one written in C++ second in C# (Visual Studio 2008). Both have same function which simple change float numbers in 2d array (1900 x 200 image) into constant value. Becouse dll is invoke in 'for-loop' (this is something like movie)  I noticed that dll written in C# is much more slower. Who can explain me why? Obviously , I know that byte-code is slower in use , but I think difference shouldnt be noticeable (in that simple function). 

 

regard

0 Kudos
Message 9 of 10
(17,667 Views)

yodus,

 

I noticed the same speed issue with .NET as well.  I started using ADO.NET on a project to access a SQL database but gave up and used ADO (activeX) when I realized how slowly the .NET code was running.  I think that casting data types into and out of .NET types is a big problem.  My guess is that the interop interface with .NET is not ready for prime time.

 

-cb

0 Kudos
Message 10 of 10
(17,660 Views)