Kistler-Morse KM STXPlus User Manual

Page 56

Advertising
background image

APPENDIX C: MODBUS PROTOCOL SERIAL COMMANDS

MODBUS FUNCTION CODES

03 (0x03) Read Holding Registers
This function code is used to read the contents of a contiguous block of holding registers in a
remote device. The Request specifies the starting register address and the number of registers.
The registers are addressed starting at zero. Therefore registers numbered 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
Function code: (1 Byte) 0x03
Starting Address: (2 Bytes) 0x0000 to 0xFFFF
Quantity of Registers: (2 Bytes) 1 to 125 (0x7D)

Response
Function code: (1 Byte) 0x03
Byte count: (1 Byte) 2 x N*
Register value: (N* x 2 Bytes)
*N = Quantity of Registers

Error
Error code: (1 Byte) 0x83
Exception code: (1 Byte) 01, 02, 03, or 04

16 (0x10) Write Multiple registers
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
Function code: (1 Byte) 0x10
Starting Address: (2 Bytes) 0x0000 to 0xFFFF
Quantity of Registers: (2 Bytes) 0x0001 to 0x007B
Byte Count: (1 Byte) 2 x N*
Registers Value: (N* x 2 Bytes value)
*N = Quantity of Registers

Response
Function code: (1 Byte) 0x10
Starting Address: (2 Bytes) 0x0000 to 0xFFFF
Quantity of Registers: (2 Bytes) 1 to 123 (0x7B)

C-3

Advertising