DEXGate 2 - Full Documentation


This article has all the documentation related to DEXGate 2. It is organized as follows:

  1. Start working with DEXGate2
  2. Register DEXGate2 in the platform
  3. DEXGate 2 - Quick Start Guide 
  4. DEXGate 2 - Full User Manual

Reminder: equipment discontinued and no longer supported.

1. Start working with DEXGate2

When using the Modbus protocol, we always recommend that you install our DEXGate2 datalogger - after all, it’s built to work with the EMS platform

No worries if you choose not to work with a DEXGate2 though - the EMS Platform still supports multiple data entries in different protocols and formats too.

DEXGate2: Configure your devices easily


DEXGate2 is DEXMA’s bespoke hardware solution built to make energy data monitoring easy. With everything you need to be integrated into a single device, DEXGate2 is the simplest and most comfortable tool to start monitoring energy with the EMS Platform.

DEXGate2 is compatible with the Modbus protocol in both Modbus-RTU and Modbus-TCP modes, so you can use it to monitor data from any Modbus-compatible device on the market.

If you are planning a new installation, or you need to monitor existing meters or probes that are based in Modbus, you can start sending data to the plarform by connecting all your Modbus devices to a DEXGate2.

Once the DEXGate2 is online, you can always access it directly from the platform's interface. Using your handy dandy dashboard, you can configure meters or even create a custom Modbus integration right from your desk, saving you lots of time, money, and countless miles.

For more details on the DEXGate 2 device:

DEXGate2 - Specs and Datasheet

Which devices can be connected to DEXGate2?

DEXGate2 is compatible with virtually any device in the market that uses the Modbus protocol. If a device is not integrated yet, you can easily do it yourself!

Electricity meters, temperature and humidity probes, thermal energy meters, or electrical and optical pulse counters are some of the different types of Modbus devices that you can connect to DEXGate2.

Check out the following article to see all the meters from different manufacturers that are already compatible with DEXGate2 and learn how to integrate your device if it's not already integrated:

Modbus devices integration in DEXGate2

How do I connect my devices to DEXGate2?

DEXGate2 can monitor both Modbus-RTU and Modbus-TCP devices at the same time.

Check the following article to see the differences between Modbus-RTU and Modbus-TCP:

Modbus-RTU and Modbus-TCP in DEXGate2

Apart from Modbus-RTU and Modbus-TCP you may also want to use wireless devices with your DEXGate2. Many wireless devices use the Modbus protocol so your DEXGate2 is also compatible with them, and can be used simultaneously with wired devices.  Check the following article about using wireless devices with your DEXGate2:

Using Wireless communication in DEXGate2

All these devices can be connected at the same time to a single DEXGate2, so hybrid installations using wireless, Modbus-RTU and Modbus-TCP devices can be performed easily with a DEXGate2.


Example monitoring infrastructure including Modbus-RTU, Modbus-TCP, and Wireless Zigbee devices

Also, take a look on these tutorials on how to connect Modbus devices using a RS485 BUS to DEXGate2:
HOWTO: Carlo Gavazzi EM210 quick install guide on DEXGate2
HOWTO: Circutor LM4i4o quick install guide on DEXGate2

Pulse Monitoring with DEXGate2

As the above image shows, pulse meters for measuring gas, water, etc. can also be connected to a DEXGate2. Check the following article for more details on how to measure pulses with DEXGate2:

Pulse Counting (Gas, water, etc)

 Additional documentation:

2. Register DEXGate2 in the platform

In order to start receiving data to your account from your DEXGate follow these steps:

1. In the upper right corner of your main page select "Settings ":

2. Once in the Settings page select Gateways.

3. Select "Register a new gateway":



4. Select DEXGate2 and click "Next"

5. Choose a name for your DEXGate2 device and type the Serial Number:



6. Take note of the Gateway token to put it on the DEXGate2 modbus config




3. DEXGate 2 - Quick Start Guide 

This guide includes the following topics:

  1. Material Needed to follow the guide
  2. DEXGate 2 Connection
  3. Network Configuration
  4. Configure Time and Date
  5. Enable Remote Access
  6. Configure the meters
  7. Connecting the meters
  8. Verify the reception


3.1 Material Nedeed

  • DEXGate2
  • Power Supply
  • WiFi antenna
  • 3G antenna if you are using the DEXGate2 3G
  • Smartphone or laptop with wifi
  • Ethernet cable
  • Networking parameters
08_5b7574b6a1ff8.png 09_5b7574b73d4be.png


3.2 DEXGate2 Connection

  1. Connect the Wireless antenna on the connector under the miniUSB port
  2. Connect the DEXGate2 through Internet. You have 2 options to feed the DEXGate2 with Internet:
    1. Ethernet, connecting the network cable to DEXGate2 and your local network.
    2. GPRS (only DEXGate2-3G), connecting the 3G antenna into the connector next to the RS232 port. Then, insert the SIM into the slot on the top of the datalogger.
  3. Power on the DEXGate2 by connecting it through a Power Supply
  4. Wait about 1 minute and connect your laptop, smartphone or tablet to the WiFi called DEXGATE_XXXX, where XXXX is the identifier of the DEXGate2. An access point is created for configuration.
  5. Just enter the password to join the network (default password is the DEXGate2 identifier in capital letters), open your web browser and access
  6. In order to access to the administration page, enter the username and password. By default both are "admin"

3.3 Network Configuration

3.3.1 Ethernet Cable

Go to System > Ehernet and Enable DHCP or disable it and use an Static Address 

  • DHCP: IP address and networking parameters are automatically configured from a DHCP server
  • Static Address: enter configuration of the local network provided by the network administrator. Contact your system administrator if you need help



3.3.2 3G/GPRS (only with the 3G/GPRS optional module)

Go to System > 3G/GPRS and configure the mobile network information. If you don't know how to configure it, contact your mobile network provider. You can use a pre-configured operator, or set a custom one. 



3.4 Configure Time and date

Go to System > Time and date and select the timezone according to the location. Then just click on Save
DEXGate2 uses the UDP port 123 to syncronize the time*.
If Syncronization through UDP port 123 is not available, you can set Time and date manually by selecting Manual (Not recommended).

(* In case of doubt, ask your system administrator)


3.5 Enable remote access

At this point, if you have connection to the internet, you may have remote access to the DEXGate2 from the platform.
DEXGate2 uses the UDP port 1196 to connect to our VPN (*


  1. Go to Diagnostic > Remote support and check if the DEXGate2 is connected to DEXMA VPN.
  2. If not, click on connect.

(* In case of doubt, ask your system administrator)

3.6 Configure the meters

We can divide the meters configuration in two steps:

  • Physical meter configuration
  • Bridge configuration

Every meter works in its own way, so we strongly recommend to read the user manual of the meter.
You can configure the bridge through the web administration interface.

If you're using modbus devices you need to specify the address and type of each meter. In order to do it, go to Modbus > Configuration.  It is important to configure properly the modbus address in order to indicate it on DEXGate system configuration. Imagine you have installed 1 CVM-mini and 2 CVM with addresses 1, 2 and 4 correspondingly. The Modbus configuration should be: 

# Ids of Circutor devices

If you're using an IEC 870-5-102  fiscal meter you have to fill the config file at IEC 870-5-102 > Configuration  with the meter's communication parameters ( Link address, Measure point, Password, Speed, Parity).

3.7 Connecting the meters

DEXGate2 has a DB15 port with the following pinout:



It is also available a DB15 to flying leads cable. Correspondence of pins and colours is as follows:

DB15 DEXGate2 Pinout DEXGate2 adapter 15 flying lead colour
3 RS485 (-) B (-) White / Black
4 RS232 TX   Purple
5 1-wire   Yellow
7 RS485 (+) A (+) Yellow / Black
9 RS232 RX   Gray
10 VCC out   Red
12 RS232-2 TX   Orange
13 RS232-2 RX / GPI1   Pink
14 GND S Black

DEXGate2 adapter :
Connect A (+), B (-) and S terminals to the RS485 BUS



3.8 Verify the reception

It takes a few minutes for a message to be processed and visible in the platform. Although you can check if the messages have been obtained from the meter and send in the "Log" section of the web administration interface of the DEXGate2.


4. DEXGate 2 - Full User Manual


  1. Device information - Specs & Datasheet
  2. DEXGate2 Wiring example
  3. Meaning and use of RS485 cable
  4. Accessing the web administration interface
  5. System Status
  6. Ethernet/Wireless connection
  7. Using Wireless communication in DEXGate2
  8. Time and date
  9. Log Kernel
  10. Log System
  11. Modbus-RTU and Modbus-TCP en DEXGate2
  12. Modbus Configuration
  13. Last Readings
  14. Modbus devices integration in DEXGate2
  15. Custom Modbus Devices
  16. Read & Write Register
  17. Log Modbus
  18. Update Modbus
  19. IEC 870-5-102 Configuration
  20. Connectivity test
  21. Remote Support
  22. Download files
  23. Reboot
  24. Factory Reset
  25. Change User Password
  26. Change Wifi Password

4.1. Device Information - Specs & Datasheet



4.1.1 Ports

  • Serial port: integrated RS485 and RS232 port
  • Ethernet: Power over Ethernet port. The default address is PoE capable
  • WiFi: An access point is created for configuration. Just join the network and point your smartphone browser to
  • USB: USB port for IEC 870-5-102
  • DC in: Power input 7-50V


4.1.2 Specifications

  • Processor: Freescale i.MX28 at 545 MHz (ARM)
  • Power requirements: 7V - 50V DC (PoE or DC in)
  • 3G Modem: integrated optional 3G module
  • Storage: 4GB eMMc Flash
  • Size: 7.8 x 6.7 x 3.7 cm
  • DINRail adapter: included in the package

4.1.3 Compatible technologies

Internet connectivity:
  • Ethernet
  • 3G integrated as an option
  • DEXGate2 pushes data to our the platform EM servers using POST request over HTTP (port 80) or over HTTPS (port 443, using Secure Sockets Layer)
  • Configurable from smartphone through Wifi
  • Web interface
  • Remote Web configuration via the platform
  • Modbus-RTU over RS485 port (RS232 also available)
  • Modbus-TCP
  • IEC 870-5-102 through Micro-USB port (RS232 also available)
  • Already integrated with more than 150 modbus devices
  • Create custom drivers for non integrated Modbus devices right from the DEXGate2
  • Integrated with new API v3

# NOTE: Current Software Versions
DEXGate2 Firmware:   v1.6
Modbus:   v6.2.8.3

4.1.4 Network requirements

DEXGate2 will need an IP address. This IP address can be obtained using DHCP or statically configured.
DEXGate2 only uses outgoing connections, so if you don't have a firewall and use NAT it will work out of the box. It uses the following ports:

  • Basic:
    • Sending data to the server: TCP port 80 to
    • Sending data to the server: TCP port 443 to
    • Using internet to sync time: UDP port 123 to various servers
  • Optional:
    • Remote control of the device: UDP port 1196 to


4.2 DEXGate2 Wiring Example

4.2.1 Overview

Here you can see an example of an installed DEXGate2 (non 3G)



At the image, you can identify:
- Schuko Power Source (could also be a DIN-RAIL Power Source)
- Ethernet Connection (To send the data to the platform, and to read Modbus-TCP devices)
- Modbus Connection (RS485 port to connect all modbus Meters). This connector isd available in different versions (see below the last version)
- IEC 870-5-102 USB Probe for fiscal metering (just Available for Spanish Market Fiscal meters)

4.2.2 RS485 BUS connector (Modbus-RTU devices)

Here you can see the RS485 BUS connector for DEXGate2 in its actual version.



The connector has the following 6 terminals:
- A (+) . RS485 positive terminal
- B (-) . RS485 negative terminal
- S  . RS485 Shield terminal
- GND (not in use)
- P1 (not in use)
- P2 (not in use)

For more information about RS485 BUS, see the following subsection: Meaning and use of RS485 Bus

4.3 Meaning and use of RS485 cable 



RS485 is a balanced, multi-point communications standard. It enables the sending and receiving of binary information between devices connected to the bus.
What is meant by “balanced” is that the signal is sent as both positive and negative by the wire in order to increase the reliability of the system.

RS485 defines how to physically send the information. It allows any type of information to go through the bus (for example Modbus data). 

Uses and Characteristics

  • Resistant and stable, so it’s ideal for industrial environments, where reliability is an important factor.
  • Up to 1200m (ideal).
  • Termination resistors recommended​ which eliminates the majority of the signal reflection. 


The recommended topology is a serial bus without any branching:


Example of adaptation from existing topologies to a serial bus:

Cable type

We recommend using a shielded twisted pair (general shield) with minimal section 0,20 mm 2 (AWG 24) of 120 ohms impedance and type L IYCY-CY.

Identification of terminals according to RS485 standard

The protocol uses 3 wires: the signal (represented by a + sign, the inverse of the signal (represented by a - sign) and the reference voltage, or ground (represented by 0). Some manufacturers call the wires A, B and 0, but whether A will is positive or negative varies by manufacturer, so it is recommended to rely on the polarity instead of the manufacturer.


- in a 3 wire network connect the 3rd terminal (C) in the terminal (OV / NC)
- in a 2 wire network use the 3rd terminal (C) to provide the shield continuity.

Line fail-safe biasing

The RS485 standard imposes one differential level of 200 mV minimum to detect the signal. If the RS485 line is not biased, this level will not be reached (without communication on the line) and successful communication will not be guaranteed. For this, we apply a bias to only one place on the bus and it is best applied at the master. On certain models of interface unit, it is possible to activate this biasing otherwise, it would be necessary to add an external supply which guarantees a level of 250-280 mV on the whole bus when there is no active communication.

In order to prove this, it is best to apply the biasing at one end of the bus (on the interface side) and verify the voltage level on the other end of the bus; this ensures adequate biasing throughout the bus.



Connecting an RS485

Recommendations when performing an RS485 installation

  • Use a different color for each wire (one for the positive, one for the negative and one for the ground) and include them in the same bus. This prevents polarity change errors.
  • Always leave some extra cable on each connection. It makes it much easier to fix wires that incorrectly connected. 
  • Shielded twisted pair is always recommended, as it minimizes interferences.
  • It's useful to review the installation with a multimeter to ensure there are no short-circuits or loose wires.



Taking a reading

We need:

  • Modbus reading program (qModMaster) or DEXGate2 "Read & Write registers" feature
  • Slave Modbus device
  • Modbus direction of the slave (from 1 to 247)
  • Initial register (from 0 to 65535) which is the number of the register we want to start
  • ​The number of registers to obtain. That's it the numbers of all successive registers we want to obtain
  • Type of registers to obtain
  • ​In Modbus RTU: Speed, parity and stop bits
  • In Modbus TCP address: IP address and port

Detecting errors

The questions we have to do in order to detect possible errors are the following:

  1. All devices are  configured to the same speed, parity and stop bits? If not, configure all devices with the same communication parameters.
  2. From a particular node are not working the rest of the devices? In an affirmative case, maintain connected the first device which is not working and disconnect the rest of the devices of the bus. Then, check thoroughly the end stretch of the wire.
  3. Common errors: crossroads of polarity, shorts-circuits and loose wires. 
  4. If it is still not working, try a node that works isolated obtaining data directly to your PC. Repeat with the failing one. 


4.4 Accessing the web administration interface

  1. Connect your laptop, smartphone or tablet to the WiFi called DEXGATE_XXXX, where XXXX is the identifier of the DEXGate2. An access point is created for configuration.
  2. Just enter the password to join the network (the password is the DEXGate2 identifier), open your web browser and access http://
  3. Log in using your username and password (the default ones are admin/admin)



4.5 System status


This screen provides some basic information about the gateway:

  • MAC Address (identifier)
  • IP address
  • Internet connection
  • Modbus status
  • Data consumption
  • DEXGate2 Firmware version
  • Modbus Version

4.6 Ethernet/Wireless connection

4.6.1 Ethernet Cable

Go to System Ethernet and Enable DHCP or disable it and use a Static Address 

  • DHCP: IP address and networking parameters are automatically configured from a DHCP server
  • Static Address: enter the configuration of the local network provided by the network administrator. Contact your system administrator if you need help



4.6.2 3G/GPRS (only with the 3G/GPRS optional module)

Go to System > 3G/GPRS and configure the mobile network information. If you don't know how to configure it, contact your mobile network provider. You can use a pre-configured operator or set a custom one. 



4.7 Using Wireless communication in DEXGate2

Wireless communication can be a good solution when installing monitoring, especially in Existing Buildings.
High costs, difficult installations and more are driving operators to consider alternatives to wired solutions.

Advantages of Wireless Networks:

  • They are usually cheaper.
  • They allow great mobility within the reach of the network 
  • They are usually installed more easily.
  • There are no physical cables (no cables that are tangled)

Modbus over Wireless networks:

When using Modbus, a wireless network is just another channel available to communicate with your devices. Configuration of your Modbus devices is very similar to wired solutions because Wireless solutions are transparent to the DEXGate2, so it doesn't really matter if the device is wired or not.

Wireless systems usually consist of one gateway that converts from wired (RS485 or RS232) to wireless communication. In Most cases, the Gateway is transparent for Modbus purposes, and the communication can be Point to Point, Point to Multipoint, or Mesh Networks:


example of a point to a multipoint solution

example of a Mesh Network topology

There are lots of different solutions for wireless communication that are compatible with Modbus Networks.
Some of these solutions consist just in a Serial to the wireless interface, and some others include not only the Wireless interface but also the Meter or probe to be used.

Zigbee networks in DEXGate2

DEXGate2 can connect to Zigbee devices from different manufacturers by adding a Zigbee to RS485 gateway or a Zigbee to Ethernet Gateway.
Once Zigbee network is created, Zigbee devices are configured like standard Modbus Devices because the Zigbee network is transparent to the DEXGate2.

Some Zigbee devices form 4Noks are already integrated in DEXGate2:

Temperature and Humidity indoor probe:
Temperature, Humidity and lux indoor/outdoor probe:
Pulse meter + 2 NTC Temperature probes:
Up to 2x Three Phase or 6x Single phase Meter:
Zigbee to RS485 Gateway (to connect zigbee devices to DEXGate2 through Modbus-RTU):
Zigbee to Ethernet Gateway (to connect zigbee devices to DEXGate2 through Modbus-TCP):
RS485 to Zigbee Bridge (to connect Wired standard devices through a zigbee network):


4.8 Time and date

 Here you can synchronize your gateway and select the timezone where the DEXGate2 is located. Here, you can:

  • Check your Current System time
  • Check Current Timezone (for example, UTC)
  • Set a new timezone. 

Go to System > Time and date and select the timezone according to the location. Then just click on Save
DEXGate2 uses the UDP port 123 to synchronize the time.

If synchronization through UDP port 123 is not available, you can set Time and date manually by selecting Manual (Not recommended).


4.9 Log Kernel

Here you can download the Kernel log and check if everything is correct. 

4.10 Log System

Here you can download the System log and check if everything is correct. 

4.11 Modbus-RTU and Modbus-TCP en DEXGate2

What is Modbus-RTU?

Modbus is a serial communication protocol that enables communication among different devices connected to the same network. 

Modbus-RTU refers to Modbus in an RS485 BUS
An RS485 BUS consists of 2 wires, positive and negative (+ ground), which connects all your meters (Slaves) to the gateway (Master)


To configure a Modbus-RTU Network:
- Slave Address: Unique in all devices in the RS-485 BUS
- Baudrate: same in all devices in the RS-485 BUS (9600, 19200, etc)

- Parity: same in all devices in the RS-485 BUS (Usually = none)
- Data Bits: same in all devices in the RS-485 BUS (Usually = 8)
- Stop Bits: same in all devices in the RS-485 BUS (Usually = 1)



What is Modbus-TCP?

Simply put, this is a Modbus RTU message transmitted with a TCP/IP wrapper and sent over a network instead of serial lines. 
The Server does not have a SlaveID since it uses an IP Address instead.


To configure a Modbus-TCP Network:
- One or several RS485 BUS behind Modbus TCP bridges
- Slave Address  (Unique in all devices in each RS485 BUS)
- IP/PORT of the Modbus Bridge



Example of Modbus configuration in DEXGate2:

In DEXGate2, you can use both Modbus-RTU and Modbus-TCP at the same time.
Modbus-RTU devices will be configured using the baudrate and Slave address (Green text at the example).
Modbus-TCP devices will be configured using the Modbus-TCP Bridge IP and port and the Slave address (Blue text at the example).


  Additional information:

Meaning and use of RS485 Cable
Connecting an RS485 cable​
Modbus configuration in DEXGate2 (User manual)

4.12 Modbus Configuration

This section provides a basic interface to modify the modbus bridge configuration. The most relevant parameters are:

Option Meaning
bridge.speed Speed of the local Modbus RTU bus
bridge.device Local device where the Modbus RTU bus is connected. Do not change
bridge.parity Options: "even" (default), "odd" or "none". 
bridge.data_bit Options:  5, 6, 7 or 8 (default)
bridge.stop_bit Options:  1 (default) or 2
bridge.ip IP of the local Modbus TCP/RTU bus. Do not change
bridge.port Port of the local Modbus TCP/RTU bus. Do not change
token Token of this dexgate in the platform Proxy Host
proxy.port Proxy Port
proxy.user Proxy User
proxy.pass Proxy Password
remotebridge-mbX IP address and port (optional) of a remote modbus-TCP device or bridge in the format IP:port
devices.manufacturer-model Coma separated list of modbus addresses of devices of this kind
profile.manufacturer-model low (default), medium or high. The profile dictates the amount of parameters sent to the server
hardcoded.gateway-mac This identificator will override the default one
publish.local this is used to publish the data locally at the Last Readings feature. Options: true (default) or false
publish.server this is used to publish the data at the Options: true (default) or false
publish.server.https this is used to publish the data at the using HTTPS or HTTP  protocol. Options: true (default) or false


4.12.1 Profiles

There are 3 profiles: Low, medium and high. They are used to minimize the unnecessary data sent to the server.

  • Active Energy
  • Active Power
  • Reactive Energy
  • Reactive Power


  • All Low Services
  • Apparent Energy
  • Apparent Power
  • Cos Phi
  • Power Factor

High: Everything


4.12.2 Modbus Configuration Example file

#baud:   9600, 19200, 57600, 115200, etc

#device: the RS485 interface

#parity: "even", "odd" or "none"

#data_bits: 5, 6, 7, 8

#stop_bits: 1, 2


#token of this dexgate in the platform

# Logger configuration

# Proxy configuration

# Remote TCP Modbus bridges

# Ids of Circutor devices

# Ids of Enerdis devices


In this example, there are 2 meters: 1 circutor cvm-mini and 1 enerdis cct. The circutor meter is connected to the local bus and the enerdis device is connected to a remote modbus-tcp bridge running on The cvm-mini has the profile high active (it will send all the information available)

The cct is a 8 input pulse counter and its configuration is quite complex:

  • mb1: This device is connected to the remote bus 1 (
  • 5: The modbus address of the cct is 5
  • [
    • 402(0.02);: The first pulse input has a energy counter connected. Each pulse represents 0.02kWh
    • 0;: The second pulse input is disconnected
    • 0;: The third pulse input is disconnected
    • 0;: The fourth pulse input is disconnected
    • 402(1);: The fifth pulse input has a energy counter connected. Each pulse represents 1 kWh
    • 419(0.001);: The sixth pulse input has a gas counter connected. Each pulse represents 1l or 0.001m³
    • 419(0.001);: The seventh pulse input has a gas counter connected. Each pulse represents 1l or 0.001m³
    • 0: The eighth pulse input is disconnected

The identifiers for every measure type supported by the platform are available here


4.13 Last Readings

This feature lets you see "locally" all the data that will be published in the platform, without the need of having the DEXGate2 connected to the internet. 


4.14 Modbus devices integration in DEXGate2

Regarding Modbus devices compatible with DEXGate2, here you can check all the devices that are already compatible:

DEXGate meters compatibility list

If your device is not on the list,  we have two integration options:

- Native integration. Requires to be integrated by our development team, after quoting the cost of integration.

- Integration through Custom Device. DEXGate2 has a device integration function in which the client can define the variables to read through a simple interface. This integration is stored locally in DEXGate2 although it can be exported to be used in another DEXGate2:

Create Custom Devices - DEXGate2

In both cases, you must have the Modbus register table of the device. There are also some register structures (which depend on the model and the manufacturer) that by their complexity aren't compatible with the Custom device feature. Despite it's not usual, these integrations would have to be done necessarily by our development team through the native integration.

If desired, you can send us the Modbus Regiters Tables of these devices to check the feasibility or not to use the Custom Device feature or to quote the native integration.

4.14.1 Configure modbus devices without a display through RS485 using DEXGate2

When installing devices in a Modbus Network, the first step is to configure them with the same Baudrate than the rest of devices and with a unique Modbus Address. When the device has buttons, a screen and a graphical interface, it's easy to browse the menus to configure it, but what to do when your device has no screen and has to be configured through the RS485 BUS?

Some devices have to be configured through RS485 by writing the address or baudrate or some predefined value in a certain register (depending on each device).
This can be done through any Modbus Master program in a PC for example, but now DEXGate2 includes the "Write registers" feature that allows you to configure your devices directly from DEXGate2.


How to configure a non-screen device like the CIRCUTOR LM4i-4o

Check your Device Manual to look for which records to modify:

In the case of CIRCUTOR LM4i-40:


- The Modbus address must be entered in register 12288 (hex3000). 
- By default the LM4i-4 comes with address 98
- You must write Baudrate (1 for 9600) in register 12289 (hex3001). 
- By default the LM4i-4o comes with the Baudrate 19200

To change the Modbus address:
- The Modbus address must be entered in register 12288 (hex3000).
By default the LM4i-4 comes with ID 98

This action will configure the device with the Slave address #3

To change the Baudrate:
- You have to write Baudrate (1 for 9600) in register 12289 (hex3001)


This action will configure the device with the Baudrate 9600 Bd

For further information take a look at the ​Read & Write Register Section in DEXGate2 user Manual 




4.15 Custom Modbus Devices

If any Modbus device is not compatible yet with DEXGate v2, you can integrate it yourself using the Custom Device feature! In order to do so, a JSON device template must be created with the format explained below.
Click on "Custom devices" menu and follow these steps: 


  1. Click on "New custom device" button or in "Import device" button if you have a JSON file already created. 
  2. Introduce a "Device name" (for example, Circutor CVM-mini) and click in "Add Subdevice"
  3. Click on "Add Service" to start configuring the corresponding device and fill the following fields:
    1. Initial Register (address)is the initial modbus register (address) (an integer between 0 and 65535). ​#Note that "Address" is the "Register-1"
    2. Type Registeris either: 'input' or 'holding'​
    3. the platform service: is the the platform service identificator. You can find them here.
    4. Operation: nothing, multiply, divide or sum. 
    5. Operand: is the operand of the operation. For example, in the kW to W case, we would set the operand value to 1000 to set the divisor of the operation to 1000.
    6. Type value: uint8_msb, int8_msb, uint8_lsb, int8_lsb, uint16, int16, uint32, int32, uint32inv,  int32inv, uint48, int48, uint64, int64, float

*Note: All type values are Big Endian (AB, ABCD), except int32inv, uint32inv and floatinv that correspond to Mid-Little Endian (CDAB)

  1. If you want to add additional services for the same subdevice, click on "Add Service"
  2. For additional subdevices under the same "Custom device" click on "Add Subdevice"

*Note: Keep in mind that it is not always necessary to define the "Name extension" field unless you need to create different values of the same type, such as several pulse channels, or create several phases (a, b, c) of a three-phase device. This extension will be added to the DeviceID in the platform following the Modbus address of the target device (eg 2a, 2b, 2c)

  1. When you finish to configure all the devices, click on "Save Device" to apply changes. 

    Your custom device should look like this:

  2. After creating a file called "yourdevice" you'll need to add a line "customdevice.yourdevice=" in your modbus configuration file followed by the modbus addresses of your custom devices. For example if your device is called Circutor-CVM-mini and it has the modbus addres 13 you'll use this line:

Mastering custom devices:

Creating a Custom device is not different than integrating a Modbus device into DEXGate2 but in an easier way than writing code. However, we need some previous concepts and some checks have to be performed in order to be sure that we are doing things right.

The most important thing when starting a custom device is to understand that you are trying to read and translate Hexadecimal numbers that are stored in a certain device, and that you want to convert them to the reading you need following a predefined schema, that depends on that specific device. This means that the first thing you need is the Modbus Registers Table that usually can be found in the device Manual, and that explains the way to read and transform these Hexadecimal numbers to get useful information.

Creating a Custom device is just defining how the DEXGate2 has to read a certain device, to get the Modbus registers we need, and transform them into the correct parameter and units to insert it into the platform. 

But even before starting the custom device you should check previously that you can read those Modbus registers (that there is Modbus communication), and this has to be performed through the Read & Write Register feature in DEXGate2.

If you don't check that you can read the registers before you create the Custom Device, three things can happen:
1- All works correctly and you're done
2- Communication is fine but you get errors because the custom device is wrongly defined
3- The custom device is fine but you get errors because communication is not working

In the second and third options, you'll be totally lost until you check if there is communication. Once you are sure you can read those registers, then you can start defining how to play with them ;)

*NOTE: Remember that DEXGate2 is set by default to 9600 Bd, 8 data bits, 1 stop bit and parity N. Please check that all the devices in the RS485 BUS have the same values. 

Also, while you are creating the custom device you can have doubts about the correct way to read the registers (holding or input, INT32 or UINT32, etc.) and looking at the hexadecimal registers can help you to understand what you are doing ( if a certain registry is empty, for example).
The best you can do when starting a custom device is trying to read at least one of the registers you want to integrate, and then try to convert it manually to the expected value. This will give you the peace of mind of doing things well.

To convert the Hexadecimal values to decimal values, there are lots of different tools, from excel to online calculators.
Here you can find a link to online calculator that makes Hexadecimal conversions to different formats INT32 float UINT16 etc, and will help you understand what you have to define in the Custom device to obtain the reading given by the analyzer.

Online Hex Converter

The first time you face a Modbus integration, it seems impossible, but once the first is done you will have any Modbus device at your fingertips

We also recommend you to take a look at our Hardware webinar, where you will find some interesting tips about how to configure your Modbus devices in DEXGate2


4.16 Read & Write Register

Read & Write register allows you to obtain the specific value for a Modbus Register or to modify a certain register by using the Modbus Predefined functions.

Read Mode:

Write Mode:

Here you can obtain the specific value for a Modbus Register. You need to specify:
  • Bridge IP Address: IP of the Modbus TCP/RTU bus. Only change if accessing the device through a remote Modbus-TCP bridge
  • Bridge Port: Port of the Modbus TCP/RTU bus. Only change if accessing the device through a remote Modbus-TCP bridge
  • Slave ID: the ID of the device you want to read or write (the Modbus address)
  • Read/Write: choose if you want to Read or Write a certain register
  • Register type: (Options change between Read and Write options)
    • Read Holding Registers (0x03)
    • Read Input Registers (0x04)
    • Read Input Status (0x02)
    • Write Multiple Registers (0x10)
    • Write Single Register (0x06)
    • Write Single Coil (0x05)
  • Register to read / Register to write:
    • When Read is Selected: Address where you want to start reading
    • When Write is selected: Address where you want to write a certain value
  • Num of registers to read / Value to Write:
    • When Read is Selected: Number of registers you want to read
    • When Write is selected: Value you want to write in a certain address

WARNING: Modifying the value of a certain register may change the configuration or normal operation of your devices. Please use the Write option under your responsibility.


4.17 Log Modbus


This section provides information on the Modbus processes running in the DEXGate2. These are the most frequent messages:

  • INFO [MBusManager :: main]  - <Publishing 72messages to the  server>: 72 messages have been read from the meter(s) and are being sent to the server
  • INFO [JSONMessagePublisher :: main] - <Insert server response: OK>: Messages correctly received by the server
  • [MBusManager :: main] - <FOUND: 2 nodes>: Number of configured devices
  • INFO [JSONMessagePublisher :: main]  - <Publishing to address: http://the>: Messages are being sent to the server


4.18 Update Modbus

The technical support team may give you updates to install. You can use this section to do so.


4.19 IEC 870-5-102 Configuration


Option Meaning
link Link address. It can be generally obtained from the meter menu. Default 1
measure Measure point. It can be generally obtained from the meter menu. Default 1
password Password. It cannot be obtained from the meter. The usual values are 1, 2 or 7. Default 1
log Log level
device Name of the serial device. Do not change
speed Speed of the serial device
parity Parity of the serial device. It can be E, O or N (even, odd, none)
token Token of this DEXGate2 in the platform
insert_server Do not change

To use the DEXGate2 to read IEC meters, you need to connect the USB (MicroUSB) optical probe to the DEXGate2 MicroUSB port. 


4.19.1 IEC 870-5-102 Log

This section provides information on the IEC 870-5-102 processes running in the DEXGate2.


4.20 Connectivity test


Here you will be able to test if all the network requirements of the DEXGate2 are configured properly and you have connectivity to each port and address. If everything is configured correctly, you should see all the 
  • Connected: indicates if you are connected by Ethernet or GPRS
  • DNS state: if the DNS is working correctly or not
  • Access to port 80 of the if the DEXGate has access to the platform in the port 80
  • Access to port 80 of insert.the if the DEXGate has access to the insertion engine of the platform in the port 80
  • Access to port 443 of insert.the if the DEXGate has access to the insertion engine of the platform in the port 443

Note: If you have trouble with the connection, verify that PINS 3 and 4 are ON and the others are OFF.


4.21 Remote Support

If you want to have access to the DEXGate2 directly from the platform Energy Manager, you need to activate the Remote Support under Diagnostic > Remote Support


Then, if you access the platform with a superAdmin or Admin user, and go to Settings > Gateways > edit your gateway > Remote access, you will be able to configure your DEXGate2, directly from the EMS!

4.22 Download Files 


Here you can Download all the log files or configuration files to see what happened on the DEXGate2 or to check the Modbus configuration

4.23 Reboot

To reboot your DEXGate2, click on "Reboot". This action will shut down the gateway, so you will lose your connectivity until DEXGate2 starts again.  


4.24 Factory Reset

Restoring your DEXGate2 from factory, will apply the following actions: 

  • Modbus Software: The DEXMA modbus software will be changed from the factory software.
  • Modbus Configuration: Will have the factory configuration modbus file.
  • Modbus Custom devices: All the custom devices will be removed
  • Ethernet Connection: The Ethernet configuration will be (DHCP)
  • Adminsitration Login: login name and password will be the factory ones


4.25 Change User Password

You can change the default password using this section. The password by default is "admin". 


4.26 Change Wifi Password

You can change the default password using this section. The password by default is the DEXGate2 identifier




Was this article helpful?