User manual
14 Modbus RTU MN744
Holding Registers (Modbus 4xxxx Reference Set)
Holding registers are the primary mechanism by which a master gains access to key control features of the H2
and its parameters.
Read Holding Registers (Function Code 03)
This function code is used to read the contents of a contiguous block of holding registers in a remote device. The
Request PDU specifies the starting register address and the number of registers. Registers are addressed
starting at zero. Therefore, registers 1-16 are addressed as 0-15.
The register data in the response message are packed as two bytes per register, with the binary contents right
justified within each byte. For each register, the first byte contains the high order bits and the second contains the
low order bits.
Request PDU
Function Code 1 Byte 0x03
Starting Address 2 Bytes 0x0000 to 0xFFFF
Quantity of Registers 2 Bytes 1 to 125 (0x7D)
Response PDU
Function Code 1 Byte 0x04
Byte Count 1 Byte 2xN*
Register Value N* x 2 Bytes
*N = Quantity of Input Registers
Error
Error Code 1 Bytes 0x83
Exception Code 1 Bytes 01 or 02 or 03 or 04
Example of a request to read registers 108-110:
Request Response
Field Name (Hex) Field Name (Hex)
Function 03 Function 03
Starting Address Hi 00 Byte Count 06
Starting Address Low 6B Register Value Hi (108) 02
Quantity of Registers Hi 00 Register Value Lo (108) 2B
Quantity of Registers Lo 03 Register Value Hi (109) 00
Register Value Lo (109) 00
Register Value Hi (110) 00
Register Value Lo (110) 64
The contents of register 108 are shown as the two-byte values of 02 2B hex, or 555 decimal. The contents of
registers 109-110 are 00 00 and 00 64 hex, or 0 and 100 decimal, respectively.
Write Holding Registers (Function Code 16)
This function code is used to write a block of contiguous registers (1 to approx. 120 registers) in a remote device.
The requested written values are specified in the request data field. Data is packed as two bytes per register.
The normal response returns the function code, starting address, and quantity of registers written.
Request PDU
Function Code 1 Byte 0x10
Starting Address 2 Bytes 0x0000 to 0xFFFF
Quantity of Registers 2 Bytes 0x0001 to 0x0078
Byte Count 1 Byte 2xN*
Register Value N* x 2 Bytes value
Response PDU
Function Code 1 Byte 0x10
Starting Address 2 Bytes 0x0000 to 0xFFFF
Quantity of Registers 2 Bytes 1 to 123 (0x7B)
Error
Error Code 1 Bytes 0x90
Exception Code 1 Bytes 01 or 02 or 03 or 04