Modbus Node Configuration Guide

The Modbus Node allows Rayven to poll and retrieve data from Modbus-compatible devices (PLCs, meters, RTUs) using TCP/IP. It supports standard register types and delivers raw or processed values into the workflow at defined intervals.

What It Does

This node connects to one or more Modbus devices by IP address and queries a specific register (e.g., Holding Register 40001). Data is extracted, transformed into a JSON payload, and pushed downstream. It is commonly used for acquiring telemetry from field sensors, energy meters, or industrial machinery.


 How to Use

Prerequisite

Before configuring the node:

  • Ensure that the target Modbus device is reachable via IP.

  • If necessary, append the port to the IP address (e.g., 192.168.1.10:502).

Implementation

In the Rayven Workflow Builder:

  1. Go to the Inputs panel and drag the Modbus node to the canvas.

  2. Double-click the node to open its configuration window.

  1. Configure general settings: name, polling interval, register address, etc.

  2. Test the connection using the built-in checker.

  3. Activate and save.


Configuration Fields

General

Field Requirement Description
Node Name Mandatory Human-readable name of the node.
Update Interval (min) Mandatory Polling interval. Example: 5 polls every 5 minutes.
Output JSON Key Mandatory The name of the field where the value will be output.
Modbus Address Type Mandatory One of:
- Coil Outputs
- Digital Inputs
- Analog Inputs
- Holding Registers
- Holding Registers Float
- Extended Registers
Modbus Address Mandatory Register address to read from (e.g., 40001).
Slave ID Mandatory The Modbus slave address (e.g., 1). Ranges 1–247.
Client ID Optional Alias for Slave ID in some configurations.
Data IP Address Mandatory IP (and optional port) of the device. Example: 192.168.1.10:502
Test Now Optional Validates the address, slave ID, and connection.
 

 JavaScript Note: 32-bit Float Conversion

Modbus only supports 16-bit registers. To combine two registers into a 32-bit float:

javascript
CopyEdit
var result = JSON.parse(input);
result.Phase_Voltage = GetSingle(Number(result.Phase_Voltage_1a), Number(result.Phase_Voltage_1b));

function GetSingle(z1, z2) {
var value = z2 << 16 | z1;
var b = value & 0x7fffff;
var e = ((value >> 23) & 0xff) - 127;
var m = 1 + b * Math.pow(2, -23);
var output = m * Math.pow(2, e);
return (value & 0x80000000) ? -output : output;
}

This technique helps reconstruct float32 values from Modbus LSW/MSW pairs.


Group by Device Label (Optional)

Field Description
Device Label Name Used to filter or group widgets per label.
Grouped Options:
- No Grouping
- Group by label value
- Group by label name
 

 Best Practices

  • Use Holding Registers Float if the device stores 32-bit values split across 2 registers.

  • Always test each mapping using the “Test Now” feature to confirm correct values.

  • Match your Modbus device’s documentation when configuring address types and registers.

  • Keep update intervals as low as possible to avoid polling overload.


 Use Cases

  • Polling real-time data from energy meters

  • Monitoring PLC values from industrial controllers

  • Logging temperature, voltage, or flow from Modbus TCP field devices

  • Integrating legacy industrial systems into modern workflows


 FAQ

Q: What’s the difference between “Holding Registers” and “Holding Registers Float”?

A: "Holding Registers" reads a single 16-bit word; "Float" reads two 16-bit words and combines them into a 32-bit float.

Q: Can I read multiple registers at once?

A: Not directly in this node’s UI. Create multiple node instances or use JavaScript to combine related fields.

Q: What happens if the node exceeds the device’s polling rate?

A: Over-polling may result in Modbus errors or dropped responses. Use conservative intervals.