LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Labview created dll with c#

Hello I want to know that 

 

1. Can I use the dll which ic created by labview application builder with c# to write a program or application?

2. If yes, then will I need the labview runtime engine in parallel for my program (written in C#) to run?

3. How can I know the functions and parameter used in labview (application builder) created dll?

 

I appologize if some question seems stupid, help me i am a newbie.

 

Thanks

0 Kudos
Message 1 of 10
(4,537 Views)

Hi Jonathan,

 

1. Can I use the dll which ic created by labview application builder with c# to write a program or application?

Ans)Of course you can.

2. If yes, then will I need the labview runtime engine in parallel for my program (written in C#) to run?

Ans)Yes you will need the LabVIEW run time engine.

3. How can I know the functions and parameter used in labview (application builder) created dll?

Ans)Please go through the details of creating dll using Application builder .

check this link..http://www.ni.com/white-paper/3189/en/

 

Regards,

Srikrishna.J

Regards,
Srikrishna


Message 2 of 10
(4,528 Views)

The AppBuilder can directly create .net interop assemblies usable in C#.  The function prototypes are to be defined in the Source File section of the AppBuilder. The LabVIEW runtime is mandatory.

Message 3 of 10
(4,512 Views)

Thanks to both of you for your response. Please can anybody explain that why would I need Labview runtime engine, if I have the dll file?

 

According to my understanding, dll will communicate to the visa layer and then visa will communicate to the instrument, so where will be the Labview runtime required?

0 Kudos
Message 4 of 10
(4,465 Views)

You need the LabVIEW runtime engine is required so that the CPU can execute the LabVIEW specific functions that the .dll calls.  Just like when you have other programs that call .dll's, you are required to have all the .dll's that are installed with Windows.

 

Since you mentioned using VISA, there is also a VISA run-time engine you will need to install.

0 Kudos
Message 5 of 10
(4,462 Views)

Hello Everybody,

 

Sorry for highjacking this thread but it covers my question in general and I need to get a bit more specific informations to be sure.

 

I wrote a driver software for one of the devices my employer developed with Labview 2012.  This driver is encapsulate into a DLL file which in turn is called by Wrapper VIs.

One of our newest customers want that driver as a pure DLL file to include it into his own program.

I want to snd them the DLL that is called by our Labview wrappers, but this DLL includes the "extcode.h" for the Labview specific data definitions.

As I cannot find this file anywhere on a system with just the runtimeenvironment installed.

Now I am afraid that our DLL will not work with just the Labview runtime environment.

 

So the Answer is simply: Will a LabView generated DLL  that uses extcode.h run without the Labview Development system or not?

 

Regards,

Sebastian

 

 

 

0 Kudos
Message 6 of 10
(4,224 Views)
If all you are using from extcode.h is the data type definitions, then you don't need the run time engine. If you are calling functions that are declared in that header, then you do need the runtime engine, because the run time engine includes the libraries that contain those functions.

However, if your library relies on LabVIEW-specific datatypes, then I recommend you change it to use standard C types to make it easier to call outside LabVIEW.
0 Kudos
Message 7 of 10
(4,196 Views)

@SBach wrote:

Hello Everybody,

 

Sorry for highjacking this thread but it covers my question in general and I need to get a bit more specific informations to be sure.

 

I wrote a driver software for one of the devices my employer developed with Labview 2012.  This driver is encapsulate into a DLL file which in turn is called by Wrapper VIs.

One of our newest customers want that driver as a pure DLL file to include it into his own program.

I want to snd them the DLL that is called by our Labview wrappers, but this DLL includes the "extcode.h" for the Labview specific data definitions.

As I cannot find this file anywhere on a system with just the runtimeenvironment installed.

Now I am afraid that our DLL will not work with just the Labview runtime environment.

 

So the Answer is simply: Will a LabView generated DLL  that uses extcode.h run without the Labview Development system or not?

 

Regards,

Sebastian

 


It's not really clear if you created the DLL from LabVIEW VIs or if you created it in C. From the first sentences it looks like it is a LabVIEW DLL but your mentioning of extcode.h makes me think it is a C DLL. If it is a LabVIEW generated DLL you need the according runtime engine installed on every computer you want to execute the DLL on. If it is a C DLL, then things are more complicated. For one a non LabVIEW process does NOT provide the necessary kernel library that implements the functions declared in extcode.h. So your customer can not call any function that makes use of such a manager function.

 

He can call any other function in your C DLL as the labview.lib import library does do lazy linking. It only will attempt to link to the LabVIEW kernel on first call of every function. So as long as none of those functions is called your DLL will load anyways.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 10
(4,161 Views)

And another thing: If you created the DLL from LabVIEW VIs as a  functional DLL and want to use it from C# it would be a lot easier for the C# programmer, if you create a .Net assembly instead from your VIs (which LabVIEW can do for you) and hand that assembly to the C# programmer. Otherwise the C# programmer has to deal with PInvoke from C# to call the unmanaged DLL and that can be quite a pain.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 10
(4,141 Views)

Hello Nathand , hello rolfk

 

Thanks for your replies.

 

Indeed I created the DLL with Labview. An one of our customers want to call this DLL in their own programm.  I dont know exactly which language they use but I think it will  be python.

I talked with the customer support of NI and they told me that it will be possible to run the DLL with the Labview Runtime, too.

 

They also suggested reading this article:

http://digital.ni.com/public.nsf/allkb/70995EC2CA1B523386256DD4004F3DE6

In which the last tip directly adresses teh use of the Extcode.h and the two other header files for LAbview DLLs.

So thank you for your help . I think it should work with the suggestd solution from the article:

1) Install Labview Runtime

2) Copy all necessary headers from the Labview Development installation folder to the target PC ,together with the DLL, its header and its lib ao the programmers have all the header information they might need.

 

So thanks everybody.

 

Regards,

Sebastian

0 Kudos
Message 10 of 10
(4,107 Views)