introduction
Modern industrial automatic control systems are developing in the direction of intelligence, networking and open structure. Using fieldbus technology, unify various intelligent devices that meet the same standard, thoroughly realize the decentralized control of the entire monitoring system, will improve system integration and data transmission efficiency, extend the effective control distance, and help improve the system's anti-jamming performance Expand system functions. In motion control, servo motors are used by more customers because of their fast response speed and precise control. If the bus communication and servo control technology are unified, it will promote the development of motion control technology and equipment remote monitoring technology. As a universal field bus, MODBUS has been widely used. Many manufacturers of PLC, intelligent I / O and A / D modules have MODBUS communication interface. In this paper, on the basis of elaborating the MODBUS communication protocol, the servo motor motion control based on MODBUS is constructed.
1 Technical characteristics of MODBUS bus control system
The MODBUS communication protocol is an industrial field bus communication protocol. It defines an information frame structure that can be recognized and used by the device controller. It is independent of the physical layer medium and can be carried in multiple network types. The MODBUS protocol specifies the communication participants as "Master" and "Slave". The communication of data and information follows the master / slave mode. When it is applied to a standard MODBUS network, the information is transmitted directly. Each intelligent device in the MODBUS bus network is connected through an asynchronous serial bus, and only one controller is allowed to be the master station, and the remaining intelligent devices are used as slave stations. With the command / response communication method, the master station sends a request, and the slave station answers the request and sends back data or status information. The slave station cannot send information by itself. The various information frame formats defined by the MODBUS protocol describe the process of the master station controller accessing the slave station equipment, specifying how the slave station responds, and checking and reporting transmission errors. Each slave device in the network must be assigned a unique address, and only slave devices that meet the address requirements will respond to commands issued by the master device.
Because the development cost of MODBUS bus system is low, it is simple and easy to use, and now many industrial controllers, PLCs, display screens, etc. have MODBUS communication interfaces, so it has become a recognized communication standard. Through the MODBUS bus, you can easily connect control devices produced by different manufacturers into an industrial network for centralized monitoring.
MODBUS was originally designed for PLC communication. It implements information exchange between PLC and the outside world through 24 bus commands. The communication functions corresponding to these bus commands mainly include data transmission of AI / AO and DI / DO. However, not many MODBUS devices use only a few of these commands and do not respond to the remaining commands.
1.1 MODBUS communication format
The MODBUS protocol defines two transmission modes, namely RTU (Remote Terminal Unit) and ASCII. In RTU mode, 1 byte of information is sent as an 8-bit character, and in ASCII mode it is sent as two ASCII characters. For example, when sending the character "20", it is "00100000" when using RTU mode, however In ASCII mode, it becomes "00110010" + "00110000" ("2" and "0" of ASCII characters). It can be seen that the efficiency of RTU mode is about twice that of ASCII mode when sending the same data. Generally speaking, when the amount of data is small and it is mainly text, ASCII is used; when the amount of communication data is large and it is a binary value, the RTU mode is mostly used.
The master station can send communication requests (or instructions) to one or all slave stations at a time. The master device gates the slave device through the address field of the message frame. The content and sequence of the message frames sent by the master station are: slave station address, function code, data field (data start address, data amount, data content), CRC check code; the information content and sequence of the slave station response and the master station The information frame is basically the same. In addition to defining communication function codes, MODBUS also defines error codes and flags error messages. After receiving the error code, the master station takes corresponding measures according to the cause of the error. The data content of the slave station responds according to the function code. For example, the function code 03 requires reading the content of the holding register in the slave device.
Round Smart Watch
Round Smart Watch
everyone enjoys luck , https://www.eeluckwatch.com