Modbus: Minimum Function Implementation

Q: What is the minimum subset of function that a Modbus salve device should implement?

A: It depend on if you are creating a commercially available slave device or your own slave device.

If you are creating a Modbus Slave device that will only be interrogate by a specific Modbus Master, then you only have to implement the functions that the Modbus Master will use to call on your Modbus Slave. If your master is interested only in reading coils then your slave could be limited to only supporting function 0x01.

If you are creating a commercially available Modbus Slave device there are 4 so called classes of function implementation.

  • Class I is the minimum useful set of functions, master and a slave should implement only read multiple registers (0x03) and write multiple registers (0x16).
  • Class II represents the additional functions which are commonly implemented: read coils (0x01), read input discretes (0x02) , read input registers (0x04), write coil (0x05), write single register (0x06), read exception status (0x07)
  • Class III are the data transfer functions needed for HMI and supervision: force multiple coils (0x15), read general reference (0x20), write general reference (0x21), mask write register (0x22), read/write registers (0x23), read FIFO queue (0x24)
  • Class IV are machine/network/vendor dependent functions: diagnostics (0x08), poll (0x10), get comm event counters (0x011), get comm event log (0x12), report slave ID (0x17), firmware replacement (0x125), report local address(0x127)

© Chipkin Automation Systems 2007