Check the wiring diagram for both serial devices. A straight-through cable carries each pin to the same pin at the other end. A null-modem cable crosses the transmit and receive lines. Two DB9 connectors can fit together even when the wiring is wrong for the equipment.

For an existing RS232 connection that needs a straight-through extension, the DB9 male-to-female serial cable comes in 0.5, 2 and 3 m. Match its male and female ends to the ports or cable you are extending.