Modbus Function Code 02 _ Read Input Status _ Simply Modbus Software
Modbus Function Code 02 _ Read Input Status _ Simply Modbus Software
오후 3:05 Modbus Function Code 02 | Read Input Status | Simply Modbus Software
Home
Read Input Status (Function Code=02)
About
MODBUS Request
fc01
This command is requesting the ON/OFF status of discrete inputs # 10197
fc02
to 10218
fc03
from the slave device with address 17.
fc04
fc05 11 02 00C4 0016 BAA9
fc06
fc15 11: The Slave Address (11 hex = address17 )
fc16 02: The Function Code 2 (read Input Status)
ASCII
00C4: The Data Address of the first input to read.
TCP
( 00C4 hex = 196 , + 10001 offset = input #10197 )
exceptions
0016: The total number of coils requested. (16 hex = 22, inputs 10197 to
10218 )
About BAA9: The CRC (cyclic redundancy check) for error checking.
Enron
Response
MODBUS
11 02 03 ACDB35 2018
RTU Master
11: The Slave Address (11 hex = address17 )
RTU Slave 02: The Function Code 2 (read Input Status)
https://www.simplymodbus.ca/FC02.htm 1/2
25. 1. 8. 오후 3:05 Modbus Function Code 02 | Read Input Status | Simply Modbus Software
03: The number of data bytes to follow (22 Inputs / 8 bits per byte = 3
TCP Client bytes)
AC: Discrete Inputs 10204 -10197 (1010 1100)
Download DB: Discrete Inputs 10212 - 10205 (1101 1011)
35: 2 space holders & Discrete Inputs 10218 - 10213 (0011 0101)
Purchase 2018: The CRC (cyclic redundancy check).
The more significant bits contain the higher Discrete inputs. This shows
Contact
that input 10197 is off (0) and 10204 is on (1). Due to the number of
inputs requested, the last data field 35 contains the status of only 6
inputs. The two most significant bits in this data field are filled in with
zeroes.
https://www.simplymodbus.ca/FC02.htm 2/2