The working principle of Serial Device Servers

First, the serial device server definition and description:

Serial server is between RS-232/485/422 to TCP / IP communications for data conversion interface converter. It provides RS-232/485/422 serial port and terminal TCP / IP network transparent two-way data transmission, providing serial to network functions, RS-232/485/422 transfer network solutions. It allows serial devices can now join the network.

With the widespread popularity of the Internet, “Let all the devices connected to the network” has become the consensus of the world’s businesses. In order to keep up with the trend of network automation, and will not lose its competitive edge, we must establish a high-quality data acquisition, production monitoring, real-time cost management of networked systems. Use to achieve TCP / IP serial data stream based on control and management of hardware devices, without having to invest a lot of manpower and material resources to be managed, replaced or upgraded.

Serial Server makes TCP / IP-based serial data stream as possible, it will connect multiple serial devices and serial data stream can be selected and processed data to the existing RS 232 interface is converted into IP port data, then IP-based management, IP-based data access, so you can send the traditional popular IP serial data channel, without prematurely out of the original equipment, thereby increasing the utilization of existing equipment rate, saving investment, but also to simplify the complexity of the wiring on the existing network infrastructure. Serial server to complete a connection-oriented RS 232 link and connectionless Ethernet for communications between the data storage control system for a variety of data processing, process serial data stream from the serial device, and format conversion, making the data frame can be transmitted in Ethernet; data from the Ethernet frame to judge, and converted into serial data delivered in response to serial devices.

Second, the serial server features:

Internal integration ARP, IP, TCP, HTTP, ICMP, SOCK5, UDP, DNS and other protocols. RS-485/422 provides automatic data conversion control. RS-232/422/485 serial interface triple, 300-230.4KBPS baud rate. Support for dynamic IP (DHCP) and static IP, gateway and proxy server support, data can be transmitted over the Internet. Provide transparent bidirectional data transmission, users do not need to make any changes to the original system. All serial ports built-600W lightning. 10 / 100M Ethernet, automatically detect straight-through or crossover cable. It can support multiple connections.

Third, the serial port server operating mode and the communication mode:

Way of working:

1. Server mode: In this operating mode, Serial Device Server as TCP server, converter platform program listens for connection requests on the specified TCP port, the approach is more suitable to a converter program to establish a connection with multiple platforms ( A converter can not establish a connection with multiple platforms program).

2. Client mode: In this operating mode, Serial Device Server as TCP Client, converter initiative program requests a connection to the internet on power, the approach is more suitable to multiple converters at the same time to establish a connection to a platform program.

Communication modes:

1. point communication mode: In this mode, the converter used in pairs, one as a server, one as a client to establish a connection between the two, two-way transparent transmission of data. This mode is suitable for the bus connection between two serial devices engineered to TCP / IP network connection.

2. Use virtual serial communication mode: In this mode, one or more converters to establish a connection with a computer, two-way transparent transmission of data. By the virtual serial port software management following converter on your computer, you can achieve a virtual serial port corresponding to a plurality of converters, N corresponds to the M virtual serial converter (N <= M). This mode is suitable for serial devices controlled by computer 485 or 232 devices.

3. Web-based communication mode: In this mode, the application on the PC SOCKET protocol based communications program written in the converter settings can be selected directly support SOCKET protocol.

Fourth, the serial server applications:

It is mainly used in access control systems, time and attendance system, Shoufan systems, POS systems, building automation systems, self-service banking system telecommunications room monitoring, power monitoring.

Fifth, the hardware system and its modules:

1. Hardware system

Hardware system is the foundation of the whole system function, is the key to the whole design implementation.

Key to the whole serial server that converts serial data packets and TCP / IP data packets between the two sides as well as the existence of data because of different rates of speed matching problem, the serial port server implementation, must also be made important consideration in the design and whether the selected device can perform these functions.

(1) hardware system modules

Technical difficulties in developing the design and the selected device encountered was how to use the processor serial data information TCP / IP protocol processing, so that it becomes possible transmission of IP packets over the Internet. Currently a lot of time to solve this problem using the 32-bit MCU + RTOS program, this program is the use of 32 high-end microcontroller software development on RTOS (Real Time Operating System) platform, TCP / IP in embedded systems protocol processing. The disadvantage is: SCM higher prices, longer development cycle; RTOS developers need to buy expensive software development capabilities to developers demanding.

Learn the advantages and disadvantages of the above programs, we decided to port the server hardware design is divided into several modules, which is several modules main processing module, serial data processing module and Ethernet interface and control module to have completed the serial server functionality .

In the selection of the device, the choice of Intel’s 801,086 chip as the main processor chip processing module, which is a very suitable for high-performance embedded applications, 16-bit microprocessor highly integrated, low-power consumption. Taking into account both sides of the lower speed serial data rates and Ethernet data transfer rate caused by the mismatch problem, we decided in line with large-capacity memory bus specification as data storage; the main processing module also relates to a data line / address lines multiplexed serial to parallel conversion, an interrupt signal decoding device, the clock signal generation, signal access control and other functions, if the use of different devices to complete, will inevitably lead to many problems such as delay inequality, we use a piece large-capacity high-performance programmable logic device to complete the functions of the above mentioned, the advantage is that we ensure the stability and reliability of programmable logic devices and programmable feature allows for the processing of signals in space more big, and has the advantage of the upgrade.

Ethernet interface and control module plays a very important role in the serial server hardware inside, it processes the IP packets from Ethernet, taking into account the principles of universality, we use a Ethernet controller chip to complete these function, and add a piece of AT24C01 to store Ethernet controller chip status in the main processing module. Through the main processing module for the Ethernet controller chip data and register read / write, we can complete the IP packet analysis, working solution / pressure package.

Serial data processing module to complete the level for serial data format conversion and data stream processing, judgment start bit serial data and stop bits, complete extraction of the data and parity bits. General design is used in a UART MAX232 and design ideas, where we also follow this design concept, but we use the integrated MAX232 + UART chip functionality, small size, low cost, low power consumption, and the use and SPITM / QS-PITM / MICROWIRETM compatible serial interface, saving board space and microcontroller I / O ports.

The advantage of this modular approach is that: the use of high-speed 16-bit microcontroller, and peripheral devices, low system costs; and the use of Intel’s development platform, can greatly shorten the development cycle and reduce development costs.

(2) hardware workflow and application architecture

First, the main processor to initialize the network and serial devices, when data from the Ethernet transmission over packet processor to analyze, and if ARP (Address Resolution physics) packets, then the program into the ARP handler; if IP data package and transport layer uses UDP, the port is correct, then that data packet is correct, data unpack the data portion by the corresponding serial output port. Conversely, if the received data from the serial port, the data is packaged in accordance with the UDP format, into Ethernet controller chip, its output data to the Ethernet. May know, the main processing module processing TCP / IP network layer and the transport layer, link layer partially completed by the Ethernet controller chip. Application layer delivery system to handle software, users can process data received on demand.

2. Hardware system modules

Depending on the structure of the hardware system and different functions, we can be a hardware system is divided into the following several modules.

(1) Main processor module

This module is the core part of the server’s serial port, mainly by the main processor, programmable logic devices, data and program memory and other devices.

The main processing module to complete the main functions are: to establish a data link between the serial data and Ethernet IP data; controlling reading and writing through the Ethernet control chip to achieve receive and transmit IP data packet; determining a serial data stream format, complete the serial device selection and designation of the serial data stream format; control rate serial data stream and IP data packets between the control, data buffering; for UART and Ethernet control chip registers read write operations, and store and forward device status; the completion of the serial-parallel converter 16 bus data; complete bus address latch function; the completion of each port and each memory device chip-select functions; complete the interrupt status of each serial port discrimination, etc. Features.

(2) Ethernet interface and a control module

The module consists of an Ethernet interface and Ethernet control section parts.

Ethernet interface is partially completed function serial server and Ethernet interface circuit, a controller module has controls for all the role of the entire interface circuit to a coordinated manner with the follow-up circuit complete Ethernet transceiver functions.

Ethernet control in part by the receiving end and the originator of the composition, among them there are Ethernet status detection and control unit, as well as send and receive coordination controller, shown in Figure 5. Since Ethernet is half-duplex, so this part must be ready to monitor the status of Ethernet and Ethernet as needed to control, but also to coordinate the work of a good state of internal transceiver side of the circuit. Ethernet detection unit and transceiver coordination controller is to complete this function. Ethernet controller interface state detection unit and Ethernet interface, the state of the interface to send and receive coordination controller, while the control signal from the controller will coordinate processed and sent to the Ethernet interface controller to control interface state.

At the receiving end, the received serial data stream signal through the main processing module string and conversion and encoding, Ethernet control unit controls each section coordination, the resulting address, data, write to the RAM write control signal processing unit . Accordingly, work processes, and the originator of the opposite receiving end.