Null-Modem Cable vs Virtual Null Modem: When You Need the Real Cable

Somewhere in every serial-port project comes the question: do I need an actual null-modem cable, or the software that imitates one? They share a name because they do the same job — but in different places, and picking wrong wastes either a purchase or an afternoon. Here is the distinction, drawn sharply: a null-modem cable connects two physical machines (or a machine and a device); a virtual null modem connects two programs inside one machine. Software can never join two separate computers. Everything else is detail.

What a null-modem cable actually is

Serial ports come in two personalities: DTE (the computer) and DCE (the modem, historically). A normal “straight-through” cable assumes one of each: pin 2 transmits here and arrives at pin 3 there because the modem’s pins are mirrored. Connect two computers straight-through and both shout into pin 2 while listening on pin 3 — silence. A null-modem cable removes the imaginary modem: inside the cable, transmit crosses to receive (2↔3), and the handshake lines are crossed or looped back in matching pairs, so each computer believes it is talking to a modem that is always ready. That is the whole invention — a cable that lies, electrically, in a useful way.

DB9 pinSignalNull-modem treatment
3TX — transmitCrosses to pin 2 of the other end
2RX — receiveCrosses to pin 3 of the other end
5GroundStraight through
7 / 8RTS / CTSCrossed in full-handshake cables
4DTRCrossed to the other end’s DSR (pin 6, often with DCD, pin 1)

In practice you will meet two grades of the lie. A simple three-wire cable crosses TX/RX and carries ground; fine for software that ignores handshaking. A full-handshake cable (or adapter) also crosses or loops RTS/CTS and DTR/DSR/DCD, which older industrial and instrument software often insists on seeing before it will say a word. If a cable “should work” but a program never starts talking, handshaking is the usual suspect.

When you need the physical cable

  • Two separate PCs must exchange serial data — a modern machine talking to a vintage one, a laptop interrogating an embedded board’s console, two test rigs. Two machines means electricity must cross the gap; that is a cable’s (or a network’s) job, never a driver on one side.
  • A PC must talk to a real serial device whose other “end” is firmware — a scale, a CNC controller, a data logger, a radio. If the device expects a DTE partner wired as its modem, you need the crossed wiring, in an adapter or a cable.
  • The other end has no software you can install — sealed instruments, legacy PLCs, anything you may not modify. Physical problems get physical solutions.

When software is the answer

If both ends of the conversation are programs on the same PC — your application and its simulator, two test tools, a logger tapping a data stream through a pair — a cable is absurd and a virtual null-modem pair is the tool: two COM ports wired back-to-back in the kernel. That is what com0com creates, free; the walkthrough is creating your first pair, and the wider landscape from free to signed is covered in com0com alternatives. Modern PCs also have no serial port at all, which settles many arguments by itself: there is nowhere to plug the cable into, while the virtual pair needs nothing physical.

Cables, adapters and gender changers: the physical forms

The null-modem function comes in three physical packages, and the choice is about tidiness, not behaviour. A null-modem cable has the crossover wired along its length — one less joint to fail, and the right answer for a permanent run between two machines. A null-modem adapter is the crossover in a stubby DB9 body that converts any straight cable; it is the diagnostician’s friend, because it can be inserted or removed in seconds when you are not sure which wiring a device expects. Gender changers do no crossing at all — they exist because both your cable and your device presented the same connector sex, and they are bought in pairs and with regret. When in doubt, the adapter wins: the two-minute test below turns “is it the wiring?” from a purchase into a thirty-second experiment.

One modern wrinkle: the “two PCs” are often two laptops with no serial ports at all, so the full physical chain becomes USB adapter, null-modem cable, USB adapter. That chain works fine, and each adapter receives its own COM number on its own machine — but it is also the moment to price the network option at the end of this page, because two adapters and a cable buy a great deal of Ethernet.

DB9, DB25 and the connector zoo

One more physical reality before you order: “serial port” is a function, not a shape. The original RS-232 connector was the 25-pin DB25; the PC world shrank it to the 9-pin DB9 (strictly, DE9) that adapters wear today; network equipment hides the same signals in RJ45 console ports with vendor-specific pinouts; and industrial gear may present bare screw terminals. None of these change the electrical conversation — a passive adapter between DB9 and DB25 is just wires landing on the right pins — but each end of your run must be inventoried before you buy, because the correct order is “a null-modem cable in the connectors both ends actually have”, and the incorrect order is the one that arrives. When the far end is a console port on network equipment, its own console cable is part of the run, and the null-modem question is answered by that cable’s design rather than yours.

Buying the cable (and the port to plug it into)

If your setup is in the physical camp, the shopping list is short and cheap. You need a null-modem cable or adapter with the right connectors for both ends (DB9 female-to-female is the classic; check your device, DB25 still roams the industrial wild), wired for full handshaking if your software is old or unknown. And if the PC end is any machine built in the last decade, it has no serial port, so you also need a USB-to-serial adapter — at which point the chipset advice in the adapter buying guide applies: the cable can be perfect and the adapter can still ruin your week. Current options, both sponsored: null-modem cables on Amazon and USB-to-serial adapters on Amazon.

Wiring two real PCs: the two-minute test

Once the cable (and adapters, if any) are in place, prove the link before involving your real software:

  • On each PC, note which COM port the cable arrived as (Device Manager → Ports). If one side is a USB adapter, this is where you learn its assigned number.
  • Open a terminal on both ends — the settings ritual is in the PuTTY loopback test guide: same speed on both sides (start at 9600), 8 data bits, no parity, 1 stop bit, and flow control set to None for a first test.
  • Type in one terminal. The characters should appear in the other. Type back. Two-way text means wiring, ports and settings are all correct, and any remaining problem belongs to your application, not the link.
  • Nothing arriving? Swap your suspicion in order: flow control still on, mismatched speeds, a straight-through cable sold as null-modem (more common than anyone admits), then the handshake-hungry program problem described above.

The third option nobody mentions: the network

Two machines that both have Ethernet often do not need a serial cable at all — one machine can expose its serial port over TCP and the other can connect a virtual port to it, which is the entire subject of our RFC 2217 recipes and the com2tcp guide. The cable is local, simple and electrons-honest; the network is flexible. Know which problem you have, buy (or download) exactly that, and may your TX always find an RX.

Similar Posts

Leave a Reply

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