DOCA0302EN-04

Modbus Client/Server Principle

Overview

The Modbus protocol exchanges data using a request/response mechanism between a client and a server. The client/server principle is a type of communication protocol in which a device (the client) controls one or more devices (the servers). A standard Modbus network consists of one client and up to 31 servers.

NOTE: For more information, a detailed description of the Modbus protocol is available on www.modbus.org.

Characteristics of the Client/Server Principle

The client/server principle has the following characteristics:

  • Only one client at a time is connected to the network.

  • Only the client can launch communication and send requests to servers.

  • The client can address each server individually using its dedicated address or all servers simultaneously using address 0.

  • The servers can only send responses to the client.

  • Servers cannot launch communication with either the client, or the other servers.

Client/Server Communication Modes

The Modbus protocol can exchange data using two communication modes:

  • Request/response mode

  • Broadcast mode

Each I/O Smart Link has a Modbus address (1 to 99), and concentrates data from connected devices on its 11 channels (Ti24 interface).

The states and orders for each device connected to I/O Smart Link are accessible in registers whose address depends on the channel (1 to 11) on which the device is connected.

Request/Response Mode

In request/response mode, the client addresses 1 server using the server dedicated address. The server processes the request, then responds to the client.

Broadcast Mode

In broadcast mode, the client addresses all the servers using address 0. Servers do not respond to broadcast messages.

Turnaround Time

The turnaround time Tr is the time between the end of receipt of a request and sending the response.

The typical value of the turnaround time Tr is less than 10 ms with the Modbus protocol.

Data Exchange

The Modbus protocol uses two data types:

  • Bits

  • 16-bit words called registers

Each register has a register number. Each data type (bit or register) has a 16-bit address.

Messages exchanged with the Modbus protocol contain the address of the data to be processed.

Frames

All frames exchanged with the Modbus protocol are 256 bytes maximum and consist of four fields:

Field

Definition

Size

Description

1

Server number

1 byte

Destination of the request

  • 0: broadcast (all servers are affected)

  • 1–247: unique destination

2

Function code

1 byte

Modbus function

3

  • Data

  • Sub-function code

n bytes

  • Request or response data

  • Sub-function code

4

Check

2 bytes

CRC16 (to check transmission errors)

Data Format

The data format is configured as shown in the following table according to Modbus RTU format:

Start

Data

Parity

Stop

1 bit

8 bits

1 bit

1 bit

NOTE: The Modbus RTU data format is composed of 11 bits.

Even parity is required, other modes (odd parity, no parity) may be also used.

If no parity is implemented in the Modbus Client, an additional stop bit must be transmitted by the Modbus Client to fill out the character frame to a full 11 bit asynchronous character.

NOTE: For more information, a detailed description of the Modbus protocol is available on www.modbus.org.
QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?