Modbus meter integration for a BMS or SCADA system

A Modbus interface reads the meters and instruments on site, and Edge serves what it collects onward over Modbus TCP, MQTT or HTTP to the system that needs it.

ZMB-31 Modbus Interface
ZMB-31Modbus interface
ZGW-20 Gateway
ZGW-20Gateway with Edge
Measure
Existing Modbus, M-Bus, pulse and analogue equipment, each through the interface it needs
Good practice
Modbus defines the protocol, not a register map: the map comes from the device Modbus
Sensors
ZMB-31, Modbus RTU over RS-485, up to 30 registers, cable runs to 1,000 m Modbus Interface datasheet
On site
ZGW-20 Gateway, a BACnet/IP and Modbus client, and a Modbus TCP and MQTT source for meter data acquisition Edge

Modbus to BACnet, and which direction the Gateway can run it

Edge is a BACnet/IP client and a Modbus client, so it reads BACnet and Modbus devices. It is also a Modbus server, so another system can read what it has collected. It does not serve BACnet. Decide which way the data has to travel before choosing anything, because that decides whether Edge or the BMS is the client.

Modbus to BACnet, and which direction the Gateway can run it
Edge reads the deviceThe BMS reads Edge
Protocols Modbus RTU and TCP, BACnet/IP, OPC UA, M-Bus, pulse, 4-20 mAModbus TCP, MQTT, HTTP
Who is the client EdgeThe BMS or SCADA system
Watch for A bus that already has a masterA point list the BMS has to be told about

Hardware for meter data acquisition

One interface per physical layer. The Gateway is what makes them one point list.

If the site has M-Bus meters

If the site has pulse-output meters

If the site has analogue instruments

What each interface is responsible for

Each physical layer has its own interface, and the Gateway turns all of them into one list of points with units.

From field measurement to Edge

Each field signal reaches its named EpiSensor interface, reports through the site Gateway and is handled locally in Edge.

  • Modbus
  • Zigbee
  • Edge
  • Platforms
Field measurement
Interface
Gateway
Local Edge
Optional output
Modbus RTU equipment
M-Bus meters
Pulse outputs
Analogue instruments
ZMB-31Modbus Interface
ZHM-21M-Bus Interface
ZPC-20Pulse Counter
ZIO-20Analogue Signal Sensor
ZGW-20Gateway
EdgeLocal data, monitoring and rules
Customer platformOptional onward data
Modbus RTU · RS-485
Zigbee mesh
Wired M-Bus
Pulse input
4–20 mA input
Runs locally
Configured MQTTS / HTTPS
Customer platformOptional onward data
EdgeLocal data, monitoring and rules
ZGW-20Gateway
ZMB-31Modbus RTU · RS-485
Modbus RTU equipment
ZHM-21Wired M-Bus
M-Bus meters
ZPC-20Pulse input
Pulse outputs
ZIO-204–20 mA input
Analogue instruments
Configured MQTTS / HTTPS
Runs locally
Zigbee mesh
Sending data on to a customer platform is optional; Edge keeps working on site without one.
What each interface is responsible for
PositionWhat it tells youReferenceSensor
Modbus RTU equipment Meters, drives and controllers that already have registers One master per bus: check nothing else is already polling it Modbus ZMB-31 (on this page)
M-Bus meters Heat and utility meters with their own calculated records One meter per interface M-Bus Interface datasheet ZHM-21 (on this page)
Pulse outputs Meters with no digital interface at all Pulse weight, width and voltage from the meter's manual Pulse Counter datasheet ZPC-20 (on this page)
Analogue instruments Transmitters whose only output is a current loop Range, scaling and loop power recorded per instrument Analogue Signal Sensor datasheet ZIO-20 (on this page)
The onward interface What the BMS or SCADA system reads, and how Modbus server, MQTT or HTTP from the Gateway Edge ZGW-20 (on this page)
  • Give each RS-485 bus one master. If a BMS is already polling the RS-485 bus, adding a second master breaks both. Either read from the BMS instead, or give the meters their own bus.

  • Serve BACnet points onward over Modbus TCP, MQTT or HTTP. Edge reads BACnet/IP as a client and does not act as a BACnet server, so a BMS that reads from Edge uses one of those interfaces.

The settings both ends have to agree on

Every one of these exists in two places. Where they disagree, the symptom is usually silence or a plausible wrong number.

The settings both ends have to agree on
SettingTypical valueWhere to check
Unit or slave address 1 to 247The device's own configuration. Two devices with the same address on one bus produce intermittent nonsense.
Baud rate, parity and stop bits 9,600 or 19,200, 8N1The device's manual, then the same settings on the interface.
Register base Zero-based offsetsThe vendor's map: a register numbered 40001 is usually holding-register offset 0.
Function code 3 for holding, 4 for inputThe map. Reading the right number with the wrong function code returns an exception, or someone else's value.
Data type and word order 32-bit float, high word firstThe map, then a value you can predict. A wrong word order gives a number that looks like data.
Scale and unit The device's own multiplierThe map, and a comparison with the device's display.
Poll interval 15 to 60 seconds per deviceThe bus load: more devices and more registers need a longer cycle.
Onward interface Modbus TCP, MQTT or HTTPWhat the BMS or SCADA system can read, agreed with whoever maintains it.

Commissioning checks

These checks catch the failures that look like success.

  • One raw exchange is understood

    Capture one request and its response, and reconcile it by hand against the vendor's register map.

    Pass when every byte of the response is accounted for, including the scaling.

  • Values are checked independently

    Compare each point with the device's own display or with a separate instrument.

    Pass when the values match, in the same units, at two different operating points.

  • The bus holds up at the polling rate

    Run the intended poll cycle for a day and count errors and timeouts.

    Pass when the error rate is stable and low, and no device drops out.

  • A broken link is visible everywhere

    Disconnect one device and watch both Edge and the consuming system.

    Pass when both show the point as stale or missing rather than holding the last value.

  • Writes are proven and bounded

    For any write, test permission, range limits, acknowledgement, timeout, local override and the behaviour on failure.

    Pass when every one of those is demonstrated, and what happens on failure is written down.

Limits of this measurement

A protocol carries values. It does not agree what they mean.

  • Modbus does not define a universal register map or engineering unit for any device.
  • RS-485 is a physical and electrical layer. Modbus is an application protocol, and it also runs over other transports.
  • Protocol translation does not make a Modbus register, a BACnet object and an MQTT topic mean the same thing.
  • Edge is a BACnet/IP client, not a BACnet server, and it does not do BACnet MS/TP.

Sources

  1. Modbus specifications and implementation guides (opens in a new tab) (opens in a new tab) Modbus Organization
  2. An introduction to Modbus (opens in a new tab) (opens in a new tab) Modbus Organization
  3. Modbus Interface datasheet (opens in a new tab) EpiSensor. Specifications, ranges and ordering codes.

Decide which direction your integration should run

An engineer can say which devices can be read as they are, and which direction the integration should run.

Build this system