Function codes Modbus: exam questions with worked answers
Practice questions from the Function codes block of the Modbus Industrial certification. Detailed corrections, public sources, free to read without sign-up.
Questions for the "Function codes" topic
Q01
Which Modbus function code is used to READ the Holding Registers (16-bit read/write registers) of a slave?- A.0x01 (Read Coils)
- B.0x02 (Read Discrete Inputs)
- C.0x03 (Read Holding Registers)
- D.0x04 (Read Input Registers)
4. Function codes· Lesen Coils/Register· MediumCorrect answerC — 0x03 (Read Holding Registers)Learning tip0x03 (Read Holding Registers) targets the 16-bit read/write register space and is by far the most used code for reading analogue values such as temperatures, pressures, counters and setpoints. 0x01 is wrong because Read Coils returns 1-bit read/write outputs, not 16-bit registers. 0x02 is wrong because Read Discrete Inputs returns 1-bit read-only digital inputs. 0x04 is wrong because Read Input Registers targets a separate 16-bit READ-ONLY register table, not the Holding Registers. The full picture includes 0x05/0x06 for single writes and 0x0F/0x10 for multiple writes.
Q02
Function 0x06 "Write Single Register" writes a single 16-bit Holding Register on a Modbus slave, with both the address and the value encoded on 16 bits each in the request.TrueFalse4. Function codes· Write Single Register (0x06)· EasyCorrect answerTrueLearning tipThe 0x06 request format is: function code on 1 byte (0x06), register address on 2 bytes (0-65535), and register value on 2 bytes (0-65535) -- 5 bytes of PDU plus the transport headers. The dual function code is 0x10 "Write Multiple Registers", which writes several consecutive registers in a single frame, up to a limit of 123 registers per request.