How to convert serial port signal to Ethernet signal?

As the earliest means of communication between electronic devices, serial ports are widely used in the industrial field. Today, serial port bus equipment on-site in the industrial field still has a very high share. With the rapid development of science and technology, the amount of information communication data has increased, and the shortcomings of serial communication distance and slow transmission rate have gradually become prominent. Therefore, equipment that converts serial port signals into Ethernet signals emerged as the times require.

The serial port server is a communication interface converter that completes data conversion between the serial port and the TCP/IP network. It provides two-way transparent data transmission between the serial port and Ethernet. It also provides the serial port to network function, allowing the serial port device to connect to the network immediately.

Serial Server

Serial to Ethernet is not a simple conversion between the physical layer and the data link layer. Since the serial port protocol itself does not have a network layer and a transport layer, serial port to Ethernet actually uses the serial port data as TCP/IP application layer data and uses TCP/IP to encapsulate and transmit it. The application layer data of TCP/IP is the truly effective data that TCP/IP wants to transmit. For example, what the user receives and sends through the recv() and send() functions of the socket is actually application layer data. In this way, users who convert the serial port to TCP/IP can use the recv() and send() functions to send and receive serial port data.

But TCP/IP is not just as simple as recv() and send(). Depending on the working mode, it is related to connection, shutdown, monitoring, etc. This is the part that needs to be added after the serial port is transferred to the network port. The working modes of TCP IP can be divided into: TCP server mode (TCP Server), TCP client mode (TCP Client), and UDP mode.

TCP mode: TCP mode adopts a reliable data transmission mechanism, so it can ensure that the data is basically free of bit errors and loss. In TCP communication, it must be composed of two ends of the communication, one of which is the TCP client and the other is the TCP server.

UDP mode: UDP mode is based on a non-connection mode. As long as there is data to send, it can be sent without prior connection. So this mode is closer to the serial port communication method. However, the UDP protocol cannot guarantee that data will not be lost and is prone to bit errors.

What are the definitions of serial to Ethernet and serial to TCP/IP?

Generally speaking, the serial port is a UART, which actually only defines the specifications of the data link layer, that is, the start bit, data bit, and stop bit. However, different physical layers are divided into: TTL serial port, RS232 serial port, RS485 serial port, etc.

TTL serial port: It is a serial port for data communication between MCU chips. It represents 1 with 5V (or 3.3V) and 0 with GND.

RS232 serial port: It is a serial port that realizes communication between devices. It mainly changes the signal voltage from 0~5V to ±15V (actually it is generally ±12V). The increase in voltage increases the distance and reliability of data transmission.

RS485 serial port: It is a serial port that realizes long-distance communication and can realize data transmission over thousands of meters. Its main feature is to replace the RS232 common mode signal (the voltage between the signal line and GND) with a differential mode signal (the voltage between the A and B lines), so that it can resist common mode interference and achieve longer distance transmission. .

If divided according to ISO’s 7-layer model (physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer), the serial port actually only includes the physical layer and data link layer. The TCP/IP protocol should belong to the network layer and transport layer. So converting serial port to TCP/IP is not accurate. Ethernet belongs to the physical layer and data link layer, so serial port to Ethernet is more accurate.

X

Please enable JavaScript in your browser to complete this form.
Enter product details such as interface configuration, environment etc. and other specific requirements to receive an accurate quote.

en_USEnglish
Please enable JavaScript in your browser to complete this form.
Enter product details such as interface configuration, environment etc. and other specific requirements to receive an accurate quote.