3
\$\begingroup\$

We have a program in Windows OS which is capable of reading serial data from an RS232 port or USB ports. We have a device which is only using RS485 communication (2 wire-half duplex).

Is there a way to use DB9 cable for reading data or should we convert RS485 to RS232 or USB? And if we do it is that enough for the program to read the data?

\$\endgroup\$
  • \$\begingroup\$ For a quick experimental monitoring-only solution (no transmitting) you may actually be able to connect one half or the other of the differential pair to the single RS232 input and receive data, though not necessarily in a manner compliant with the specification. That's because RS232 receivers will typically register voltage levels much lower than those which RS232 transmitters are supposed to send, and in the absence of noise that may be enough. \$\endgroup\$ – Chris Stratton Jan 27 '14 at 22:53
4
\$\begingroup\$

RS-485 is not compatible with RS-232 in voltage levels, so you'll need either a USB-to-RS-485 or RS-232-to-RS-485 converter.

Beyond that, it's really impossible to say if it will work or not. The protocol might not be compatible since you are typically not controlling exactly when the RS-485 driver relinquishes the bus (it's usually done by some kind of timer in the unit).

You might have to add some kind of delays at one end or the other to allow that to happen properly. Usually it will work out of the box, but there is no guarantee that just because the voltage levels and baud rates are compatible that the protocol will be compatible.

With RS-485 data going both ways is transmitted on a single differential pair, so the possibility of collisions exists even with only two devices on the bus.

Here is a white paper that covers the issues.

\$\endgroup\$
  • \$\begingroup\$ do you mean even if I buy a RS-232-to-RS-485 converter it still might not work? \$\endgroup\$ – user16307 Jan 27 '14 at 22:02
  • \$\begingroup\$ @user16307 - Yes. That is what he said. \$\endgroup\$ – Michael Karas Jan 27 '14 at 22:08
  • \$\begingroup\$ but please tell me my program's baudrate normally is arranged same with the outputting device. i know the baudrate of RS485 device and if I use a RS-485-to-RS-232 converter will the baudrate change? How can I know the new baudrate parity ect stuff after conversion with an adapter? \$\endgroup\$ – user16307 Jan 27 '14 at 22:14
  • \$\begingroup\$ Usually there is no change to the baud rate, etc. from the port configuration in the PC. \$\endgroup\$ – Spehro Pefhany Jan 27 '14 at 22:17
  • 2
    \$\begingroup\$ Note that if the PC is only monitoring and never transmitting, most of the potential problems in turning around the line are eliminated. \$\endgroup\$ – Chris Stratton Jan 27 '14 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.