Longs ( 4 ) = 10000 ' A long takes 2 registers doc. URegisters ( 2 ) = 50000 ' no matter the Modbus address used. SRegisters ( 1 ) = - 10 ' Note that the Index used counts from 0 doc. SRegisters ( 0 ) = 1 ' Modbus address 100 doc. SetupHoldingRegisters ( 1, 100, 8 ) doc. Connection = 1 ' Modbus TCP/IP ' TCP/IP settings. ' Set doc2 = CreateObject("Mbslave.Document") ' Set one of 5 connection types. You can only create 1 application object Set app = CreateObject ( "Mbslave.Application" ) ' Create a new Modbus Slave document (Data Window) ' This is the same as open a new data window in Modbus Slave ' You can create up to 50 Modbus Slave documents (Data Window) Set doc = CreateObject ( "Mbslave.Document" ) ' Show Modbus Slave ' res = doc.ShowWindow() ' Create doc2 if needed. Public doc As Object Public app As Object Dim status As Integer Dim n As Integer Private Sub StartSlave_Click () ' Create an application object. If the two timestamp values are the same, then reader can be certain that the data is consistent. This is accomplished by (i) reading the timestamp, (ii) performing the desired read requests, and (iii) reading the timestamp again. Timestamps are provided as a means to ensure consistency when data is read with multiple requests (e.g., to read multiple, discontiguous registers). The Modbus server guarantees that any data read with a single request is consistent. 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 change-in-value is available only as a 32-bit floating point number. For convenience, the same value is also available, at reduced resolution, as a 32-bit floating point number.
The cumulative value is available with full resolution as a signed 64-bit value.
The raw frame sent does not include the prefixed '30', this indicates the function code used.įor 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. If requesting more registers than can be returned in a single frame, the response may be truncated or an exception may be returned.Īdditional help is available by clicking the buttons on the Modbus Server settings page.Īll data is provided as Modbus input registers and therefore their Modbus addresses start at 30000. Most DAS and Modbus systems will automatically split any requests to limit the response size to not exceed the upper limit.
This translates to (61) 32-bit registers or (30) 64-bit registers. The maximum Modbus frame size is 255 bytes. = Data bytes to follow (not including CRC) = Contents of register 500 and 501 respectivelyĠx42f62a06 decoded as big-endian (ABCD) float is roughly 123.08, so L1 voltage is 123.08VrmsĮxample Modbus RTU request and response for L1 RMS voltage: = Number of words to return (2 words for float value) = Function code (0x04 is read input registers) Local timestamp (for use when reading from addresses Modbus Server, is displayed below:Įxample Modbus TCP request and response for L1 RMS voltage:
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. The exact Modbus map depends on the eGauge device configuration and is available on the Modbus settings screen. In the eGauge interface, navigate to Settings -> Modbus Server. Virtual registers are in the order they appear on the settings page, meaning addresses can change if virtual registers are added or deleted.
The addresses used prior to v4.0 are still usable to provide backwards-compatibility, but are marked as deprecated and are not recommended to use as installation settings reconfiguration may change them. Firmware v4.0 adds additional ranges that are tied to the register ID. NOTICE: Prior to firmware v4.0, the Modbus map addresses are liable to change if the register name or contents is modified.
If the Modbus Server option is not available, upgrade your firmware in Tools -> Firmware Upgrade.
The Modbus server can be enabled in Settings -> Modbus Server. eGauge models with USB ports also have capability for Modbus RTU (serial via RS485) output capability, with use of the eGauge USB485 converter. All eGauge models with firmware v3.2 or higher have Modbus TCP output capability.