Different Modbus RTU address types and the corresponding function codes

I. Explanation of Modbus RTU Addresses (HMI as Master)

The types of Modbus protocol addresses include 0x, 1x, 3x, 4x, 6x, 10x, 3x_Bit, 4x_Bit, etc. Below is an explanation of these address types and their corresponding function codes in the Modbus protocol.

Address TypeDescription
0x (0-65535)This is a readable and writable address type, equivalent to the output points of the device. The function code for reading bit status is 01H, and for writing bit status is 05H. The function code for writing multiple bit registers is 0FH.
1x (0-65535)This is a read-only address type, equivalent to reading the input points of the device. The function code for reading bit status is 02H.
3x (0-65535)This is a read-only address type, equivalent to reading the read-only data registers of the device. The function code for reading data is 04H.
4x (0-65535)This is a readable and writable address type, equivalent to operating the device’s data registers. The function code for reading data is 03H, for writing single data is 06H, and for writing multiple data is 10H.
3x_dw (0-65535)This address type is the same as 3x, with identical function codes. The difference is that 3x_dw is a double word. For 32-bit unsigned data, the positions of the high and low words are swapped. If the data read using 3x is 0x1234, the data read using 3x_dw would be 0x3412.
4x_dw (0-65535)This address type is the same as 4x, with identical function codes. The difference is that 4x_dw is a double word. For 32-bit unsigned data, the positions of the high and low words are swapped. If the data read using 4x is 0x1234, the data read using 4x_dw would be 0x3412.
3x_Bit (0-65535)This address type supports the same function codes as the 3x address type. The difference is that 3x reads data, while 3x_Bit reads the status of a specific bit in the data.
4x_Bit (0-65535)This address type supports the same function codes as the 4x address type. The difference is that 4x reads data, while 4x_Bit reads the status of a specific bit in the data.
6x (0-65535)This is a readable and writable address type, equivalent to operating the device’s data registers. The function code for reading data is 03H, and for writing single or multiple data is 06H.
10x (0-65535)This is a readable and writable address type, equivalent to operating the device’s data registers. The function code for reading data is 03H, and for writing single or multiple data is 10H.

II. Explanation of Modbus RTU Slave Addresses (HMI as Slave)

Address TypeDescription
LB (HMI bit register 0-65535)Corresponds to Modbus RTU’s 0x and 1x addresses, i.e., supporting function codes 01H, 02H, 05H, 0FH.
LW (HMI word register 0-65535)Corresponds to Modbus RTU’s 4x, 4x_dw, and 4x_bit addresses, supporting function codes 03H, 06H, 10H.
RWI (HMI recipe register 0-2999, recipe name 3000-3999)Corresponds to Modbus RTU’s 3x, supporting function code 04H.

Leave a Comment