1. What Is Communication
To understand RS485 communication, we first need to clarify what communication is. In fact, communication is the transmission of 0 and 1 codes between two devices, where 0 represents low level and 1 represents high level. If device A transmits data to device B, then device A and device B must be connected via a cable. If device A wants to send the code 101010 to device B, it must generate the combination of high and low levels shown in Figure 1-1 at its communication port. Through the cable medium, device B’s communication port will receive this combination of high and low levels and translate it into the binary code 101010, thus completing the data transmission from device A to device B. The same principle applies for data transmission from device B to device A.
Figure1-1
At this point, we also need to explain the concepts of full duplex, half duplex, communication rate, and master-slave communication.
Full Duplex means that the communication port can send and receive data simultaneously, while Half Duplex means that at any given moment, the communication port can either send data or receive data, but not both at the same time.
Communication Rate refers to the number of 01 codes (or high and low levels) sent by the communication port within 1 second. For example, if we say the communication rate is 9.6kbps, it means the communication port sends 9600 bits of data per second, which translates to generating a total of 9600 high and low levels per second (note that this total includes both high and low levels).
Master-Slave Communication indicates that in a communication network, one station acts as the master, while other stations act as slaves. Data can be directly transmitted between the master and slaves, but slaves cannot directly communicate with each other. If slaves want to exchange data, they must go through the master, as shown in Figure 1-2.
Figure 1-2
2. RS485 Communication
Now that we understand the basic concepts of communication, we can find RS485 communication relatively easier to grasp. We will introduce it from four aspects: communication medium, communication method, communication type, and physical layer.
Communication Medium: Shielded twisted pair, which is the commonly used two-core cable with a shielding layer, as shown in Figure 2-1.
Figure 2-1
Communication Method: Half Duplex
Communication Type: Master-Slave Communication
Physical Layer: 9-pin interface. It is important to note that usually for the 9-pin interface of RS485, we only need to connect the two-core cable to pins 3 and 8, where pin 3 is the signal “+” and pin 8 is the signal “-”. Figure 2-2 shows the female connector, while Figure 2-3 shows the male connector.
3. Communication Protocol
Finally, let’s clarify the concept of communication protocol. Many friends often confuse communication protocol with the physical layer of communication. When asked what protocol is used for communication, many people say, “I use the RS485 protocol or the RS232 protocol.” This is a typical confusion between communication protocol and physical layer. To illustrate, it is like making a phone call: the phone represents the physical layer, while the language spoken between the callers represents the protocol. The same physical layer can transmit different protocols, just like people on both ends of the phone can speak either Chinese or English. Chinese is one protocol, while English is another. RS485 is like the phone as a physical layer, which can transmit the Modbus protocol or the Profibus protocol. This analogy should clearly reflect the relationship between communication protocol and physical layer.
In this article, we will first introduce the basic concepts of communication and the physical layer of RS485 communication. It is important to establish a basic understanding. I believe that to truly understand communication, it is crucial to comprehend the concept of protocol. In the future, I will update a series of articles to help everyone gradually understand and master RS485 communication.
Author: Jicheng Training Network (Ma Le)
Copyright belongs to Jicheng, unauthorized theft will be pursued!
Series Articles
This great system must be shared!
Reply with the following keywords to get related articles
RS485, Proximity Switch, Multimeter, Electrician, Cable Selection Free Class PLCVideo PreviewInverter Control Electrician Mnemonics
Click “Read Original” for more exciting content