Rockwell Automation Publication 5069-UM003B-EN-P - January 2020
131
Appendix
B
Modbus Command Codes
Master Command List
Function Codes
Read Coil Status (Function Code 01)
Query
This function allows you to obtain the ON/OFF status of logic coils (Modbus 0x
range) used to control discrete outputs from the addressed slave only. Broadcast
mode is not supported with this function code. In addition to the slave address
and function fields, the message requires that the information field contain the
initial coil address to be read (Starting Address) and the number of locations that
are interrogated to obtain status data.
The addressing allows up to 2000 coils to be obtained at each request. However,
the specific slave device can have restrictions that lower the maximum quantity.
The coils are numbered from zero; (coil number 1 = zero, coil number 2 = one,
coil number 3 = two, and so on).
The following table is a sample read output status request to read coils 0020 to
0056 (37 coils) from slave device number 11.
Topic
Page
Read Coil Status (Function Code 01)
Read Input Status (Function Code 02)
Read Holding Registers (Function Code 03)
Read Input Registers (Function Code 04)
Force Single Coil (Function Code 05)
Preset Single Register (Function Code 06)
Force Multiple Coils (Function Code 15)
Preset Multiple Registers (Function Code 16)
TIP
This is the structure of the message being sent out to the Modbus network.
The following byte values are in hexadecimal display.
Node Address
Function Code
Data Start Point
High
Data Start Point
Low
Number of Points
High
Number of Points
Low
Error Check Field
(2 bytes)
0B
01
00
13
00
25
CRC