74
Modbus RTU control (RS-485 communication)
11.3 Function code
This section explains the function codes supported by the
BLH
Series RS-485 communication type driver.
Note that the function code cannot be executed if function codes other than those introduced here are sent.
11.3.1 Reading from a holding register(s) (03h)
This function code is used to read a register (16 bits). Up to 125 successive registers (125×16 bits) can be read.
Read the upper and lower data at the same time. If they are not read at the same time, the value may be invalid.
If multiple holding registers are read, they are read in order of register addresses.
Example of read
Read the "Rotation speed" in the operation data Nos. 0 and 1 of the slave address 1.
Using the indirect reference function can set multiple items in consecutive addresses.
Description Register address
Value read
Corresponding hexadecimal Corresponding decimal
Rotation speed of operation data No.0 (upper) 1152 (0480h) 0000h
500
Rotation speed of operation data No.0 (lower) 1153 (0481h) 01F4h
Rotation speed of operation data No.1 (upper) 1154 (0482h) 0000h
2500
Rotation speed of operation data No.1 (lower) 1155 (0483h) 09C4h
z
Query
Field name Data Description
Slave address 01h Slave address 1
Function code 03h Reading from holding registers
Data
Register address (upper) 04h
Register address to start reading from
Register address (lower) 80h
Number of registers (upper) 00h
Number of registers to be read from the starting register address
(4 registers=0004h)
Number of registers (lower) 04h
Error check (lower) 44h
Calculation result of CRC-16
Error check (upper) D1h
z
Response
Field name Data Description
Slave address 01h Same as query
Function code 03h Same as query
Data
Number of data bytes 08h Value of twice the number of registers in the query
Value read from register address (upper) 00h
Value read from register address 0480h
Value read from register address (lower) 00h
Value read from register address +1 (upper) 01h
Value read from register address 0481h
Value read from register address +1 (lower) F4h
Value read from register address +2 (upper) 00h
Value read from register address 0482h
Value read from register address +2 (lower) 00h
Value read from register address +3 (upper) 09h
Value read from register address 0483h
Value read from register address +3 (lower) C4h
Error check (lower) 22h
Calculation result of CRC-16
Error check (upper) 10h