LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call library function node: library not found or failed to load. Trying to use third-party library.

Hi, I am trying to use third-party API. I have placed the .dll file in system32 and sysWOW64 folder as well. I have copied the .lvlib and associated controls folders in a folder in user.lib.

The library appears on function palate. whenever I pick any vi, subvi from function palate, the error  "Call library function node: library not found or failed to load" occurs. I can see functions written in .dll file are correctly loaded in labview dropdown list under function names(see image attached) but still the error says library not found. Why? please help

 

P.S. The drivers are properly installed as C codes work fine.

Download All
0 Kudos
Message 1 of 17
(2,255 Views)

Hi Sidkay,

 

what about the bitness of LabVIEW and that 3rd-party API/DLL? Are they the same?

 

AFAIK it doesn't make sense to "place the DLL" in those two different OS folders…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(2,235 Views)

How do I check the bitness of both? 

Actually as per third-party guidelines I have to put dll in system32. Things did not work I put dll in sysWow64 too.

0 Kudos
Message 3 of 17
(2,225 Views)

Hi Sidkay,

 


@Sidkay wrote:

How do I check the bitness of both? 


Open the LabVIEW->Help->"About…" dialog. There you can read the bitness of your installed LabVIEW version.

 


@Sidkay wrote:

Actually as per third-party guidelines I have to put dll in system32.


This is a strong hint that this 3rd-party DLL is compiled for usage on 64-bit systems using a bitness of "64"…

 


@Sidkay wrote:

Things did not work I put dll in sysWow64 too.


Copying a 64-bitness DLL into the folder for 32-bitness DLLs will usually not work!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(2,220 Views)

@Sidkay wrote:

How do I check the bitness of both? 

Actually as per third-party guidelines I have to put dll in system32. Things did not work I put dll in sysWow64 too.


It really depends how old that DLL (and its documentation is). Microsoft decided that System32 should be the folder for the native bitness, so if you are on a 64-bit system, it is for 64-bit binaries and if it is a 32-bit system, it is for 32-bit binaries. 32-bit binaries on 64-bit systems should go into SysWOW4. Sounds all very logical doesn't it??? 😁

 

If that DLL was compiled and documented 10 years ago, it is almost certainly 32-bit (and the fact the documentation doesn't even mention both variants, makes this very likely) and in that case the DLL belongs into the SysWOW64 folder and you would need to use 32-bit LabVIEW.

 

If that still doesn't help you might have a different problem. This DLL is compiled by a certain C(++) compiler and linked with C Runtime support functions. Each C compiler requires its own C Runtime support functions and Microsoft C for instance used until a few years ago a compiler version specific Runtime Library. This means if the DLL was compiled by Microsoft Visual Studio C 2008 it needed the Microsoft C Runtime library 9.0 and Visual Studio C 2010 compiled products require the MSC Runtime 10.0 etc. While Windows already has installed certain C Runtime libraries since its tools and programs are all compiled with Microsoft C too, it doesn't typically contain all of them and you need to find out which it uses and download the according Microsoft C Runtime Redistributable installer from Microsoft and install it on your machine. Ideally your DLL driver would come with an installer which contains the correct Microsoft C Runtime installer and does the right thing but considering that the documentation tells you to move the DLL manually into System32 that is obviously an idle dream. 

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 17
(2,204 Views)

and the fact the documentation doesn't even mention both variants, makes this very likely

 The have provided different folders for 32-bit and 64-bit library. I am following Readme of 64 bit version, So yes it is designed for 64-bit version.

I have tried 32bit labview as well but no luck.

What if I install multiple Microsoft run time libraries?

0 Kudos
Message 6 of 17
(2,124 Views)

@Sidkay wrote:

What if I install multiple Microsoft run time libraries?


That's not a problem. The problem is to know which version you need to install!

 

And that depends on what Visual Studio version was used to compile the DLL. There are different versions for the different Visual Studio versions.

 

Visual Studio Version     Microsoft C/C++ Runtime version

2005                                                 8.0

2008                                                 9.0

2010                                               10.0

2012                                               11.0

2013                                               12.0

2015 and newer                             14.x

 

It is safe to assume that on Windows 10 you have one of the latest 14.x versions of the Microsoft C/C++ runtime installed for Windows itself. But earlier runtimes only happen to be installed if you already have installed other programs that came with them.

 

Your Astronics/Ballard driver should have come with an installer that does copy the DLLs to the correct location AND installs the accordingly needed C/C++ Runtime Library automatically. Anything else is not from these times anymore! And since it is about accessing a hardware plugin interface I would be surprised if it doesn't also need some device driver installer. This is definitely not something they can let a user do but requires a real installer.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 17
(2,114 Views)

Thanks for the detailed reply. Yes they provided device software and that I have installed and my C# codes work properly.

There are some extracts of the readme files that you might want to check. Below quotes are from the Readme files.

 


INTRODUCTION

The BTI*.LIB files are the import library files for the BTIDriver API. With these files, users can write applications that operate a BTIDriver compliant device.

The Driver API has been tested using the Microsoft Visual C++ Compiler Version 6.0 and the Borland C++ Compiler Version 4.5.


Further in another readme it says

INSTALLATION

To install the BTIDriver LabVIEW library, create a folder called BTIVI in the LabVIEW user.lib folder. The user.lib folder is typically located at:

C:\Program Files\National Instruments\LabVIEW X.Y\user.lib

where X.Y is the version of your LabVIEW installation (eg. 2010).

Extract the contents of BTIVI.ZIP into the BTIVI folder you created.

Next, copy the BTIVI.DLL file to the SYSTEM32 folder of your 64-bit Windows installation typically located at:

C:\WINDOWS\SYSTEM32



Does it mean that I can use only labview 2010 or 8.6 only? I am using LV2017(64-bit).

Please suggest what am I missing.

Thanks.

0 Kudos
Message 8 of 17
(2,108 Views)

Why do you say only LabVIEW 8.6 or 2010?

e.g. is simple the abbreviation for the Latin "exempli gratia" or in simple English "for example".

 

The problem is not so much what LabVIEW version you use (although if you use just the right one, the LabVIEW installer will install the right C Runtime library, since it is compiled in Visual Studio too. And different LabVIEW versions are compiled in different Visual Studio versions. But which version of the C Runtime is the right for your DLL one is still a big question).

 

If I had that DLL available I could take a quick look at it and tell you, but you haven't attached anything yet. That readme should at least mention which Visual Studio version was used to create the DLLs. Even better would be if there was actually a setup.exe program that properly installs the DLL AND the correct Runtime Library.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 17
(2,098 Views)

Please check attachment. 

0 Kudos
Message 10 of 17
(2,082 Views)