LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can I create a DLL file for labview which has DLL library with in it?

Solved!
Go to solution

Hello every one,

I am   trying to develop an application for devicenet PCI card in labview environment ( beginner to labview).  There is a DLL file for the PCI Card  from the vendor. But it is too complicated for a beginner to call every function  with in the DLL from labview. Hence I am trying  to re-use  a VC++  program (running properly)that calls  some functions from the  vendors DLL library .    To do that,  I have created  DLL file which includes all headers and DLL library of the vendor as it is shown in the attached  figure. But I couln't see the effect on the device. is that  possible to create a DLL file for labview which has DLL library with in it? if not, how I may  implement the program shown in the figure?

I would like to extend a huge  regards in advance.

0 Kudos
Message 1 of 5
(3,976 Views)
Solution
Accepted by topic author fikadu

It's not something I have a lot of experience in so I don't know all the details of limitations/requirements etc. - but it is definitely possible to create wrappers for DLLs and then use them in LabVIEW - sometimes this is necessary to be able to convert some native C/C++ data types/structures into something which you can pass to/from LabVIEW from your other DLL.

 

There's a link here: http://digital.ni.com/public.nsf/allkb/06ECDC689DDA0F3D862574440074CD95


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 5
(3,955 Views)
Solution
Accepted by topic author fikadu

DLL is the abbreviation for dynamic link library. The idea is that a DLL is a library of routines that can be used by various executable modules and another DLL is also just a code module. So yes it is definitely possible.

 

For that to work you would usually link your DLL with the import library (usually you link multiple import libraries to your DLL project already such as kernel32.lib. user32.lib, advapi32.lib, etc.). This import library does attempt to load the according DLL as soon as your DLL is loaded and resolves the function calls into the other DLL. Now the dependent DLL has to be in a location so that Windows can locate it based on the DLL name. For that there is the DLL search path of Windows which applies here.

 

However most import libraries do resolve the function calls directly at load time and will usually fail the load of your DLL if any of the DLLs or symbols in the DLL can't be found. So unless your PCI card vendor created an import library which does do delayed load, LabVIEW would already have barked at you that it couldn't load your DLL or one of its dependencies.

 

Of course the import library could do delay loading but then you do proper error handling in your code by checking error return codes and such?

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 5
(3,950 Views)

Dear Developer, I would like to pay a huge respect for your help.  after wrapping my dll file, it is working well

0 Kudos
Message 4 of 5
(3,903 Views)

Dear Rolf Kalbermatter,  I would like to pay a huge respect for your detail explanation and genuine help.  After wrapping my dll file, it is working well

0 Kudos
Message 5 of 5
(3,888 Views)