Date Code 20010518 Appendix G G-3
SEL-2020 Instruction Manual
FUNCTION CODES
Message Framing
All Modbus data requests consist of an address, a function code, some data, and a checksum. For
the SEL-2020 to respond, the address must match one of those established in the settings and the
checksum must be valid. This frame format can be viewed as:
1 byte Slave Address (must match an ADDRESSn setting)
1 byte Function Code (see below for supported function codes)
n bytes Information specific to function code
2 bytes CRC-16 code for message
For successful operations, the response message will have the same format as the request
message. For error responses, the message format will be as follows:
1 byte Slave Address (echo of received)
1 byte Exception Function Code (function code with high-bit set)
1 byte Exception Code (see below)
2 bytes CRC-16 code for message
Whenever multiple-byte values are sent over Modbus, they are sent most significant byte first.
The function codes supported by the SEL-2020 are:
01h Read Coil Status
02h Read Input Status
03h Read Holding Register
04h Read Input Register
05h Force Single Coil
06h Preset Single Register
10h Preset Multiple Registers
11h Report Slave ID
Read Coil Status (Function Code 01h)
The SEL-2020 uses function code 01h to read the status of various bits. You may read up to
1000 bits at once.
The master request must have the following format:
1 byte Slave Address
1 byte Function Code (01h)
2 bytes Starting Bit Address
2 bytes Number of Bits to Read
2 bytes CRC-16 for Message