How Do Distinguish Between RS232, RS485, RJ45, and Modbus?(5)
A few related questions to explain:
6)When the distance is very long, the RS485 interface can also be connected to optical fiber, but it needs to be equipped with a pair of optical fiber converters. The reason for having 1 pair is because one is for electricity to light and the second is for light to electricity. The communication medium in the middle of the optical fiber transceiver is the optical cable or optical fiber.
Optical fibers are divided into single-mode and multi-mode. The single-mode fiber is thinner, and the light is less reflected during the transmission process, so the distortion is small, and the transmission distance can reach more than 15km. The multi-mode fiber is thicker, and the light is reflected more during the transmission process, so the distortion is large, and the transmission distance is 1.5km.
7)The CRC check code is a binary division without borrowing, which is used to check whether the received information is wrong.
Before the master station sends a frame, it first performs CRC calculation on the frame, and then attaches the remainder of the CRC operation to the end of the frame and sends it to the slave station. After the slave station receives the frame, it first performs CRC operation on the part of the frame except the CRC to check whether it is correct. If it is not correct, the slave station requests the master station to retransmit.
Similarly, when the slave station sends information to the master station, the master station also checks the correctness of the data according to the CRC. If an error is found, the slave station is required to retransmit.
8)About MODBUS-RTU, MODBUS-ASC and MODBUS-TCP
If the way of expressing data in MODBUS adopts BCD code, it is called MODBUS-RTU; if the way of expressing data in MODBUS adopts ASCII code, it is called MODBUS-ASC; if MODBUS runs on the network layer, It is called MODBUS-TCP.
In actual use of MODBUS, most of them use BCD code, so MODBUS-RTU is widely used.
It is worth noting that: in the use of the protocol, the values in the data frame are expressed in hexadecimal numbers. For example, 100A current is written as 0X64H, and 380V voltage is written as 0X17CH.
9)About the twisted pair communication line and grounding used in the RS485 network
We know that there will be distributed capacitance between two parallel cables, and distributed capacitance will weaken the strength of the signal. In order to eliminate the distributed capacitance, the two parallel lines of the communication line need to be twisted and twisted with each other by a certain length, and this line is called a twisted pair. There is a specification for the twisted pair length, which is closely related to the communication rate. In actual use, the appropriate twisted pair should be selected according to the communication rate.
The outer layer of the twisted pair has a shield. The shielding layer must be grounded at a single point and must not be grounded at the head and tail of the wire at the same time to prevent the ground current from flowing and causing interference. In the actual wiring, each line segment is independently grounded, and the practice of uniformly grounding the shielding layers of all line segments before and after is strictly prohibited.
10)About the communication link connection method of chrysanthemum petals
An absolute daisy chain network does not exist. In fact, in the communication network constructed by the daisy-petal-chain connection method, each node is a terminal, and the terminal is connected to each substation through twisted pairs, and these twisted pairs form a similar star structure. We might as well call this connection method the quasi-star connection under the chain network.
It has been proved in engineering practice that the length of the quasi-star connection shall not exceed 70cm. Once exceeded, communication instability may occur.
The purpose of the terminating resistor is to absorb reflected waves.
For communication, whether it is a reflected wave or a standing wave, it will seriously affect the communication quality. Termination resistors are used to absorb reflected waves and increase the level of the final substation.
The two concepts of RS485 and MODBUS need to be mastered through practice. It is difficult to understand and master by reading the text alone. If this small article can bring benefits to your practical activities, I will be very pleased.