Modbus is an open communication protocol used to exchange data between industrial devices. Modicon introduced it in 1979 for PLC communication. Its relatively simple message structure and broad implementation have made it common in automation.

The protocol defines how requests and responses are formatted, how data is represented and how operations are identified. Devices can include temperature instruments, motor controllers, sensors and other equipment in factories or remote installations.

Background

The protocol originated with Modicon, now part of Schneider Electric. The Modbus Organization was established in 2002 to support access to specifications and continued use of the protocol. Current terminology uses client/server in place of the older master/slave terms.

Client and server roles

The client initiates a transaction by sending a request. The server processes it and returns a response. A client can communicate with several servers and request different kinds of data.

For details, see the Modbus application protocol specification.

Data model

Modbus exposes data through defined logical areas:

  • Holding registers: values that a client can read and, where supported, write.
  • Input registers: read-only register values.
  • Coils: readable/writable binary states, such as on/off.
  • Discrete inputs: read-only binary states.

The device register map defines which addresses and operations are actually available.

Message framing

A Modbus message includes addressing, a function code and function-specific data. Framing and error-checking depend on the transport. In the ASCII example below, a colon begins the frame and carriage return/line feed ends it.

Modbus ASCII frame fields
StartAddressFunctionDataLRCEnd
:2 characters2 charactersN characters2 charactersCRLF