TCW241_R4.17
–
October 2022
Page 50
01: 7 space holders & Discrete Input 100 (0000 0001)
The 7 most significant bits are filled in with zeroes.
8.3.1.4.
Read Holding Registers (FC=03)
Request
This command is requesting the content of holding registers 19800.
03
4D58 0002
03: The Function Code 3 (read Holding Registers)
4D58: The Data Address of the first register requested (4D58 hex = 19800)
0002: The total number of registers requested. (read 2 registers each 2 byte = 4
bytes)
Response
03
4 41BD 0655
03: The Function Code 3 (read Sensor 1 Part 1 Holding Registers)
04: The number of data bytes to follow (2 registers x 2 bytes each = 4 bytes)
41BD 0655: 4 bytes value
All holding registers with float value are sent in big-endian.
In the example, the above value of 23.628 is sent.
Request
This command is requesting the content of holding registers 18100.
03
46B4 0020
03: Function Code 3 (read Sensor 1 description Holding Registers)
46B4: The Data Address of the first register requested (46B4 hex = 18100)
0020: The total number of registers requested (read 32 registers each 2 byte = 64
bytes)
Response
03 40 5365 6E73 6F72 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)
5365 6E73 6F72 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 “Sensor1” is sent.
8.3.1.5.
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
The function code received in the query is not an allowable action for the
controller.
02 Illegal data address
Содержание TCW241
Страница 1: ...smtp...
Страница 16: ...TCW241_R4 17 October 2022 Page 16...
Страница 55: ...TCW241_R4 17 October 2022 Page 55 Appendix A Fig 1 Fig 2...