TCW280_R1.2 – February 2019
Page 24
7.1.1.3.
Read Holding Registers (FC=03)
Request
This command is requesting the content of holding registers 500.
03 01F4 0002
03: Function Code 3 (read Holding Registers)
0064: The Data Address of the first register requested (01F4 hex = 500)
0002: The total number of registers requested. (read 2 registers each 2 bytes = 4
bytes)
Response
03 04 3FA0 0000
03: Function Code 3 (read Analog Output Holding Registers)
04: The number of data bytes to follow (2 registers x 2 bytes each = 4 bytes)
3FA0 0000: 4 bytes value
All holding registers with float value are sent in big-endian.
In the example above, a value of 1.25 is sent.
Request
This command is requesting the content of holding registers 1000.
03 03E8 0020
03: Function Code 3 (read Holding Registers)
03E8: The Data Address of the first register requested (03E8 hex = 1000)
0020: The total number of registers requested (read 32 registers each 2 bytes = 64
bytes)
Response
03 40 5265 6C61 7920 3100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000
03: Function Code 3 (read Analog Output Holding Registers)
40: The number of data bytes to follow (32 registers x 2 bytes each = 64 bytes)
5265 6C61 7920 3100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000: 64 bytes value
All holding registers with strings are sent in big-endian.
The answer is padded with 0.
In the example above string “Relay 1” is sent.
7.1.1.4.
Exception codes
All exceptions are signaled by adding 0x80 to the function code of the request, and
following this byte by a single reason byte for example as follows:
01 Illegal function
Function code received in the query is not an allowable action for the controller.
02 Illegal data address
The data address received in the query is not an allowable address for the slave.
More specifically, the combination of the reference number and the transfer
length is invalid. For a controller with 100 registers, a request with offset 96 and
length 4 would succeed, a request with offset 96 and length 5 will generate
exception 02.
Содержание TCW280
Страница 1: ......
Страница 34: ...TCW280_R1 2 February 2019 Page 34 Fig 1 Fig 2...