Chapter 2. API Reference
Messaging Model And Data Mapping
Modbus is an application protocol that defines rules for messaging structure and data organization that are indepen-
dent of the data transmission medium. Traditional serial Modbus is a register-based protocol that defines message
transactions that occur between master(s) and slave devices (multiple masters are allowed on using Modbus TCP/IP).
The slave devices listen for communication from the master and simply respond as instructed. The master(s) always
controls communication and may communicate directly to one slave, or all connected slaves, but the slaves cannot
communicate directly with each other.
Fig. 25: Modbus segment diagram
Note: It is assumed that the number of slaves and their register maps are known by the Modbus master before the
start of stack.
The register map of each slave device is usually part of its device manual. A Slave device usually permits configuration
of its short slave address and communication options that are used within the device’s network segment.
The Modbus protocol allows devices to map data to four types of registers (Holding, Input, Discrete, Coil). The
figure below illustrates an example mapping of a device’s data to the four types of registers.
The following sections give an overview of how to use the ESP_Modbus component found under compo-
nents/freemodbus. The sections cover initialization of a Modbus port, and the setup a master or slave device ac-
cordingly:
• Modbus Port Initialization
Espressif Systems 622
Submit Document Feedback
Release v4.4