There may be a few different causes to this issue. Check each item below:
- Buffer Flushing: If USB communication begins from an unstable state (i.e. your application has closed unexpectedly), it is recommended to first flush the USB buffers of both the PC and the USB device. See the following function prototype below:
BOOL fnPerformaxComFlush(IN HANDLE pHandle)
- USB Cable: Another source of USB communication issues may come from the USB cable. Confirm that the USB cable being used has a noise suppression choke.
- Time-outs: If the timeout parameter for USB communication on your PC is either set too large or too small, out of sync communication may occur. The function prototype for the timeout function is below. Units are in milli-seconds and the recommended time-out value is 1000 milli-seconds.
BOOL fnPerformaxComSetTimeouts(IN DWORD dwReadTimeout, DWORD dwWriteTimeout)