IMD SolutionComputing LibraryShop main store

Selection guide

Selecting a gateway to publish Modbus data to Azure IoT Hub

Edge computing and IIoT Published 8 min read

Short answer

Publish direct from the gateway only when its exact model and firmware documents an Azure IoT Hub connector with a configurable JSON payload and a configurable publish interval; Azure accepts TLS-secured MQTT at QoS 0 or 1 only. Otherwise keep acquisition on the gateway and run Azure messaging on a small edge application beside it.

On this page
  1. When can a single gateway publish Modbus data straight to Azure IoT Hub?
  2. What must the gateway's Azure connector support?
  3. How do you size the Modbus side of the gateway?
  4. What belongs in the JSON payload contract?
  5. How do you verify a 15-minute publish interval and outage behavior?
  6. When should you split acquisition and Azure messaging across two boxes?
  7. How do you field-validate the gateway before committing?
  8. What lifecycle status rules out a gateway?
  9. Questions asked

Commit to direct cloud publishing only when the gateway's documentation — for the exact model and firmware you will deploy — shows an Azure IoT Hub connector with a configurable JSON payload and a configurable publish interval, meeting the hub's fixed rules: TLS-secured MQTT at QoS 0 or 1, and a publish interval you can set to 900 seconds with buffering for missed messages. That one gate decides the architecture: pass it and a single box does the whole job, fail it and the right design keeps Modbus acquisition on the gateway and puts Azure messaging on a small edge application beside it. The sections below follow the selection in the order you meet it, from connector requirements through payload, interval and validation, to the lifecycle gate that can veto an otherwise suitable box.

When can a single gateway publish Modbus data straight to Azure IoT Hub? #

Only when that exact model and firmware documents an Azure IoT Hub connector — a named feature in the vendor's own datasheet and manual, not an MQTT client you hope to point at the hub — with payload and interval settings you can actually change. Field connectivity is the entry ticket, not the qualification: Modbus RTU over serial, Modbus TCP over Ethernet and a wireless-sensor radio tell you the box can collect, and they say nothing about northbound delivery.

Treat every capability claim as scoped to the named model and firmware. A connector present on one variant of a product family is not present on all of them, and a feature added in a later firmware release is absent on the version shipping today. Write the requirement set down before you shop — inputs (RTU slaves, TCP servers, wireless sensors), output (JSON over MQTT to the hub), publish every 15 minutes, configurable — and make the vendor's documentation answer each line.

What must the gateway's Azure connector support? #

It must meet the hub's device-messaging rules: TLS-secured MQTT only, with insecure connections on port 1883 refused; QoS 0 or QoS 1, because the hub does not handle QoS 2; and authentication with a device identity the hub recognizes. Azure IoT Hub is not a general-purpose MQTT broker that accepts arbitrary application topics; it exposes a device-messaging interface with documented message formats in both directions.

Read the connector documentation for four things in order: the security statement (TLS, certificate validation), the QoS statement, the supported authentication methods, and the message-format controls. If the connector uses certificate authentication, fixing X.509 certificate auth to Azure IoT Hub over MQTT covers the failure modes you will meet at commissioning. Get the hub endpoint, the device identity and the approved authentication method from whoever administers the Azure subscription before you configure anything on the plant floor.

How do you size the Modbus side of the gateway? #

Count before you choose: list every Modbus RTU slave and TCP server with its registers, data types, scaling and required poll rate, then check the totals — devices and acquired points — against the gateway's documented limits. Modbus RTU is a serial bus: matching baud rate, parity and stop bits, unique slave addresses, and termination and biasing per the interface documentation. Modbus TCP carries the same requests over IP, so each endpoint needs a reachable address and its unit addressing.

Commission the wired and wireless sides separately. For wireless sensors, demand an explicit compatibility listing for the exact sensor model together with its enrollment procedure — a radio standard named in a datasheet is not a device compatibility list. Note whether each device integrates through a predefined profile or manual register mapping, because manual mapping puts byte order, signed values and scaling on you. The register list you build here is also the yardstick for field validation later: every published value traces to an address, a scale and a unit on it.

What belongs in the JSON payload contract? #

Fix the contract before you shop, and make it six fields deep — asset identification, measurement name, value, unit, timestamp, and a data-quality flag — then confirm the connector can shape its output to that contract or you will be transforming downstream forever. The connector's native payload is a format, not a contract: map each native field to your contract, and whatever you cannot map and cannot customize is a gap the cloud side pays for.

The trade is familiar from MQTT pipelines generally: publishing a simple tag value without Sparkplug metadata keeps payloads small but leaves the consumer to infer identity, units and quality — acceptable when the consumer already knows the tag, expensive when it does not. Decide batching here too: one message carrying all points per publish, or one message per point. The interval math in the next section shows why batching wins at a 900-second interval.

How do you verify a 15-minute publish interval and outage behavior? #

Treat it as two independent settings — acquisition poll rate and publish rate — and demand that the connector schedules the publish itself: 900 seconds per message, 96 messages a day, with documented buffering for every publish missed while the link to the hub is down. Acquisition and publishing rates are set separately, so a gateway can poll fast while publishing slowly, and each rate carries its own failure mode.

Worked example with illustrative inputs — a line of 120 points polled every 10 seconds, published as one batched JSON message per interval:

  • Publishes per day: 86,400 s ÷ 900 s = 96 messages.
  • Worst-case age of a value at the cloud consumer: 900 s publish interval + 10 s poll period = 910 s.
  • Planned four-hour WAN outage: 4 × 3,600 s = 14,400 s; 14,400 s ÷ 900 s = 16 publishes missed, so the connector must buffer at least 16 messages and replay them on reconnect.

The decision from those numbers: take the 910 s figure to the consumer. If it is too old, halving the interval to 450 s doubles the traffic to 192 messages a day and halves the worst-case age. Keep publishing batched: at one message per point this line would send 120 × 96 = 11,520 messages a day instead of 96.

One timing truth the datasheet will not spell out: a publish timer fires on schedule, but the value it carries is whatever acquisition had ready at that moment, so freshness tracks the poll, not the clock. The dependence shows up in other protocols too — OPC UA publishing timing depends on publish readiness — so a mixed Modbus-plus-OPC UA source exhibits the same lag on its OPC UA half.

When should you split acquisition and Azure messaging across two boxes? #

Split the moment any gate fails — no documented connector, a fixed payload, no interval control, no outage buffering — because an edge application beside the gateway gives you the Azure messaging behavior, payload shaping and scheduling the connector lacks, at the cost of one more component to deploy and maintain. That is the honest trade, and the table is the decision:

Decision factor Direct from the gateway Gateway plus edge application
Field acquisition Documented RTU, TCP and sensor support on that model Same requirement; the edge box reads the gateway over a documented local interface
Azure connection Connector supplies TLS, QoS 0/1 and device-identity auth Edge application owns the connection and the credentials
JSON payload Native payload must match the contract or be configurable Application serializes exactly the contract
900 s interval Connector's scheduler plus buffering Application scheduler, independent of acquisition
Component count One box, one firmware chain Two: added deployment, monitoring and credential management

The edge application does not have to be custom code — sending PLC data to an IoT hub without custom software walks one well-trodden route. The second box is typically a fanless mini PC in the same cabinet, sized for the flow tool, the credential store and the buffering disk. One limit the split cannot fix: an intermediary can only publish what the gateway exposes. If a reading never leaves the gateway over any documented interface, no edge application recovers it — that is an acquisition failure, not a messaging one.

How do you field-validate the gateway before committing? #

Validate in strict order — field readings, then an authenticated connection, then one real message inspected inside Azure, then the interval measured over a full day and a deliberate network cut — and let no step pass on the previous step's success. Each step isolates the next failure to one layer.

  1. Commission acquisition: repeated clean reads on the RTU bus and on each TCP endpoint; wireless sensors enrolled one by one and showing fresh values.
  2. Prove values, not movement: compare gateway readings against device displays or a reference instrument, and settle byte order, signed values, scaling and register-offset conventions. A wrong decode stays plausible and rides the whole cloud pipeline without raising a communications fault.
  3. Bring the connection up with a correct clock and TLS certificate validation enabled. If trust fails, fix the clock or the trust store — never disable validation to make the error go away; that is the one safety line in this article, because the box would then hold an unauthenticated TLS path from your OT network to an internet service.
  4. Publish one message and inspect it inside Azure: identity, JSON structure, values and timestamps checked against the register list.
  5. Measure the interval across 24 hours — 96 messages expected — then cut the WAN for a planned window and verify the buffer replays without silent loss.

What lifecycle status rules out a gateway? #

End-of-life status rules a gateway out of a new deployment: a box that no longer receives firmware updates terminates a TLS session between your OT network and a cloud service, which is precisely where you want current patches and a published replacement path. Check the vendor's lifecycle pages for three statements — current active status, a stated end-of-sale-to-end-of-support window, and a named migration path to a successor.

Do not treat any successor as functionally identical: run it through the same connector, payload, interval and buffering gates as a fresh selection. If an end-of-life box is already collecting on a line you now need to connect, validate the replacement against the same register list and cut over on your schedule, not the failure's.

Questions asked

Can I prove the Azure path with a plain MQTT client before choosing a gateway?

Yes, and it is a cheap way to isolate faults later. A desktop MQTT client configured with TLS, the hub endpoint and a test device identity proves the endpoint, credentials and network path are sound. When the gateway connector later fails to connect, you already know the problem is in the connector configuration, not the Azure side. Run the test from the IT network, not the OT segment.

How many messages a day does a 15-minute interval produce for 40 devices?

Ninety-six per device identity per day: 86,400 seconds divided by 900 seconds is 96. With 40 gateways each holding its own device identity, that is 40 × 96 = 3,840 messages a day, still one batched message per device per interval. The count scales with identities and interval, not with point count, as long as publishing stays batched.

Which QoS should the connector use toward Azure IoT Hub?

QoS 1. The hub handles QoS 0 and QoS 1 only, and QoS 1 plus buffering gives at-least-once delivery across reconnects. At-least-once means a replayed message can arrive twice after an outage, so include a message identifier or publish timestamp in the JSON and let the cloud side discard duplicates on arrival.

How deep is the cloud-to-device queue if commands come back through the hub?

Each device queue holds at most 50 cloud-to-device messages, and the device must acknowledge a message as complete before the hub frees the slot. MQTT supports server push from the hub, so commands reach the device immediately rather than waiting for your publish interval, but your application must acknowledge each one, or the queue fills and later commands stall.

The gateway we planned on is end-of-life but still works. Can we keep it?

Not for a new cloud-connected deployment. End-of-life means no further firmware releases, and the box terminates a TLS session from your OT network to an internet service, where unpatched firmware is a standing exposure. If it must keep collecting while you validate a replacement, restrict its outbound traffic to the hub endpoints alone and treat the migration as scheduled work, not emergency work.

Keep reading

  • How-to

    Sending PLC data to an IoT hub without custom software

    You do not need custom software to move PLC data to an IoT hub: a configurable edge package with an S7, Modbus TCP or EtherNet/IP driver, a channel mapping and an MQTT publisher replaces hand-written acquisition code. Verify two things before you commit: the driver covers the protocol your controller actually speaks, and the publisher covers the destination's authentication and message format. Software still does the work — you configure it instead of writing it.

    Edge computing and IIoT

  • How-to

    Bridging OPC UA PLC data to MQTT with an edge PC

    Keep the OPC UA server on the PLC side and give MQTT publishing its own role on a separate edge PC that acts as the OPC UA client and MQTT publisher. Commission the two links independently — first a verified tag read, then a verified subscriber message — and only then widen the tag set.

    Edge computing and IIoT

  • Comparison

    PLC MQTT direct publishing versus an IoT gateway

    For publishing process data to an MQTT broker for web monitoring, put the MQTT client in a gateway and leave the S7-1500 out of broker session logic. Keep the LMQTT_Client block in the PLC only when publication must be coordinated with control logic or the gateway cannot meet your topic, payload and delivery requirements. A green MQTT status proves the broker connection only, never the S7 data behind it.

    Edge computing and IIoT