Download 1 Safety precautions

Transcript
13
Method of control via Modbus protocol
• Response
Field name
Slave address
Function code
Number of data bytes
Value read from register address (upper)
Value read from register address (lower)
Value read from register address+1 (upper)
Data
Value read from register address+1 (lower)
Value read from register address+2 (upper)
Value read from register address+2 (lower)
Value read from register address+3 (upper)
Value read from register address+3 (lower)
Error check (lower)
Error check (upper)
Data
01h
03h
08h
00h
00h
27h
10h
FFh
FFh
D8h
F0h
08h
A3h
Description
Same as query
Same as query
Twice the number of registers in the query
Value read from register address 0402h
Value read from register address 0403h
Value read from register address 0404h
Value read from register address 0405h
Calculation result of CRC-16
Writing to a holding register (06h)
This function code is used to write data to a specified register address.
However, since the result combining the upper and lower may be outside the data range, write the upper and lower at
the same time using the "multiple holding registers (10h)."
Example of write
Write 80 (50h) as speed filter to slave address 2.
Description
Speed filter
Register address
024Bh
Value write
50h
Corresponding decimal
80
• Query
Field name
Slave address
Function code
Register address (upper)
Register address (lower)
Data
Value write (upper)
Value write (lower)
Error check (lower)
Error check (upper)
Data
02h
06h
02h
4Bh
00h
50h
F8h
6Bh
Description
Slave address 2
Writing to a holding register
Data
02h
06h
02h
4Bh
00h
50h
F8h
6Bh
Description
Same as query
Same as query
Register address to be written
Value written to the register
address
Calculation result of CRC-16
• Response
Field name
Slave address
Function code
Register address (upper)
Register address (lower)
Data
Value write (upper)
Value write (lower)
Error check (lower)
Error check (upper)
−114−
Same as query
Same as query
Calculation result of CRC-16