Forum

Share:
Notifications
Clear all

What are the Modbus request commands?

1 Posts
1 Users
0 Reactions
274 Views
Posts: 18330
Admin
Topic starter
(@click2electro)
Member
Joined: 4 years ago

Modbus is a communication protocol commonly used in industrial automation systems to establish communication between devices such as programmable logic controllers (PLCs), remote terminal units (RTUs), and supervisory control and data acquisition (SCADA) systems. In Modbus communication, devices exchange data using a set of predefined request and response commands. Here are the main Modbus request commands:

  1. Read Coils (Function Code 01):

    • Requests to read the status of discrete coils (binary outputs) from a device.
    • Syntax: Read Coils (FC 01): Slave Address + Function Code (01) + Starting Address + Quantity of Coils
  2. Read Discrete Inputs (Function Code 02):

    • Requests to read the status of discrete inputs (binary inputs) from a device.
    • Syntax: Read Discrete Inputs (FC 02): Slave Address + Function Code (02) + Starting Address + Quantity of Inputs
  3. Read Holding Registers (Function Code 03):

    • Requests to read the contents of holding registers (16-bit registers) from a device.
    • Syntax: Read Holding Registers (FC 03): Slave Address + Function Code (03) + Starting Address + Quantity of Registers
  4. Read Input Registers (Function Code 04):

    • Requests to read the contents of input registers (16-bit registers) from a device.
    • Syntax: Read Input Registers (FC 04): Slave Address + Function Code (04) + Starting Address + Quantity of Registers
  5. Write Single Coil (Function Code 05):

    • Requests to write a single coil (binary output) to a specified value (ON or OFF) in a device.
    • Syntax: Write Single Coil (FC 05): Slave Address + Function Code (05) + Output Address + Output Value (ON/OFF)
  6. Write Single Register (Function Code 06):

    • Requests to write a single holding register (16-bit register) to a specified value in a device.
    • Syntax: Write Single Register (FC 06): Slave Address + Function Code (06) + Register Address + Register Value
  7. Write Multiple Coils (Function Code 15):

    • Requests to write multiple coils (binary outputs) to specified values in a device.
    • Syntax: Write Multiple Coils (FC 15): Slave Address + Function Code (15) + Starting Address + Quantity of Coils + Byte Count + Coil Values
  8. Write Multiple Registers (Function Code 16):

    • Requests to write multiple holding registers (16-bit registers) to specified values in a device.
    • Syntax: Write Multiple Registers (FC 16): Slave Address + Function Code (16) + Starting Address + Quantity of Registers + Byte Count + Register Values

These are the main Modbus request commands used for reading and writing data between Modbus devices. The syntax for each command includes the slave address (address of the target device), function code, and additional parameters depending on the specific command.

Share: