Get PLC data to MQTT and the cloud, without touching the PLC program.
If your PLC speaks Modbus TCP or Modbus RTU, an AppBlocks gateway can poll its registers, scale the values, and publish them to any MQTT broker, an HTTP API, Azure IoT, or AppBlocks Cloud. The gateway is a separate device, and its logic is a flowchart your whole team can read.
Everything between the register map and the broker.
Read any register
Coils, discrete inputs, holding and input registers, over Modbus TCP or RTU on RS-485 or RS-232.
Poll on your schedule
Fast tags every half second, slow ones every minute. Each poll is just a timer block.
Scale and filter at the edge
Turn raw counts into engineering units, and publish only when a value changes enough to matter.
Publish anywhere
Your MQTT broker, an HTTP endpoint, Azure IoT, or AppBlocks Cloud, from the same flow.
Secure transport
MQTT over TLS with QoS 0, 1, or 2, and HTTPS for API calls.
Write back when you choose
Subscribe to a topic and write setpoints to the PLC, with limits checked in the flow first.
A gateway is four or five blocks.
These sketches use real block names. Open the Designer and you’ll find each one in the palette.
Poll the PLC and publish
A timer sends a Modbus Request. When the PLC answers, On Modbus Response scales the value and publishes it. If the PLC stops answering, On Modbus Timeout lets you publish a status topic, so your dashboard knows the difference between zero and offline.
- Modbus TCP on port 502, or RTU on a serial port
- Function codes 01–06, 15, and 16
- Poll several slaves on one RS-485 bus by address
Report by exception
Publishing every value every second is fine on a LAN and expensive on a cellular plan. Compare each reading with the last value sent, and publish only when it moves by more than a deadband you choose.
Send setpoints back to the PLC
Subscribe to a topic and write the value to a holding register. Check the range in the flow before it goes anywhere near the PLC, and log anything out of range. You decide which registers are writable; everything else stays read-only.
MQTT in AppBlocksOne gateway, a whole panel
Modbus RTU puts up to 247 slaves on one RS-485 bus, so a single gateway can read the PLC, the energy meter, and the drives in the same cabinet. Each device gets its own polling schedule, and each Modbus Request names the slave address it’s meant for.
- Fast tags every second, slow ones every minute
- Slave addresses 1–247 on one bus
- Handle the answers in On Modbus Response
Build your first gateway in an afternoon.
Questions, answered.
Do I need to change my PLC program?
Not if the data you want is already mapped to Modbus registers. If it isn’t, you enable the PLC’s Modbus server and map the tags once. After that, the gateway only reads, unless you choose to write setpoints.
My PLC uses PROFINET, EtherNet/IP, or S7. Will this work?
AppBlocks talks Modbus. Many PLC families offer Modbus TCP as a built-in feature or an add-on; for those that don’t, a Modbus protocol converter bridges the gap.
Which MQTT brokers are supported?
Standard MQTT brokers such as Mosquitto, HiveMQ, and EMQX, with username and password authentication, TLS on port 8883, and QoS 0, 1, or 2. Azure IoT has its own telemetry and command blocks. MQTT in AppBlocks.
Can I send data to a REST API or a historian instead?
Yes. The HTTP Request block calls any HTTP or HTTPS endpoint, so you can post readings to your own back end, an ERP, or a historian with an HTTP interface.
What hardware do I use for the gateway?
A Tibbo Project System device with an Ethernet port and an RS-485 module is the usual choice, in a DIN-rail enclosure. Add a 4G LTE module for sites without a network. AppBlocks also runs on Zephyr boards such as the ESP32. Supported boards.
Ready to build your first firmware?
Start free in your browser, follow the tutorials, or book a free one-on-one session. No board yet? We’ll demonstrate everything on ours.