
93
Modbus
(
RTU
)
Protocol
digit of 8, and the received digits are less than 8 or greater than 8 bytes.
5. When the station address is 0x00, it represents the broadcast address, the AT381x does not
respond.
11.1.5
Error Code
Table 11-3
Description for Error Code
Error code
Name
Description
priority
0x01
Function code error
Function code does not exist
1
0x02
Register error
Register code does not exist
2
0x03
Data error
The number of registers or the
number of bytes is incorrect
3
0x04
Execution error
The data is illegal, and the written
data is not allowed.
4
11.2
Function Code
The instrument only supports the following function codes, other function codes will respond
to the error frame.
Table 11-4
Function code
Function code
Name
Description
0x03
Read multiple registers
Read multiple consecutive register data
0x04
Same as 0x03
Please use 0x03 instead
0x08
Echo test
The received data is returned as it was.
0x10
Write to multiple registers
Write to multiple consecutive registers
11.3
Register
The number of registers in the instrument is 2-byte mode, that is, 2 bytes must be written
each time. For example, the speed register is 0x3002, the data is 2 bytes, and the value must
be written to 0x0001.
Data
:
The instrument supports the following values:
1. 1 register, double-byte (16-
bit) integer, for example: 0x64 → 00 64
2. 2 registers, four-byte (32-
bit) integer, for example: 0x12345678 → 12 34 56 78
3. 2 registers, 4 bytes (32 bits) single precision flo
ating point number, 3.14 → 40 48 F5 C3
Reference
:
My company's "Communication Test Tool", which has Modbus communication debugging method. It
contains floating-point converter..
11.4
Read Multiple Registers
Figure 11-5
Read Multiple Registers
(
0x03
)