How can you tell when a SerialPort.Write completes?

G

Guest

I have a device that transmits at a diffenent baud rate than it receives.
This means I need to send it a message, change the baud, wait for its reply,
change the baud back.
The problem is that if I change the baud before the query message has
completely written then the device will not understand it. If I wait too
long then I will not understand its reply.
In other words, I need to know when the last byte of the message I'm writing
has been sent. I'm in C# with MS2005 on a WM5.0 device.
I had hoped I could wait for SerialPort.BytesToWrite == 0, but it is always
0 so no joy.
Any help would be appreciated.
Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top