Creating a Mervis SCADA project

The Mervis SCADA is a cloud application for remote control and monitoring of technologies including one or more Unipi controllers from a single control interface. The control panel is available via a web browser or app for smartphones and tablets.

Axon
Neuron
Unipi 1.1

The following tutorial will show you how to create a new Mervis SCADA project, and how to use Mervis SCADA for access to an already existing Mervis IDE project.

Prerequisites

This tutorial makes use of some specific terms, some of them being quite similar to each other. That said, you need to know their exact meaning.

Mervis SCADA

A software application that communicates with controllers and makes their control accessible through a Control panel (see below). As the application is running on Unipi servers, you don’t need to worry about the installation and management.

Customer portal

At this point, you probably already have an account on the Unipi.technology webpage, which you used to purchase Unipi controllers. Upon login, go into the upper menu and look for the Mervis Licence tab, in which PLC licenses are placed. The Mervis SCADA tab then serves for managing your SCADA projects, their users and user groups.

SCADA project

SCADA project is a description of your specific installation. SCADA projects are usually named after their location, such as Boiler Room 2, My House, Main Reactor etc.

Mervis SCADA project contains information that tells the Mervis SCADA application which PLCs are connected to the project and how the Control panel visualisation looks like. The project “runs” inside the Mervis SCADA application in a similar fashion as with the Mervis IDE project running inside a PLC.

SCADA control panel

To control technologies connected to a specific SCADA project, simply log into a web browser accessible on scada.unipi.technology. The control panel allows you to access the technology using a graphic and text interface we will create later in this tutorial. The same panel will also eventually contain integrated graphs with historic data gathered from the individual PLCs in the way you already know from the Mervis DB. All of it in a single interface.

Mervis mobile app

The same SCADA control panel can be displayed on smartphones and tablets. However, for better convenience, we advise to use a native mobile application through which controlling the system is much easier. To download the app, go to Google Play or Apple App Store and install the Mervis application

SCADA users and user groups

A login is required for access to SCADA control panel, or through a mobile app to prevent any unauthorized access. A single user - administrator - is created by default for each SCADA project. This user has full control over the entire project, and we will use him for the entirety of this tutorial. Creating more users or their groups will be described in other tutorials.

Mervis IDE project

Mervis IDE projects are managed in the Mervis IDE development environment. To configure or program a PLC, you need to create a “project” and attach your PLC to it. A guide to this process is available on this link.

1.1 How it all works

Mervis SCADA is an application running on Unipi servers and uses the Mervis Proxy to communicate with the PLCs. All PLCs you wish to include into the project thus need to be connected both to the internet and Mervis Proxy. For visualisation and analysis in Mervis SCADA, you need to store the PLC variables into the Mervis DB database. The SCADA control panel and the mobile app then access Mervis SCADA directly without communicating with the PLC itself. Thanks to this, you do not need to worry about public IP addresses, port forwarding or firewalls. The PLC itself also does not have to be connected to the internet directly, which increases system security.

1.2 Creating a SCADA project

The first step of connecting your PLC into the Mervis SCADA is to create a SCADA project using the Customer portal. Log in using the account you purchased the PLC with.

1.2.1 Initial Mervis SCADA configuration

You need to agree with the Mervis Cloud terms of use before creating the first SCADA project. Read the terms thoroughly, confirm your consent using the checkbox at the bottom and proceed to the next step.

Now you need to create an administrator user account for managing your SCADA projects. This account will be also used for access to the SCADA Control panel and to the mobile app. Enter your valid e-mail address and click on “Activate Mervis SCADA”.

1.2.2 Creating a SCADA project

You can now start creating your first SCADA project. Enter a short and descriptive project name, such as “My House”, “Boiler Room No.2”, “Main Reactor” etc. You also need to select a timezone - enter the timezone used by your PLC. Additionally, you can also enter an address or GPS coordinates as optional info. When finished, click on “Save”.

After saving, you will be redirected to a list of SCADA projects. Here, you can display detailed info about individual projects. At the moment, we will not change anything here.

The second step is to configure the PLC to make it accessible for Mervis SCADA. Create a new project in the Mervis IDE, or open an existing one. The project must be opened in Full mode.

Any PLC we want to connect to the SCADA project must be connected to the Mervis Proxy service. You can configure Mervis Proxy using the Proxy Parameters section located in the PLC properties. All the needed parameters are available in your Customer portal. Use a unique Proxy ID for each PLC. A more detailed description is available in the Connecting to Unipi via Mervis Proxy tutorial.

To display historic data in the SCADA control panel and the mobile app, the PLC must send data to the Mervis DB service. In this case, use identical login info for each PLC within a single SCADA project. Again, Mervis DB login info can be found in the Customer portal. A more detailed explanation is available in the Storing data to the Mervis DB tutorial.

Upon finishing the Mervis Proxy and Mervis DB configuration, don’t forget to upload the configuration into the PLC.

2.1 Creating a SCADA terminal

In this context, a terminal is a virtual device in the Mervis IDE, which contains all information about the SCADA project and defines which PLCs will Mervis SCADA communicate with and which communication channels will be used.

Start by right-clicking on System and selecting Add terminal.

Then select Mervis SCADA from the dropdown menu.

You just added a Mervis SCADA terminal, into which you need to add all PLCs you want Mervis SCADA to have access to. Expand the terminal using the arrow left from its name, and right-click on the terminal’s channel terminalChannel.

Click on Assign Device.

A list of all PLCs available for the given IDE project will open. Select all controllers you want to connect to Mervis SCADA, and confirm by clicking on OK. Usually, you will select all of them.

The next step is to set the terminal’s properties to match those of the SCADA project we created in the customer portal. Open Customer portal and open detail of the previously created SCADA project.

Enter the following parameters into the properties of the parameters in Mervis IDE:

  • Project ID: copy the ID from the SCADA project detail
  • Project Name: copy the SCADA project name
  • Project Time Zone: set the same timezone as you have set on the SCADA project
  • Project Domain: copy the SCADA project domain
  • Mervis DB login and Mervis DB password: enter the login and password entered in the PLC properties.

Proceed to configure the individual controllers added to the terminal. In the SSCP Parameters section, edit the following properties:

  • End point: change HW configuration to Custom
  • leave the device address on 1 (according to SSCP parameters settings in the PLC properties)
  • if you left the login and password for the PLC unchanged, leave the default “user” and “rw”. You can confirm in the PLC properties by checking the Users Definition → Username (Full Control) and Users Definition → Password (Full Control)
  • Enter the same Proxy ID as the one used in properties of the given PLC.

Continue with configuring the TCP Parameters. We recommend using the SSL secure connection.

  • Device Address: proxy.unipi.technology
  • Port: 12349
  • Enable SSL: True
  • Certificate Validation: set to FALSE by default, more info available at → SSL Certification validity

Note: you need to always use secured connection from Mervis IDE to the PLC. Chapter Securing the controller in this guide will guide you through the process.

Now we can export a list of variables to the SCADA control panel. For this, we will create a datapoint table, which is nothing else than a structured list of variables. This list, including the actual values, will be available in the SCADA control panel and the mobile app.

For each SCADA project, we can create only one table. We can group the data points (variables) into groups and each data point can have its unique name.

3.1 Creating a table

To create the table, right-click on HMI projects and click on Add New HMI Template in the context menu.

The Add HMI Template dialogue window will appear. Set the parameters as follows:

  • Name: ENTER_ANY_NAME
  • Display Type: Data Point Table
  • Template Type: Terminal
  • Terminal: select the Mervis SCADA terminal created in Chapter 3

Leave the SCADA Import checkbox empty.

To connect the table and the SCADA terminal, a terminal property is used. Look for the “Data Point table” item and choose the table you created.

3.2 Import and properties of data points

To make a variable usable in the data point table, you need to configure it as such. For this step, we will use the Variable browser, in which you can select all variables you want to add to the table. Click on For SCADA Import in the right column of SCADA properties, and set it to True.

Select the data point type (input/output). “Input” data point serves for indication/reading of variable values. “Output” data point is used for changing values of both physical I/O variables and software variables.

For digital IOs (two or multiple state variables), you need to set up mapping, eg. how the variable value will be represented in Mervis SCADA. A variable can be represented either as a text or as a number. Click on three dots next to the State Mapping.

To add a state, click on Add. When you have the required number of states, set their values and click on OK to save them.

In “For SCADA Import”, you can set a so-called comprehensible name, which will affect only the data point name in the SCADA project.

The individual properties of data point selected for the SCADA table (such as state mapping or name) should be always entered and/or edited in the Variable Browser. Make sure to never edit these properties directly in the template (dptable data point table) on already imported data points to prevent creating duplicate data points.

In the preceding step, the ULED_1.01 variable was added. Give it a descriptive name which will be displayed in the Mervis SCADA interface.

Continue by setting up an analogue variable representing a temperature value (such as from a sensor connected to the xG18 module, or a sensor connected directly to the PLCs 1-Wire bus).

All necessary configurations are now set. Let’s proceed to the import itself. It is necessary to build the solution first.

After a successful compilation, right-click on the data point tables and select Import SCADA Variables.

Then select one of the options: Add (all), Add (new only), Update (existing) and Update (existing) and Add (new). In our case, we will select Add (all).

You now have all variables imported and ready for further use.

3.3 Adding data points into the Mervis DB

After selecting and adding all data points into the table, select them all.

We strongly recommend adding all data points in the table into the variable history in Mervis DB. Variables not added to history cannot be displayed in a graph, nor used for long-term variable data.

Right-click on any of the highlighted items. A context menu will appear. Select Add to History.

Variables used by Mervis SCADA are now added into the Mervis DB.

As Mervis SCADA reads variables from Mervis DB, you need to make sure the Mervis DB connection parameters in the PLC are set correctly.

In case of editing dbtable, graphic HMI or any other adjustments in the SCADA terminal without any changes in the PLC itself, you do not need to deploy the solution into the PLC - a compilation only will do. By compiling the solution, a new definition for Mervis SCADA will be generated without affecting the PLC.

You now need to deploy the project into the PLC.

If all is set, click on Build Solution. By doing so will create an export folder in the same folder as all other project files. The export folder will then contain a subfolder with the same name as the project ID. In the subfolder, there will be a .zip archive containing the SCADA project definition. This archive is the last crucial part for making the Mervis SCADA operational.

Open the project you created previously in the Customer Portal (see Chapter 1). The tab Properties in the upper right corner serves mainly for uploading a SCADA terminal definition into the Mervis SCADA project. By SCADA definition, we mean the above-mentioned SCADA project archive. That said, click on Upload SCADA definition:

Then select the correct archive from the export folder in the project main folder.

The Mervis SCADA is now set. Go to the scada.unipi.technology webpage and log in using the login info you entered in Chapter 1. If you want to create a graphic template, check out the Creating a graphic HMI for Mervis SCADA tutorial and then return here.

This is not an Unipi customer account, as it has access only to the Mervis SCADA interface. For the time being, only an admin account is created, able to access all your projects.

The picture below depicts a web interface. This interface contains a single project (right column) and two data points (left column).

Select the coloured checkbox of the Temperature data point, placed left from the last time of data point refresh. If you now click on the graph icon below the Mervis logo, a graph with historic values will appear.


The mobile app is available for download at Google Play or Apple App Store.

In the app itself, start by selecting the right server, eg. scada.unipi.technology/api. Then enter the login info for your Mervis SCADA account and log in.


A newly created project will appear. Click on it.


A list of data points used in the project will appear.


Upon clicking on any of the items (data points), a list of properties and detailed info will appear (time of the last change etc.).


Long press the data point to select it.


After selecting a data point, you can display a graph visualising the selected values. The last image shows a graph of temperature recorded from a sensor.