I been working in a project that involves seria communication, and i have found a problem, i have a device that send me information, lets say that i send a status request to the device (a string containing 6 characters) and the the device sends another string with the current status (a string containing 31 characters) all these is fine, BUT, after a while the string recieved from the device is truncated or splited in two pieces, i asked to a frien and he told me that is something worn with the read intervals in the port configuration, but a dont know what to do now, because i�ve moved a lot of params and it gives me the same result, so what can i do? who can help me?
Please use SetCommTimeouts first,
After you execute the ::CreateFile(...),
you can use SetCommTimeouts to set the TimeOut of read/write. by default, it will blocks when the device is Off-line or has some other errors.
So, when you use WriteFile/ReadFile, you will "timeout" if the error occurs, and next call the GetLastError(), you will get the detail error info.