From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

FTDI SPI_InitDevice IO Error

Hello,

 

I have an FTDI FT2232H mini module. When executing SPI_Init_Device the VI hangs up. I have to unplug the FT2232H module to get control of LabView again. Has anyone using the FT2232H, LabView, and the FTCSPI.DLL had this same problem?

 

I am using Labview 8.5 and version 2.0 of the FTCSPI.dll.

 

I have successfully gotten the following functions working in LabView using the Call Library Node Function and the FTCSPI.dll (ver2.0):

  - SPI_Get_DLL_Version (returned value -  2.0)

  - SPI_getHiSpeedDeviceNameLocIDChannel (returned values - Device Name: Dual RS232-HS A, Channel: A, LocID: 1329, HS Device Type: 01)

  - SPI_OpenHiSpeedDevice (returned value - Handle: 0x8756CF0)

  - SPI_GetHiSpeedDeviceType (returned value - FT2232H)

  - SPI_Close_Device

 

Along with the FTCSPI DLL Application Note AN_111 I used the C++ example in the application note (AN_114 - Interfacing FT2232H Hi-Speed Devices to SPI BUS Application) as a guidline and have been successful up to the point i have to execute the SPI_InitDevice.

 

The function prototype is: uint32_t SPI_InitDevice(uint32_t Handle, uint32_t ClockDivisor);

I looked at the functions for the I2C and JTAG libraries and the dll.h files and they are exaclty the same for the SPI function.

I am passing in the Handle (0x8756CF0) that i recieved from the SPI_OpenHiSpeedDevice and a legal value for the ClockDivisor, but it just hangs.

Just wondering what i'm missing here?!?!

Any help would be greatly appreciated.

 

 

 

 

 

 

0 Kudos
Message 1 of 3
(7,314 Views)

Hi whtrsh,

 

I have not worked with this specific device, but I don't see anything that stands out - your VI seems correct based on the function prototype.  You mentioned that you are using a C++ example as a guide - have you been able to run that C++ code to confirm that the DLL's SPI_InitDevice function works outside of LabVIEW?

 

Morgan S

Applications Engineer

National Instruments

0 Kudos
Message 2 of 3
(7,290 Views)

I have the same problem. Followed the function prototypes too. No idea. Did you figure it out?

0 Kudos
Message 3 of 3
(6,531 Views)