LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL import with visa library dependency

Hi,

I have a problem importing a DLL with the "Call library function node" block in LabView.

I want to build a wrapper VI for each function call of my library.
If I choose my library and the function name in the drop down menu inside the configuration dialog I get the error message "A dynamic link library (DLL) initialization routine failed".
If I list the errors I see the messge: "Call library function node 'xyz.dll:myfunction': function not found".

All function calls are exported correct using the keywords "__declspec(dllexport)" and extern "C" {}.
The DLL is compiled with MS Visual C++ 7.1. A .def file also exists.
I also use the correct calling convention.

Because my dll is used to access a PXI device, I'm using the NI-Visa library.
My DLL calls the API functions of the Visa library and links against it.
Because of the dependencies the libraries visa32.dll and NiViSv32.dll are in the same directory as my library.

I wrote a little test application in Visual C++ and there I can load my library without problems.

I suppose the problem is a conflict if I use the Visa library together with my library and then import it in LabView.
Is this possible?
Or can there be other reasons for the malfunction?
I consider all rules in the documents which describes a dll import.and unfortunately have no further ideas.

Many thanks in advance.

Best Regards,
Florian
0 Kudos
Message 1 of 4
(2,879 Views)
hi, have you registered the dll on your machine?? also try using automation open fuction which will open you the classes and methods or any fucntions used...follow the tutorial on ActiveX in the help. Should help you out with your error...
0 Kudos
Message 2 of 4
(2,865 Views)

No I haven't registered my DLL.
I have no ActiveX components im DLL and I don't use MFC or .NET.

I only have a DLL which provides some function calls.
And for each function call I want to build a VI.

I removed the dependency to the Visa library from my Visual Studion project and commented out all Visa function calls.
Now my DLL can be imported into LabView and no error occurs.
Adding the dependency again let the error appear again.

Importing my DLL with the Dependency Walker shows no conflicts or errors.

Best Regards,
Florian


0 Kudos
Message 3 of 4
(2,851 Views)
I found the problem.
I linked against an old version of the Visa DLL.  😞
Now it seems to work.

Best Regards,
Florian

0 Kudos
Message 4 of 4
(2,835 Views)