Description of Each Function
Function 3 – Read Multiple Registers
Reads one or more 16 bit registers from the slave device.
Notes:
1. The limit of 125 registers is to comply with the Modbus specification which requires that a message must not exceed 256 bytes including all fields.
2. Any request for a register that is defined in this standard must return a normal response, if the register is not implemented by a particular product it must return the unimplemented value from the table below to indicate this fact, it must not return an exception.
3. A request for a register that is defined in this standard as contain some unimplemented bits must return a normal response, the unimplemented bits will contain the unimplemented value from the table below.
4. A request for a register that is defined in this standard as unimplemented will return the unimplemented value from the table below.
5. A request for a register that is defined as reserved in this standard will either return extended exception code 12 (Reserved register), or the 16 bit unsigned unimplemented sentinel (0xFFFF), i.e. not an exception. This option permits efficiency improvements by allowing reading across gaps in the register map. In exceptional circumstances the option to return a sentinel may be problematic for a particular page so should not be used, this will be documented in the description of the page.
6. A read from a multi-register value such as a 32 bit value or a string must be performed by a single message, not by multiple ones. This avoids the possibility of a value being partly current and partly old data.
7. The instrumentation values can return the sentinel values described in the table below to indicate a value that is over or under the measurable range, that a transducer is faulty, that the data is bad for some other reason or that the transducer is actually a digital type.
8. The sentinel value ‘high digital input’ means that the instrumentation value is high (high oil pressure, high temp, etc), similarly ‘Low digital input’ means the instrumentation value is low. They do not refer to voltage levels on the inputs.
Query message
Byte
| Field name
| Notes
|
0
| Slave address
|
|
1
| Function code (3)
|
|
2
| First register address – high byte
| 16 bit register address
|
3
| First register address – low byte
|
|
4
| Number of registers to read – high byte
| 16 bit number of registers, must be in the range 1 to 125
|
5
| Number of registers to read – low byte
|
|
6/7
| Error check CRC
|
|
Normal response message
Byte
| Field name
| Notes
|
0
| Slave address
|
|
1
| Function code (3)
|
|
2
| Byte count (n)
| 8 bit even number in the range 2 to 250 (number of registers *2)
|
3
| First register – high byte
| 16 bit register
|
4
| First register – low byte
|
|
…
|
|
|
1+n
| Last register – high byte
| 16 bit register
|
2+n
| Last register – low byte
|
|
3+n/4+n
| Error check CRC
|
|
Exception response message
Byte
| Field name
| Notes
|
0
| Slave address
|
|
1
| Function code +128 (131)
| Top bit is set
|
2
| Exception code
| 1 – Illegal function code
2 – Illegal data address
6 – Slave device busy
|
¾
| Error check CRC
|
|
Unimplemented register and field values
Size of register
| Value returned
| Notes
|
1 bit flag within a register
| 0
| No third state exists for a flag to indicate it is not valid
|
2 bit named digital input/output code
| 3
| Unimplemented input/output
|
4 bit alarm condition codes
| 0xF
| Unimplemented alarm
|
4 bit LED colour code
| 0xF
| Unimplemented LED
|
16 bit unsigned, any scale
| 0xFFFF
| The largest number
|
16 bit signed, any scale
| 0x7FFF
| The largest positive number
|
32 bit unsigned, any scale
| 0xFFFFFFFF
| The largest number
|
32 bit signed, any scale
| 0x7FFFFFFF
| The largest positive number
|
ASCII strings
| “ ”
| A string of spaces (Unicode 0x0020), NULL terminators are not used
|
Unicode strings
| “ ”
| A string of spaces (Unicode 0x0020), NULL terminators are not used
|