Main points about RS485. How to log RS485 activity.
RS485 is a common communications standard that is widely used in data acquisition and control applications. One of its main advantages is that it allows putting several RS485 devices on the same bus which makes it possible for multiple nodes to connect with each other. This article covers some of the most commonly asked aspects of RS-485 communications and tells what RS485 communication is and how to efficiently analyze it.
- What is RS485?
- Software solution: RS485 data logger
- What is RS485 Modbus protocol?
What is RS485?
RS-485 interface (also referred to as EIA / TIA-485) is a standard of the physical layer of communication. The physical layer is the communication channel and the signal transmission method (level 1 of the OSI open system interconnection model).
Communication network built on the RS-485 interface consists of transceivers connected by a twisted pair (two twisted wires). The basic principle of RS-485 interface is differential (balanced) data transmission. That means one signal is transported over two wires. With that, one wire of the pair transmits the original signal and the other one transports its inverse copy.
How far can you run RS485?
As a result of differential signal transmission there is always a potential difference between the wires. This ensures high resistance to common mode interference. In addition, the twisted pair may be shielded, which ensures the protection of transmitted data. All this allows sending data over long distances at relatively high speeds, which can reach 100 kbits/s at 4000 feet. 4000 feet or about 1200 meters is the maximum cable length in RS-485 communications. A general guideline, however, is that the product of line length (in meters) and the data rate (in bits per second) should not be more than 108. For instance, a 20-meter cable allows a maximum data rate of 5 Mbits/s.
What is RS485 communication protocol?
When RS485 communication line is ready for operation at the physical level, it's time to think about the data transfer protocol - an agreement between the system's devices on the format of the data packets transmission.
By the nature of RS-485 interface, RS-485 devices cannot transmit and receive data at the same time, as it leads to a conflict of transmitters. Therefore, the deterministic behavior is mandatory to avoid collisions of data packets.
In RS485 communication protocol, the commands are sent by the node which is defined as a master. All other nodes connected to the master receive the data over RS485 ports. Depending on the information sent, zero or more nodes on the line respond to the master.
With that said, this type of communication is not the only possible way to exchange data over RS485 protocol. There are some other implementations of RS485 networks where every node can start the data transfer on its own. However, the risk of possible data loss is higher in such networks.
Software solution: RS485 data logger
Working with serial apps and devices, specialists often rely on dedicated software, like RS485 Analyzer by Eltima, to sniff and analyze serial port activity, detect errors, compare received data, etc.