Wednesday, December 12, 2007

Null-modem emulator (com0com)

As described in my previous post, Palm Simulators, I wanted a better way to get two serial (COM) ports "wired together", at least virtually, for two pieces of software to work together that were both expecting to communicate together through serial ports.

Yes, this could be done through hardware, but this requires having two, available serial ports. Most computers no longer come with any serial ports, especially laptops. Even if they are available, using both for one application may be a rather large sacrifice. Even then, the appropriate cable (and possibly an adapter) would be needed.

With all the virtualization options that are now available, I knew there had to be a better option. The first Internet search result I found led me to Virtual Null Modem. 3 versions are available, ranging from $35-$70. Even if a full version was $20, I would have had a hard time justifying it.

Fortunately, I quickly found a project hosted on SourceForge: Null-modem emulator (com0com) - free and open-source, and without any artificial restrictions. It even provides both a GUI and a command-line interface to change the available options, including pin mappings!

The same project also hosts a few other related tools, though I've not yet tried them. "com2tcp" allows for bridging a serial port over TCP/IP. "hub4com" allows multiple applications to share a single serial device.

Another alternative that may be worth looking into is N8VB_vCOM Virtual Null Modem Cable on BerliOS. I've not tried it, it's still listed as Beta, and there hasn't been a release since mid-2005, but it does have a version (and is also free and open-source).


Anonymous said...

It would have been useful if you posted an example of say how to set it up to emulate a null modem between COM4 and COM5

Mark A. Ziesemer said...

Useful instructions are available at the com0com project web site, available at the link in the original post. I see no need to duplicate that information here.

Anonymous said...

What instruction are you talking about?
They tell you to refer to the read me text, but they never explain how to create a new virtual port. They just talk about routing the data!!!

Mark A. Ziesemer said...

In the "ReadMe.txt for com0com" link, look under the "INSTALLING" section. Particularly, search for "Simply run the installer".

If you still have issues, I'd recommend submitting a support request on the SourceForge project page at