Simply Modbus logo

 


Home

About
MODBUS

fc01
fc02
fc03
fc04
fc05
fc06
fc15
fc16
ASCII
TCP
exceptions

About
Enron
MODBUS


RTU Master

RTU Slave

TCP Client

Download

Purchase

Contact

 

Read Input Status (Function Code=02)

Request

This command is requesting the ON/OFF status of discrete inputs # 10197 to 10218
from the slave device with address 17.

11 02 00C4 0016 BAA9

11: The Slave Address (11 hex = address17 )
02: The Function Code 2 (read Input Status)
00C4: The Data Address of the first input to read.
             ( 00C4 hex = 196 , + 10001 offset = input #10197 )
0016: The total number of coils requested. (16 hex = 22,  inputs 10197 to 10218 )
BAA9: The CRC (cyclic redundancy check) for error checking.

Response

11 02 03 ACDB35 2018

11: The Slave Address (11 hex = address17 )
02: The Function Code 2 (read Input Status)
03: The number of data bytes to follow (22 Inputs / 8 bits per byte = 3 bytes)
AC: Discrete Inputs 10204 -10197 (1010 1100)
DB: Discrete Inputs 10212 - 10205 (1101 1011)
35: 2 space holders & Discrete Inputs 10218 - 10213 (0011 0101)
2018: The CRC (cyclic redundancy check).

The more significant bits contain the higher Discrete inputs. This shows 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.

HomeFAQEnronDownloadPurchaseContact

Copyright © 2024 Simply Modbus. All rights reserved