Rs485 Db9 Pin Assignment

RS485 DB9 on Connect Products

Using RS-485 on the DB9 port of Digi Connect / ConnectPort Products

Not all Digi products support RS-422/485; some support RS-232 only. Those which do support selectable RS-422/485 refer to this as Multi-Electrical Interface or MEI.

Digi Support has an official document that covers EIA-232/422/485 in general, which is document 90000253 and titled Cable Guide Including all PortServer TS, Digi Connect, and Digi One Products. The PDF is here: Document 90000253_E as-of Sept-2009

This Wiki page directly covers products which use a standard DB9 serial port (a DTE or PC-like port).

Relevant Digi Products

This discussion covers at least the following Digi Products:

  • Digi Connect SP
  • Digi Connect Wi-SP
  • Digi Connect WAN, WAN IA, WAN VPN
  • Digi Connect WAN 3G, WAN 3G IA

Pinouts

1DCD = InputCTS-- = InputNot Used
2RXD = InputRXD+ = InputRXD+ or Not Used
3TXD = OutputTXD+ = OutputDAT+ (often B)
4DTR = OutputRTS-- = OutputNot Used
5GND, SignalGND, SignalGND, Signal
6DSR = InputRXD-- = InputRXD-- or Not Used
7RTS = OutputRTS+ = OutputNot Used
8CTS = InputCTS+ = InputNot Used
9Not UsedTXD-- = OutputDAT-- (often A)

Note: "A" is often "-" and "B" is often "+". For historical reasons, some vendors reverse label "A" and "B", so it is a less predictable naming convention than +/- (which a few vendors also reverse label!) So make sure you try swapping the +/- (A/B) if you cannot communicate. EIA-422/485 compliant devices cannot be damaged by reverse wiring the +/- (A/B) signals.

Cable: RS-422/485 4-wire Full

  • Pins 3 and 9 are your Transmit pair, and they will connect to the RX/Receive pins of your remote or slave device(s).
  • Pins 2 and 6 are your Receive pair, and they will connect to the TX/Transmit pins of your remote or slave device(s).
  • Pins 7 should short to pin 8, this is RTS->CTS (+)
  • Pins 4 should short to pin 1, this is RTS->CTS (-)

Note Do you require the RTS/CTS loopback? Technically, the Digi product does not require this. However, this loopback is required if a user enables hardware flow control on the port, or if a remote application using Digi RealPort were to assert RTS and then expect CTS to be viewed as also asserted.

Cable: RS-422/485 4-wire Minimum

  • Pins 3 and 9 are your Transmit pair, and they will connect to the RX/Receive pins of your remote or slave device(s).
  • Pins 2 and 6 are your Receive pair, and they will connect to the TX/Transmit pins of your remote or slave device(s).
  • The RTS/CTS pins are ignored - See the RTS/CTS note under RS-422/485 4-wire Full cable.

Cable: RS-485 2-wire Full

  • Pins 3 and 9 are your Data+/Data- lines respectively
  • Pins 2 should short to pin 3, this shorts the Txd+ and Rxd+ to form Dat+
  • Pins 6 should short to pin 9, this shorts the Txd- and Rxd- to form Dat-
  • The RTS/CTS pins do not apply

Note Do you require the Txd/Rxd shorting? Technically, most Digi products do not require this. However, some future product might require it.

Cable: RS-485 2-wire Minimum

  • Pins 3 and 9 are your Data+/Data- lines respectively
  • Pins 2 and 6 are ignored - See the Txd/Rxd note under RS-485 2-wire Full cable.
  • The RTS/CTS pins do not apply

Products tested to work fine with either the RS-485 2-wire Full or Minimum 3-wire cable

  • Digi Connect WAN IA with 16MB memory (which implies it works on WAN and WAN VPN with 16MB memory since they share main boards)
  • Digi Connect WAN 3G/3G IA

Enabling RS-422/485

Software Select - Web UI

You will find the setting under the: Configuration > Serial Ports > Serial Port Configuration > The Multiple Electrical Interface (MEI) Serial Settings web page.

Software Select - Telnet/CLI

The set switches command is used. (See the appropriate Family Command Reference such as 90000566 for more information). RS-422 is considered RS-485 4-wire.

set switches [port=range] [mode={232|485}] [wires={two|four}] [termination={on|off}]

DIP Switches

Older Digi Connect products included 4 DIP switches to change between RS-232 and RS-485. Since most of these products have been converted to software select, these settings won't be covered here. Such products will have a label attached showing the settings.

About Termination and Bias

Although "termination" rarely has noticeable impact on RS-485, the line bias used to quiet idle floating lines is general critical. Failing to apply adequate line bias either causes complete RS-485 communications failure, or else causes intermittent noise problems which can be very hard to diagnose. You should always enable the termination on a Digi RS-485 port by default and then only disable it as a last resort when trying to solve a communication problem.

If the device(s) you are connecting already apply a line bias, then line bias within the Digi might be redundant or even disruptive.

Pin 5 Connection (Ground/Signal Reference) is Critical

Although RS-485 products FROM A SINGLE VENDOR can often run as pure 2 or 4-wire and no explicit ground, this rarely works reliably when mixing product from multiple vendors. This is because RS-485 2-wire is NOT a loop - a transmitting driver is sourcing a tiny current on both "+" and "-", while a receiving driver is sinking a tiny current on both "+" and "-". Thus a common ground reference must exist to complete the circuit.

So while a specific Vendor X can say "Our products work together without a 3rd (or 5th) Ground wire", they CANNOT say "Therefore other unknown products won't need a 3rd (or 5th) Ground wire to talk to us." This is a fallacy.

Using RS-422/485 to connect a Digi product to a third-party product without an explicit ground reference MIGHT work - but it might not. Or it might generally work and intermittently NOT work. Therefore assume that you need to properly handle the ground/signal return.

If the third party product lacks a signal reference for the RS-422/485, try to find any signal which that product treats as a logic or signal ground. Worstcase, connect the Digi's signal ground via a 1-watt, 1000-ohm resister to the 0-volt/negative return of that product's DC power supply.

Symptoms of Missing Ground Wires

The most common symptom is that the communications works for a few hours, days, or weeks, then stops working for hours at a time. Rebooting the devices may restores communications (or may not). Refreshing the Digi MEI settings may restore communications (or may not). Disconnecting and reconnecting the cable may restore communications (or may not). But in all cases the failure will repeat again in a few hours, days or weeks.

© 2017Digi International Inc. All rights reserved.
RS485 DB9 on Connect Products updated on 19 Oct 2017 10:54 AM

The source content is published at:

http://zone.ni.com/devzone/cda/tut/p/id/3450

DE-9 (DB9) Connector

The DE-9 connector is the most common serial connector.  This connector is found on National Instrument’s one and two port serial interfaces.

Figure 1: Pinout diagram for DE-9 Connector

 To perform a loopback test with no hardware flow control, you will need to connect pins 2 and 3 for RS-232 and pins 4 to 8 and 5 to 9 for RS-422/485.  These connections can be seen in redbelow (figure 2 for RS-232 and figure 3 for RS-422/485). 

When using hardware flow control, you will need to connect pins 4 to 6 and 7 to 8 for RS-232.  Pins 7 and 8 are used for RTS/CTS hardware flow control where pins 4 and 6 are used for DTR/DSR hardware flow control.  For RS-422/485, you will need to connect pins 2 to 3 and 6 to 7.  Both of these connections are required for RTS/CTS hardware flow control since RS-422/485 have differential connections.  These connections can be seen in blue below (figure 2 for RS-232 and figure 3 for RS-422/485).

Figure 2: RS-232 female DE-9 plug with connections required for loopback test

Figure 3: RS-422/485 female DE-9 plug with connections required for loopback test

DB-25 Connector

This connector is not as common as the DE-9 connector.  This connector can still be used to perform a loopback test with a method similar to the one used for the DE-9 connector.

Figure 4: Pinout diagram for DB-25 Connector

Most of the pins on DB-25 connectors are not connected since only nine pins are used for RS-232, RS-422, and RS-485 communication. 

To perform a loopback test with no hardware flow control with a DB-25 connector, connect pins 2 to 3 for RS-232.  For RS-422/485 connect pins 5 to 20 and 7 to 22.  The required connections can be seen in red on figures 5 and 6.

For hardware flow control using RS-232, pins 4 and 5 must be connected along with pins 6 and 20. When using RS-422/485, pin 5 must connect to pin 20 and pin 7 must connect to pin 22.  This will allow the loopback test to use the proper flow control lines.  These connections can be seen in blue on figures 5 and 6.

Figure 5: RS-232 female DB-25 plug with connections required for loopback test

Figure 6: RS-422/485 female DB-25 plug with connections required for loopback test

10P10C (RJ50) Connector

This connector is most commonly found on National Instrument’s 4 port serial interfaces.  The National Instrument 4 port serial interfaces come with 4 10P10C to DE-9 male converter cables. 

Figure 7: Pinout diagram for RJ50 Connector

It is not recommended to use the 10P10C connector by itself to perform a loopback test due to the small separation between pins.  Using a 10P10C to DE-9 connector (Part Number 192190-01), a looback test can be performed using the methods described above. 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).

Was this article helpful?0 out of 0 found this helpful

Have more questions? Submit a request

Article is closed for comments.

One thought on “Rs485 Db9 Pin Assignment

Leave a Reply

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