c++ - Serial port input processing under Windows - with real time requirements -
i have implement task which, ideally, should done under real-time os. but, due constrains, have under windows 7 64 bits. i'll glad have inputs. @ least, understand if task feasible under windows.
external 3rd party device send 80 bytes message on serial @ 115200 baud each 20 milliseconds.
i should receive message, processing (which takes maximum 5 milliseconds) , configure other device.
configuration of other device should start not later 20 milliseconds after single message received serial port (all 80 bytes). otherwise other device function incorrectly.
i did experiments creating simple prototype in c++, uses basic communication functions (https://msdn.microsoft.com/en-us/library/windows/desktop/aa363194(v=vs.85).aspx). commtimeouts (https://msdn.microsoft.com/en-us/library/windows/desktop/aa363190(v=vs.85).aspx), defined readintervaltimeout=1, readtotaltimeoutmultiplier=0, readtotaltimeoutconstant=0. idea wait blocking on com port , decide end of message if there timeout of 1 ms between bytes.
the problem have running of prototype number of messages arrives in 1 read serial port. and, in case cannot keep latency 20 milliseconds message reception.
any idea can done resolve issue ?
Comments
Post a Comment