Troubleshooting RS485 Connections

I'm having problems sending data across an RS485 connection between a Lantronix external device server and one or more RS485 devices. What can I do to troubleshoot this problem?


The most common cause of RS485 connection problems is cabling. There are two types of RS485 connection, "2-Wire" and "4-Wire". Here are some examples showing both types of connection:

Two-wire Mode

In two-wire mode, the MSS operates in half duplex: one pair of wires shares transmit and receive signals, and an optional third wire can be used for shield/ground. The main advantage of using two-wire mode is reduced cabling costs.

Figure 1: Example Two-wire Mode Network

Image

On a two-wire RS-485 network, the device server must turn its transmitter on when it is ready to send data and then off a certain period of time after the data has been sent so that the line is available to receive again. At most baud rate settings, the timing delay is typically one character length with a maximum of 1.5 character lengths.

NOTE: In some implementations, for 600 baud and 4800 baud operation, the timing delay is doubled.

Four-wire Mode

In four-wire mode, the MSS operates in full duplex: one pair of wires functions as the transmit pair, another pair of wires functions as the receive pair, and there is a shield/ground wire for each pair. In a fourwire RS-485 network, one device, such as the MSS, acts as master while
the other devices are slaves.

Figure 2: Example Four-wire Mode Network

Image


It is important to connect the transmitter of the master device to the wire that is connected to the receive terminals on the slave devices, and connect the receiver of the master device to the wire that is connected to the transmit terminals on the slave devices. In essence, the master device will be connected to the slave devices with a swapped cable. The MSS transmitter is always driving and the receiver is always enabled, so the MSS is able to send and receive data simultaneously. The advantages of four-wire mode are double the throughput of two-wire mode and a guaranteed open path to each slave device’s receiver.

On the older Lantronix device servers such as the MSS485 the terminals where labeled TXA, TXB, RXA and RXB to comply with the EIA-485 specification. Most current Lantronix products label the same terminals TX-, TX+, RX- and RX+. Both types of labelling are widely used in the industry.

To connect 2 RS485 devices together with a reasonably short cable, 5 to 10 feet, you'd use a cable wired like this:


Lantronix         4-Wire
Device                               RS485 
Server                               Device
TX- or TXA ------------------------- RX- or RXA
TX+ or TXB ------------------------- RX+ or RXB                    
RX+ or RXB ------------------------- TX+ or TXB
RX- or RXA ------------------------- TX- or TXA
Shield ----------------------------- Shield


or


Lantronix         2-Wire
Device                            RS485 
Server                            Device
- or A -------------------------- - or A
+ or B -------------------------- + or B 
Shield -------------------------- Shield

To avoid common mode currents (ground loops), only connect one end of the shield wire to ground..

For short cables between two RS485 devices in electrically quiet environments this is all you should need to do.

Thing get more complicated when:

  • you're using longer cables
  • multiple RS485 devices are connected to the device server
  • there is some source of electrical noise nearby

One common symptom of serial data transmission problems is Framing Errors. If you open the Line n Statistics page in the web manager of an EDS, IntelliBox, XPort Pro Evolution or other Evoluton-based device server, one of the counters will show framing errors.

A framing error indicates that at least one character in the data stream was garbled. Framing errors can be caused by:

1) Cable problems. Check to make sure all connections are tight and that you're using a good quality cable wired per the above diagram.

2) Bad serial port(s). Try replacing the RS485 devices one at a time with a known good device. If you're doing multi-drop RS485 then any one device with a bad serial port can cause problems for all the other devices on that cable.

3) Termination and/or biasing problems. This is usually only a problem if the cable is fairly long or if there are lots of RS485 devices on the same cable.

4) Electrical Noise. If there is an electric motor, high voltage power line, radio transmitter, microwave oven or other source of electrical noise near the device server, the cable or the connected serial device(s) it may cause framing errors.

5) Misconfigured serial ports. If one serial port is set to 7 bit, even parity and the other is set to 8 bit, no parity (for instance) then one of the symptoms may be framing errors.

6) A ground loop. If more than one device on the RS485 cable connects the shield to ground it can cause a ground loop. A ground loop can interfere with data by distorting the RS485 signal. If the shield is grounded in the middle of the cable (because it's accidentally touching some grounded metal object for instance) it can also cause a ground loop.



[Originally Published On: 07/21/2000 01:21 PM]