
Modbus Commands
C-8
TIWAY I Gateway User Manual
Modbus Function Descriptions (continued)
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:
I000000
Request: 07 02 000A 0005 XXXX
Checksum (XXXX)
Number of points (0005)
Start point (000A)
Function code (02)
Slave address (07)
Figur
e C-6
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 TIW
A
Y I Primitive 20 request
using TT
-type 6 (Packed Discrete Inputs)].
I000000
Response: 07 02 01 1A XXXX
Checksum (XXXX)
Data (1A)
Number of bytes (01)
Function code (02)
Slave address (07)
Figur
e C-7
Read
Input Status Example — Response
Code 02 — Read
Input Status
Comentarios a estos manuales