User`s guide
Copyright © 2004 EIM COMPANY, INC. • 13840 PIKE ROAD • MISSOURI CITY, TX. 77489
Page 118
Controlinc 1746-C (Version 5.21) Network Master Users Guide (2004-11-18)
Example (in byte order) of a request to
read 37 coils … 20–56 (internal coil
addresses 19 – 55) from slave device 17:
1. Slave Address 11
2. Function 01
3. Starting Address Hi byte 00
4. Starting Address Lo byte 13
5. No. of Coils Hi byte 00
6. No. of Coils Lo byte 25
7. CRC Hi byte ––
8. CRC Lo byte ––
NOTE: 19 decimal is 0x13
37 decimal is 0x25
6.5.2. Modbus Function (Command) Code Descriptions
Most of the rest of the information in this section came directly (or was paraphrased) from the Modbus
Specification.
6.5.2.1. Modbus Function Code 01 … Read Coil Status
Using function code 01, the Modbus master (host) may directly address and read bits that indicate the
live discrete outputs, software generated status bits and configuration bits.
Refer to the previous section that identifies “
Standard Coils”
Response example (in byte order):
1. Slave Address 11
2. Function 01
3. Byte Count 05
4. Data (Coils 27–20) CD
5. Data (Coils 35–28) 6B
6. Data (Coils 43–36) B2
7. Data (Coils 51–44) 0E
8. Data (Coils 56–52) 1B
9. CRC Hi byte ––
10. CRC Lo byte ––
The status of coils 27–20 is shown as the byte value CD hex, or binary 1100
1101. Coil 27 is the MSB of this byte, and coil 20 is the LSB.
Left to right, the status of coils 27 through 20 is: ON–ON–OFF–OFF–ON–
ON–OFF–ON.
By convention, bits within a byte are shown with the MSB to the left, and the
LSB to the right. Thus the coils in the first byte are ‘27 through 20’, from left to
right.
The next byte has coils ‘35 through 28’, left to right. As the bits are
transmitted serially, they flow from LSB to MSB: 20 . . . 27, 28 . . . 35, and so
on.
In the last data byte, the status of coils 56–52 is shown as the byte value 1B
hex, or binary 0001 1011.
Coil 56 is in the fourth bit position from the left, and coil 52 is
the LSB of this byte.
The status of coils 56 through 52 is: ON–ON–OFF–ON–ON.
Note how the three remaining bits (toward the high order end) are zero–filled.