SerialPort and hardware flow control

G

Guest

After some tests with a serial connection and the SerialPort class, I found
out that in hardware flow control, you have to manually stop sending data
when the CTS ligne goes low. I made some test and the SerialPort class
doesn't seem to react to the CTS signal. If you tell to send 1000 bytes, it
will send them no matter what the CTS level is.

The only way I found to make all this works is by waiting for
SerialPort.CtsHolding to become true and then send a single byte. And so on
and so forth until the complete buffer is sent. I also found out that the
Handshaking enumeration have a RequestToSend member but no "Hardware". So it
really seems that the SerialPort class only handle automatically the RTS line
and not the CTS line.

Am I right or is there a way to tell the SerialPort class to handle the CTS
signal, ie stop sending the bytes in the buffer momentarily until the CTS
line is up?

Etienne Fortin
 
D

Dick Grier

Hi,

What serial port class? Is this System.IO.Ports in VS 2005? If so, this
may be a bug and perhaps it should be reported via beta feedback. I am
assuming here that you have enabled hardware flow control? If not... Then
what you are seeing is the expected operation. Certainly, no serial class
should assume that you want to use HW flow control, you actually have to
enable its use.

If some other class, perhaps you need to notify the person who wrote that
class? (same caveat as above).

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 
G

Guest

I'M SO DAMN STUPID!!!!!!!

I looked-up how to change handshaking in the doc. I knew exactly the option
to set. I assumed I did it. But I wasn't!!! It wasn't set at all!!! I should
have looked at that possibility right at the begining. Can you imagine
something more pathetic from a programmer? :)

Anyway, now it works perfectly.

Thanks for pointing the obvious thing I should have checked before.

Etienne
 
D

Dick Grier

Good to hear that it was simple to solve.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 
G

Guest

So where did you enable the handshaking?...I think I am doing the exact same
stupid thing as you!!!!!!
 

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