Connecting multiple virtual serial ports together

Now that we know how the com0com works, we can try using it.

Open the com0com setup. Check if there is already a virtual com port pair connected and ensure it has ports class enabled.

If you already have a pair of connected virtual ports with COMx names you can skip the following paragraph.

If there is no pairs already created click Add Pair button to add a new pair. If Windows asks you to restart the computer just close the popup (no restart should be needed). New pairs by default are created as CNCAx <> CNCBx where x is a number. Newly created pairs don’t have port class enabled, so if you want to use them in programs you will have to enable it by checking the checkboxes and pressing Apply button. After enabling the ports class the port will become visible under a new name with COMx naming convention and will be available for use with programs.

 

2014-12-18 16_05_31-Setup for com0com

Here you can see that I have four COM port pairs installed, the chosen one for this example is COM6 and COM9 pair.

You can also check the device manager to see the ports that are available. The ports available to the programs will be listed under Ports (COM and LPT), while the serial port pairs and non-enumerable ports (available just to applications like hub4com) will be listed under com0com.

 

2014-12-18 16_06_14-Upravljanje računalnika 2014-12-18 16_07_00-Upravljanje računalnika

Now you can use your favorite terminal emulator software to connect to both of the serial ports to check the functionality. I will use RealTerm software in my example. Open two instances of the program. Open one port from the pair (COM6) in one instance and the other port (COM9) in the second instance of the program. To open ports in RealTerm you need to first choose the port name and then click the Open button. If changing the port settings you either have to click the Open button twice (to open and close the port) or click the Change cutton. You can send the data from one program to another, emulating a null modem cable. For sending data in RealTerm you can either type the data after clicking in the terminal window or you can use the Send tab. Send ASCII button sends the data in the text box next to it.

 

2014-12-18 16_15_07-RealTerm_ Serial Capture Program 2.0.0.70

Using the Pins tab you can also try out the flow control routing of com0com package. By default the DTR of transmitting port is connected to DSR and DCD signal inputs of the second port. RTS is connected to CTS. When you modify RTS or DTR signal on one port using Set or Clear buttons you can see the connected signals change on the other port.

2014-12-18 20_50_44-RealTerm_ Serial Capture Program 2.0.0.70

(This is a multipage post. Read on for examples on hub4com for connecting multiple ports >>)

Tagged with: , , , ,
One comment on “Connecting multiple virtual serial ports together
  1. Louis Carrel says:

    Thanks for the article, a very nice read! However, I would like also to add, that there are also other pieces of software that can create virtual COM ports or let you connect a real device with a virtual port. All additional details can be found in the articles, like this one
    https://www.eltima.com/create-virtual-serial-port.html
    Software to connect real devices to a virtual serial cable
    https://www.eltima.com/products/serialsplitter/

Leave a Reply

Your email address will not be published. Required fields are marked *

*