MODBUS OPC UA server implements MODBUS TCP protocol and exposes COIL, DI, HREG and IREG registers via OPC UA interface.


version: v2.7.0

published: Jun 03, 2024

Download 64-bit installer for Windows - 1.52 MB

Docker image


Installation process is very simple and straight forward. Installer copies the following files to “%PROGRAMFILES%\X-tensive\DPA.UA\modbus\“ directory:

Firewall exception is added for executable.

If there is no certificate or private key for OPC UA server default instance, a self-signed certificate as well as private key are generated and placed to “instances\default\“ subfolder.

Installer is a simple console application that requires no user interaction or parameters. All output is sent to stdout and stderr. It is fine to run installer under SSH session. Here is a typical output:

dpa installer, 64-bit
Destination: C:\Program Files\X-tensive\DPA.UA\modbus\
Discovering services for ""...
Discovering services for ""...
Checking processes for ""...
Checking processes for ""...
Copying ""... ok
Copying ""... ok
Generating default certificate...
  default certificate exists already. Will skip.
Will configure firewall...
  exception for ""... ok
installation SUCCEEDED!

Update of running services

In case when a previous version was already installed and OPC UA server instances are up and running as Windows services, the installer will do update correctly. First, all running services of OPC UA server are shutdown gracefully. Old binaries are replaced with a new version. Finally, all previously running instances are started again.

Update of interactively running processes

In case when OPC UA server runs as interactive console process, installer kills this process before installation to release any locks of old binaries, otherwise installation and update of the binaries would fail. The installer does not attempt to restart interactive processes after binaries update.

Command line arguments


MODBUS device ip and port (optionally), like “” or “”.


Optional. MODBUS slave id.


Optional. Reconnection interval between two consecutive connection attempts, ms. Default is 5000 ms.


Optional. Minimal interval between requests, ms. Default is 100 ms.


Optional. Timeout interval used to wait for a response, ms. Default is 1000 ms.


Optional. Timeout interval between two consecutive bytes of a message, ms. If there is no character in the buffer, the allowed timeout interval between two consecutive bytes is defined by byte timeout. Default is 1000 ms.


Optional. Maximal read attempts before failure. Default is 3.


Optional. Specifies instance name for non-default instance. Instances are explained here.


Do not use certificates. Indicates that OPC UA server should not expose secured endpoints. Can optionally be applied only to OPC UA servers running interactively. Can not be applied to OPC UA servers running as Windows Services.


Optional. Specifies TCP port for OPC UA server. Default is 4840.

Running in Console mode

The OPC UA server can run interactively in console mode. For instance: /dev: /slave:16 /responseTimeout:3000

Ctrl+C gracefully shuts down the server.

Running as Windows Service

It’s very easy to run OPC UA server as Windows service. is used to list, register and unregister Windows Services for MODBUS OPC UA servers. For example, to register OPC UA server as a service: /install /dev: /slave:16 /responseTimeout:3000

If you need to connect several MODBUS devices, named instances must be used. Instances are explained here. The instance name is specified via the command line argument “instance”. Take into account, each instance must have unique tcp port to expose OPC UA endpoints: /install /dev: /slave:16 /responseTimeout:3000 /instance:dev2 /port:4841

To list all installed instances: /list

Typical output:

  instance: (default)
  port: 4840
  slave: 16
  reconnectionInterval: 5000
  requestInterval: 100
  responseTimeout: 3000
  byteTimeout: 1000
  readAttempts: 3
  start type: auto
  status: stopped
  instance: dev2
  port: 4841
  slave: 16
  reconnectionInterval: 5000
  requestInterval: 100
  responseTimeout: 3000
  byteTimeout: 1000
  readAttempts: 3
  start type: auto
  status: stopped

Finally, to start the (default) instance:


Or to start named instance “dev2”:

net start DPAOPCUA.MODBUS.dev2

To unregister the Windows Service: /uninstall /instance:dev2

Take into account, the service is not stopped automatically when unregistering. It must be stopped with “net stop” command before.

Address space

MODBUS OPC UA server provides namespace which defines 4 variables to access COIL, DI, HREG and IREG registers respectively:


Use OPC UA indexes to access particular register. For instance, to access HREG register number 32:


Ranges are supported as well. To read HREG values of registers 32-38:


To explicitly specify the slave number, use indexes with two components. For instance, to read HREG values of registers 32-38 from slave 13:


Aliases are human-readable shortcuts, allowing easy access to indexed registers using clear notations such as “temperature”, “speed”, etc. Conversion and data transformation are also supported. For example, to convert two 16-bit registers into one value of type “float”.


Windows Service fails to start

In case OPC UA server fails to start as Windows Service, run it in Console mode with exactly the same command line arguments to check console output. Normally, all diagnostic messages are sent to stdout and stderr. For instance, when OPC UA server fails to read the certificate or the private key:

[2023-10-18 11:07:13.019 (UTC+0300)] fatal/server       Could not load certificate storage.

In that case ensure that .cert and .key files exist and are located according to Instances directory structure.

An invalid or corrupted alias.json file may cause service to fail to start:

[2023-10-18 11:08:54.418 (UTC+0300)] fatal/server       Could not load alias json.

In that case ensure that alias.json is valid and its content respects the demands described here. Take into account that empty alias.json file is considered as invalid. If aliases are not used, just remove alias.json.


If the license is not installed or if the license is not valid, for example, an expired TRIAL license, then the OPC UA server will function for 1 hour after starting the process. After the hour has elapsed, the OPC UA server will return a BADLICENSENOTAVAILABLE or BADLICENSEEXPIRED error on requests to read and write data, except for system objects and system variables of OPC UA server.

The variable “Objects/Server/Instance/LicenseKey” allows to read the loaded license and its status. Next, the license status can be checked with the command line utility target <OpcServerIp>

MODBUS communication

To troubleshoot any MODBUS communication issues, please, refer to “Objects/MODBUS/link” variable. It provides detailed information about the status of MODBUS TCP connection as well as any errors detected, including the rich set of counters for various types of errors.