ICP DAS, ZT-257x DIO Data Concentrator Quick Start Guide, v1.0
Page 41
Copyright © 2016, by ICP DAS Co., LTD. All Rights Reserved
5.3.2.
02 (0x02) Read Discrete Inputs
This function code is used to read the current status of the Digital Input channels on
the ZT-257x module.
Request
Byte Description
Length Value
00
Address
1
0x01 to 0xF7 (1 to 247)
01
Function Code
1
0x02
02-03
Starting Channel
Number or Address
Mapping
2
DI
(Temporary Input) 0x0000 to 0x0117
04-05
Output Channel
Number or Bit Count
2
0x0001 to 0x0118
(
Bit Count)
Response
Byte Description
Length Value
00
Address
1
0x01 to 0xF7 (1 to 247)
01
Function Code
1
0x02
02
Byte Count
1
The Byte Count of the Response
[B = (Bit Count + 7)/8]
03
Bit Values
B
(Bit Values)
Error Response
Byte Description
Length Value
00
Address
1
0x01 to 0xF7 (1 to 247)
01
Function Code
1
0x82
02
Exception Code
1
Refer to the Modbus standard for more details