All eGauge models with firmware v3.2 or higher have Modbus TCP output capability. eGauge models with USB ports also have capability for Modbus RTU (serial via RS485) output capability, with use of the eGauge USB485 converter. The Modbus server can be enabled in Settings -> Modbus Server. If the Modbus Server option is not available, upgrade your firmware in Tools -> Firmware Upgrade.



Contained in this article:

  1. Enabling the Modbus server
  2. Modbus Register Map
  3. Example Modbus transmission
  4. Additional technical information


Enabling the Modbus server


In the eGauge interface, navigate to Settings -> Modbus Server. The following options are available:


Check the box for "Enable Modbus" for the appropriate service (Modbus TCP uses Ethernet, Modbus RTU uses the eGauge USB485 serial converter).


For Modbus TCP, choose the port to listen on (default: 502).


For Modbus RTU, click inside the serial device box and detected adapters will be listed to choose from as shown below. Choose the appropriate baud rate, parity and stop bits to match the Modbus master.


Modbus Register Map

The exact Modbus map depends on the eGauge device configuration and is available on the Modbus settings screen. The map is available for viewing in the web browser or for download as a comma-separated value (CSV) file which can then be imported into any spreadsheet program.


Address range

Description

Timestamps

40000 -- 40003

local timestamp (for use when reading from addresses <45000)

40004 -- 40007

THD timestamp indicates when data was acquired that is used by FFTarg(), FFTarg2(), FFTmag(), and THD() functions

40008 -- 40009

register timestamp (for use when reading from addresses ≥45000)

Local data (channel checker)

40500 -- 40999

Line voltages (RMS)

41000 -- 41499

Line voltages (DC/mean)

41500 -- 41999

Line frequencies

42000 -- 42499

Sensor values (RMS)

42500 -- 42999

Sensor values (DC/mean)

43000 -- 43949

Sensor frequencies

Register Data

45000 -- 45999

Cumulative register values (signed 64-bit integers)

46000 -- 46999

Change of register value (float)

47000 -- 47999

Reduced precision cumulative register values (float)


An example Modbus map, which can be found in Settings -> Modbus Server, is displayed below:



Example Modbus Transmissions:


Example Modbus TCP request and response for L1 RMS voltage:


Request: [00 01] [00 00] [00 06] [01] [04] [01 f4] [00 02]


[00 01] = Transaction identifier

[00 00] = Protocol identifier (always 00 00)

[00 06] = Bytes following (0x0006 = 6 bytes)

[01] = Unit ID

[04] = Function code (0x04 is read input registers)

[01 f4] = Starting register address (500)

[00 02] = Number of words to return (2 words for float value)


Response: [00 01] [00 00] [00 07] [01] [04] [04] [42 f6 2a 06]


[00 01] = Transaction identifier

[00 00] = Protocol identifier (always 00 00)

[00 07] = Bytes following (0x0007 = 7 bytes)

[01] = Unit ID

[04] = Function code (0x04 is read input registers)

[42 f6 2a 06] = Contents of register 500 and 501 respectively


0x42f62a06 decoded as big-endian (ABCD) float is roughly 123.08, so L1 voltage is 123.08Vrms


Example Modbus RTU request and response for L1 RMS voltage:


Request: [01] [04] [01 f4] [00 02] [31 c5]


[01] = Unit ID

[04] = Function code (0x04 is read input registers)

[01 f4] = Starting register address (500)

[31 c5] = CRC error check


Response: [01] [04] [04] [42 f6 2a 06] [90 ac]

[01] = Unit ID

[04] = Function code (0x04 is read input registers)

[04] = Data bytes to follow (not including CRC)

[42 f6 2a 06] = Contents of register 500 and 501 respectively


0x42f62a06 decoded as big-endian (ABCD) float is roughly 123.08, so L1 voltage is 123.08Vrms



Additional technical information

Additional help is available by clicking the [?] buttons on the Modbus Server settings page.


All data is provided as Modbus input registers and therefore their Modbus addresses start at 40000. The raw frame sent does not include the prefixed '40', this indicates the function code used.


For each register recorded by eGauge, the register's current cumulative value and the amount by which it changed since the previous one-second interval can be read. The cumulative value is available with full resolution as a signed 64-bit value. For convenience, the same value is also available, at reduced resolution, as a 32-bit floating point number. The change-in-value is available only as a 32-bit floating point number. In addition to the register data, it is also possible to read locally measured data such as line-voltages, frequencies, and the value measured by each sensor-port.


The Modbus server guarantees that any data read with a single request is consistent. Timestamps are provided as a means to ensure consistency when data is read with multiple requests (e.g., to read multiple, discontiguous registers). This is accomplished by (i) reading the timestamp, (ii) performing the desired read requests, and (iii) reading the timestamp again. If the two timestamp values are the same, then reader can be certain that the data is consistent.