Com Ports - Technical Information

Handshaking

An integral part of managing the receive and transmit buffers is ensuring that the back-and-forth transmission of data is successful — that the speed at which the data is being received does not overflow the buffer limits, for example.

Handshaking refers to the internal communications protocol by which data is transferred from the hardware port to the receive buffer. When a character of data arrives at the serial port, the communications device has to move it into the receive buffer so that your program can read it. A handshaking protocol ensures that data is not lost due to a buffer overrun, where data arrives at the port too quickly for the communications device to move the data into the receive buffer.

You set the Handshaking property to specify the handshaking protocol to be used by your application. By default, this value is set to none (comNone). You can, however, specify one of the other following protocols:

Setting Value Description
comNone 0 No handshaking (Default).
comXOnXOff 1 XOn/XOff handshaking.
comRTS 2 RTS/CTS (Request To Send/Clear To Send) handshaking.
comRTSXOnXOff 3 Both Request To Send and XOn/XOff handshaking.


The protocol that you choose depends upon the device to which you’re connecting. Setting this value to comRTSXOnXOff supports both of the protocols.

In many cases, the communications protocol itself handles handshaking. Therefore, setting this property to something other than comNone may result in conflicts.

Note If you do set this value to either comRTS or comRTSXOnXOff, you need to set the RTSEnabled property to True. Otherwise, you will be able to connect and send, but not receive, data.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray