03-15-2022 08:52 AM
I am having problems trying to import a shared library (LibFT4222-64 from FTDI).
The library is created along with the associated VIs.
There are no errors or warnings when parsing the header file.
I get a report at the end, from LabVIEW saying that the VIs are not executable.
Does anyone have any ideas as to what I am doing wrong?
03-15-2022 10:25 AM
Most likely those functions all use a HANDLE type, which is a pointer to void. If that is the case you need to reconfigure those parameters to be Pointer Sized Integers and replace the control with an 64-bit integer.
03-15-2022 12:05 PM
Thank you for your reply.
The LabVIEW import tool seems to handle the parameters correctly. The types of the controls and indicators in the VIs match the function prototype:
The problem I see when I try to open the VIs generated by the import is "Library not found or failed to load":
03-15-2022 12:50 PM
Well that error message usually indicates that the path to the DLL is incorrect. If that's the case, you have two options. Either open the DLL configuration and browse to it, or set the DLL node to use a dynamic path and wire the DLL as a path to the VI.
However, it could also be a bitness issue. It could be that a you're using 32 bit LabVIEW to call a 64 bit DLL, or vice versa. The name of the DLL does imply that it's 64-bit.
03-15-2022 01:07 PM
Where did you install that DLL? Did you install it anywhere even?
03-16-2022 07:59 AM
Hi Kyle,
Thank you for the suggestions.
The import wizard sets up the call with the DLL path, with a wildcard:
C:\Program Files\National Instruments\LabVIEW 2021\user.lib\LibFT4222-64\LibFT4222-64.*
Browsing to the DLL does not change the error message.
C:\Program Files\National Instruments\LabVIEW 2021\user.lib\LibFT4222-64\LibFT4222-64.dll
I am not convinced that using a dynamic path will make any difference. I am inclined to think it will just change the point at which the error is reported (at runtime).
I might try that if all else fails, but I have never had to do it that way before.
You are right about using a 64-bit DLL. I am trying to run it on 64-bit LabVIEW, so that should be OK.
03-16-2022 08:53 AM - edited 03-16-2022 08:55 AM
Thank you for your reply Rolf,
I installed it to:
C:\Program Files\National Instruments\LabVIEW 2021\user.lib\LibFT4222-64
There are two device drivers that get installed, via an FTDI application.
As I understand it, the API level DLL (LibFT4222-64) that sits on top of the device drivers, handles all the user interaction.
I downloaded this API from FTDI and imported it into LabVIEW. The importation process generates the LabVIEW library and places the DLL in the same place.
03-16-2022 09:59 AM
@Dave_RS wrote:
Thank you for your reply Rolf,
I installed it to:
C:\Program Files\National Instruments\LabVIEW 2021\user.lib\LibFT4222-64
There are two device drivers that get installed, via an FTDI application.
As I understand it, the API level DLL (LibFT4222-64) that sits on top of the device drivers, handles all the user interaction.
I downloaded this API from FTDI and imported it into LabVIEW. The importation process generates the LabVIEW library and places the DLL in the same place.
Did you really install it or just copy it into that location? That is not the same at all. DLLs are compiled with a compiler and compilers tend to require runtime libraries. These runtime libraries tend to be compiler version specific and unless they are explicitly linked into the DLL (which is not the default and makes them larger), this runtime library needs to be installed on your system. And yes I mean installed, copying some extra files is usually not enough as it is not trivial to track down all the possible dependencies and they may vary depending on the OS version you want to use them on.
01-29-2025 05:24 PM
Hello,
I was having the same issue when trying to import the LibFT4222-64.dll library, but I was able to successfully import after adding the paths to ftd2xx.h and stdint.h.
However, the issue is that I cannot reliably use the functions in the library. I was only able to run the functions with no FT_Status errors once, but got a LabVIEW error 1097. After this I was unable to replicate this behaviour even after restarting labview, creating a new VI, etc. and keep getting a FT_4222_DEVICE_NOT_SUPPORTED error for the first instance of the library function call and FT_DEVICE_NOT_OPENED errors for calls afterwards.
It doesn't seem to be a problem with the dll or my FTDI devices because I can successfully initialize SPI with the same parameters and no errors from Visual Studio, and I'm not sure what I'm doing wrong in LabVIEW.
Please let me know if you were able to successfully use any of the functions from the LibFT4222-64.dll library and what steps you took, thank you.
02-02-2025 06:18 PM
Hi dkim2,
Were you able to get the libFT4222-64.dll working? I am running into a similar issue where I am able to successfully run the ftd2xx64.dll working with FT_Open, however when I execute FT4222_SPISlave_Init it returns FT_4222_DEVICE_NOT_SUPPORTED.
I am able to get it working in 32-bit labVIEW with the libFT4222.dll as well as in Visual Studio in both 32 and 64-bit, but its the 64-bit labVIEW where I am unable to get it to work.
Thanks,