1. There are many practical applications of converting RS485 to Ethernet by using RS485 communication technology, especially in engineering. The advantages in engineering are as follows:
Wiring is very simple: only two wires are needed, and network cables with shielded wire interfaces are commonly used at present.
Long communication distance: compared with RS232; The communication distance of RS485 is much longer, which is due to the use of differential mode communication mode in RS485.
① Widely compatible with multiple servers to implement networking communication:
RS485 can connect or mount multiple server terminals at the same time, and maintain communication with multiple server terminals by waiting for queries and making detailed responses.
Compared with RS232, which can only be one-to-one, RS485 can achieve twice the result with half the effort.
② RS485 needs to be converted to Ethernet from time to time. Analyze the reasons in detail:
Ethernet is able to implement long-distance communication and data communication monitoring on a global scale because it can connect to the Internet.
However, RS485 can not be directly connected to the Internet. If you want to connect, you must use Ethernet as the transmission medium.
When multiple computers need to be connected to the computer, the traditional solution can only be used: using multiple serial port cards, but RS485 devices can not cope with it.
Simply speaking, while using multiple RS485 serial ports, the computer also needs to expand multiple serial ports to correspond to the RS485 serial ports, which is more troublesome and a waste of resources.
The stub data will be stored after the RS485 is converted to the Ethernet. If you want to store the stub data in the computer server, you need to keep a network cable at the end of the monitoring computer, so that the stub data of the RS485 interface can be left in place, and it is more convenient to use again.
2. Before implementing a specific RS485-to-Ethernet solution, a software driver and a hardware converter are required:
The hardware converter is divided into two types: serial server (serial communication server is serial networking server) and serial networking module.
The serial server of RS485 model is "wearing clothes" (with shell), which can make 485 devices indirectly connect to Ethernet, which is very in line with the transformation of the existing RS485 serial devices for networking.
The RS485 serial port networking module is "without clothes" (without shell), and the ERS485 serial device is equivalent to the embedded RS485 to Ethernet module.
By using the module form to solve the problem, the module can be packaged and transmitted to the inside of the user equipment, so that the data can be transmitted in time, and the integration of the serial server and the equipment is formed.
The hardware RS485 interface of the serial server is perfectly transformed into the TCP/IP interface (network interface) server of the computer, and is used alternately in this way. On the contrary, the virtual serial port server can drive the computer TCP/IP to be virtually converted into a serial port again.
The driver of the virtual serial port can bind the remote serial port server with these virtual serial ports, and can virtualize virtual serial port numbers such as COM5 and COM6 in the driver layer of the computer.
The user serial program opens the virtual serial program to communicate through the remote serial server, so as to complete the serial device data transmission communication.
The advantage of using the combination of software and hardware system to realize RS485 to Ethernet is that the user's 485 equipment indirectly realizes the expansion of network information, so that the original hardware and software programs do not need to be modified.
3. The key technology of RS485 to Ethernet If RS485 wants to upgrade to Ethernet seamlessly, it contains many key technologies, which need to combine Ethernet technology and RS485 communication protocol seamlessly for transition.
These include: framing technology, 9-bit technology, master-slave mechanism, etc. The following is a brief description: ① master-slave mechanism, ② framing technology, ③ 9-bit technology.
① Master-slave mechanism:
For the interconnection architecture of slave and multiple master buses, the role of decoder is very critical.
The host port has three decoders, which are the decoders of the write address channel, the write data channel, and the read address channel.
Its function is to convert the information of the internal register and the information of the channel to each other.
The port of the slave is the write response and the read data channel will have a decoder.
It is the role of the decoder to ensure that one party can pass in several other directions.
This design can be customized. If you know the details and content, you don't need to use a decoder.
② Framing technology:
The serial port server can receive the data of the serial port equipment by using the framing technology;
When to packetize and forward data to the Ethernet network? It is obviously inefficient to packetize each byte into one packet. How many bytes are packetized and when
The user needs to set a distance called the longest packet length and the longest packet interval.
On the other hand, if the data is packed and converted into Ethernet, then each byte is packed into a packet, which will greatly reduce the efficiency, and when will so many packets be completed! So framing technology solves this problem.
③ 9-bit technology:
In network communication, Ethernet has 8 bits of data space, and there is no space for 9 bits to be placed, so how to make 485 9 bits of data transmit to each other has become a big problem.
With the 9-bit technique, the user can send 9 bits of data space, and sometimes the 9th bit is used to represent either the address frame or the data frame.