Submit your email address to get a link for quick download on your desktop and get started!
There are COM port tools available on Windows 10 by default, which don’t need to be installed. These are the Command Prompt and PowerShell. Both of these are command-line tools, and without third-party software, GUI tools for interaction with COM ports are very limited.
In this article, we will describe some basic port configuration and input/output commands for both PowerShell and CMD. Additionally, you can learn about Virtual Serial Port Driver - an easy-to-use solution that can help you create various types of connections between serial hardware and software.
The Command Prompt is a simple terminal with a DOS-like interface. It provides a range of simple commands for interaction with file systems, devices, and ports. The Command Prompt can be launched by typing “cmd” into the search box on the taskbar. If you want to access a COM port through CMD, you will need to run the mode command.
When it’s ran without any arguments, mode shows all available serial ports. You can also use it to set a port up:
mode [port name] [option]=[value]
You can then use the echo command to send text strings to one of the devices:
echo [text] > [port name]
While CMD is good for a quick test, PowerShell is recommended if you need any sort of automation. In addition, it provides a reliable way to read from a serial device, which CMD does not.
Note that you can also launch CMD on Windows 11 in Windows Terminal, by opening a new tab.
PowerShell is part terminal and part scripting language, able to access many system functions and variables in Windows. Even though it can be used to create complex scripts, PowerShell can also be used directly from the command line. Much like CMD, you can find it by typing “PowerShell” into the taskbar search box.
In order to access a port through PowerShell, it needs to be added as an object:
$port = new-Object System.IO.Ports.SerialPort [port name],[baud rate],[parity],[data bits],[stop bits]
Once added, it can be opened:
$port.Open()
A message can be sent to an open port with the WriteLine method:
$port.WriteLine(“test”)
Things are more complicated with ReadLine. This method reads one line at a time, meaning that you will need to loop it in order to read data continuously. In addition, if you want to output the data into a file, this will also require the use of Out-File. Both of these will need to be learned separately in order to apply them effectively.
PowerShell can also be opened on Windows 11 by opening a new tab in a Windows Terminal instance.
Virtual Serial Port Driver is an application that allows you to connect COM port devices and software with the use of virtual ports. The ports it creates are indistinguishable from real ones, and can be configured in a variety of ways - you can emulate a null-modem connection between two virtual ports, split or join physical ones, and more.
All of this is done through a simple graphical interface, which also provides information on port status and the amount of transferred data. The parameters of virtual ports are fully customizable, allowing them to be configured for use with a wide variety of devices and software. VSPD has a lengthy free trial, so give it a try! When it comes to commercial use, Virtual Serial Port Driver has a well-documented and versatile SDK as well.