Skip to main content

5.3 Modbus communication

  • Modbus is a communication protocol widely used in the field of industrial control. It adopts a master-slave architecture and supports data interaction between a single master and multiple slave devices (such as sensors, actuators). The protocol enables precise operation through functional codes, such as reading or writing device data, and supports a variety of communication methods, including serial communication (RTU/ASCII) and Ethernet communication (TCP/IP) to meet different industrial environment needs. The Modbus protocol has the characteristics of openness, flexibility and reliability.

5.3.1 Modbus TCP/IP

5.3.1.1 Introduction to Modbus TCP/IP protocol

  • Modbus TCP/IP protocol is a communication protocol widely used in the field of industrial automation. It is based on the TCP/IP protocol stack and realizes efficient and reliable data interaction between devices through Ethernet. This protocol adopts a client-server architecture. The client (such as the SCADA system) initiates a request by specifying the server IP address and port. The server (PLC) responds and returns data

5.3.1.2 Modbus communication usage method

  • Enable the Modbus communication function of the GE network port in the device properties and configure the corresponding master parameters. See Modbus TCP/IP Configuration in Hardware Parameters for details
  • Create a global variable and IO mapping table, map the Modbus register to the global variable through the IO pilot table
  • The slave station configures the corresponding connection parameters, such as IP address, port number, etc., to establish a connection with the master station (PLC).
  • The detailed information of Modbus communication connection will be recorded in the diagnostic buffer, which is easy to debug and troubleshoot.

5.3.2 Modbus RTU

5.3.2.1 Introduction to Modbus RTU protocol

  • The Modbus RTU (Remote Terminal Unit) protocol is a serial communication-based Modbus variant suitable for short-range, low-speed industrial environments. It realizes data exchange between devices through the master-slave architecture, and supports a variety of functional code operations, such as reading and holding registers, writing to single coils, etc.

5.3.2.2 Modbus communication usage method

  • Enable the Modbus communication function of RS485 in the device properties and configure the corresponding master parameters. See Modbus RTU Configuration in Hardware Parameters for details

  • Create a global variable and IO mapping table, map the Modbus register to the global variable through the IO pilot table

  • The slave station configures corresponding connection parameters, such as baud rate, check bit, etc., to establish a connection with the master station

  • The detailed information of Modbus communication connection will be recorded in the diagnostic buffer, which is easy to debug and troubleshoot.

5.3.3 Modbus communication application scenario

  • Industrial automation control system
    • Equipment integration and control: As a server, the PLC connects sensors, actuators and other devices to realize real-time data acquisition and control command transmission. For example, in the automobile manufacturing production line, the PLC reads the status data of the welding robot (such as temperature and current) through Modbus TCP/IP and controls its action parameters
    • Process optimization: In semiconductor manufacturing, the PLC reads the process equipment parameters through the function code "0x03", and combines the "0x10" function code to batch write adjustment instructions to optimize the production process
  • Energy Management System
    • Real-time monitoring and diagnosis: PLC integrates power meter, water meter and other equipment, and transmits energy consumption data to the management platform through Modbus TCP/IP, supporting remote monitoring and fault diagnosis. For example, in a smart grid, the PLC records the power consumption through the "input register" address 40001 for analysis by the energy management system.
    • Remote control: By writing function codes (such as "0x05" to control a single coil), adjust the inverter output power or valve opening to achieve optimized energy distribution.
  • Intelligent Manufacturing and Industrial Internet of Things (IIoT)
    • Device interconnection and data analysis: PLC is connected to the industrial Internet of Things platform as a server to realize the integration and analysis of production data. For example, Modbus TCP/IP data is forwarded to the cloud through the MQTT protocol, supporting remote operation and maintenance and equipment health management.
    • Flexible production: In CNC machine tool networking, PLC receives production planning instructions through Modbus TCP/IP, dynamically adjusts processing parameters, and adapts to the needs of multiple varieties and small batches of production.