Skip to content
RenoktaRenokta

How is Modbus data moved to a platform? Register maps and MQTT

To turn Modbus data from PLCs, energy analysers and meters into reliable reports, the register map, data type, scaling, polling interval and timestamps must be verified from the start.

Request a demo

Renokta Ekibi ·

A live process chart on the touch panel beside an injection moulding machine.
Data path from Modbus to platform
FielddevicesRegistermapGatewayMQTTPlatform
  1. 1. Field devicesPLCs, analysers, meters and inverters on Modbus RTU or TCP.
  2. 2. Register mapAddress, data type, byte order and scale are verified.
  3. 3. GatewayRead-only polling, scaling and local buffering during outages.
  4. 4. MQTTTimestamped measurements are published per topic.
  5. 5. PlatformDashboards, alarms, reports and export to other systems.

Modbus is one of the most widely used protocols for sharing data between industrial devices. PLCs, energy analysers, meters, inverters and drives usually support Modbus RTU (over RS485) or Modbus TCP (over Ethernet). Moving this data to an IoT platform is technically simple, but if values are not read from the right register, with the right data type and scale, the screen shows meaningless or misleading numbers.

What is the difference between Modbus RTU and Modbus TCP?

Modbus RTU runs over a serial line such as RS485; several devices share one line with different addresses, and the polling side reads them one after another. Line length, cable type, termination resistors and baud rate must be set correctly. Modbus TCP carries the same data model over an Ethernet network; each device has an IP address and cabling is easier where network infrastructure exists. RS485 is only the physical layer; an RS485 port does not necessarily speak Modbus, as some devices use other protocols.

Why is the register map the first step?

Every device manufacturer publishes a register map showing which value is held at which address. For each value to be read, the following details are taken from the map and verified on site:

  • Register type and address: Coil, discrete input, input register or holding register. Whether addresses start from zero or one can differ between manufacturers.
  • Data type: 16-bit integer, 32-bit integer or 32-bit floating point. 32-bit values occupy two registers.
  • Byte and word order: The same 32-bit value can be stored in a different order on different devices; the wrong order produces absurdly large or small values.
  • Scale and unit: A value may be stored multiplied by 10 or 100; current and voltage transformer ratios may also need to be applied.

Polling interval and line load

Reading every value once a second is rarely necessary and loads the RS485 line for no reason. For energy meters, one-minute or five-minute readings are usually enough; fast-changing values such as status and alarms can be read more often. Several systems sending uncontrolled queries on the same line can cause collisions, so who polls the line and how often should be planned.

Read-only access and security

In monitoring projects it is recommended to only read from devices and keep write commands disabled. A wrong write command can change a PLC parameter. Since Modbus itself offers no authentication or encryption, Modbus TCP devices should be kept in a separate network segment and not exposed to direct outside access.

How is data carried to the platform with MQTT?

The site gateway reads Modbus devices at set intervals, scales the values and assigns units, and publishes them to the platform with MQTT. MQTT is a lightweight publish-subscribe messaging protocol designed for low bandwidth. Each measurement is sent under a topic together with a timestamp and device ID. When the internet drops, the gateway stores data locally and forwards it in order once the link returns.

What is checked in the acceptance test?

  • Selected values are compared with the device display or a reference instrument.
  • Cumulative values (kWh, m³) are checked to only increase and to handle rollover correctly.
  • Device, gateway and platform clocks are confirmed to be aligned.
  • Missing data is confirmed to be filled in after a connection outage.

Which documents does a Modbus data collection project need?

Documents gathered before going on site greatly reduce trial and error on installation day. Especially on sites with several brands and models, the following is prepared for each device.

  • Device list: Brand, model, firmware version and location.
  • The manufacturer’s register map and communication manual for each model.
  • Communication settings: Modbus address, baud rate, parity and stop bits, or IP address and port.
  • The existing RS485 line diagram and any other systems polling the line (SCADA, building automation).

These documents speed up gateway configuration and define in advance the references to compare against in the acceptance test.

This article is part of Energy monitoring and management guide; read the guide for the full topic.

Frequently asked questions

Does the PLC program need to change to read Modbus data?
Usually not. Registers already present in the PLC are read in read-only mode. If a required value is not in any register, a small mapping on the PLC side may be needed; this is planned with the automation engineer.
Why do very large or meaningless values appear on screen?
The most common causes are a wrong data type, wrong byte or word order and a missing scale factor. Comparing the register map with the value on the device display fixes it.
Can Modbus devices be read wirelessly?
Yes. A Modbus-to-LoRaWAN converter or a cellular gateway connected to the RS485 line can read devices where cables cannot be run and send the data wirelessly.
Can OPC UA be used instead of MQTT?
It can. OPC UA offers a rich data model, especially between systems inside a factory, while MQTT is common for carrying lightweight data to cloud platforms. The choice depends on existing infrastructure.

Sources

Let's plan the right solution for you, together.

Request a demo