Modbus Function Descriptions (continued)
Code 02 — Read
Input Status
2-10
Modbus Commands
Code 02 allows the application to read a series of discrete inputs. The
command includes the start address and the number of points to be read.
Addressing is sequential up to the maximum memory size for a particular
PLC. The maximum number of inputs that can be addressed with one
command is 2000. If more are requested, the whole command will be
rejected with an Exception code 03.
Example:
Request:
07 02 000A 0005 XXXX
Figure 2-7 Read Input Status Example — Request
This request is for the data from 5 discrete inputs (On/Off) starting at the
10th input.
[This command is equivalent to sending a TIWAY I Primitive 20 request
using TT-type 6 (Packed Discrete Inputs, or Packed Xs)].
Response:
07 02 01 1A XXXX
Figure 2-8 Read Input Status Example — Response
Checksum (XXXX)
Number of points (0005)
Start point (000A)
Function code (02)
Slave address (07)
Checksum (XXXX)
Data (1A)
Number of bytes (01)
Function code (02)
Slave address (07)
SIMATIC TI505/TI500 MODNIM User Manual