Calling a 32-Bit DLL from 64-Bit LabVIEW and Vice Versa

Updated Oct 23, 2023

Reported In

Software

  • LabVIEW

Issue Details

When I try to select a 32-bit DLL in a Call Library Function Node in 64-bit LabVIEW, I get a dialog stating:

The library selected is not valid for the current platform. For example, you are running 64-bit LabVIEW and the library might be a 32-bit library.

 


OR:
 
When I try to select a 64-bit DLL in a Call Library Function Node in 32-bit LabVIEW, I get a dialog stating:

The library selected is not valid for the current platform. For example, you are running 32-bit LabVIEW and the library might be a 64-bit library.

 

 
Why am I seeing these errors? Can I call a 32-bit DLL from 64-bit LabVIEW or vice versa?

Solution

You cannot call a 32-bit DLL from a 64-bit LabVIEW version, or vice versa. This is a limitation of 64-bit Windows, which does not support mixed 64-bit/32-bit processes.

If you are trying to use a 32-bit DLL in 64-bit LabVIEW or vice versa, the recommended solution is to recompile the DLL from the source code for the corresponding target architecture. Alternatively, you can load the DLL in the matching bitness of a LabVIEW VI or executable and communicate between the required architecture and the desired one using Shared Variables or other networking technologies.

Additional Information

You can install both the 32-bit and 64-bit versions of LabVIEW on the same machine.

You can check this article for alternatives if you are not certain of what DLL is LabVIEW calling.