Asynch Serial Comms
-
-
Hi there, Is there any other way of implementing asynchronous serial communication in Visual C++ than the MFC way. The MFC way is too time consuming. I so far have seen that _inp and _outp are only for WIN95 platform. Any suggestions will help. Thanks.
-
You can use CreateFile and the Win32 Communications API which contains functions like BuildCommDCB(...) etc.
Thanks for the reply. Yes, you're right CreateFile() and the WIN32 Comms API can be used. My problem is that I receive data that is between 40 and 45 bytes in length far too late. The instrument on the other side sends the data at 9600 baud every 100ms. My program must receive it by 65ms. At the moment the data is received it at approximately 80ms, which is way too late. I have used the CreateFile() and ReadFile() with the necessary time-out, threads and event operations to read the data. I also wrote a utility in Delphi which seem to work fine (54ms). Unfortunately the code must be in C++ as it fits into a bigger Visual C++ program. Any ideas. Thank again.