Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Does RS-485 2-wire mode actually require only 2 wires?

Solved!
Go to solution

Hi everybody,

 

I am using the on-board RS-485 port on a cRIO-9035 to communicate with a temperature controller. The controller is using 2-wire RS485, terminated with a DB9 with three pins on it, (A-, B+ & GND). The pinouts for the cRIO RS-485 port shows connections for 4-wires; TXD-, TXD+, RXD- & RXD+. I have established communication by shorting the TXD- & RXD- on the cRIO and connecting to A- on the temp controller and shorting the TXD+ & RXD+ and connecting to the B+ on the temp controller (see attached image). This works.

 

My question, however, is related to the port 'wire mode' attribute. I have tried changing it to RS485/Wire2-Auto in the hopes that it would remove the need for me to have to short the TX & RX wires at the cRIO but that didn't seem to work. Was hoping somebody could enlighten me on to what the purpose of this attribute is and what I should set it to, given my configuration. If there is any way to avoid having to short out the TX and RX wires, that would also be neat - though not a huge deal. If anything I'm looking to get a better understanding on using RS-485.

 

Thanks!

0 Kudos
Message 1 of 5
(6,149 Views)

Hi,

 

RS-485 interfaces are shown in many different ways. Just a few items I know (also related to your question)

Most information I retrieve from IC manufacturers. The design the RS-422 - 485 transceivers so they know how to do it !!

 

  • Normally the A is the + and the B is the -. In your picture they reversed. Luckily for all devices. Sometimes this will lead to strange connections to get it working.
  • To be able to handle both RS-422 and 485 the master is as in your picture. This way you can handle both but for RS-485 you have to make two connection.
  • If it is a single master configuration in RS-422 the master transmitter can be always enabled. If it is a RS-485 configuration the transmitter must be disabled after transmission so the receiver can receive data. That is the setting/attribute you refer to.
  • Always use a ground line. According to some manufacturers of devices this is not necessary. Some devices have no ground connection !
  • Use terminators at both sides. Preferable a fail-safe terminator at the master side and a passive one at the other end.
  • Wiring should be a daisy chain without stubs or short (< 10cm) stubs. 
  • With many connections (>32) look at the load drive capacity and unit load of the slaves.
  • ... I could go on.....

Kees

0 Kudos
Message 2 of 5
(6,112 Views)

Thank you for the detailed response KC. So if I understand you correctly, the 'wire mode' attribute has nothing to do with the actual connections necessary but more with the communication protocol - so I need to short the TX & RX lines together as shown in the picture regardless of the selected mode?

 

Also, can you elaborate a bit on termination of RS-485? I wasn't aware that it needed to be terminated, as it's not shown in the reference picture and it is operating without termination (that I know of). Appreciate the feedback.

0 Kudos
Message 3 of 5
(6,104 Views)
Solution
Accepted by topic author Ricky77

Hi Ricky,

 

The selected mode should correspond to the interface you want together with the connections. They are all linked.

In RS-422 mode (which is 4-wire) the 4-wire attribute mist be selected with no short between RX & TX.

In RS-485 mode (which is 2-wire) the 2-wire Auto attribute must be selected with the short between RX & TX.

In RS-422 mode the transmitter is always enabled (single master configuration) in RS-485 the transceiver must (automatically) switch between transmit and receive mode.

RS-422 can be used as a Full-duplex interface i.e. transmit and receive at the same time

RS-485 can only be used in Half-Duplex i.e. either transmit data or receive data.

 

You mentioned 'protocol'. Where we talked about is only hardware. As we say the first layer, the hardware layer. A communication protocol is 1 or more levels higher and is related to software. e.g. a ModBus protocol.

From the hardware perspective a line is used to transport data. Any data.

A protocol defines the rules how to communicate. Commands, formats, etc. This can be done through any hardware layer. RS-422, RS-485, RS-232, ethernet, smoke, etc.

 

Terminators:

RS-485 is a very robust interface. It will work also in harsh environments. When I connect two (or more) device together on my workbench I don't care about terminators, twisted pair cable, RS-485 cable, Ground connection,etc. Just using a few fires and it works. If it doesn't I have to keep in mind that I used a sh*t connection. 

If we are installing an interface at the customer site it has to work for many years and we want to be sure that it will always work.

So that is why we use the terminators, Daisy chain wiring and good RS-485 cable. 

RS-485 (and RS-422) are balanced lines. If you have an electronic background you know what that is. 

Balanced lines must be terminated to have a guaranteed energy transport. To be sure that the lines are forced in a idle state fail-safe terminators are use at one side. See attached picture.

Vcc and Gnd are the power supply connection of the RS-485 transceiver. 

 

At the outside it is not always possible to wire it this way. Look in the manual to see if your master has terminitors. If you are not able to create a fail-safe terminator use the next step. A passive terminator as connected to the end of the line.

 

Kees

 

Message 4 of 5
(6,096 Views)

Hi,Ricky77

Have you tested the voltage of idle level in 2-wire mode? Is it high or is it 0V?

0 Kudos
Message 5 of 5
(4,547 Views)