Modbus Reading Expression Syntax – GW04
Overview
Modbus register mapping entries allow Modbus register values to be defined using flexible mathematical expressions. This allows for unique registers to be created that acquire data from any monitoring node and process that data to produce the desired reading — for example to combine power readings from multiple monitoring nodes or to change the measurement units of a certain value.
The expressions can refer to readings from the current node or other nodes. Miscellaneous power-calculation helper functions are also available. For a full set of math functions available see http://mathjs.org/docs/expressions/syntax.html.
Accessing reading data within mapping expressions
R(channel)
Return reading value on a specific channel
Parameters:
- channel: standard data channel name (e.g. VoltageA, CurrentB etc., WITHOUT QUOTES). See the Modbus register map for available channels
Examples:
- R(VoltageA) – Voltage A reading
- R(PowerC) – Power C reading
- R(EnergyA) – Energy A reading
Sample reading channels supported (note: specific readings available vary by monitoring node type and configuration and may include channels not listed below – please see specific node documentation for details):
- VoltageA/B/C
- CurrentA/B/C
- PowerA/B/C
- Power
- EnergyA/B/C
- Energy
- VAA/B/C
- PhaseAngleA/B/C
- Temperature0..12
- Humidity
- Pressure
R(node, channel)
Return reading value on a specific channel on a specific monitoring node
Parameters:
- node: node reference, in the formats Nxxxxxxxxxxxxxxxx (x = 16-char hex node ID)
- channel: standard data channel name (e.g. VoltageA, CurrentB etc., WITHOUT QUOTES)
Examples:
- R(NA30000000000AB3E, EnergyA) – Energy A reading of Monitoring node #A30000000000AB3E