LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a C# dll in Labview?

How can I use a C# dll in Labview 8.2? With the "Import Shared Library" Wizzard I need the header file which I don't have. Is there another way
to use such .dll to import the functions created in C#?


Thanks in advance
                              NorickSmiley Happy
0 Kudos
Message 1 of 4
(3,919 Views)
Norick,


C# != C++

So, you won't call C#-code with a Call Library Function Node.
You have to use the .NET-functions, namely constructor ~, property ~ and invoke node and the close reference function. You can find these in the Connectivity >> .NET palette.

hope this helps,
Norbert B.
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(3,914 Views)
Norbert
is there a application note how to create step by step such class librarys with the .net functionallity?


Thanks
            Norick
0 Kudos
Message 3 of 4
(3,896 Views)
Norick,

afaik there is no tool which provides you the possibility to create something like an instrument driver for .NET assemblies.

Maybe we should take a look into terminology:

- Instrument driver: This is a set of functionality, which provides the user with an easy to use API for a special instrument. Very often, the driver itself is written in C/C++ and provided as a DLL.

- "Import Shared Library" Wizard: This wizard enables the user to create an own API for any C/C++ DLL (or compatible) for LabVIEW. This wizard requires the information on all exported functions; this info is contained in the header file. The result of the wizard is a set of VIs containing one Call Library Function Node each for each exported function.

- .NET assembly (extension .exe OR .dll): This can be compared to ActiveX. So the way to program with .NET is similar to ActiveX. Maybe you want to take a look into the examples of LabVIEW regarding .NET...

- Global Assembly Cache (GAC): All assemblies contained here are registered in the system. Every application can easily work with assemblies contained here.

- Private assemblies: This would be the way to work with .NET assemblies which are built on your own. You have to select the .DLL-file itself and make sure that the file can always be found in the same (relative)folder of your application.


hope this helps,
Norbert

Message Edited by Norbert B on 02-21-2007 02:16 AM

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