Before you can use a Comm control to transmit data, you must establish a connection to the port. Each serial port has settings that control how the port sends data. The CommPort property determines which port the control will use, and the Settings property sets the port’s baud and the number of parity, data, and stop bits. The baud determines the speed of the connection, while the parity, data bits, and stop bits provide error control. Each side of a serial connection must use the same port settings.
In addition to using identical port settings, each side of the connection must know when to transmit or receive data. Properties such as Handshaking, DTREnable, and RTSEnable manage the connection and the flow of data through the serial port.
You can set the Handshaking property to specify the handshaking protocol used by your application. By default, the Handshaking property is set to comNone, indicating that the connection does not use handshaking.
If you set Handshaking to either comRTS or comRTSXOnXOff, you must set the RTSEnabled property to True. Otherwise, you can only send, not receive, data through the connection.
Once you establish the settings and protocols, set the PortOpen property to True to open a communication port; set it to False to close the port.
When the port is open and the connection is active, you can send and receive data through the port.