Abstract: In practice application, combined with network system and management information system, the monitoring system can automatically process large amounts of data. Transmission, compression storage, resource sharing, providing effective, fast and convenient services to decision makers and managers at all levels. The Modbus protocol for remote monitoring systems is a standard, truly open network communication protocol and is widely used in industrial applications.
I. Introduction
The role of the monitoring system in production and life is becoming more and more important. For example, in the transportation, banking, power and other departments, the requirements of the monitoring system are getting higher and higher. The demand is also increasing. In the remote monitoring system, as a Various distributed control systems and industrial communication protocol Modbus protocol have been well applied in the industrial field. This paper elaborates on its meaning, system design architecture and system performance.
2. Analysis of the Modbus protocol
(1) Modbus protocol developed by Modbus protocol is a distributed control system and industrial communication protocol. It is well applied in distributed control system and industrial equipment communication. RS485 mode is adopted as physical interface. Controller is controlled via network. Communication between devices and communication protocols can become a common standard in industrial production. It can connect different control devices into an industrial network to achieve centralized control and monitoring.
(2) As a master-slave network Modbus network allows multiple or one slave to communicate with one host, where the response message and the command message are in a corresponding relationship, that is, the command/response mode is adopted. The host issues a command message. When receiving a message from the host, the corresponding response message is sent to respond to the command message. Each slave has a unique address in the network, and the accessed slave address is included in the host. In the command, the corresponding command is answered by the slave with the address.
(3) Transmission mode ASCII and RTU are applied in the Modbus protocol. There is no parity. 2 slots. 8 data is the transmission format of the RTU. It depends on the time of receiving the inter-character application. The RTU receives the device for one frame. Start the judgment. After the time is 3 and a half characters, the frame is not completed or there is no new character. The frame will be abandoned by the receiving device. The start of the new frame is based on the next character. The information of 1 byte is in the RTU mode. It is treated as an 8 character to be sent, and as two ASCII characters are sent in ASCII mode.
System design framework
Data collection RTU equipment. Data interaction monitoring equipment. Remote monitoring server is the main component of this system hardware. Application serial communication RTU equipment and monitoring equipment communication and Modbus TCP protocol conversion, application TCP socket The technical server communicates with the monitoring device and implements the conversion of the Modbus TCP protocol.
(1) Design protocol conversion
When communicating in the Modbus TCP protocol, what kind of network does not need to be considered, because it defines a message structure, and the public formula for the content and pattern of the message domain is formulated. In communication, this protocol is for each The address of the RTU device is defined, the information sent by the address is identified, and the action to be generated is determined. In case of a response, the feedback information is generated in the RTU device, and the information is sent using the Modbus TCP protocol. When converting the Modbus TCP protocol to the Modbus protocol, there is no need to change the RTU, and only the corresponding MBAP header is converted. When the server request is received, the MBAP header is removed by the Modbus TCP protocol and sent to the RTU device. The data is read according to the received command RTU device, and the CRC is error-checked; when the corresponding RTU device is received, the corresponding MBAP header is added to the Modbus TCP protocol, and the CRC error check is performed. It is removed and transmitted back to the server. Through this process, the mutual conversion of the two protocols is realized.
(2) Realize reading and writing of device parameters
The device parameter reading and writing module is realized by C/S model.
Establishing Socket communication is the first step. The remote monitoring terminal establishes a connection with the data server by sending a registration packet. The TCP keep-alive mechanism is started. Waiting for the server to issue a command, when writing or reading the device parameter command is sent by the data server. According to the Modbus TCP protocol, the remote monitoring terminal receives the command, converts it into Modbus protocol before the incoming device, writes or reads the corresponding device parameters according to the command RTU device, and sends a response to the remote monitoring terminal. Or if the read is successful, the response received according to the Modbus TCP protocol is encapsulated by the remote monitoring terminal and sent to the data server; if it is a failed write or read, the abnormal response is sent by the remote monitoring terminal according to the Modbus TCP protocol. To the data server.
(3) Design and implement socket communication
The data exchange between the monitoring device and the server is realized through the socket communication layer. The core of the whole design is the parallel connection of the serial port. The process of designing the communication part is shown in Figure 1.
(5) Design and implement serial communication
The read of Modbus data from the header is from shared memory. The half-duplex mechanism is the mechanism used by the serial port. It cannot receive data and send commands at the same time. The serial data is read after the command is sent. After being adopted, this problem can be solved. The serial communication flow chart is shown in Figure 2.
Analysis of system performance
(1) In the aspect of the function and function of the monitoring system, the management of the pressure blower room in the air compressor, the low efficiency of operation and the waste of manpower and material resources are solved, so that the speed of processing, exchange and transmission of information is accelerated, so that the monitoring system is Reliability and safety are guaranteed, and the control system is humanized. Intelligent. The level of automation is improved. The main functions realized in the remote monitoring system are: making the work report run normally, and the alarms in various faults can be realized; The gas pressure parameter can be set remotely, and the parameters can be corrected online; the gas supply pressure can be monitored in real time, the gas supply overpressure and underpressure will be alarmed; the reliability of the power supply system can be improved;
(2) Through the transparent transmission method, the received command only needs to be unpacked by the remote monitoring terminal, that is, the protocol analysis does not need to be performed, and the MBAP packet header is removed; after the RTU response is received, only the received and received The response, that is, the CRC error check is removed, plus the MBAP header, the protocol parsing does not need to be performed, and the transparency of the protocol is realized. The perfection of the socket communication performance is realized by the Socket exception handling, for the data service. Network interruptions and automatic reconnections can be detected by the system in time. Normal network interruptions are easily detected by the socket communication mechanism, and network interruptions such as unplugging the network cable are not easily found.
V. Conclusion
Through the above analysis of Modbus protocol. System design framework. Analysis of system performance, we can know that remote monitoring system based on embedded Modbus protocol can realize device parameter reading and writing and socket communication, so that processing, exchange and transfer of information speed Accelerate. In short, this system has many advantages, and we need to increase research and application in this area.
DIY tool cabinets are super hot online and they have mail order packings for safety in delivery.
Diy Tool Chest,Diy Tool Cabinets,Diy Mobile Tool Cabinet,Diy Tool Storage Cabinet
Changzhou Xingsheng Tianhe Electric Appliance Co., Ltd , https://www.roller-tool-cabinet.com