Designed & Made in the USA Since 1983

Null Modem vs. Straight-Through: Which RS-232 Cable Does Your Gage Need (and What to Do When Neither Works)

How to tell which RS-232 cable your gage needs, test it in two minutes, and fix the wiring when neither cable works.

LinkedIn
Reddit
Threads
Facebook
X
Email

Your gage is plugged in. The COM port opens in ComTestSerial. The settings match the manual: 9600-N-8-1. You press the data button and nothing arrives.

When the communication parameters are right and the port is open, the problem is usually one of two things: the RS-232 device isn’t set to output data, or the cable is wrong. On the wiring side, the most common cause is two devices trying to transmit on the same wire. This guide explains why that happens, how to identify what you have in under two minutes, and what to do when the device doesn’t follow the standard at all.

Quick answer

  • A straight-through cable connects each pin to the same pin on the other end (2 to 2, 3 to 3). Use it between a DTE device and a DCE device.
  • A null modem cable crosses transmit and receive (pin 2 to pin 3, pin 3 to pin 2), and often the handshake lines too. Use it between two DTE devices, such as a PC and an instrument wired like a PC.
  • Can’t tell which you have? Check continuity from pin 2 on one end. If it reaches pin 2, it’s straight-through. If it reaches pin 3, it’s null modem.
  • Neither works? The device may use a non-standard pinout or require handshake signals. A configurable adapter like the ProAdapter remaps the pins without soldering.

DTE vs. DCE: why the cable type matters

RS-232 was designed to connect a terminal or computer (DTE, Data Terminal Equipment) to a modem (DCE, Data Communication Equipment). The pin names are written from the DTE’s point of view:

  • A DTE device transmits on pin 3 and receives on pin 2.
  • A DCE device does the opposite: it transmits on pin 2 and receives on pin 3.

Connect a DTE to a DCE with a straight-through cable and everything lines up. Each transmitter feeds a receiver.

Connect two DTE devices with a straight-through cable and both transmitters drive pin 3. Both receivers listen on pin 2, where nothing is being sent. No data moves. The fix is a cable that swaps the lines in the middle. It’s called “null modem” because it lets two DTE devices talk directly, without the pair of modems that would originally have connected them.

Your PC’s serial port is DTE, and so is the port on a typical USB-to-serial adapter. Many gages, scales and instruments are also wired as DTE. Others are wired as DCE. The manual usually doesn’t say which, which is why this question comes up so often.

DTE to DCE and DTE to DTE RS-232 connections with straight-through and null modem cables

A straight-through cable works between DTE and DCE. Between two DTE devices, both transmit on pin 3 and nothing arrives until a null modem cable crosses the lines.

DB9 RS-232 pinout (DTE)

DB9 RS-232 connector pin numbering for male and female connectors, front view

DB9 pin numbering, viewed from the mating side. Pins 2, 3 and 5 are the only ones most gages use.

Pin
Signal
Direction (from DTE)
1
DCD (Data Carrier Detect)
In
2
RxD (Receive Data)
In
3
TxD (Transmit Data)
Out
4
DTR (Data Terminal Ready)
Out
5
GND (Signal Ground)
N/A
6
DSR (Data Set Ready)
In
7
RTS (Request to Send)
Out
8
CTS (Clear to Send)
In
9
RI (Ring Indicator)
In

Strictly speaking, the 9-pin connector is a DE-9; “DB9” is the name almost everyone uses. For most gage data collection, only pins 2, 3 and 5 matter. The handshake lines become important only when a device is configured for hardware flow control, which we cover below. For more background on baud rate, parity and RS-232 basics, see How to Interface with RS-232 Devices.

Straight-through vs. null modem pinouts

A straight-through cable is simple: pin 1 to pin 1, pin 2 to pin 2, and so on through pin 9.

A null modem cable is less standardized than the name suggests. Four wirings are commonly sold under the same label:

Variant
Data Lines
Ground
Handshake lines
Minimal (3-wire)
2 to 3, 3 to 2
5 to 5
Not connected
Loopback handshake
2 to 3, 3 to 2
5 to 5
7 and 8 jumpered on each end; 1, 4 and 6 jumpered on each end
Partial handshake
2 to 3, 3 to 2
5 to 5
4 to 6 crossed in both directions; 7 and 8 jumpered on each end and wired to pin 1 on the other end
Full handshake
2 to 3, 3 to 2
5 to 5
7 to 8, 8 to 7; 4 to 6 on the other end (both directions), often also to pin 1

All of them work for a device that ignores the handshake lines, which describes most gages. They behave differently for a device that waits for CTS or DSR before it transmits. If one null modem cable works and another “identical” one doesn’t, the variant is the likely reason.

Straight-through DB9 cable pinout, pins 1 through 9 wired to the same pin
Minimal 3-wire DB9 null modem pinout: pin 2 to 3, pin 3 to 2, pin 5 to 5
Loopback handshake DB9 null modem pinout with RTS-CTS and DTR-DSR-DCD jumpered on each end.
Full handshake DB9 null modem pinout with crossed data and handshake lines

Gender is not wiring

By convention, DTE ports are male and DCE ports are female. In practice that convention is not reliable, and connector gender says nothing about how a cable is wired inside.

The most common mix-up is with small DB9 adapters. A gender changer and a null modem adapter can look identical: same shell, same connectors on both ends. One passes every pin straight through. The other crosses pins 2 and 3. If you keep both in a toolbox, label them. The DB9 Adapter Kit includes one of each in both male-to-male and female-to-female.

How to tell which cable you have, and which one you need

1. Check the cable with a multimeter

Set the meter to continuity. Touch one probe to pin 2 on one end of the cable and find which pin on the other end beeps.

  • Pin 2 to pin 2: straight-through.
  • Pin 2 to pin 3: null modem. To identify the variant, check pin 7 against pin 8 twice: once across the cable (end to end) and once on the same connector. Do the same for pins 4 and 6. Compare the results to the table above. A beep on the same connector means a local loopback jumper; a beep end to end means a crossed handshake line.

2. Find the device’s transmit pin with a voltmeter

This tells you what the device is, without relying on the manual.

  1. Power the device on and leave it idle. Don’t trigger a reading.
  2. Put the black probe on pin 5 (signal ground).
  3. Measure pin 2, then pin 3.

An idle RS-232 transmitter sits in the “mark” state at a negative voltage, usually between −3 V and −12 V depending on the driver chip (the standard’s valid range is −3 V to −15 V). An unconnected receive pin reads close to 0 V.

  • Negative voltage on pin 3: the device transmits on pin 3, so it is wired as DTE. To connect it to a PC, you need a null modem cable.
  • Negative voltage on pin 2: the device transmits on pin 2, so it is wired as DCE. Use a straight-through cable.
  • Negative voltage on neither pin: check the three possibilities below.

Both pins near 0 V. Some low-power RS-232 driver chips shut their transmitters off when they don’t detect a valid signal on their receive inputs, and wake up as soon as one appears. Battery-powered instruments often use them. Connect the device to a powered PC serial port and measure again at the back of the connector. If both pins still read near 0 V, the transmit line may be on a different pin (see the next section).

Some devices draw their power from the PC’s DTR or RTS lines, and some use non-standard 0 V to +5 V outputs that never go negative. Both read near 0 V on their own.

A pin idles at a positive voltage, around +3.3 V or +5 V. The device is probably using TTL-level (logic-level) serial, not true RS-232. TTL serial idles high and swings between 0 V and its supply voltage, with the opposite polarity to RS-232. Changing the cable won’t fix that. Don’t connect it directly to an RS-232 port either, because RS-232 voltages can damage a logic-level input. Contact us and we’ll help you find the right interface.

Voltmeter test to find the RS-232 transmit pin and choose a null modem or straight-through cable

3. Confirm with a two-minute test

Open ComTestSerial, our free serial test program, on the PC’s COM port. Set the parameters from the device manual and trigger a reading. If nothing arrives, add a null modem adapter and try again. If data appears, you’ve found your answer.

ComTestSerial’s status indicators also show the state of the handshake lines, which helps with the next section. For a full walkthrough of finding the right COM port and reading the results, see COM Port Testing: Easy Windows Tools & Tips.

4. Use an RS-232 breakout box

If you troubleshoot serial devices often, an RS-232 breakout box (also sold as a DB9 line tester) is worth keeping on the bench. It plugs inline between the device and the cable and has an LED for each signal line. You can see at a glance which pins are being driven, which handshake lines are asserted, and which line flickers when the device sends a reading. Fuller-featured models add switches and jumper wires, so you can open individual lines and cross-connect pins to try a null modem or custom wiring before you buy or build a cable.

When neither cable works: non-standard RS-232 pinouts

Sometimes you’ve confirmed the parameters and tried both cable types, and the device still sends nothing, or sends garbage. At that point the problem is usually that the device doesn’t follow the standard DB9 pinout. Common patterns:

  • The device waits for a handshake signal. It won’t transmit until CTS or DSR is asserted. ComTestSerial’s handshake indicators stay off, and no data arrives with either cable.
  • Transmit, receive or ground are on non-standard pins. Some instruments use the DB9 for more than serial data: power, a footswitch input, or an analog output. The serial lines end up wherever the designer put them.
  • The device expects power on a DB9 pin. Some instruments draw power from, or supply power on, a pin that a standard cable doesn’t connect.
  • The original cable is discontinued. Legacy and discontinued measurement equipment is often wired for a manufacturer cable that is no longer sold, and the pinout is documented only in an old manual.

These situations show up most often with force gages, measurement amplifiers, older benchtop instruments, and equipment with proprietary RS-232 wiring.

Two ways to fix it

Option 1: Build a custom cable. Take the pinout from the device manual and solder a cable to match. It works, but each cable is a one-off. If the pinout guess is wrong, you re-solder. If the cable fails two years from now, the wiring may exist only in the memory of whoever built it. In a controlled measurement system, an undocumented hand-wired cable is a configuration you can’t easily reproduce or verify.

Option 2: Use a configurable adapter. The ProAdapter has an internal push-pin matrix that assigns Tx, Rx, RTS, CTS, DTR, DSR, power and ground to any of the 9 output pins, with no soldering. It has a male DB9 on one end and a female DB9 on the other. You can try a mapping, test it in ComTestSerial, and change it in minutes.

A repeatable workflow:

  1. Identify the device pinout from the manual, or use the voltmeter test above to find the transmit pin.
  2. Map the signals in the ProAdapter to match.
  3. Verify with ComTestSerial: trigger a reading and confirm clean data.
  4. Record the mapping and label the adapter, so the next technician, or the next audit, can see exactly how the gage is connected.

The ProAdapter works with WedgeLink AT, WedgeLink SP, the MobileCollect RS-232 Remote, and GageWay Pro (front-panel channels require the Level Converter Cable).

Choosing the right MicroRidge cable or adapter

Situation
What You Need
Wiring is correct, you need more reach
6′ DB9 Serial Extension Cable (straight-through, female to male)
Both devices transmit on the same pin
DB9 Null Modem Cable (female to female)
Wiring is correct, connector genders don’t match
Gender changer from the DB9 Adapter Kit
Wiring needs a crossover and the genders don’t match
Null modem adapter from the DB9 Adapter Kit
Non-standard pinout, handshake requirements, or a discontinued cable
Going wireless with MobileCollect
RS-232 V2 Connector, DB9, available male or female, in Standard wiring (for DCE devices) or Null Modem wiring (for DTE devices). Use the voltmeter test above to choose.

Frequently Asked Questions

What is a null modem cable?

A null modem cable is an RS-232 serial cable that crosses the transmit and receive lines (pin 2 to pin 3, pin 3 to pin 2) so two DTE devices, such as a PC and an instrument, can communicate directly.

What is the DB9 null modem pinout?

At minimum: pin 2 to pin 3, pin 3 to pin 2, and pin 5 to pin 5. Full-handshake versions also connect pin 7 to pin 8, pin 8 to pin 7, and pin 4 to pin 6 on the opposite end in both directions, often with pin 1 tied to pin 6.

Is a crossover cable the same as a null modem cable?

For serial connections, yes. “DB9 crossover cable” and “null modem cable” describe the same thing. An Ethernet crossover cable is something different and not interchangeable.

Can I use a null modem adapter instead of a null modem cable?

Yes. A null modem adapter on the end of a straight-through cable gives the same crossover. Check that the adapter’s handshake wiring suits your device.

Will using the wrong cable damage my gage?

Swapping straight-through for null modem won’t normally damage RS-232 equipment, because RS-232 drivers and receivers are required to withstand indefinite short circuits to ground or to any voltage up to ±25 V. There are two exceptions: a device that supplies or expects power on a DB9 pin, and a device with TTL-level (logic-level) serial, which RS-232 voltages can damage. Check the manual before experimenting with either.

Does a USB-to-serial adapter change which cable I need?

No. Most USB-to-serial adapters present a DTE port, the same as a built-in PC serial port, so the same cable rules apply. If the adapter itself is the problem, see our FTDI driver page and Your USB Serial Converter Stopped Working.

Now get the data into your software

Once the device is sending data, the next problem is the computer side: virtual COM ports, drivers, and software that has to listen on the right port with the right settings. MicroRidge interfaces take that off your plate.

  • WedgeLink keyboard wedges turn RS-232 output into keystrokes, so readings land in Excel, your SPC software, or any program that accepts keyboard input. WedgeLink SP needs no drivers or software.
  • MobileCollect RS-232 transmitters send the same data wirelessly to a base receiver at the PC, with multiple devices paired to one base.
  • GageWay Pro connects several RS-232 devices to one PC through a single wired interface.

 

Request a demo kit and test it with your own equipment before you buy.

Leave a Reply

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