How to Create a Virtual Serial Port (COM Port)

giu-vicente-FMArg2k3qOU-unsplash-resize-opt

What is a virtual COM port?

A virtual COM port or a virtual serial port is an ideal solution when a legacy software application expects a connection to a serial device port (COM port or COMM port) but cannot connect, due to a physical lack of available serial ports. Instead, we reconfigure the computer to send serial port data over a local area network or the Internet as if over a true serial port. When the legacy application attempts to send data to a serial COM port, it is actually transmitted through the virtual serial port over a TCP/IP connection. Information sent back to the legacy application also travels over the network where it is received by the virtual serial or virtual COM port, and is then finally passed to your legacy application.

Secure Serial to Ethernet Server
for use with Virtual Comm Ports

SB800EX-JDTW-IR-1 Serial to Ethernet Converter with Wifi

Learn more and compare all of our Virtual Comm Port products here.

Why should I use a virtual COM port?

Most modern desktop computers and laptops no longer have the old school DB9 RS-232 serial ports (COM ports) that were traditionally used to connect directly to the hardware used in commercial, laboratory or industrial safety and control systems. In many cases, even if they do, the number of available ports is very limited. This can be problematic if you still rely on legacy software applications that communicate through those now non-existent (or very limited) serial ports. The challenge here is different than just converting a serial device’s interface to a USB or Ethernet interface. This is because the legacy software doesn’t know how to recognize or read USB or Ethernet data — and resurrecting the software engineer that originally coded it probably isn’t an option.

We all need to upgrade computers from time to time to keep up with the latest OS and security requirements, not to mention just getting that new car smell. However, that doesn’t mean your legacy serial software assets should suddenly be worthless…does it? We say down with obsolescence and waste!

We’re going to help you get more life out of your serial system while keeping your computer in the 21st century. NetBurner provides a free virtual COM port application that creates a virtual COM port that can be used to transmit serial data over a network (Internet or LAN) to NetBurner Serial to Ethernet Servers or System on Modules. This saves time and money by allowing you to continue using your existing legacy applications.

Important Note: This tutorial deals exclusively with a virtual COM port implementation that is used with NetBurner devices. If you are looking for a native software solution to create virtual COM ports for use with other systems or hardware, we suggest the Virtual Serial Port over Ethernet Connector or the Virtual Serial Port Driver from our partners at Eltima Software. They are both incredibly stable and versatile utilities that support various Windows versions, up to the latest Windows 10.

Hardware and software required for the example

Our test setup

We’re going to show you a very basic virtual COM port configuration to display the ins and outs of getting a virtual COM port running. Please note that the virtual COM port driver provided on our website can only be used with NetBurner’s serial to Ethernet (S2E) hardware and System-on-Modules. To set up a virtual serial port configuration that can be used with any type of device over a network, we recommend the Virtual Serial Port over Ethernet Connector from our partners at Eltima Software. This application allows for the creation of any number of virtual COM ports with preassigned parameters. It can be used to establish a connection with hardware serial device servers over an Ethernet connection, as well as to create links with virtual serial ports created on other computers.

In our scenario, we will run an instance of the MTTTY serial terminal application to represent both ends of our communication path. First, it will represent the “remote client” that is connected to the NetBurner serial to Ethernet device through the serial to USB converter. Second, it will represent the “legacy serial application” that is sending and receiving data to this device through the virtual COM port.

System diagram on how to set up a Virtual Com Port.
System Diagram Virtual COM Port configuration

We will start by creating a virtual serial port on COM20. This will allow us to send data from the ” legacy serial application” MTTTY instance to the NetBurner serial to Ethernet device over an Ethernet connection. The NetBurner device will then send this data out of its own serial port (DB9) back to the laptop. This data will be read using the USB port on the laptop with the help of a USB to serial converter. Finally, we will use the “remote client” MTTTY terminal to read the data from our USB converted serial port, COM6. This communication path is bi-directional. This means that data sent to one MTTTY terminal instance will show up in the other, and vice-versa.

How to setup the virtual COM port driver

  • Install the Virtual COM Port Driver software. The default installation directory for the software linked above can be found at C:\nburn\VirtualCommPort. From here, execute NBVirtualCommPort.exe. The application window will open…we’ll come back to this shortly.
Example screenshot com port drive set up
Virtual COM Port executable file
  • Before we go further, we will need to know the IP address of your device and the listening port number. With NetBurner devices, finding the IP address is as easy as using our IPSetup tool’s search ability to discover our device on the network. IPSetup can be found in the C:\nburn\pcbin directory of your install, or just use your operating system’s search utility to find it.

If you are new to NetBurner products here’s a quick guide to help you use IPSetup. First, make sure your NetBurner S2E device or System on Module is connected to your Ethernet router or LAN. In our example, we use the SB800 EX. Second, power your devices either with an AC wall wart or via USB (if you are using a development carrier board, and have the jumper configuration setup to do so).

Open the IPSetup software. Your device should appear in the “Select a Unit” field, but if not click “Search Again” and wait for it to show up. If your device supports WIFI, clicking the “+” sign will expand the device’s entry to reveal the unit’s current IP address. Otherwise, it should be listed on the first line of the device entry. In the figure below, the SB800 EX shows an IP of 10.1.1.130. Jot down this IP address to use later.

IPSetup tool
NetBurern’s IPSetup tool used to find the device
  • Now we need to go to your device’s homepage and discover its listening port. You can simply click “Launch Webpage” in IPSetup or type the IP of the device into your favorite browser. Click the “TCP” hyperlink in the menu. The figure below shows the “TCP” page for our SB800 EX, which has two serial ports, Port 0 and Port 1, respectively. Jot down the listening port for serial port 0.
Embedded Device homepage
NetBurner embedded device TCP configuration page
  • Back in the Virtual COM Port application, click on “Add” in the Virtual Serial Port dialog box, which will bring up the “Edit Connection” window.
Virtual COMM Port application
Virtual COMM Port application screenshot
  • Next, from the “Select serial port” drop-down menu, select a COM port to associate the virtual COM port with, and give it a new “Connection Name”. In this case, we chose COM20 and named it “Client_COM20”. Then, in the box labeled “Remote host name/port”, enter the IP address of your NetBurner device followed by the listening port determined during the previous steps.
Edit Connection Virtual Serial Port
Editing the connection for your virtual serial port
  • Click “Add”, verify that the entry was added to the list, and then click “Apply”.
Successfully added virtual com port
Confirm the device is found by virtual COM port utility with IP seen under “Host”
  • Now we can see that our new virtual COM port has been successfully added to the main Virtual Comm Port application window.
See Virtual Comm port has been created
Our new virtual COM port can be verified as created
  • Open two Multi-threaded TTY windows (the MTTTY serial terminal application). One window will be used for the USB Serial port connection, and one window will be used for the virtual serial port. In our image below, COM20 was the virtual COM port we had set up, and COM6 is connected directly to our device via a serial port (in this case converted from the USB port- Universal Serial Bus).
Open two NetBurner MTTTY application windows.
Open two NetBurner MTTTY application windows.
  • Click the “Connect” button on both application windows, and send data from the virtual serial port or USB serial port to confirm data is going back and forth.
Confirm connection between two MTTTY applications
Confirm connection between two MTTTY applications

Congratulations! You have now set up and tested your virtual COM port. We hope that you can see how this example can be expanded upon to incorporate your own legacy serial comm applications to work with newer computers that either have too few DB9 RS-232-style ports or none at all.

License Terms

Permission is hereby granted to purchasers of NetBurner System-on-Modules and serial-to-Ethernet modules (NetBurner Devices) to use this program to create a virtual serial communications port on a Windows computer so long as the sole purpose is to connect to the NetBurner Device. No other rights to use this program or its derivatives in part or in whole are granted.

Share this post

Subscribe to our Newsletter

Get monthly updates from our Learn Blog with the latest in IoT and Embedded technology news, trends, tutorial and best practices. Or just opt in for product change notifications.

9 thoughts on “How to Create a Virtual Serial Port (COM Port)

  1. Windows 10; The Specified INF Files could not be copied or installed. Program close. Attempted all compatibility settings.

    1. Hi Eric,

      Thank you for bringing this to our attention. It looks like the link for the Virtual COM port software was not pointing to the right file. Please feel free to try the download again and let us know if you run into any additional issues.

      Kind Regards,
      Jon

      1. The program does not emulate COM port for the PK70 EX 4-Port Serial to Ethernet Server. It seems that the Virtual COMM Port Driver (Windows XP – 10) installer (i.e. VirtualCommPort-2.2-windows-installer) installs the NBVirtualCommPort only but does not install the Virtual Serial Port Driver (vspdxp_install.exe) from Eltima. After the NBVirtualCommPort application is configured no com port appears in Windows 10 devices manager. The unpacked vspdxp_install.exe is of version 6.9.41.0 (2000-2008). Running it explicitly does not help either. Is it compatible with Windows 10? Also, if the NBVirtualCommPort is installed under the C:nburnVirtualCommPort, the path to sec_service.exe cannot be found. It does work if it is under C:VirtualCommPort.

        1. I am facing an identical issue trying to connect to an SBL2e. Did you ever resolve the issue?

          1. Hi Max,

            This is now resolved, and should be fixed in the latest version, 2.3. A Windows update had broken the functionality.

            Kind Regards,
            Jon

  2. Is it possible to set up a solution where, from a single computer, I can access multiple Cisco switch console ports over ethernet (USB console/serial ports with USB-A sockets on the switches) . i.e. some kind of command center with multiple switches defined and the ability to click between them effortlessly and bring up their unique console windows, have multiple sessions open at once etc. I understand I would probably need some kind of ethernet to USB-A serial hardware on each switch.

    1. Hi Tony, thanks for the question! If I understand the setup correctly, it should be possible to have multiple switches talk to a single computer over Ethernet with the use of Serial-to-Ethernet converters. You would need one converter per switch. They would allow you to connect to the console ports with a network connection from any computer on the same network using a SSH or Telnet client.

  3. Hi
    Can I send data from one computer to other computer through internet cable which is in a same lan. If so, How to transfer data from one Virtual serial port to other port. Please provide step by step process.
    Regards,
    Vino

    1. Hi Vino,

      The process described in the article (and the software we provide) is really only applicable for individuals using our serial to Ethernet devices. You can connect two virtual serial ports together as you described across a LAN, but will need more general software to do so. You can find this from Eltima. You will need one virtual serial port to be set up as the server, and the other as the client. The client will then initiate the connection to the server, and at that point, you will be able to start sending data across the virtual serial ports. Good luck!

      Kind Regards,
      Jon

Leave a Reply
Click to access the login or register cheese