FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:



Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


Author Topic: Would need to know more details about the FT_Write() function  (Read 40 times)

mosi

  • Newbie
  • *
  • Posts: 1
    • View Profile
Would need to know more details about the FT_Write() function
« on: November 07, 2018, 08:38:51 PM »

A question about the FT_Write() function.

Code: [Select]
FT_STATUS FT_Write (FT_HANDLE ftHandle, LPVOID lpBuffer, DWORD dwBytesToWrite, LPDWORD lpdwBytesWritten)

I wonder about the lpdwBytesWritten.

When will it ever return lpdwBytesWritten < dwBytesToWrite? Would FT_Write return other than FT_OK in that case?

And how much data can I send in one call to FT_Write? What limit has the dwBytesToWrite parameter?

Logged

FTDI Community

  • Administrator
  • Full Member
  • *****
  • Posts: 167
    • View Profile
Re: Would need to know more details about the FT_Write() function
« Reply #1 on: November 09, 2018, 04:34:06 PM »

Hello,

Please see the D2XX Programmer's Guide for all available information.

dwBytesToWrite is DWORD type. This is an unsigned, 32-bit unit of data. It can contain an integer value in the range 0 through 4,294,967,295.

FT_Write would return with an error code other than FT_OK if it's not completed successfully.
Error codes can be found in Appendix A - Type Definitions.

You may also want to set FT_SetTimeouts which sets the read and write timeouts for the device.

Please also take a look at AN232B-04 Data Throughput, Latency & Handshaking which provides additional useful information and applies to all our FTDI USB products.

Best Regards,
FTDI Community
Logged