ICP DAS, ZT-2005-C8 User Manual, Version v1.0.1 Page 46
Copyright © 2014 by ICP DAS Co., Ltd. All Rights Reserved.
5.3.5
Function 04(0x04)
–
Read Multiple Input
Registers
Desctiption
This function code is used to read the value at addresses 3xxxx.
Syntax
Byte
Description
Value
00
Module address
1~247
01
Function Code
0x04
02~03
Reference Address
Refer to section 5.3.1, Address
1xxxx
04~05
Word Count
Number of word(W) to read
06~07
Checksum (CRC16)
Two bytes checksum
Response
Byte
Description
Value
00
Module address
1~247
01
Function Code
0x04
02
Byte Count
Response data byte N = W x 2
03~(N+2)
Word Value
Response word data
(N+3)~(N+4) Checksum (CRC16)
Two bytes checksum
Error Response
Byte
Description
Value
00
Module address
1~247
01
Function Code
0x84
02
Exception Code
Refrt to section 5.3
03~04
Checksum (CRC16)
Two bytes checksum
Examples
Command 1A 04 00 00 00 08 [F2 27]
Response 1A 04 10 1C 86 80 00 80 00 80 00 80 00 80 00 80 00 80 00 [E2 17]
Reads temperature value of 8 channels from module address 26, and reponse
channel 0 is 23.4
℃
, channel 1 to 7 are under range.
。
Examples
Command 1A 04 00 01 00 05 [62 22]
Response 1A 04 0A 80 00 1C 86 80 00 1C E3 80 00 [9C 79]
Reads temperature value of channel1 to 5 from module address 26, and reponse
channel 1, 3, 5 are under range, channel 2, 4 are 23.4
℃
and 23.7
℃
.