3.4 Modbus services - "Function Code"
The table below provides an overview of the available Modbus serv-
ices:
"Function
Code"
Meaning under Modbus Meaning from device per-
spective
3 Read Multiple Registers Reading a parameter
8 Diagnostics Diagnostics
16 Write Multiple Registers Writing a parameter
23 Read/Write Multiple Registers Reading and writing parame-
ters
43
Subcode14
Read Device Identification –
90 UMAS File Transfer (Upload) –
3.4.1 "Function Code" 3 (Read Multiple Registers)
This "Function Code" 3 (Read Multiple Registers) allows you to read
several consecutive parameters, starting at any address.
Modbus request Structure of the Modbus request:
Field Bytes Value Meaning
Function Code 1 3 = 03
h
Read Multiple Registers
Starting Address 2 (various) Address of the first parameter to be read
Quantity Of Regis-
ters
2 2 * n Number of 16 bit values to be read
(1 parameter has the value 2 since a parameter
consists of a 32 bit value)
Modbus response Structure of the positive Modbus response:
Field Bytes Value Meaning
Function Code 1 3 = 03
h
Read Multiple Registers
Byte Count 1 4 * n Number of data bytes
Registers Value 4 * n (various) Parameter values
Structure of the negative Modbus response
Field Bytes Value Meaning
Function Code 1 03
h
+ 80
h
= 83
h
Read Multiple Registers
Exception Code 1 01
h
... 04
h
See chapter
"3.3.2 Modbus response to a Modbus request"
3 Basics
LXM32M
28 Modbus-TCP module
0198441113843, V1.01, 01.2012