This post isn’t about angling for fish called Com Ports, nor is it about any kind of lurid Com Port activity. It’s about how some contemporary USB-based instruments use a traditional device at the software level to provide a lot of programming flexibility.
Plain and simple, the phrase COM port refers to a serial port interface of the old RS-232 variety. Largely missing from PCs at the hardware level these days, COM ports used to be as common as power buttons. They were THE way to interface external devices of all kinds to a personal computer and countless products of all types like scales, vernier calipers, data acquisition, printers, and many more were developed with COM ports for this purpose. And all PC-side programming languages provided special commands to read data to and from the COM port to allow easy access to external data and control at the software level. You’d connect an external device to a PC’s COM port, load the appropriate software, and have instant measurement automation. Over time, hardware COM ports were displaced almost entirely by USB ports, but the COM port lives on at the programming level because of its long, ubiquitous history.
So, an instrument manufacturer is presented with an interesting combination of options when deciding what kind of interface to place on his product and how best to communicate with it. Clearly at the hardware level, it doesn’t make sense to provide access via a standard RS-232 (COM) port. Few could connect that to a contemporary PC. Yet, it would be nice to provide software access to the device as though it had a real COM port on it, while providing a more common USB hardware interface.
In fact, various USB drivers exist that do just that, and a good example is DATAQ Instruments’ data acquisition starter kits. These new products all feature a USB interface along with a Windows driver that allows access to the hardware as though it’s really connected to a old style COM port. When a starter kit is connected to a USB interface and the proper software is installed, the operating system is instructed to hook a COM port. If you enable Windows’ Device Manager while the instrument is connected (see the nearby graphic), you won’t find the instrument under the USB category of devices. Instead, you’ll find it listed under Ports. Referring to the graphic, a model DI-149 starter kit was connected at the hardware level to a USB port, but from the software level it hooked COM port number 3. This means that any communication to or from the device occurs as though it’s connected to an old style RS-232 port as COM port 3, and all the programming tools designed specifically to work with COM ports apply.
COM ports can be hooked by other operating systems, too. One of the more popular alternatives to Windows is a Linux operating system, which provides its own mechanism for hooking COM ports that’s just as effective.
One final advantage to hooked COM port operation is that popular applications called terminal emulators can be used to communicate using ASCII characters typed right from the keyboard and read from the PC’s screen. More on those in my next post.