I have connected up my socket and can send and receive RS232 data over. My problem is that if my RS232 string is 26 characters I dont always receive 26 characters. Sometimes I do but most of the time I only receive 16 characters. What can cause this?
To send data I do the following
If CanSend == false
return FALSE
If DataLen == 0
return FALSE
Effectively I had the same problem, there are a buffer of 16 characters used by the RS232 chip. And before you can receive the next data you must read this buffer.
Here my function to resolve this problem by reading all data and using a timer to define the end of waiting for data :