
6 Jul
2013
6 Jul
'13
8:42 p.m.
Thanks for replying. I may oversimplify my original code in the post, but this piece of code can run and read data from the port. The only problem is unstable.
Here is my original code modify from a previous version posted on this board. Again this program can successfully read data from a third part device (which writes data to the RS232 port at certain sampling frequency), but just unstable some times.
I'm not an expert, but at a glance your code (at least its asio-related part) looks to me correct. I'd suggest you to build your project with BOOST_ASIO_ENABLE_HANDLER_TRACKING macro defined and to see where the flow goes when the applications enters the undesired state.