MVI69E-MBS ♦ CompactLogix™ Platform
Modbus Serial Enhanced Communication Module
8.2.5 Read Input Status (Function Code 02)
Query
This function allows you to obtain the ON/OFF status of discrete inputs (Modbus 1x
range) in the addressed slave. PC Broadcast mode is not supported with this function
code. In addition to the slave address and function fields, the message requires that the
information field contain the initial input address to be read (Starting Address) and the
number of locations that are interrogated to obtain status data.
The addressing allows up to 2000 inputs to be obtained at each request; however, the
specific slave device may have restrictions that lower the maximum quantity. The inputs
are numbered form zero; (input 10001 = zero, input 10002 = one, input 10003 = two, and
so on, for a 584).
The following table is a sample read input status request to read inputs 10197 to 10218
(22 coils) from slave number 11.
Note: This is the structure of the message being sent out to the Modbus network. The byte values below are
in hexadecimal display.
Function
Node
Code
Address
02
0B
Response
An example response to Read Input Status is as shown in the table below. The data is
packed one bit for each input. The response includes the slave address, function code,
quantity of data characters, the data characters, and error checking. Data is packed with
one bit for each input (1=ON, 0=OFF). The lower order bit of the first character contains
the addressed input, and the remainder follows. For input quantities that are not even
multiples of eight, the last characters are filled in with zeros at high order end. The
quantity of data characters is always specified as a quantity of RTU characters, that is,
the number is the same whether RTU or ASCII is used.
Because the slave interface device is serviced at the end of a controller's scan, the data
reflect input status at the end of the scan. Some slaves limit the quantity of inputs
provided each scan; thus, for large coil quantities, multiple PC transactions must be
made using coil status for sequential scans.
Func
Node
Code
Address
02
0B
The status of inputs 10197 to 10204 is shown as AC (HEX) = 10101 1100 (binary).
Reading left to right, this show that inputs 10204, 10202, and 10199 are all on. The other
input data bytes are decoded similar.
ProSoft Technology, Inc.
Data Start
Data Start
Point High
Point Low
00
C4
Byte
Data Discrete
Count
Input 10197 to
10204
03
AC
Number of
Number of
Points High
Points Low
00
16
Data Discrete
Data Discrete
Input 10205 to
Input 10213 to
10212
10218
DB
35
Reference
User Manual
Error Check
Field (2 bytes)
CRC
Error Check
Field
(2 bytes)
CRC
Page 117 of 159
Need help?
Do you have a question about the CompactLogix MVI69E-MBS and is the answer not in the manual?