Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Modbus

Kconfig: CONFIG_MODULE_MODBUSGClasses: C_PROT_MODBUS_M

Modbus protocol master — reads/writes device registers (coils, discrete inputs, input/holding registers). For industrial IoT.

C_PROT_MODBUS_M

Modbus master protocol — supports four object types:

ObjectAccessSize
Coilsread-write1 bit
Discrete Inputsread-only1 bit
Input Registersread-only16 bits
Holding Registersread-write16 bits

Address range 0x00000xFFFF. Configuration-driven slave device mapping with data-format conversion and multiplier support.

The master runs over C_TCP ("modbus_protocol": "TCP"). The slave/register map is JSON config: a slaves array, each with its register definitions (type, address, format, multiplier). The master polls them on a timer.

Commands: dump_data (current register snapshot), set-poll-timeout.

Trace levels: messages, traffic (raw bytes), polling, decode, send.