Data Transformer

Modbus to MQTT

A Modbus device answers register reads. An MQTT broker expects messages on topics. The Gateway sits between them: it polls the registers, turns them into engineering values with a name, a unit and a quality, and publishes them on a topic you choose.

Architecture

Typical use case

An energy meter, a VFD or a PLC holds the values a cloud application or an on-premise broker needs. Writing a bespoke poller means owning reconnection, byte order, scaling and buffering forever. The Gateway does that part, and the application subscribes to a topic.

One tag, published as it changes
{
  "device": "Main Meter",
  "tag": "Voltage_L1",
  "value": 230.5,
  "unit": "V",
  "quality": "GOOD",
  "timestamp": "2026-03-04T09:21:14.250Z"
}

Configuration approach

Define the device

Host and port for TCP, or serial line settings for RTU, plus the unit ID. Poll interval per tag or per group.

Define the tags

Register type, address, quantity, data type and byte order. Scale and offset turn raw counts into volts, amps or kilowatts.

Shape the stream

A deadband suppresses publishes while the value sits still; a rate limit publishes on a fixed interval instead of on every change.

Publish

Topic templates such as factory/{device}/{tag}, QoS, retain, TLS, and Store & Forward so an outage does not lose data.

Questions engineers ask

Does the broker need to reach the PLC?

No. The Edge Runtime makes the Modbus connection locally and the MQTT connection outbound. The PLC is never exposed to the broker or to the Internet.

What happens when the broker is unreachable?

With Store & Forward enabled the runtime writes messages to a bounded on-disk buffer and replays them in order when the broker returns. The buffer has a size and age limit, so it cannot fill the disk.

Can one device publish to two brokers?

Yes. A source can feed several destinations; the device is polled once and the values are routed to each.

Build a Modbus to MQTT gateway

Create a project, define the device and its tags in the Edge Logic Editor, and download a runtime to test at the plant.

Modbus to MQTT | Modbus Logic