Modbus – Gateway Version 4
Quick Links
NOTE: Modbus register maps are pre-loaded on Gateways with firmware versions 1.12.0 or higher. These register maps have static / pre-assigned register numbers. It is suggested that any Gateway (GW04) be upgraded to firmware version 1.12.0 or higher rather than importing register maps.
Legacy register maps may be download from the below links:
Modbus Register Map Download Modbus Register Map Definitions Modbus Reading Expression Syntax
EG4 Modbus Overview
The Ethernet Gateway Modbus interface makes all monitoring data received from Packet Power’s wireless monitoring network accessible via standard Modbus TCP/IP protocol via the Ethernet port of the Gateway. The Gateway is capable of providing a Modbus data output and simultaneously serving data to EMX portal. This allows users to take advantage of the EMX portals features while also serving data to the third party monitoring system.
The Ethernet Gateway appears as a standard Modbus device listening on port 502 at the IP address of the Gateway. Individual monitoring nodes have distinct Modbus slave IDs. If more than 254 nodes are present, multiple nodes may report at the same slave ID under different register ranges (see Register Mapping section below). The Modbus protocol requires a single Master connection for all connected nodes.
Peering Gateways and Using a Master Gateway
Packet Power Gateways can be deployed in a master / peer relationship. In this approach, the master gateway gathers data from all of its peers. This makes it easier for monitoring applications to access data as the monitoring application only needs to communicate with the master gateway. Note that all peered Gateways must have support for Modbus protocol conversion. Refer to the peering section of the Data Sources guide for instructions on peering Gateways.
Note that in a network consisting of a mix of EG2, EG3 and EG4 Gateways, an EG4 must be designated as the master.
Enabling Modbus Output
To enable Modbus output, access the Gateway Console:
- Make sure your Gateway is configured with an IP address and accessible on your network.
- The Gateway must be connected to a switch /router on an accessible network. It may not be accessible directly through a PC Ethernet to Gateway connection in all cases.
- Enter the IP address of the Gateway on any browser to access the Gateway Console.
For Gateway network configuration instructions follow this link.
Once the Console appears, it will present a System status screen. Validate:
(1) The system is communicating properly with the monitoring nodes as indicated by a green status light
(2) Modbus is listed as a licensed feature (2). If not ,see the licensing section on how to add a license.
Enabling and Configuring the Modbus Driver
(1) To enable the Modbus driver, select Modbus tab under the Data Destinations menu in the Gateway Console
(2) Make sure that the “Enabled” check box (2) is checked
(3) Enter the port number to be used. This is typically port 502
Click “Save” to enable the selections.
(4) Once enabled, there will be a green light next to the Modbus tab
Viewing and Verifying Monitoring Data using the Gateway Console
(1) To view data for monitoring nodes associated with the Gateway and confirm operation of specific nodes select the “Monitoring Data” tab (1) on the Gateway Console.
This will display all connected nodes which are organized by type (power and environmental) in the sub-menu
To search for a specific node enter the GUID (16 digit node ID) in the “Node” tab
(2) To access specific readings for each node click on the “readings” icon to expose the real time readings
An explanation of the readings data can be found here.
Accessing Register Maps Maps
Depending on your Gateway, register maps may be pre-loaded on Gateways with firmware versions 1.12.0 or higher and will appear under the Modbus Register Maps table.
There are three main register map sets:
- Environmental monitor
- Single phase power monitor
- Three phase power monitor
Your register maps can be imported if they are not pre-populated.
Importing and Exporting Register Maps
(1) To import a register map, select the “Register Maps” tab under the Data Destinations > Modbus menu
(2) Click on the utility icon under the Modbus Register Maps table
Highlight the import tab and specify the register file to be imported; the map will appear in the “Modbus Register Maps” table
This process can be used to export register maps for back-up and transfer to other Gateways.
Download Modbus Register Maps Here
Viewing Register Maps
(1) Once a register map is loaded or populated it can be accessed in “Register Maps” under the Data Destinations > Modbus menu
(2) Each register has a status column to indicate the validity of the register; if the register is reading properly it will have a green check mark
Register maps are explained in detail in the Register Maps section which explains Register features including Addressing Options, Offsets, Expressions and Mapping.
Manually Assigning Registers and Register Maps
Creating Register Maps
Individual registers can be added or removed as needed.
To create a new register map:
(1) Select the “Register Maps” tab from the menu under Data Destinations > Modbus
(2) Select the “+” icon on the Modbus Register Maps table and provide a Map Name and Description for the register map
Click “Add” to save the selection.
Creating Registers
(1) To access and add registers, select the “Register Maps” menu and highlight the specified register map
(2) Click on the “pencil” icon under the Register Maps table; this will expose the registers.
Adding Registers to Register Maps
To add individual registers to a register map select the “+” icon from the Register Map
Enter the Register, Expression and Mapping. For more details on these items see the Register Mapping section.
Modbus Device IDs
Node Maps serve to assign “device IDs” and register maps to specific monitoring nodes. Modbus is limited to 255 unique device IDs (0-254) per master.
To allow more than 255 devices to serve under one master i.e. Gateways, different nodes can share a device ID but utilize register offset mapping.
Register Offset Node mapping
The Packet Power system supports large numbers of devices reporting through a single gateway. Up to 2000 nodes are supported in the Modbus Enterprise version.
In order to accommodate such large numbers of devices and maintain a simple, common register map for each node, the Packet Power Modbus interface uses multiple Modbus slave IDs and, if necessary, register offsets.
Automatically assigning different host IDs to each nodes allows each node to have an identical register map. The number of host IDs is limited to 254 (1-254.)
For installations larger than 254 nodes register offsets are used.
Each register map is contained within a 200 register window (0-199). The register map, however, can be offset: the first 254 nodes use host IDs 1-254 with the register window located at address 0 (registers 0-199); the second 254 nodes also use host IDs 1-254, but with the register window located at address 200 (registers 200-399). This way 2000 nodes can be accommodated with at most 8 register windows using the following mapping:
Nodes | Slave IDs | Register range |
1-254 | 1-254 | 0-199 |
255-508 | 1-254 | 200-399 |
509-762 | 1-254 | 400-599 |
763-1016 | 1-254 | 600-799 |
1017-1270 | 1-254 | 800-999 |
1271-1524 | 1-254 | 1000-1199 |
1525-1778 | 1-254 | 1200-1399 |
1779-2000 | 1-254 | 1400-1599 |
The following image illustrates the mapping process:
The gateway Modbus node to slave ID and register offset mapping can be automatically generated and customized if necessary.
Note: the “Map all nodes” button will remove all existing Slave ID mappings and re-assign them in the order of Node ID. If you want to preserve your existing Slave ID assignments (e.g. when you add more monitoring nodes to the system), you should edit the node mapping table directly, using the edit function at the bottom of the node mapping table.
Accessing and Verifying Modbus Readings Using the Gateway Console
To access and verify Modbus readings:
- Select the “Readings” tab under Data Destinations>Modbus>Register Maps>Readings.
- A table containing all Modbus readings will be displayed allowing for easy verification.
Exporting Modbus Readings
(1) Readings can also be exported by selecting the utility icon and selecting export all readings. The files are exported in .CSV format and can be viewed in a standard spread sheet.
Note that readings should match the readings shown in the Monitoring Data tab.