Real, paste-ready Node-RED flows for every Modbus data type — from basic FC03 reads to 32-bit floats in all byte orders, MQTT bridges, and InfluxDB logging. Every example includes a "same in ModPackQT in 30 seconds" shortcut.
node-red-contrib-modbus. Install it via Manage Palette in Node-RED or run npm install node-red-contrib-modbus in your Node-RED directory. Update the tcpHost in the modbus-client config node to your device's IP address.Reading holding registers is the most common Modbus operation.
Input registers (3x range) are read-only 16-bit values — typically live sensor readings like temperature, pressure, or ADC counts.
Digital I/O over Modbus.
Reading a 32-bit float is straightforward once you know the byte order.
Energy counters, position feedback, and large totals often come back as 32-bit integers spread across two registers.
Some Modbus devices expose text — serial numbers, firmware strings, model names — in consecutive registers, two ASCII characters per register.
Writing a single holding register (FC06) is how you send setpoints, configuration values, or commands to a Modbus device.
Writing a coil controls a digital output — a relay, an LED, a solenoid.
FC16 writes a block of consecutive holding registers atomically.
FC22 lets you flip individual bits in a holding register without disturbing the rest.
Forward Modbus register values to an MQTT broker so other systems (dashboards, cloud platforms, other PLCs) can subscribe.
Store Modbus register values as time-series data in InfluxDB for trending, analytics, and dashboards (Grafana, Chronograf).
Trigger an alert when a Modbus register value crosses a threshold — an email, a Telegram message, or a webhook.
Display live Modbus values in a Node-RED Dashboard with gauge and chart widgets.
Modbus communication fails — devices go offline, CRC errors happen, exception responses arrive.
This example turns Node-RED into a Modbus TCP slave (server) and shows how to update holding register values in the server's memory so any Modbus master can read them with FC03.
Extend the Modbus TCP slave example to coil registers (0x range).
Run a Modbus RTU slave directly from Node-RED over a serial port (RS-485 or USB-to-serial adapter) and keep its holding registers fresh from your flows.
Expose boolean output states (relays, valve open/close, enable flags) from Node-RED as Modbus RTU coils over RS-485.
In node-red-contrib-modbus, there is no standard Modbus function code that lets a Node-RED flow write into input registers (FC04) — those are truly read-only from the master's side by spec.
Discrete inputs (FC02) in node-red-contrib-modbus cannot be updated from user flows — their buffer is not writable via any standard Modbus function code.
A focused Modbus TCP master read flow covering all four register types — holding (FC03), input (FC04), coils (FC01), and discrete inputs (FC02) — over a single TCP connection.
A complete Modbus TCP master write reference covering single register (FC06), multiple registers (FC16), and single coil (FC05) writes.
32-bit IEEE 754 floats span two consecutive 16-bit Modbus registers.
Every raw Modbus holding and input register value is a 16-bit unsigned integer (0–65535).
32-bit integers span two Modbus registers (like float32) and can be signed (INT32: −2 billion to +2 billion) or unsigned (UINT32: 0 to 4.
Some high-precision energy meters and counters store 64-bit integer values across four consecutive Modbus registers.
Modbus coils (FC01) and discrete inputs (FC02) return boolean arrays in Node-RED.
Every example in this directory can be done in ModPackQT with a few clicks — no JavaScript, no function nodes, no flow deployments. Works with Modbus TCP and RTU.