- Applicable models
This note is applicable to standard Modbus protocol products (MA01 series, ME31 series, M31 series, ME15-AXAX8080).
- Functional introduction
Functional description: The Modbus command quick generation tutorial is designed to help users quickly generate Modbus communication commands to achieve data transmission between devices. By determining the communication method, selecting the function code, determining the starting address and data length, users can easily generate instructions that comply with the Modbus protocol specification. Commonly used function codes include reading holding registers, writing single holding registers, etc., which are used to read or write device data. Through this tutorial, users can quickly understand how to generate Modbus commands and apply them in industrial control and other fields to achieve efficient communication and data exchange between devices.
Related knowledge:
(1) Modbus is a master/slave communication mode. The master station has no address on the Modbus network. The address range of the slave station is 0-247, where 0 is the broadcast address and the actual address range of the slave station is 1-247.
(2) Modbus register types: Coil status: output port, the output status of the port can be set, and the output status of the bit can also be read; 2. Discrete input status: input port, the input status can be changed by external settings, readable but not writable; 3. Holding register: certain parameters set when the controller is running, readable and writable; Input register: certain parameters obtained from external devices when the controller is running, readable but not writable;
(3) Modbus function code:
Function Code |
Name |
Register Area |
01 |
Read coil status |
00001~09999(0 zone) |
02 |
Read discrete input status |
10001~19999(1 zone) |
03 |
Read holding registers |
40001~49999(4 zone) |
04 |
Read input registers |
30001~39999(3 zone) |
05 |
Write single coil |
00001~09999(0 zone) |
06 |
Write single holding register |
40001~49999(4 zone) |
15 |
Write multiple coils |
00001~09999(1 zone) |
16 |
Write multiple holding registers |
40001~49999(4 zone) |