---
title: "Modbus TCP / RTU to MQTT — ConnectMQ Edge Connector | ConnectMQ"
description: "Read Modbus TCP and RTU energy meters, drives and RS-485 sensors with ConnectMQ Edge and publish coils and registers to MQTT over TLS in an ISA-95 topic tree."
url: "https://connectmq.com/connectmq-edge/modbus/"
language: "en"
---

ConnectMQ Edge · Modbus TCP / RTU

# Every Modbus meter and drive, on one dashboard

Energy meters, drives and RS-485 sensors hold valuable data, but it often stays locked behind serial lines and register maps. ConnectMQ Edge reads them over Modbus TCP, UDP or RTU and sends every value to your ConnectMQ broker as an ISA-95 topic with value, quality, unit and timestamp. No gateway programming, and nothing lost when the internet drops.

-   Modbus TCP / UDP · port 502
-   RTU / ASCII over RS-485
-   Serial-to-Ethernet gateways

[Try it free](https://app.connectmq.com/signup) [See pricing](https://connectmq.com/pricing/)

No card required

-   Siemens S7 PLCs
-   OMRON PLCs
-   Modbus meters
-   IEC 104 RTUs
-   IEC 61850 IEDs
-   OPC UA servers

**ConnectMQ Edge**Windows service`ISA-95 · JSON``offline buffer`SCADA / HMI · OPC UA :48010 · MQTT :1883

**ConnectMQ Cloud**`broker.connectmq.com`Dashboards · Alerts · Digital Twin · API

## Why connect Modbus TCP / RTU to ConnectMQ

### Register map in, live data out

Write the addresses exactly as in the manual (40001, 30001, 00001). Neighbouring registers are combined into one request automatically.

### Real values, not raw registers

Data type, byte order, scale and unit turn raw registers into readable V, A and kWh, ready for dashboards, alerts and the Digital Twin.

### Works on any link, even offline

Modbus TCP, RS-485 on a COM port or a serial-to-Ethernet gateway, and values are buffered on disk while the internet is down.

## What it reads and does

-   Coils, discrete inputs, input and holding registers
-   Modbus TCP/UDP, RTU/ASCII on a COM port, serial-to-Ethernet gateways
-   Energy meters, drives, PLCs and RS-485 sensors
-   16-, 32- and 64-bit values, floats and register bits (40010.3)
-   ByteOrder ABCD / CDAB, Scale and Unit per tag
-   Neighbouring registers read in one request

What arrives in ConnectMQ Cloud`connectmq/site1/production/line1/panel1/MainPanel/Voltage`

```
{ "value": 230.4, "quality": "good", "unit": "V", "dataType": "Float32", "tag": "Voltage", "device": "MainPanel", "channel": "EnergyMeters" }
```

## Up and running in three steps

1.  1
    
    ### Install ConnectMQ Edge
    
    Download Edge from your ConnectMQ account and sign in — the Windows service and desktop app come in one installer.
    
2.  2
    
    ### Add the Modbus TCP / RTU channel
    
    Pick the Modbus TCP / RTU template, enter the address of your device and the tags you need, and press Save and apply.
    
3.  3
    
    ### Use the data
    
    The tags appear in your ConnectMQ broker as ISA-95 topics, ready for dashboards, alerts and the Digital Twin.
    

## Where teams use it

### Energy monitoring and sub-metering

Read voltage, current and kWh from every panel meter and track consumption per building, line or tenant in ConnectMQ.

### Drive and pump monitoring

Watch speed, current and fault registers of drives and pumps, and alert maintenance as soon as a value leaves its range.

### RS-485 sensors in the cloud

Bring temperature, flow or pressure sensors on existing RS-485 lines into ConnectMQ through a COM port or a serial gateway.

## Modbus TCP / RTU: frequently asked questions

How do I send Modbus TCP data to MQTT?

Add a Modbus TCP channel in ConnectMQ Edge, enter the device’s IP address, port (usually 502) and Unit ID, and list the registers from the manual as tags (40001, 30001, 00001…). After Save and apply, Edge reads the device and publishes each tag to your ConnectMQ broker over MQTT and TLS (port 8883) as an ISA-95 topic with a JSON payload.

Why do my Modbus float values look wrong?

Usually because of the word order. If a value reads 1.2e-38 instead of 230.5, change ByteOrder to CDAB (word swap) in the device settings. Most meters use either ABCD or CDAB. Also check that 32-bit values are addressed with two registers.

Can I read Modbus RTU devices on RS-485?

Yes. Pick the Modbus RTU template and set "Serial": { "PortName": "COM3", "BaudRate": 9600 } for a COM port on the Edge PC, or use "Transport": "Tcp" with the IP address of a serial-to-Ethernet gateway. RTU and ASCII are both supported.

Technical details: step-by-step setup and example configuration

### Set it up step by step

1.  1
    
    Collect the device details: IP address and port (usually 502), the Unit ID and the register map from the device manual.
    
2.  2
    
    In ConnectMQ Edge, open Connectors in the left menu, click + Add channel and pick the Modbus TCP template.
    
3.  3
    
    The channel is added with sample addresses. In the editor on the right, change the IP address, device settings and tags to match your equipment; Validate project checks the configuration.
    
4.  4
    
    Press Save and apply. The channel starts right away without restarting the service. Add as many channels as you need, including several of the same type.
    
5.  5
    
    Write the addresses as in the manual: 40001 for a holding register, 30001 for an input register, 00001 for a coil and 40010.3 for a bit of a register. 32-bit values take two registers.
    
6.  6
    
    If floats look wrong (for example 1.2e-38 instead of 230.5), change ByteOrder to CDAB (word swap). Most meters use either ABCD or CDAB.
    
7.  7
    
    For RS-485 devices, pick the Modbus RTU template instead and set "Serial": { "PortName": "COM3", "BaudRate": 9600 }, or use "Transport": "Tcp" with the IP address of a serial gateway.
    
8.  8
    
    Check the result: on Overview, the devices show Reading data under Field devices, and problems (wrong address, timeout, rejected login) appear in the Last problem column. The values themselves are in Local OPC UA Server › Live tag values; details are in Windows Service Settings › Logs.
    
9.  9
    
    Open the ConnectMQ portal: the tags appear in the topic tree as <enterprise>/<site>/<area>/<line>/<cell>/<device>/<tag> with a JSON payload (value, quality, unit, timestamp), ready for dashboards, alerts and the Digital Twin.
    

Example configuration

```
{
  "Name": "EnergyMeters",
  "Driver": "ModbusTcp",
  "Settings": { "Host": "192.168.1.10", "Port": 502 },
  "Devices": [{
    "Name": "MainPanel",
    "ScanRateMs": 1000,
    "Isa95": { "Cell": "panel1" },
    "Settings": { "UnitId": 1, "ByteOrder": "CDAB" },
    "Tags": [
      { "Name": "Voltage", "Address": "40001", "DataType": "Float32", "Unit": "V" },
      { "Name": "Current", "Address": "40003", "DataType": "Float32", "Unit": "A" },
      { "Name": "Energy", "Address": "400101", "DataType": "UInt64", "Scale": 0.001, "Unit": "kWh" },
      { "Name": "Alarm", "Address": "40010.3", "DataType": "Boolean" }
    ]
  }]
}
```

### Good to know

-   Floats such as 1.2e-38 instead of 230.5 almost always mean the wrong word order: switch ByteOrder between ABCD and CDAB.
-   32-bit values (Float32, UInt32) take two registers, so the next tag starts two addresses later — 40001 and 40003 in the example.
-   Neighbouring registers are combined into one request automatically; you list the tags one by one.
-   Use Scale to convert raw values, as in the example where Energy (UInt64) is multiplied by 0.001 to give kWh.

## Other connectors

[**Siemens S7**S7-1200/1500, S7-300/400, S7-200 SMART and LOGO! over ISO-on-TCPLearn more](https://connectmq.com/connectmq-edge/siemens-s7/) [**OMRON FINS / NJ-NX**CJ/CP/CS memory areas over FINS and NJ/NX variables by nameLearn more](https://connectmq.com/connectmq-edge/omron/) [**OPC UA Client**Subscribe to any OPC UA server: S7-1500, Beckhoff, B&R, KEPServerEXLearn more](https://connectmq.com/connectmq-edge/opc-ua-client/) [**IEC 60870-5-104**RTUs and substation gateways as controlling station, port 2404Learn more](https://connectmq.com/connectmq-edge/iec-104/) [**IEC 61850 (MMS)**Protection relays, bay controllers and IEDs over MMS with SCL importLearn more](https://connectmq.com/connectmq-edge/iec-61850/) [**Sparkplug B**Ignition, Node-RED and Sparkplug gateways via the local brokerLearn more](https://connectmq.com/connectmq-edge/sparkplug-b/) [**Local OPC UA server**Every tag Edge collects on one OPC UA endpoint for SCADA and MESLearn more](https://connectmq.com/connectmq-edge/opc-ua-server/)

[ConnectMQ Edge](https://connectmq.com/connectmq-edge/)

## Connect your first PLC this week

Create your ConnectMQ account, download ConnectMQ Edge from the portal and add your first connector in minutes.

[Get started](https://app.connectmq.com/signup) [See pricing](https://connectmq.com/pricing/)

## Articles

[All articles](https://connectmq.com/blog/)

Industrial IoT

### [Sparkplug B and the Unified Namespace: Structuring Industrial IoT Data on MQTT](https://connectmq.com/blog/mqtt-sparkplug-b-unified-namespace/)

Sparkplug B gives industrial MQTT a strict session and payload model, while a Unified Namespace gives your plant data a single, readable home. Here is how they fit together, with topic design tips and live examples.

August 26, 20269 min read

Managed MQTT Cloud

### [How to Choose an IoT MQTT Broker: 12 Criteria and the Questions to Ask Your Vendor](https://connectmq.com/blog/how-to-choose-an-iot-mqtt-broker/)

A practical 12-point checklist for choosing an IoT MQTT broker, a table of questions to ask every vendor, and a five-minute hands-on test you can run against broker.connectmq.com.

September 21, 20269 min read

MQTT Security

### [MQTT Security Best Practices: A 12-Point Checklist for IoT Teams](https://connectmq.com/blog/mqtt-security-best-practices/)

A hands-on MQTT security checklist covering TLS, credentials, client IDs, topic design, payload validation, rate limits and certificate checks, plus how ConnectMQ handles each point.

September 28, 202611 min read
