![Xytronix Research & Design CONTROL BY WEB XW-111 Скачать руководство пользователя страница 38](http://html1.mh-extra.com/html/xytronix-research-and-design/control-by-web-xw-111/control-by-web-xw-111_user-manual_3845242038.webp)
Modbus/TCP
XW-111™ Wi-Fi Digital Sensor Users Manual
5.5 Read Discrete Inputs – Modbus Function Code 02 (0x02)
This function returns the state of the digital inputs.
Request
The sum of the starting address and the quantity of coils must not be greater than 0x0002. For example,
if you want to read 0x0002, both inputs, then the start address must be 0x0000. To read the second input
only the start address is 0x0001 with a quantity of 0x0001.
Input Start Addresses
Start Address: 0x0000 (Input 1) to 0x0001 (Input 2)
Input Quantity: 0x0001 to 0x0002
Response
The inputs states are indicated by bits one and two of the status byte. A 1 indicates that the input is
switched high ON. A 0 indicates that the input switched low OFF. Bit zero of the return value will be the
state of the coil corresponding to the start address. For example, if a start address of 0x0001 is used, bit
zero will be the status of input 2.
When reading all 4 inputs, the following table shows the bit positions.
Discrete Input State Byte
Bit 7
6
5
4
3
2
1
Bit 0
X
X
x
x
X
X
Input 2
Input 1
Errors
Input Read Error Function Code (1 byte): 0x82
Exception Codes (1 byte):
0x01 – Function not supported.
0x02 – Incorrect combination of start address and input quantity
Page 38
Xytronix Research & Design, Inc.
Содержание CONTROL BY WEB XW-111
Страница 1: ......