Modbus background
Modbus is a request/response application protocol for reading and writing values in devices. Modicon created it for its PLCs in 1979, and the Modbus Organization now publishes the specifications. PLCs, drives, power meters and sensor gateways are among the many industrial devices that speak it.
Modbus is deliberately simple. A client sends a function code with an address and a quantity; the server reads or changes its data model and answers. There is no equipment state model and no event reporting. The device manual tells you which address holds which value, and your application decides how often to read it.
Clients and servers
Section titled “Clients and servers”A Modbus exchange has two roles.
| Role | What it does | Old name in the serial specification |
|---|---|---|
| Client | Sends requests and waits for responses. Typically an HMI, a SCADA system or a PC application. | Master |
| Server | Receives requests, processes its data model and responds. Typically a PLC or an instrument. | Slave |
The client always starts the exchange. A server never sends data on its own.
Client Server | request: function 03, address 0, qty 1 | | ----------------------------------------> | reads holding register 0 | | | response: function 03, 2 bytes, 0x002A | | <---------------------------------------- |Specifications
Section titled “Specifications”The Modbus specifications are split into the application protocol and one document per transport. The background pages rely on these official specifications, which you can download from the Modbus Organization website.
| Specification | Defines | Pages |
|---|---|---|
| MODBUS Application Protocol Specification V1.1b3 | Data model, PDU, function codes, exception responses | Data model and addresses, PDU, ADU and function codes |
| MODBUS Messaging on TCP/IP Implementation Guide V1.0b | MBAP header, unit identifier, TCP connection management | Modbus TCP |
| MODBUS over Serial Line Specification and Implementation Guide V1.02 | RTU and ASCII frames, CRC and LRC, character timing, parity, RS-485 | Serial line: RTU and ASCII |
| MODBUS/TCP Security Protocol Specification | TLS, certificates, role-based authorization | Modbus/TCP Security |
These pages cite section numbers but don’t reproduce the specification text. The explanations and examples are PDComm’s own.
Reading order
Section titled “Reading order”- Data model and addresses: the four data tables and zero-based addresses.
- PDU, ADU and function codes: the bytes of a request and a response, function codes and exception responses.
- Pick your transport:
- Ethernet: Modbus TCP
- RS-232 or RS-485: Serial line: RTU and ASCII
- Encryption and authentication: Modbus/TCP Security
- PDComm Modbus features: the transports, function codes, security and endpoint behavior of PDComm.
If you’d rather run something first, start with the quickstart. Every tutorial lists the background pages it needs before you begin.