1
Discussion - Drivers / FT_Write returning FT_OK but BytesWritten is 0
« on: August 23, 2019, 03:02:45 PM »
Hello;
We have a project using the FTDI driver (ftd2xx.dll) that generally works for loads of customers without problems. However I recently had a customer where communication between the software and device was failing, and it turns out that the FT_Write function was returning FT_OK but the 'BytesWritten' field was returned set to 0.
Can anyone tell me under what possible conditions this could happen? I can't find anything online or in the documentation. It looks as if a failure to write any data should return an error code, but it doesn't. It's not something I've seen before - in the past we have seen FT_Write fail with an error code of 4 (FT_IO_ERROR) and it's because the device has been unplugged.
Re-plugging the device's USB connection seems to have solved the issue for now, but it has happened a couple of times for this customer and I'd like to get to the bottom of what is causing it.
Thanks
Liam
We have a project using the FTDI driver (ftd2xx.dll) that generally works for loads of customers without problems. However I recently had a customer where communication between the software and device was failing, and it turns out that the FT_Write function was returning FT_OK but the 'BytesWritten' field was returned set to 0.
Can anyone tell me under what possible conditions this could happen? I can't find anything online or in the documentation. It looks as if a failure to write any data should return an error code, but it doesn't. It's not something I've seen before - in the past we have seen FT_Write fail with an error code of 4 (FT_IO_ERROR) and it's because the device has been unplugged.
Re-plugging the device's USB connection seems to have solved the issue for now, but it has happened a couple of times for this customer and I'd like to get to the bottom of what is causing it.
Thanks
Liam