Function Code 02 - Read Digital Input Status - Honeywell HC900 User Manual

Process controller
Hide thumbs Also See for HC900:
Table of Contents

Advertisement

4.4 Function Code 02 - Read Digital Input Status

Description
Function code 02 (1X references) is used to read a digital input's ON/OFF status using 16 bit addressing for
DI access and data is returned in a binary format mapped into bytes.
The Modbus Comm Digital I/O Channel to address mapping is shown starting on page 26.
Broadcast is not supported.
Query
The query message specifies the starting input and the quantity of inputs to read. The DI address in the
message is based on the slot and channel number of the digital input being read.
Example: Read inputs for channels 1 to 16 in Rack #1, Slot 1, from the controller with slave address 1.
Slave
Address
(00 for TCP)
TCP Example
00
RTU Example
01
Response
The input status in the response message is packed as one input per bit of the data field. Status is indicated
as: 1 = ON; 0 = OFF. The LSB of the first data byte contains the input addressed in the query. The other
inputs follow toward the high order end of this byte, and from low order to high order in subsequent bytes.
If the returned input quantity is not a multiple of eight, the remaining bits in the final data byte will be
padded with zeros (toward the high order end of the byte). The byte count field specifies the quantity of
data bytes returned.
Example: Inputs for channels 2 and 6 in Rack #1, Slot 1 are on, all others are off.
TCP Example
RTU Example
In the response the status of inputs 1 - 8 is shown as the byte value 22 hex, or 0010 0010 binary. Input 8 is
the MSB of this byte, and input 1 is the LSB. Left to right, the status of input 6 through 1 is: OFF-OFF-ON-
OFF-OFF-OFF-ON-OFF. The status of inputs 9-16 are shown as 00 hex, or 0000 0000 with the same bit
ordering.
Revision 13
April 2017
Query message format for function code 02
Function
Starting
Code
Address
High
02
00
02
00
Response message format for function code 02
Slave
Function
Address
Code
(00 for TCP)
00
02
01
02
HC900 Process Controller Communications User Guide
Modbus/TCP & Modbus RTU Function Codes
Function Code 02 - Read Digital Input Status
Starting
Number
Address
Inputs
Low
High
00
00
00
00
Byte Count
Data
02
22
02
22
Number
CRC
Inputs Low
(RTU)
10
10
CRC
Data
CRC
CRC
(RTU)
(RTU)
00
00
CRC
CRC
CRC
(RTU)
CRC
29

Advertisement

Table of Contents
loading

Table of Contents