IDE v2.6.5 and later
up to IDE v2.5.0

Storing data into the Mervis DB

In this tutorial, we are going to demonstrate how to use history logs for long-term storing of data from Unipi controllers running Mervis OS.

Patron
Neuron
Gate
Unipi 1.1
Axon

Prerequisites

(!)

Note:
The Mervis DB credentials are generated together with the Mervis SCADA project and are intended for all PLCs connected to this SCADA project. When the Mervis SCADA project is stopped or deleted, the saving to Mervis DB is also stopped.

PLC properties settings

The first step is to set up the storage.

If you wish to use the Mervis DB service to back up variables using our servers, you need to set its communication parameters first. In the left panel, select PLC.

Mervis DB parameters

Unroll the PLC, select Configuration and search for Mervis DB Parameters in its properties. Set its values to the following:

(!)

Note:
Mervis DB credentials are available in the Mervis SCADA Manager (Mervis SCADA project administration).

(!)

Note:
Observant users probably realized we just entered a second different time parameter, namely the Communication period.

What's the difference?

The Save Period defines how often the PLC will sample variable values. The Communication Period is how often the PLC will send those samples to the Mervis DB.

  • Communication Period defines how often will PLC send data to Mervis DB. Can be set in PLC Properties
  • Save Period determines how often will PLC parse variable values. Can be configured in the History log.

Since we changed the configuration of the PLC, we need to upload it. If you are not sure, check out the Uploading a RunTime configuration tutorial.

Deploy the solution, start the Debugging Mode and open the System status tab located on the main panel. In the MervisDB section (or RcWareDB in older versions of the IDE), you can check if the PLC communicates with Mervis DB. If the Communication interval [min] is set to 1 minute, the Records saved value will increase every 60 seconds.

Saved data can be found in graph view in Mervis SCADA.

If Mervis DB fails to display data even if you configured everything correctly, it is probably caused by the fact Mervis DB does not have any logged data yet. Wait until the first log is uploaded - the required time for this varies depending on communication intervals set for the PLC and DB, or on the history log interval. The interval can be synchronous (eg. with a fixed upload time) or asynchronous (the interval depends on how long it takes for data to be logged). If the issue persists even then, check Mervis DB login and password, make sure the address is set correctly and also make sure you uploaded the configuration into the PLC correctly.