I am working on a project, RS232 for serial communication with a device, open comport is called to initiate communication, It opens eveytime successfully using FT_OPEN ** Receive Data ** FT_CLOSE, but sporadically FT_OPEN returns FT_ERROR code of '3' and whole cycle is broken. Does any one know what that code means? How can I troubleshoot this issue?
-
Is there a reason you need to use the D2XX drivers instead of using the normal virtual com port drivers? – rm5248 Aug 27 '16 at 14:56
-
Yes. At any given instance, we are connected to multiple devices, it will be easier for us to identify the USB device using its serial number and start communication with it.Correction. we are actually using FT_OpenEx() to open using the serial number. Thank you for your comment. – Srikanth Chadalavada Aug 27 '16 at 18:12
-
1http://www.ftdichip.com/Support/Knowledgebase/index.html?ft_openex.htm – Jim Hewitt Aug 28 '16 at 15:00
2 Answers
Since you want to open up the open up the serial port by the serial number of the chip, there's things you can do to get around this. On Windows, the COM port is associated with the serial number of the chip anyway. If you're using Linux, create a udev rule to symlink the proper ttyUSB
to a well-known location. Something like this should work:
DRIVERS=="ftdi_sio", ATTRS{serial}=="FT00112233", SYMLINK+="com_port_name"
Once you have the proper udev rules in place, you can simply open the symlink.
It has been my experience that FTDI's D2XX drivers are not the most reliable; if you still need to do any low-level configuring you could try using libFTDI.
Libraries to use a serial port from Java:
- RXTX
- JSSC
- PureJavaComm
- JavaSerial (disclaimer: this is my library)

- 2,590
- 3
- 17
- 16
-
It is on Windows, There are two devices, I have been opening comport successfully and every once in a while FT_STATUS of one device(same one every time) returns error code of 3.I have to unplug and replug the USB device to start the communication again. Is there a way I can trouble shoot this? Thank you. – Srikanth Chadalavada Aug 27 '16 at 23:18
Use: FT_CyclePort(ftHandle)
From FTDI Knowledgebase:
The effect of this function is the same as disconnecting then reconnecting the device from USB. Possible use of this function is in situations where a fatal error has occurred and it is difficult, or not possible, to recover without unplugging and replugging the USB cable.

- 61
- 1
- 4