Skip to content

Integration tool which: 1. Collects data from OPC UA Servers and stores it in SQL database; 2. Acts as a back-end for Grafana SimpleJson data source plugin..

Notifications You must be signed in to change notification settings

alexmc1510/OPC-UA-Data-Logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OPC-UA-Data-Logger

Integration tool, which performs 2 tasks:

  1. Collects data from OPC UA Servers and stores it in PostgreSQL database (which might have TimescaleDB extension installed).
  2. Acts as a back-end for Grafana SimpleJson data source plugin.

Context Diagram

OPC UA Data Logger - Context Diagram

Getting Started.

Prerequisites

Installation and initial configuration.

Running of the OPC UA Data Logger.

Open Windows comman line console, navigate to the folder where OPC UA Data Logger files are unzipped, and start application OpcUaLogger.exe. Please note that at the very first start it might take some time to generate OPC UA Application Instance Certificate. At the first start, it will also create tables in the PostgreSQL database. The application has built-in web server to support web based GUI to configure it, so it will listen to http port. Windows operating system will pop-up dialog window to asking for permission to listen on the port, you will need allow it.

Configuration of connections to OPC UA Servers and selection of OPC UA variables to monitor (log into the database).

Open web browser (Google Chrome is only tested browser currently), and navigate to address http://localhost:8989

In the left side panel, click on Add button and add new connection. Note that currently web page needs to be refreshed in order to refresh the Address Space tree.

Browse OPC UA Server's address space and select one or more OPC UA Variable nodes which has numeric data type (those, for which value can be converted into float data type, for example, Byte, Int16, Int32, float, double).

Once one or more OPC UA Variables are selected, the button Log will be enabled. If you click on it, selected nodes will be used to create new records in the right side grid table. If a record has field Active checked and the field Historize unchecked, then its value will be monitored by OPC UA Data Logger, and written (logged) into the PostgreSQL database. If a record has option Historize set to true, then OPC UA Data Logger will not log it. When historical data is requested via REST API for those variables, historical values for it will be read from OPC UA Server.

The following below screenshot illustrates typical GUI: Configuration GUI Screenshot

Configuring Grafana

Grafana Screenshot

Using PostgreSQL data source.

It is possible also to get logged data values from PostgreSQL database directly, using PostgreSQL data source plugin for Grafana (installation is not required, included into Grafana by default). Example of the SQL quesry can be found below:

SELECT $__time(time), value FROM values WHERE $__timeFilter(time) and sourceid='1'

Here time, value and sourceid are column names in the values table. You can figure out corresponding to the OPC UA variable sourceid from Logged Variables data grid on the configuration GUI.

Soon the video with more detailed instructions will be posted on youtube.

About

Integration tool which: 1. Collects data from OPC UA Servers and stores it in SQL database; 2. Acts as a back-end for Grafana SimpleJson data source plugin..

Resources

Stars

Watchers

Forks

Packages

No packages published