تسجيل الدخول

مشاهدة النسخة كاملة : How to add an event handler for serial port timeout?



C# Programming
05-22-2009, 08:12 PM
I have searched high and low for an answer to this one. I'm sure someone has
run into a similar situation.
Basically, I set up a serial port with a ReadTimeout of 10 seconds; open it; send a "command"
character to a serially attached device and expect an answer within this period of time.
If data is received, the serialPort_DataReceived event handler fires and reads the data.
However, I want to be able to notify the operator of a problem, should the external
device not reply within 10 seconds. This could indicate the device is not attached or
not powered up.

Appreciate the help,
Steve.