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.
Solved! Go to Solution.
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 !!
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.
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.
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.