Explicação pormenorizada da diferença entre RS232 e RS485

Friends who have used PLC should know that the communication between PLC and control equipment is basically based on the serial communication interface and is controlled using its corresponding communication protocol. The serial communication interface includes RS232, RS422, and RS485. , RS422 can be seen on Mitsubishi PLCs, but it is relatively rare for other PLCs and equipment. The focus of this article is to introduce the difference between RS232 and RS485.

RS232 serial communication interface

Let’s first introduce the interface standard of RS232. The RS-232 interface complies with the interface standard for serial data communication established by the Electronic Industries Alliance (EIA). It is widely used for computer serial interface peripheral connections, such as the one configured on some old-fashioned PCs. There is RS232 interface.

The working mode of RS232 is single-ended working mode. This is an unbalanced transmission mode. The logic levels of the signals at the sending and receiving ends are relative to the signal ground. RS232 was originally a product of DET (Digital Terminal Equipment) and DCE (Data Communication equipment) One-to-one communication, that is, point-to-point, is generally used for full-duplex transmission, but of course it can also be used for half-duplex transmission.

In addition, RS232 is negative logic, the logic level is ±5~±15V, and the transmission distance is short, only 15 meters. In practical applications, it can reach 50 meters, but any longer distance requires modulation.

Initially, the RS232 standard physical interface had 25 pins, because 9 pins were commonly used. Later, the DB9 connector was basically used. Let’s take a look at the pin definitions of the DB9 connector of RS232.

DTU/Edge Gateway/Plataforma IoT/Módulo Gateway

Among the 9 pins of DB9, not all signal terminals are used. For example, RTS/CTS is only used for switching between sending and receiving in half-duplex mode, but in full-duplex mode, due to the configuration Two-way channel so no need.

Generally speaking, in full-duplex mode, only three wires are enough for RS232 standard wiring, two data signal wires TXD/RXD, and one signal ground wire GND. The way to connect the two parties is to cross-connect TXD and RXD, directly connect the signal ground, then short-circuit their respective RTS/CTS, DSR/DTR, and leave DCD and RI floating.

DTU/Edge Gateway/Plataforma IoT/Módulo Gateway

RS485 serial communication interface

In order to improve the shortcomings of RS232 communication distance and low speed, EIA formulated the RS485 interface standard based on RS422. RS485 uses balanced transmission and differential reception, so it has the ability to suppress common mode interference. Its maximum transmission distance is 1200 meters , which can actually reach 3000 meters, and the transmission rate can reach up to 10Mbit/s. Therefore, RS-485 serial communication is generally used when the communication distance is required to be tens of meters to thousands of meters.

RS-485 uses half-duplex operation, allowing multi-point, two-way communication on a simple pair of shielded twisted pairs. However, only one point can be in the sending state at any time. Therefore, the sending circuit must be controlled by an enable signal. .

Different from RS232, RS485 works in a differential mode. The so-called differential working mode means that in a bunch of twisted pairs, one is defined as A and the other is defined as B. Normally, the positive level between sending drivers A and B is 2~6V, which is a logical state, the negative level is -2~6V, which is another logical state, and there is another signal ground C.

There is also an enable terminal in RS485, which is used to control the cutting and connecting of the sending driver and the transmission line. The receiver and transmitter make the same provisions, and the transmitter and receiver connect AA and BB correspondingly through a balanced twisted pair.

Because RS485 is a half-duplex communication method, there must be a signal to remind each other. According to what was said before, sending and receiving are actually converted through the enabling end. You can also think of this enabling end as a switch. When the switch, that is, the enable terminal signal is 1, the signal is output. When the enable terminal signal is 0, the signal cannot be output.

The RS485 standard physical interface also has 9 pins and has different identifications for pin definitions.

1. British symbols are TDA(-), TDB(), RDA(-), RDB(), GND

2. American signs are Y, Z, A, B, GND

3. Chinese symbols are TXD( )/A, TXD(-)/B, RXD(-), RXD( ), GND

The two lines of RS485 are generally defined as: “A, B” or “Date, Date-“, which is what we often call 485, 485-.

The specifics depend on the signal pins used by the manufacturer. Some RS485 may also use RTS or DTR pins. Let’s take a look at the DB9 pin definition of the RS485 port in Siemens S7-200PLC.

DTU/Edge Gateway/Plataforma IoT/Módulo Gateway

DTU/Edge Gateway/Plataforma IoT/Módulo Gateway

最后,我们总结一下RS232和RS485的区别,分别体现在通讯距离不同、速率不同、逻辑电平不同等,具体如下图所示。 Finally, we summarize the differences between RS232 and RS485, which are reflected in different communication distances, different rates, different logic levels, etc., as shown in the figure below. Finally, we summarize the differences between RS232 and RS485, which are reflected in different communication distances, different rates, different logic levels, etc., as shown in the figure below. Finally, we summarize the differences between RS232 and RS485, which are reflected in different communication distances, different rates, different logic levels, etc., as shown in the figure below.

DTU/Edge Gateway/Plataforma IoT/Módulo GatewayDTU/Edge Gateway/Plataforma IoT/Módulo Gateway

本文转载来源:今日头条-技成培训网(文章来源于网络,如果对您的利益照成损害,请联系我们删除) This article is reproduced from: Toutiao-Jicheng Training Network (the article comes from the Internet, if it is harmful to your interests, please contact us to delete it) This article is reproduced from: Toutiao-Jicheng Training Network (the article comes from the Internet, if it is harmful to your interests, please contact us to delete it) This article is reproduced from: Toutiao-Jicheng Training Network (the article comes from the Internet, if it is harmful to your interests, please contact us to delete it)

本文关键词:以太网数据传输设备Keywords in this article: Ethernet data transmission equipment Keywords in this article: Ethernet data transmission equipment Keywords in this article: Ethernet data transmission equipment

Contactar-nos