
ET-7X00/PET-7X00 User Manual, version 1.1.2 Page: 95
Copyright © 2014 ICP DAS CO., LTD. All Rights Reserved. E-mail: [email protected]
4.5.
Modbus Functions and Registers
4.5.1.
01 (0x01) Read Coils
This function code is used to read the status of coils in an ET-7X00/PET-7X00 module. The
Request PDU specifies the starting address, i.e. the address of the first coil specified, and
the number of coils. In the PDU Coils are addressed starting at zero.
The coils in the response message are packed as one coil per bit of the data field. Status is
indicated as 1=ON and 0=OFF. The LSB of the first data byte contains the output addressed
in the query. The other coils follow toward the high order end of this byte, and from low
order to high order in subsequent bytes.
If the returned output 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 complete bytes of data.
Here is an example of a request to read digital outputs of ET-7026/PET-7026 module:
Request
Response
Field Name
(Hex)
Field Name
(Hex)
MBAP Header
01
MBAP Header
01
02
02
00
00
00
00
00
00
06
04
Unit Identifier
01
Unit Identifier
01
Function Code
01
Function Code
01
Starting Address Hi
00
Byte Count
01
Starting Address Lo
00
Outputs status 0-1
02
Quantity of Outputs Hi
00
Quantity of Outputs Lo
02
The status of outputs 0-1 is shown as the byte value 02 hex, or binary 0000 00
10
. DO1 is in
the seventh bit position from the left, and DO0 is the LSB of this byte. The six remaining
high order bits are zero filled.