Rapid SCADA

Software Overview

Software Purpose and Characteristics

Rapid SCADA provides creation of automated systems of the following types:

Rapid SCADA is a software that automatically collects data communicating with controllers, processes data and provides information to a dispatcher. Rapid SCADA supports commonly used communication standards such as Modbus protocol and OPC that allow using a huge amount of various devices. The list of supported devices can be extended by developing additional drivers.

Rapid SCADA consists of the set of application and libraries. The software is a platform which allows flexible system configuration to meet the customer needs. Rapid SCADA is open source software, its internal data formats and communication protocols are documented. This approach simplifies integration of Rapid SCADA with other applications to create complex enterprise-wide solutions. Functionality of Rapid SCADA can be enhanced by adding custom modules which implement required features.

Access to information and control functions in Rapid SCADA is restricted according to user rights. The ability to use Active Directory for user authentication significantly increases the safety of storing passwords. User rights management using Active Directory eliminates the system administrator from manual input user logins and passwords.

The following table contains the main characteristics of the software.

Characteristic Value
Supported OS families Windows, Linux
Maximum number of input channels 65535
Maximum number of output channels 65535
Maximum number of communication lines 65535
Maximum number of devices 65535
Minimum current data writing period 1 second
Minimum archive data writing period 30 seconds
Maximum archive data storing period 10 years
Automatic archive data backup Yes
Active Directory authentication option Yes
Communication protocol between the applications TCP
Writing application and user actions to log files Yes
Disable telecontrol commands option Yes
Extensible functionality Yes
The software is open source Yes

Software Architecture

The architecture of Rapid SCADA is multi-tier and distributed (see Figure 1). Applications can run on a single server or multiple computers across a network. Controllers can use communication channels of different types for connecting to a system. Major factors that determine the system configuration are number of equipment locations, distance between them, estimation of end-user activity, restrictions of external systems.

Software architecture
Figure 1. Software architecture

Rapid SCADA includes the following main applications:

  1. Webstation is a web application that displays information to a dispatcher via browser in different forms (tabular, schematic, diagrams, reports) and provides sending commands.
  2. Server manages the data archives, performs mathematical calculations and provides information to the client applications.
  3. Communicator interacts with controllers, transmits data to Server application.

Providing data access using web technology significantly simplifies the deployment and maintenance of the system, which is especially important for a large number of users.

Commonly used devices controlled by a system are electricity meters, heat meters, fire and security alarms, access controllers and other equipment.

Description of Applications

Server Application

Server manages the data archives, performs mathematical calculations and provides information to the client applications. Server writes data to the main archive and makes the backup copy simultaneously.

Graphical shell for Server configuring
Figure 1. Graphical shell for Server configuring

Server works as a service. It does not have a user interface. Server operates continuously in the background regardless of user login and logout. The graphical shell for Server configuring is built into the Administrator application (see Figure 1).

The application monitors user connections and checks user rights while processing requests and passing commands. Information about the application state and performed actions is stored in textual log files. Server is designed for non-stop running.

Additional server modules allow extending the functionality of Server according to customer requirements.

Communicator Application

Communicator interacts with controllers and transmits data to the Server application. Communication with controllers connected to a system is executed in parallel across multiple lines. Communicator receives current data, archive data, events from controllers and sends commands to controllers. The application helps troubleshooting issues with communication lines and devices.

Graphical shell for Communicator configuring
Figure 1. Graphical shell for Communicator configuring

Communicator works as a service. The graphical shell for Communicator configuring is built into the Administrator application (see Figure 1). Information about the application, communication lines and each connected device is stored in log files. Communicator is designed for non-stop running.

Developers are able to implement their own device drivers to interact with a variety of controllers.

Webstation Application

Webstation is a web application that displays information to a dispatcher via browser in different forms (tabular, schematic, diagrams, reports, etc.) and provides sending commands. Reports are generated in commonly used HTML and Microsoft Excel formats.

Webstation application. Scheme view
Figure 1. Webstation application. Scheme view

Webstation application. Table view
Figure 2. Webstation application. Table view

User is able to choose a view (table or scheme) and a date to access archive data. To show a diagram of an input channel, click an item icon in a table or an appropriate element in a scheme.

Webstation is available from any computer or tablet connected to an organization network without any software installation. Access is managed by a system administrator who defines user rights.

The functionality of Webstation can be extended by additional plugins. For example, Chart Pro Plugin extends the capabilities of Rapid SCADA charts: adds scaling, displaying of multiple charts, export to PNG and PDF. Elastic Report Plugin allows to generate reports according to a custom configuration. Using this plugin, you can build almost any desired report. Developers can download Rapid SCADA source code and the documentation to learn how to implement plugins.

Agent Application

Agent transfers configuration between Rapid SCADA instance and the Administrator application. In addition, Agent provides log files for displaying in Administrator. Agent runs as a service on a server where Rapid SCADA instance, controlled by Agent, is installed. An instance of Rapid SCADA includes the Server, Communicator and Webstation applications, all or some of these applications.

Agent communicates with Administrator via TCP. Therefore, Administrator can be installed on the same computer as Agent, or on another computer that is accessible over the network. By default, Agent uses TPC port 10002. In case of remote access, incoming connections on this port must be allowed by the server firewall.

Agent has no user interface. To check its operation, use the log files which default location is C:\SCADA\ScadaAgent\Log

Administrator Application

The Administrator application (see Figure 1) is intended for developing Rapid SCADA projects and monitoring the state of the automated system. The Administrator is an integrated development environment provides editing the configuration database, configuring the main Rapid SCADA applications, Server modules and device drivers.

Administrator application
Figure 1. Administrator application

The Administrator tools to speed up the configuration process:

A project contains a set of configuration files, mainly using the XML format. This approach makes it easy to copy projects from one computer to another. To control project versions and collaboration, Git is the best choice.

Table Editor Application

The Table Editor application is designed to create table views which are displayed on operator's workstation. Table Editor is used by engineers during Rapid SCADA configuration.

Table Editor application
Figure 1. Table Editor application

Choose the channels from the configuration database in the left pane of the window, and add them to the table view. The contents of the table view is displayed in the right pane. Hidden items of a table view are not displayed in the Webstation application, however they make sense when filtering events by view.

Table Editor is usually started from the Administrator application by double-clicking on a table view node in the project explorer. The status bar of the editor displays the configuration database path of the project in which contains the table being edited.

Scheme Editor Application

The Scheme Editor application is designed to create schemes which are displayed on operator's workstation. Scheme Editor is used by engineers during Rapid SCADA configuration.

Scheme Editor application
Figure 1. Scheme Editor application

A scheme consists of textual and graphical elements which have a set of properties define their appearance and behavior. Static elements display unchanging content. Dynamic elements are bound to the channels of the configuration database that allows to display current measured values and states, draw charts and send commands by user click.

Roadmap

Main Features
Unified development environment of Rapid SCADA projects Completed
The Agent application for interacting with remote servers Completed
Application for automatic generation and sending of reports Completed
Schemes
Binding any properties of scheme components to input channels Not included in plan
New scheme components Community help is appreciated
New images for schemes Community help is appreciated
Communicator Drivers
Modbus Slave Driver Completed
IEC-61850 Driver Community help is appreciated
BACnet Driver Community help is appreciated
Any new drivers Community help is appreciated
Server Modules
Voice Module Community help is appreciated
Any new modules Community help is appreciated
Webstation Plugins
Update Chart Pro Plugin according to feedback from users Completed
Improvement of Dashboard Plugin Not included in plan
Development of a plugin for downloading and uploading archives Not included in plan
Any new plugins Community help is appreciated

Installation and Run

System Requirements

Windows Server Software Requirements

Linux Server Software Requirements

Server Hardware Requirements

Hardware configuration of a server depends on the scale of the automated system. The minimum configuration is determined by the operating system requirements. To estimate the required hard disk space, first configure Rapid SCADA, then measure the daily increment of archive data size and multiply it by the archive data storing period.

Rapid SCADA contains its own built-in DBMS, so no additional charge for third-party DBMS is needed. The software can work either on physical or virtual environment.

Workstation or Tablet Requirements

Software Installation

Before Installation

Rapid SCADA requires certain Windows components to be installed. Go to Control Panel > Programs > Turn Windows features on or off. The required compontns of Microsoft .NET Framework are shown in Figures 1 and 3. Pay attention that Windows Communication Foundation child components of Microsoft .NET Framework 3.5 must be turned off.

The Webstation application requires Internet Information Services (IIS) that is a one of Windows features. Webstation would be inoperable unless the set of certain IIS features were turned on. Figures 2 and 4 show what features have to be installed. During the web application setup the availability of these features is checked by the installer.

Windows 7 .NET components
Figure 1. Windows 7 .NET components

Компоненты IIS для Windows 7
Figure 2. Windows 7 IIS components

Windows 10 .NET components
Figure 3. Windows 10 .NET components

Windows 10 IIS components
Figure 4. Windows 10 IIS components

Installation

Run ScadaSetup.exe from the installation package to start Rapid SCADA installation. The installer is shown in Figure 5. Installation must be performed using an administrator account. Rapid SCADA requires the up to date version of Microsoft .NET Framework installed. The installer checks if the framework is presented, and suggests to download and install it if necessary.

Rapid SCADA installer
Figure 5. Rapid SCADA installer

Before the installation starts, user is asked for choosing the applications and the installation directory (see Figures 5 and 6). This directory specifies the location of the entire software. The installer creates subdirectories required for the chosen applications. The default directory C:\SCADA is recommended due to simplifying configuring the applications.

Choosing the installation directory
Figure 6. Choosing the installation directory

The web application installation options (see Figure 7) are agreed with a system administrator. If there are no specific requirements for the web application, you should use the default values.

Web application installation options
Figure 7. Web application installation options

When installation is completed, it is recommended to check that the Scada web application uses an application pool having .NET 4.0 runtime version and integrated pipeline mode. IIS management console path is Control Panel > System and Security > Administrative Tools > Internet Information Services (IIS) Manager.

Manual Installation

Manual Rapid SCADA setup provides full control over the process of the software installation, update and uninstallation.

The manual installation sequence:

  1. Install Microsoft Internet Information Services (IIS) by selecting the appropriate Windows features. More details...
  2. Install Microsoft .NET Framework (install IIS before the framework) of the version specified in System Requirements.
  3. Unzip files from the Arc folder of the installation pachage to the SCADA installation directory. Recommended destination is C:\SCADA
  4. Open IIS management console: Control Panel > System and Security > Administrative Tools > Internet Information Services (IIS) Manager.
  5. Add a web application to the site tree. Right click the appropriate site, Default Web Site in most cases, then choose the Add Application menu item.
  6. Enter the application alias: Scada. Check that the selected application pool uses .NET 4.0 runtime version and integrated pipeline mode. Specify the physical path to the web application files: C:\SCADA\ScadaWeb. Then click OK.
  7. Register ScadaServerService by executing ScadaServer\svc_install.bat as administrator.
  8. Register ScadaCommService by executing ScadaComm\svc_install.bat as administrator.
  9. Register ScadaAgentService by executing ScadaAgent\svc_install.bat as administrator.
  10. Create shortcuts for the Admnistrator and Webstation applications on the desktop if necessary.
  11. Run the applications.

The manual uninstallation sequence:

  1. Delete Scada web application using IIS Manager.
  2. Stop ScadaServerService and ScadaCommService services, close all the applications of Rapid SCADA.
  3. Unregister ScadaServerService by executing ScadaServer\svc_uninstall.bat as administrator.
  4. Unregister ScadaCommService by executing ScadaComm\svc_uninstall.bat as administrator.
  5. Unregister ScadaAgentService by executing ScadaAgent\svc_uninstall.bat as administrator.
  6. Delete SCADA folder from the hard disk and delete the shortcuts from the desktop.

Installation of Additional Modules

Rapid SCADA supports additional modules which extend the software functionality. This section contains a description of the common installation sequence that is typical for most modules.

Installation of Server Modules

The sequence of installing a new or updating an existing module of the Server application:

  1. Close the Administrator application if it is running.
  2. Unzip the module installation package.
  3. Copy all files from the SCADA folder of the module installation package to the Rapid SCADA installation directory, the default is C:\SCADA, with the hierarchy of directories retained.
  4. In case of using Windows 8 or higher, find C:\SCADA\ScadaServer\Mod\Mod*.dll, open the file properties and unblock the file.
  5. Start Administrator, open the project and open the Server > Modules page using the project explorer.
  6. Select the installed module in the list of unused modules and click the Activate button.
  7. Perform the configuration of the module specified in the module documentation.
  8. Save the project and upload the configuration to the server using the button.

Installation of Communicator Drivers

The sequence of installing a new or updating an existing driver of the Communicator application:

  1. Close the Administrator application if it is running.
  2. Unzip the driver installation package.
  3. Copy all files from the SCADA folder of the driver installation package to the Rapid SCADA installation directory, the default is C:\SCADA, with the hierarchy of directories retained.
  4. In case of using Windows 8 or higher, find C:\SCADA\ScadaComm\KP\Kp*.dll, open the file properties and unblock the file.
  5. Start Administrator, open the project and open the Communicator > Drivers page using the project explorer.
  6. Make sure that the installed driver is in the list of available drivers. And if the driver is selected, its description is displayed.

Installation of Webstation Plugins

Additional modules for the Webstation application are called plugins. The installation sequence for a new plugin:

  1. Unzip the plugin installation package.
  2. Copy all files from the SCADA folder of the plugin installation package to the Rapid SCADA installation directory, the default is C:\SCADA, with the hierarchy of directories retained.
  3. In case of using Windows 8 or higher, find C:\SCADA\ScadaWeb\bin\Plg*.dll, open the file properties and unblock the file.
  4. Login the web application as administrator and go to Main Menu > Plugins > Installed.
  5. Find the new plugin on the page and click the Activate link.
  6. Perform the configuration of the plugin specified in the plugin documentation.

Run Applications

First Run

After installing Rapid SCADA, it is recommended to restart the computer so that the Server, Communicator and Agent services start automatically. After the reboot is complete, run one of the following browsers: Google Chrome, Mozilla Firefox or Microsoft Edge. In the address bar, type http://localhost/scada/. The login page should open (see Figure 1). Enter admin and 12345 in the login and password fields and click the Login button.

Login web form
Figure 1. Login web form

Run Administrator

To start the Administrator application, use the shortcut located in the menu Start > Programs > SCADA . If the shortcut is missing for any reason, Administrator can be run from the executable file C:\SCADA\ScadaAdmin\ScadaAdmin.exe

The Administrator application includes the tools for managing other Rapid SCADA applications.

Services

The Server, Communicator and Agent applications work as services. In case of working on Windows, use the services.msc snap-in to manage services. It can be run from the command line or by Control Panel > System and Security > Administrative Tools > Services. Service names: ScadaServerService, ScadaCommService and ScadaAgentService.

In addition, there are the svc_start.bat and svc_stop.bat files in the directories of the corresponding applications, which allow to start and stop the services. These batch files must be run as administrator.

The Administrator application also ables to start and stop Server and Communicator. To manage the services in Administrator, open a project and then open the instance status form (see Figure 2) using the button.

Instance status in Administrator
Figure. 2. Instance status in Administrator

The default startup type of the Server, Communicator and Agent services is Automatic, i.e. the services start when an operating system starts, and the services stop when the OS stops. If auto start is not necessary, Manual startup type could be set (see Figure 3).

Setting Windows service startup type
Figure 3. Setting Windows service startup type

Web Application

To open the web application named Webstation, in the browser address bar, enter http://compname/scada/ where compname is the host name or IP address of the computer with the installed web application, scada is the virtual directory specified during the installation. If Webstation is opened on the same computer on which it is installed, it is possible to use http://localhost/scada/ or http://127.0.0.1/scada/

The default username: admin
The default password: 12345

Migrate Configuration to New Server

The typical tasks when Rapid SCADA migration to another server is needed:

The steps to migrate a configuration are:

  1. Ensure that connections between the server and the devices are properly configured: the required serial ports exist, industrial controllers available via the network, etc.
  2. Install Rapid SCADA on the new server, but do not start the Server and Communicator services.
  3. Stop the Server and Communicator services on the obsolete server. Switch startup type of these services to Manual.
  4. Copy the data archive located in the following directories from the obsolete server to the new server:
    C:\SCADA\ArchiveDAT
    C:\SCADA\ArchiveDATCopy
  5. Transfer the configuration from the obsolete to the new server in one of the following ways.
    • Copy the content of the directories listed below from the obsolete to the new server (default directories are shown):
      C:\SCADA\BaseDAT
      C:\SCADA\Interface
      C:\SCADA\Projects
      C:\SCADA\ScadaAgent\Config
      C:\SCADA\ScadaComm\Config
      C:\SCADA\ScadaServer\Config
      C:\SCADA\ScadaWeb\config
      C:\SCADA\ScadaWeb\storage
    • Open the project in the Administrator application and upload the configuration to the new server with the button, unchecking the Restart Server and Restart Communicator checkboxes.
  6. Start the Server and Communicator services on the new server.
  7. Check whether the new server operates well.

Software Update

Updating Rapid SCADA to new versions has to be performed on the test environment first. Carefully read the list of changes were made in the new version. If the configuration database structure is changed or the archive or configuration files formats are changed, special utility is required to convert data.

Installation on the production server is allowed only being sure that the new version of Rapid SCADA operates properly on the test environment.

The steps for updating Rapid SCADA:

  1. Make a backup copy of the all files of Rapid SCADA located in C:\SCADA directory by default.
  2. Uninstall Rapid SCADA using the installer ScadaSetup.exe.
  3. Install a new version of Rapid SCADA and migrate the configuration from the backup copy.
  4. Clear the browser cache or refresh the web application pages by pressing Shift + F5.

Updating Rapid SCADA by directly copying files of a new version is technically possible. However, this operation requires a deep understanding of Rapid SCADA and can cause errors in the software.

Safety Recommendations

File Protection

If Rapid SCADA is used in a corporate environment, restrict access of domain users to the Rapid SCADA installation directory, by default C:\SCADA\. To do this, open the properties of the directory which contains the Rapid SCADA applications, choose the Security tab and configure access rights.

HTTPS

Configure a web server to enable HTTPS protocol for the Webstation application. Using HTTPS, all traffic between a browser and the web server, including passwords, is encrypted.

VPN

Use VPN to provide access for external users. If possible, avoid open access to Webstation from outside.

Passwords

Change the default passwords. Open the project using the Administrator application, enter the new passwords in the Users table, and update the passwords for connecting to Server specified in the application settings. To create strong passwords, use a password generator. If a company uses Active Directory, setting up authentication in Rapid SCADA based on Active Directory enhances system security.

Software Configuration

Configuration Basics

Creating Project

Configuration of Rapid SCADA is performed on a project basys. A project is a set of files in various formats that are stored in the project directory. To create and edit projects, use the Administrator application. When Administrator starts, the Start page opens, which contains the buttons to create a new or open an existing project (see Figure 1).

Start page
Figure 1. Start page

Project creation form
Figure 2. Project creation form

Pay attention to the Template field of the project creation form (see Figure 2). The template defines the initial configuration that is added to the project. Another existing project can be used as a template.

Project Structure

Rapid SCADA configuration is displayed in the project explorer, which is located in the left part of the main Administrator window. The project consists of the following main parts (Fig. 3):

Project structure
Figure 3. Project structure

An instance is a computer on which Rapid SCADA is deployed. A single project can include multiple instances of Rapid SCADA that exchange data. The Administrator application can connect to remote servers for downloading and uploading configuration, therefore, Rapid SCADA can be configured using one workstation.

General Configuration Sequence

Starting to work with Rapid SCADA, it is recommended to follow the general configuration sequence described below. Having obtained some experience, better understanding the dependencies between the applications, the sequence can be varied to increase efficiency.

  1. Create a new or open an existing project.
  2. Add objects, communications lines and devices into the configuration database. To create communication lines and devices it is recommended to use wizards that are opened using the and buttons located on the Administrator's toolbar.
  3. Check that the added communication lines and devices are present in the Communicator settings. If necessary, import them by selecting the Import menu item from the context menu of the Communication Lines node of the project explorer.
  4. Configure communication with devices in Communicator.
  5. Create input and output channels in the configuration database. It is recommended to use the wizard opened by the button.
  6. Create views and specify them in the Interface table of the configuration database.
  7. Upload the project to the server by the button.

Tune Up Configuration Database

Configuration Database Structure

The configuration database is a structured description of the entire automated system. The applications included in Rapid SCADA use the information from the configuration database in conjunction with their settings.

The configuration database is edited using the Administrator application as part of a project. The edited instance of the configuration database is in XML file format. When a project is uploaded to a server for execution, the configuration database is converted into a special DAT format.

The configuration database consists of tables, which in turn are composed of columns and rows. Each table belongs to one of the following groups:

  1. System. This group contains the tables which define a configuration of a particular automated system.
  2. Dictionaries. This group contains the auxiliary tables. In most cases changing of these tables is not needed.

The following table describes the configuration database tables.

Table Name Description
System Group
Objects Contains logical objects that are used to structure information in the system. Objects can be interpreted as locations
Communication lines Describes communication lines which are used to exchange data with devices
Devices Contains real or virtual devices
Input channels Defines data received from the devices and calculated data
Output channels Specifies commands executed by the system
Roles Contains roles. Each role defines a set of functions available to a user
Users Contains a list of users of the system and their roles
Interface Contains descriptions of interface objects (views, reports and data windows)
Rights Defines rights to interface objects by roles
Dictionaries Group
Channel types Dictionary of input channel types
Command types Dictionary of command types used by output channels
Event types Dictionary of system event types and statuses of input channels in the archive
Device types Dictionary of device types that can be connected to the system
Quantities Dictionary of measured quantities
Units Dictionary of units of input channel values and enumerable values of input channels
Command values Dictionary of enumerable command values which are transmitted by output channels
Number formats Dictionary of formats which are used to display input channel values
Formulas Dictionary of formulas used in calculation of input channel data and command values of output channels

Editing Configuration Database

The configuration database tables have relations with each other, that is, a cell of one table can refer to a record of another table. For example, each device refers to the communication line to which it is connected. Therefore, it is efficient to edit tables in a certain sequence. For tables from the System group, enter data in order starting with the Objects table and ending by the Rights table.

To add communication lines and devices, it is suggested to use the wizards that are opened using the and buttons. Using the wizard allows to add an entry to the configuration database table, and also to create the corresponding entity in the Communicator settings. To create input and output channels, use the wizard opened by the button. However, automatic channel creation must be supported by the device drivers selected, otherwise channels should be entered manually.

If the button is displayed on the table toolbar, the table can be edited using the form view. Forms for editing channel properties are shown in Figure 1 and 2.

Input channel properties
Figure 1. Input channel properties

Output channel properties
Figure 2. Output channel properties

Creating a configuration database can be significantly accelerated by using the existing works. To exchange information between different databases, the Administrator application supports the Import table and Export table features (see Figure 3 and 4), which are accessible in the File menu. Tables can be are exported to DAT, XML and CSV files. Then information can be imported from DAT and XML files into the same or a different project. Limit the range of exported and imported data by specifying the starting and ending identifiers. If the new destination identifier for the import operation is set, data is imported with an offset of identifiers.

Import table
Figure 3. Import table

Export table
Figure 4. Export table

A cloning tool is available for input and output channels (see Figure 5). In the Clone Channels form fill the source and destination channel numbers. If needed, select a new object and device for the cloned channels. The function of updating channel numbers in formulas applies if a channel number is used as an argument in the following functions: N(), Val(), Stat(), SetVal(), SetStat() and SetData().

Channel cloning
Figure 5. Channel cloning

Copy (Ctrl + C) and paste (Ctrl + V) are available for table cells. Click a column header to sort the table rows by the values of that column. The search and replace feature (Ctrl + F) also speeds up editing.

Using Formulas

Formulas are used for calculating values and statuses of input channels and calculating values of commands. Formulas processing is performed by the Server application.

Formulas are enterd in the Formula column of the Input channels and Output channels tables of the configuration database. To enable the formula, tick the checkbox in the Formula used column. The Formulas table contains additional functions and data structures which can be used in formulas for input and output channels.

Formula Writing Rules

The general rules of writing and using formulas:

  1. Formulas use the expressions syntax of C# language. Many of Microsoft .NET classes are accessible, for example, Math and DateTime classes.
  2. New constants, fields, properties and methods can be added to use in formulas.
  3. If at least one formula contains an error, Server operation is impossible. Information about errors in formulas is written in the Server application log.

The rules for calculating input channel formulas:

  1. Channels of the Discrete and Real types are calculated when the channels data are received by Server. Use these channel types if formula does not refer to data of other channels.
  2. Channels of the Calculated * and Switching counter types are calculated permanently in order according to the channel numbers. A formula of a calculated channel usually refers to data of other channels.
  3. Channels of the Minute * and Hourly * types are calculated periodically, once per minute or once per hour. Use these channel types to create accumulated values, for example, energy consumption or operating time.
  4. For channels of the Discrete and Real types statuses of the channels after calculating are equal to the statuses of these channels received by Server if status calculation does not specified explicitly.
  5. The statuses of the other types of channels are set to Defined if status calculation does not specified explicitly.
  6. An input channel formula that does not contain ";" (semicolon) symbol calculates the input channel value only.
  7. If an input channel formula contains ";", the formula calculates the input channel value and status. The first part before semicolon is a formula for value calculation and the second part after semicolon calculates status.
  8. If the channel limits are specified, the channel status is recalculated taking the limits into account after calculating the channel formula.
  9. A formula for calculating a channel value must return a real number of the double type, and the formula for calculating the status returns an integer having the int type.

The rules for calculating output channel formulas:

  1. Formulas are processed for output channels having the Standard and Binary command types.
  2. A formula for calculating the value of a standard command must return a real number of the double type, and the formula for calculating data of a binary command returns an array of bytes of the byte[] type.

Existing Formulas

The variables accessible in formulas:

Variable Value Type Description
CnlVal, Cnl double The input channel value transmitted to Server before calculation
CnlStat int The input channel status transmitted to Server before calculation
CmdVal, Cmd double The command value transmitted to Server before calculation
CmdData byte[] The command data transmitted to Server before calculation
CnlNum int The channel number for which the formula is calculated
E double The natural logarithmic base, specified by the constant, e
PI double The ratio of the circumference of a circle to its diameter, specified by the constant, π

The functions accessible in formulas:

Fucntion Value Type Description
N(n) int Returns the specified channel number for updating numbers on cloning
Val() double Gets the current value of the formula channel
Val(n) double Gets the current value of the channel n
SetVal(n, val) double Sets the current value of the channel n
Stat() int Gets the current status of the formula channel
Stat(n) int Gets the current status of the channel n
SetStat(n, stat) int Sets the current status of the channel n
SetData(n, val, stat) double Sets the current value and status of the channel n
Abs(x) double Calculates the absolute value of a number
Sin(x) double Calculates the sine of the specified angle
Cos(x) double Calculates the cosine of the specified angle
Tan(x) double Calculates the tangent of the specified angle
Exp(x) double Calculates e raised to the specified power
Ln(x), Log(x) double Calculates the natural (base e) logarithm of a specified number
Sqr(x) double Calculates the square of a specified number
Sqrt(x) double Calculates the square root of a specified number

Additional formulas, including formulas for calculating averages, are available on GitHub.

Debugging Formulas

If you develop custom formulas, check their syntax and validate whether they work correctly. If the Server service fails to compile the formulas at startup, information about the error is written in the Server log file, and the source code of the formulas that Server tries to compile is available in CalcEngine.cs, which is located in the Server log directory, by default C:\SCADA\ScadaServer\Log\

To develop complex formulas, it is recommended to use Microsoft Visual Studio Community Edition. Add a refererence to the FormulaTester.dll assembly in the project. As an example, use the project mentioned above, which contains formulas.

User Authentication Configuration

Rapid SCADA supports three methods of user authentication:

  1. Based on usernames and passwords stored in the configuration database.
  2. Based on Active Directory.
  3. Combined method.

To perform authentication, a client application, for example, Communicator or Webstation, sends to the Server application a request to validate user name and password. Server checks user credentials and returns the user role to the client application.

The standard user roles and their capabilities are listed in the following table.

ID Role Name Description
0 Disabled Access to the system is denied
1 Administrator Full access
2 Dispatcher Viewing all information, sending commands
3 Guest Viewing all information
4 Application Interacting with the Server application

To restrict user access to interface objects (table views, schemes, etc.), create new user roles in Roles table in the configuration database. Then specify access rights in the Rights table.

If Rapid SCADA operates in a network that managed by Active Directory, it is recommended to use the 2nd and the 3rd authentication methods because of security reasons. The details of these methods are described below.

To allow the Server service interact with Active Directory, specify domain controller path and tick the nearby checkbox on the Common Parameters page of the application, and activate ModActiveDirectory.dll on the Modules page.

The 2nd authentication method is used if the standard roles are enough to manage user rights. The benefit of this method is that rights management is performed using usual Active Directory tools without editing the configuration database and restarting the Server service.

To use the 2nd method, it is required to create the security groups in Active Directory. The groups correspond to the user roles:

If a user is a member of a group listed above, or he is a member of a group which, in turn, is a member of the above groups, the user is granted the corresponding rights in Rapid SCADA.

The 3rd method combines the capabilities of the 1st and the 2nd methods. Validation of user credentials is performed using Active Directory, and a user role is defined by the Users table of the configuration database. In this case, user names and user roles are specified in the Users table, but user passwords are kept blank in the table.

Simultaneous use of all the above authentication methods is allowed.

Communication with Devices Configuration

Interaction with real or virtual devices is performed by the Communicator application, which acting as a master or a slave, polls data and sends commands to devices. All the devices are bound to communication lines. Communication lines are independent of each other and work in parallel.

The user interface of Communicator, designed for configuration, is built into the Administrator application. Communicator is configured as part of a project.

Figure 1 shows an example of the main communication line parameters. A communication channel determines physical interface or network protocol which is used for data exchange with devices. The following communication channels are supported: Serial port, TCP client, TCP server and UDP. In some cases, if the interaction with devices is implemented by a device driver, communication channel should be undefined (e.g., the OPC driver).

If sending commands to devices is not required, it is recommended to untick the Commands enabled checkbox due to safety reasons.

Main communication line parameters
Figure 1. Main communication line parameters

Request sequence
Figure 2. Request sequence

Communication order and request parameters are set on the Request Sequence page (see Figure 2).

If the Active checkbox on the Main Parameters page is unset, the corresponding communication line is disabled, and no requests are performed. If the Active checkbox in the Selected Device group box is unset, communication with that device is disabled.

The Bound to Server checkbox on the Main Parameters page allows to switch on or off sending the communication line data to Server. The Bound to Server checkbox in the Selected Device group box has the similar purpose, but applied only for the device. If the Interact with Server checkbox on the Common Parameters page of the Communicator settings is unset, any interaction between Communicator and Server is disabled. These options are useful for testing new devices being connected to the system.

If the Time and Period parameters of a device are equal to zero, the device is requested cyclically. If the Time parameter is greater than zero and Period is zero, the device is requested once a day in the specified time. If Period is greater than zero, the device is requested periodically starting at the specified time. The Timeout field defines how long to wait an answer from the device after a request. The Delay field defines a delay after each request to the device. Command line may contain additional parameters described in documentation of a device driver.

To reset request parameters of the selected device to the default values, click the Reset button. To open the device properties form, if it is supported by a driver of the selected device, click the Properties button or use a popup menu of the project explorer. To set global properties for a device type, choose the Drivers page, select the device driver and click the Properties button if the button is enabled.

To import communication lines and devices from the configuration database to the Communicator settings, right-click the Communication Lines node or a node of a specific communication line in the project explorer and select the Import item in the context menu. The import form is shown in Figure 3.

Import Communicator settings
Figure 3. Import Communicator settings

The settings synchronization feature (see Figure 4) is also run using the communication line context menu. Synchronization allows to update the parameters of existing communication lines and devices according to the configuration database, however, the parameters entered manually may be lost.

Sync Communicator settings
Figure 4. Sync Communicator settings

Creating Views

View is a form of data representation in the Webstation application. There are 2 types of views supported by default: table views and schemes. Support for other types of views can be added by installing additional plugins.

Table Editor and Scheme Editor are designed to create views. Views are saved to files that must be located in the interface directory of a project. At run time, views are located in the interface directory specified in the Server application settings, or in its subdirectories, by default C:\SCADA\Interface\

Examples of view files:
Interface\Servers\ServerRoom.sch - scheme,
Interface\Servers\ServerRoom.tbl - table view.

To open a dialog for creating a view, select the New file context menu item (see Figure 1 and 2). Then in the dialog form, select the type of view, specify the file name and click the OK button. The created file will be displayed in the project explorer. By double-clicking on the corresponding tree node, the view is opened by the editor.

Menu to create a view
Figure 1. Menu to create a view

View creation dialog
Figure 2. View creation dialog

After view files are created, they must be specified in the Interface table of the configuration database, as shown in Figure 3. View identifiers must be unique. The view path is relative to the interface directory. The text specified in the Title column is displayed as a node text in the explorer tree of Webstation, and identifiers determine the sorting of the views. If view files are located in the subdirectories of the interface directory, these subdirectories must also be specified in the Interface table.

Editing the Interface table
Figure 3. Editing the Interface table

Scheme Templates

Schemes support the template mode. A template is a regular scheme created using Scheme Editor, which can be bound to arbitrary input and output channels.

To use a scheme in the template mode, specify the appropriate arguments in the Interface table. Two options are available (see Figure 3):

  1. Specify the channel number offset relative to the original scheme, and the title component identifier.
  2. Specify the file that contains the bindings of the scheme components to the channels.

Scheme template in the Interface table
Figure 4. Scheme template in the Interface table

Description of the arguments:
inCnlOffset - input channel number offset;
ctrlCnlOffset - output channel number offset;
titleCompID - title component identifier;
bindingFileName - file name of the bindings relative to the Webstation configuration directory.

The title text of a scheme working in the template mode is taken from the Title field of the Interface table. When creating a scheme template using Scheme Editor, it is recommended to leave the scheme title property blank.

Binding files must be located inside the Webstation configuration directory, by default C:\SCADA\ScadaWeb\config\. Binding file example:

<?xml version="1.0" encoding="utf-8" ?>
<TemplateBindings>
  <TemplateFileName>MyScheme.sch</TemplateFileName>
  <TitleCompID>3</TitleCompID>
  <Binding compID="1" inCnlNum="101" ctrlCnlNum="101" />
  <Binding compID="2" inCnlNum="102" />
</TemplateBindings>

Modules

Database Import Driver

Overview

The database import driver is designed to receive current data from a third-party database, as well as write information to a third-party database using telecontrol commands. This driver is included in the Rapid SCADA installation package and does not require separate installation. The driver library file is KpDbImport.dll.

Configuring

Each device that uses the database import driver contains one request for receiving data and a set of commands for changing data. There can be one or more devices importing data on a one communication line.

Configuring the database import driver is performed using the device properties form. To open this form, find the corresponding device in the Communicator settings, right-click on the device node and choose the Properties menu item.

Setting up a database connection

The Database page allows to specify the database type and the parameters of the database connection. If non-standard connection parameters are needed, it is possbile to edit the connection string directly.

Setting up data retrieval

The Data Retrieval page specifies the SQL query to retrieve current data from the database. The driver automatically creates device tags based on the list of requested table columns. If a request has a complex syntax, enter the number of tags manually.

Setting up telecontrol commands

The telecontrol commands supported by the device are defined on the Commands page. Commands provide information transfer from Rapid SCADA to the database. SQL query of a command may include the variables cmdVal and cmdNum which contain the value and number of the command. For most DBMS variables in the query need the prefix @, whereas : (colon) is usually used for Oracle.

A command having the number 0 is a default command. If the number of the command sent is not found in the list of the device commands, the default command is executed.

Modbus Slave Driver

Overview

The driver supports the standard Modbus communication protocol and works as a slave. Using the driver, the Communicator waits for incoming requests and commands from a third-party device or application that works as a master. The following communication channels are supported: serial port, TCP server, and UDP. The driver can work in Modbus RTU or Modbus TCP mode.

Modbus Slave Driver features:

  1. Receives data from a device using write commands.
  2. Provides data to a device in response to read commands.
  3. Transmits values of Rapid SCADA input channels received from other devices in order to integrate with third-party systems.

Installation

Modbus Slave Driver is installed in accordance with the general sequence of installing Communicator drivers. The driver library file is KpModbusSlave.dll.

Configuring

First of all, create a new communication line and a new device in the configuration database, as well as in the Communicator settings. For this purpose, it is suggested to use wizards that are opened by the and buttons. The device address matters, because this is the unit ID that the Communicator validates to respond. Then open the main parameters of the communication line, select the communication channel type and configure its properties. Examples of communication channel properties are shown below.

Serial port properties

TCP server properties

After creating a device in Communicator, open the the device properties form and configure the device.

Modbus Slave device properties

Input data validity period allows to automatically set the undefined status of the device input tags, if no new data has been received from the device within a specified time.

Device template defines the Modbus register map. Device templates of the KpModbus.dll and KpModbusSlave.dll drivers are fully compatible.

Data source device is set to non-zero to transmit the input channels values received from another device into a third-party system. If the driver is used to interact with a real device, this parameter should be 0.

The following figure shows the Modbus template editor:

Modbus template editor

Modbus Slave Driver requires registration. After completing the settings, upload the project to the server using the button. Then open the Drivers page in the Administrator application, select the KpModbusSlave.dll driver, open the driver properties and register it. After registration, upload the project to the server again.

Telegram Driver

Overview

Telegram Driver is designed to send notifications using the popular Telegram messenger. The advantages of using Telegram is quickness of receiving notifications, no fee for the service and easy management of notification groups.

Installation

Telegram Driver is installed in accordance with the general sequence of installing Communicator drivers. The driver library file is KpTelegram.dll.

Configuring

Creating Telegram Bot

First you need to create a Telegram bot. To do this:

  1. Install the application and register Telegram.
  2. Add the bot named BotFather to the contact list.
    Telegram BotFather
  3. In the dialog with BotFather, run the command /newbot and follow the instructions from BotFather.
  4. Click the menu icon and create a new group to receive notifications.
    Новая группа Telegram
  5. Add the bot you created to the new group.
  6. Add contacts to the new group. These contacts will receive notifications.

Driver Settings

Configuring of notifications is performed using the Administrator application as part of a project. The configuring steps are:

  1. Open the Device types table and check that the device type "224 Telegram" exists. If the specified record is missing, enter it manually.
  2. Create a separate communication line and a single device of the Telegram type that belongs to this communication line. Use wizards that are opened by the and buttons.
  3. In the Communicator settings open the device properties, enter the bot token obtained when creating the bot, and generate a bot password that is needed to manage subscriptions.
    Telegram Driver configuration
  4. Save the driver configuration.
  5. Upload the project to the server by the button.
  6. Go to the Registration page and register the driver using the hyperlinks on the form.
    Telegram Driver registration
  7. Save the changes again and upload the project to the server.

Manage Subscriptions

If the settings are correct, your bot will respond to messenger commands, for example, the /help command. It is necessary to specify the subscriptions (chats) in the driver settings.

Telegram notification group

To get the ID and the name of the subscription, send the /info command using the messenger. Then add the received values using the device configuration form.

Obsolete method: to add or remove subscriptions, use the /start and /stop commands with the previously generated password. However, by default, subscription changes are blocked. To unlock it, send a standard command number 2 with a value of 1 by Communicator. Then you can add or remove subscriptions.

Sending Messages

To send a message from Rapid SCADA to a Telegram group, you need send a binary command number 1 containing the group name (or identifier) and the message text. For example:
RapidScadaDemo; Test message.

Sending Telegram message

Automatic sending of notifications in case of specific conditions and events are performed by Automatic Control Module.

Automatic Control Module

Overview

Automatic Control Module automatically sends commands depending on certain conditions. Unless you register the module, it works in the demo mode. The duration of a full functional demo is limited to 10 minutes after restart. The module operates under control of the Server application. The form shown below is designed to configure the module.

The module configuration form

Conditions required for sending commands specified as triggers of several types:

Each trigger contains a set of commands which are sent if the trigger fires. The information about firing of the triggers is accessible on the Log page or directly from the ModAutoControl.log file. This file is located in the Server logs directory C:\SCADA\ScadaServer\Log

Installation

Automatic Control Module is installed in accordance with the general sequence of installing Server modules. The module library file is ModAutoControl.dll. By adding the module, perform the following additional actions:

  1. After activating the module, upload the project to the server in order to determine the computer code for module registration.
  2. Select the module on the Modules page and click the Properties button to open the module settings form.
  3. Go to the Registration page and register the module using the hyperlinks on the form.
  4. Configure the module by creating triggers and commands.
  5. Save the module configuration and upload the project to the server.

Variables of Telecontrol Commands

String data of telecontrol command, which are send on trigger firing, can contain variables. Variables are written in braces.

The following variables are supported:

Variable Description
{n} The current value of the input channel n with a unit, where n is a channel number, n = 0 is the channel specified in the data trigger
{Now} The current date and time on the server
{CnlNum}, {CnlName} Parameters of the data trigger: input channel number and name
{CnlVal}, {CnlStat} Value and status of the input channel those caused the trigger firing
{EvNum}, {EvTime}, {EvObj}, {EvDev}, {EvCnl}, {EvText} Parameters of the event that caused the trigger firing: number, date and time, object, device, channel and description
{CtrlCnlNum}, {CtrlCnlName} Parameters of the command trigger: output channel number and name
{CmdVal}, {CmdDataStr}, {CmdDataHex} Parameters of the command that caused the trigger firing: value, data as a string, data in hexadecimal representation

Export to Database Module

Overview

The module provides real-time export data, which received from devices, in the popular databases. The supported DBMS are Microsoft SQL Server, Oracle, PostgreSQL and MySQL. This module is included in the Rapid SCADA installation package and does not require separate installation. The module library file is ModDBExport.dll.

Configuring

In a project go to the Modules page, activate the ModDBExport.dll module and open its properties. The module supports export in several different databases in parallel. To add a database, click the button. The Connection page contains the parameters for connecting to the database. Specify the SQL queries on the Current Data, Archive Data and Events pages. These queries are executed by the module when new data is received by Server. The database, which is an export target, must be created and contain appropriate tables for storing data.

DB connection parameters

Current data export parameters

If some data was not timely exported, for example, if a database is unavailable, the data can be transferred in manual mode. The manual export form is opened by the button. To make manaul export possible, create the corresponding output channels in the configuration database and specify them on the form.

Manual export

Examples of Tables and SQL Queries

Microsoft SQL Server

-- Delete channel data table if it exists
IF OBJECT_ID('CnlData', 'U') IS NOT NULL
DROP TABLE CnlData;

-- Create channel data table
CREATE TABLE CnlData (
  DateTime datetime2 NOT NULL,
  CnlNum   int NOT NULL,
  Val      float NOT NULL,
  Stat     int NOT NULL,
  PRIMARY KEY (DateTime, CnlNum)
);

CREATE INDEX idx_CnlData_CnlNum ON CnlData (CnlNum);

-- Delete events table if it exists
IF OBJECT_ID('Events', 'U') IS NOT NULL
DROP TABLE Events;

-- Create events table
CREATE TABLE Events (
  DateTime   datetime2 NOT NULL,
  ObjNum     int NOT NULL,
  KPNum      int NOT NULL,
  ParamID    int NOT NULL,
  CnlNum     int NOT NULL,
  OldCnlVal  float NOT NULL,
  OldCnlStat int NOT NULL,
  NewCnlVal  float NOT NULL,
  NewCnlStat int NOT NULL,
  Checked    bit NOT NULL,
  UserID     int NOT NULL,
  Descr      char(100),
  Data       char(50)
);

CREATE INDEX idx_Events_DateTime ON Events (DateTime);
CREATE INDEX idx_Events_ObjNum ON Events (ObjNum);
CREATE INDEX idx_Events_KPNum ON Events (KPNum);
CREATE INDEX idx_Events_CnlNum ON Events (CnlNum);

-- Insert current data
INSERT INTO CnlData (DateTime, CnlNum, Val, Stat)
VALUES (@dateTime, @cnlNum, @val, @stat)

-- Insert or update existing archive data
MERGE CnlData AS target
USING (SELECT @dateTime, @cnlNum) AS source (DateTime, CnlNum)
ON (target.DateTime = source.DateTime AND target.CnlNum = source.CnlNum)
WHEN MATCHED THEN 
  UPDATE SET Val = @val, Stat = @stat
WHEN NOT MATCHED THEN
  INSERT (DateTime, CnlNum, Val, Stat)
  VALUES (@dateTime, @cnlNum, @val, @stat);

-- Insert event
INSERT INTO Events (DateTime, ObjNum, KPNum, ParamID, CnlNum, OldCnlVal, OldCnlStat, NewCnlVal, NewCnlStat, Checked, UserID, Descr, Data)
VALUES (@dateTime, @objNum, @kpNum, @paramID, @cnlNum, @oldCnlVal, @oldCnlStat, @newCnlVal, @newCnlStat, @checked, @userID, @descr, @data)

Oracle

-- Delete channel data table if it exists
BEGIN
  EXECUTE IMMEDIATE 'DROP TABLE cnldata';
EXCEPTION
  WHEN OTHERS THEN
    IF SQLCODE != -942 THEN
      RAISE;
    END IF;
END;

-- Create channel data table
CREATE TABLE cnldata (
  datetime TIMESTAMP NOT NULL,
  cnlnum   INTEGER NOT NULL,
  val      FLOAT NOT NULL,
  stat     INTEGER NOT NULL,
  PRIMARY KEY (datetime, cnlnum)
);

CREATE INDEX idx_cnldata_cnlnum ON cnldata (cnlnum);

-- Delete events table if it exists
BEGIN
  EXECUTE IMMEDIATE 'DROP TABLE events';
EXCEPTION
  WHEN OTHERS THEN
    IF SQLCODE != -942 THEN
      RAISE;
    END IF;
END;

-- Create events table
CREATE TABLE events (
  datetime   TIMESTAMP NOT NULL,
  objnum     INTEGER NOT NULL,
  kpnum      INTEGER NOT NULL,
  paramid    INTEGER NOT NULL,
  cnlnum     INTEGER NOT NULL,
  oldcnlval  FLOAT NOT NULL,
  oldcnlstat INTEGER NOT NULL,
  newcnlval  FLOAT NOT NULL,
  newcnlstat INTEGER NOT NULL,
  checked    INTEGER NOT NULL,
  userid     INTEGER NOT NULL,
  descr      CHAR(100),
  data       CHAR(50)
);

CREATE INDEX idx_events_datetime ON events (datetime);
CREATE INDEX idx_events_objnum ON events (objnum);
CREATE INDEX idx_events_kpnum ON events (kpnum);
CREATE INDEX idx_events_cnlnum ON events (cnlnum);

-- Insert current data
INSERT INTO cnldata (datetime, cnlnum, val, stat)
VALUES (:dateTime, :cnlNum, @val, :stat)

-- Insert or update existing archive data
MERGE INTO cnldata
USING dual ON (datetime = :dateTime AND cnlnum = :cnlnum)
WHEN MATCHED THEN 
  UPDATE SET val = :val, stat = :stat
WHEN NOT MATCHED THEN 
  INSERT (datetime, cnlnum, val, stat)
  VALUES (:dateTime, :cnlNum, :val, :stat)

-- Insert event
INSERT INTO events (datetime, objnum, kpnum, paramid, cnlnum, oldcnlval, oldcnlstat, newcnlval, newcnlstat, checked, userid, descr, data)
VALUES (:dateTime, :objNum, :kpNum, :paramID, :cnlNum, :oldCnlVal, :oldCnlStat, :newCnlVal, :newCnlStat, :checked, :userID, :descr, :data)

PostgreSQL

-- Delete channel data table if it exists
DROP TABLE IF EXISTS cnldata;

-- Create channel data table
CREATE TABLE cnldata (
  datetime timestamp NOT NULL,
  cnlnum   integer NOT NULL,
  val      double precision NOT NULL,
  stat     integer NOT NULL,
  PRIMARY KEY (datetime, cnlnum)
);

CREATE INDEX ON cnldata (cnlnum);

-- Delete events table if it exists
DROP TABLE IF EXISTS events;

-- Create events table
CREATE TABLE events (
  datetime   timestamp NOT NULL,
  objnum     integer NOT NULL,
  kpnum      integer NOT NULL,
  paramid    integer NOT NULL,
  cnlnum     integer NOT NULL,
  oldcnlval  double precision NOT NULL,
  oldcnlstat integer NOT NULL,
  newcnlval  double precision NOT NULL,
  newcnlstat integer NOT NULL,
  checked    boolean NOT NULL,
  userid     integer NOT NULL,
  descr      char(100),
  data       char(50)
);

CREATE INDEX ON events (datetime);
CREATE INDEX ON events (objnum);
CREATE INDEX ON events (kpnum);
CREATE INDEX ON events (cnlnum);

-- Insert current data
INSERT INTO cnldata (datetime, cnlnum, val, stat)
VALUES (@dateTime, @cnlNum, @val, @stat)

-- Insert or update existing archive data
WITH upsert AS (UPDATE cnldata SET val = @val, stat = @stat 
WHERE datetime = @datetime AND cnlnum = @cnlNum RETURNING *)
INSERT INTO cnldata (datetime, cnlnum, val, stat)
SELECT @dateTime, @cnlNum, @val, @stat
WHERE NOT EXISTS (SELECT * FROM upsert)

-- Insert event
INSERT INTO events (datetime, objnum, kpnum, paramid, cnlnum, oldcnlval, oldcnlstat, newcnlval, newcnlstat, checked, userid, descr, data)
VALUES (@dateTime, @objNum, @kpNum, @paramID, @cnlNum, @oldCnlVal, @oldCnlStat, @newCnlVal, @newCnlStat, @checked, @userID, @descr, @data)

MySQL

-- Delete channel data table if it exists
DROP TABLE IF EXISTS cnldata;

-- Create channel data table
CREATE TABLE cnldata (
  datetime DATETIME NOT NULL,
  cnlnum   INT NOT NULL,
  val      DOUBLE NOT NULL,
  stat     SMALLINT UNSIGNED NOT NULL,
  PRIMARY KEY (datetime, cnlnum)
) ENGINE=InnoDB;

CREATE INDEX idx_cnldata_cnlnum ON cnldata (cnlnum);

-- Delete events table if it exists
DROP TABLE IF EXISTS events;

-- Create events table
CREATE TABLE events (
  datetime   DATETIME NOT NULL,
  objnum     INT NOT NULL,
  kpnum      INT NOT NULL,
  paramid    INT NOT NULL,
  cnlnum     INT NOT NULL,
  oldcnlval  DOUBLE NOT NULL,
  oldcnlstat SMALLINT UNSIGNED NOT NULL,
  newcnlval  DOUBLE NOT NULL,
  newcnlstat SMALLINT UNSIGNED NOT NULL,
  checked    TINYINT UNSIGNED NOT NULL,
  userid     INT NOT NULL,
  descr      CHAR(100),
  data       CHAR(50)
) ENGINE=InnoDB;

CREATE INDEX idx_events_datetime ON events (datetime);
CREATE INDEX idx_events_objnum ON events (objnum);
CREATE INDEX idx_events_kpnum ON events (kpnum);
CREATE INDEX idx_events_cnlnum ON events (cnlnum);

-- Insert current data
INSERT INTO cnldata (datetime, cnlnum, val, stat)
VALUES (@dateTime, @cnlNum, @val, @stat)

-- Insert or update existing archive data
INSERT INTO cnldata (datetime, cnlnum, val, stat)
VALUES (@dateTime, @cnlNum, @val, @stat)
ON DUPLICATE KEY UPDATE val = @val, stat = @stat

-- Insert event
INSERT INTO events (datetime, objnum, kpnum, paramid, cnlnum, oldcnlval, oldcnlstat, newcnlval, newcnlstat, checked, userid, descr, data)
VALUES (@dateTime, @objNum, @kpNum, @paramID, @cnlNum, @oldCnlVal, @oldCnlStat, @newCnlVal, @newCnlStat, @checked, @userID, @descr, @data)

Rapid Gate Module

Overview

Rapid Gate Module is designed to synchronize data between different Rapid SCADA instances. The module allows to setup a backup server, as well as provides data transfer from SCADA installed on remote locations to the primary SCADA. The module supports an arbitrary number of independent gateways for exchanging information with several Rapid SCADA servers.

Installation

Rapid Gate Module is installed in accordance with the general sequence of installing Server modules. The module library file is ModRapidGate.dll. After adding the module, perform several additional actions are needed:

  1. Copy the module configuration files ModRapidGate.xml and ModRapidGate_Reg.xml into the edited project. Inside the project these files are located in ScadaServer\Config\
  2. After activating the module, upload the project to the server in order to determine the computer code for module registration. The computer code is written in C:\SCADA\ScadaServer\Log\ModRapidGate.log
  3. Register the module by contacting the developers or using the trial key generator. A register key must be stored in the project file ScadaServer\Config\ModRapidGate_Reg.xml between RegKey tags.
  4. Configure the module and upload the project to the server.

Configuring

To cofigure Rapid Gate Module, edit the project file ScadaServer\Config\ModRapidGate.xml with a text editor. Note that you usually need to configure the firewall on the target server to allow incoming connections to TCP port 10000.

Briefly consider the contents of the configuration file:

XML Tag Description
Gate Gateway section. The file can contain several such sections
GeneralOptions General gateway options
ConnectionOptions Remote server connection options. Password must be encrypted using the EncryptPassword.exe utility
MappingOptions Defines matching of channel, objects and device numbers between this server and the remote server
TransferOptions Options for transferring data to a remote server
CurDataTransferOptions Current data transfer options
ArcDataTransferOptions Archive data transfer options
EventTransferOptions Event transfer options
InCmdTransferOptions Options that determine receiving telecontrol commands from a remote server
OutCmdTransferOptions Options that determine transferring telecontrol commands to a remote server
ArcUploadOptions Options that determine uploading archives to a remote server

Archive Uploading

The upload state of archives is saved during the operation of the module and is restored when the Server service is restarted. The state file is written to the Storage directory. Uploading archives is performed automatically. However, an operator can manually send a command to upload archives for a certain period. The command of the binary type must be sent using the output channel specified in the module configuration.

Command example:

cmd=ArcUpload
minDT=2020-02-18 10:00:00
maxDT=2020-02-18 10:15:00

Chart Pro Plugin

Overview

Chart Pro Plugin is the additional plugin for the Webstation application extends the capabilities of Rapid SCADA charts: adds scaling, displaying of multiple charts, export to PNG and PDF.

Installation

First you need to perform the general sequence of installing plugins, and then perform several additional actions:

  1. Go to Main Menu > Registration > Chart Pro.
  2. Register the plugin using the hyperlinks on the page.
  3. Go to Main Menu > Configuration > Web application.
  4. Find the Chart plugin parameter, select the Chart Pro plugin from the dropdown list and click the Save Configuration button.
  5. Download the changed Webstation settings to the project using the Administrator application.

Configuring

Chart Pro Plugin is configured by default. Plugin settings are saved in the PlgChartPro.xml file, which is located in the project in the Webstation configuration directory. If necessary, the system administrator can change the settings by editing the existing file or creating a new settings file.

In addition to the configuration file, chart displaying is determined by the query string. The query string has the following form:
http://localhost/Scada/plugins/ChartPro/ChartPro.aspx?cnlNums=101&viewIDs=2&year=2020&month=3&day=31&mode=fixed&period=1&title=Test&config=PlgChartPro.xml

The query string parameters are as follows.

Parameter Values Description
cnlNums Comma separated integers Input channel numbers displayed on the chart
viewIDs Comma separated integers View IDs for each input channel
year, month, day Integers Start date of the displayed data. If not specified, the current date is used
mode fixed | rolling Chart mode: fixed or rolling
period Integer. It can be positive or negative Period of the chart relative to the start date. In days for fixed mode and in minutes for rolling mode
title String. Can be empty Chart title
config String. Can be empty Chart configuration file name relative to the web application configuration directory

In the fixed mode, the plugin displays a chart for a selected period of time. The chart data is automatically updated by adding new values to the right side of the chart.

In the rolling mode, the plugin displays a graph from the current moment to the specified depth. The chart data is automatically updated, while the chart shifts from right to left.

The following figure helps to understand the layout of the chart in order to change the plugin configuration.

Chart layout

Dashboard Plugin

Overview

Dashboard Plugin displays useful widgets on dashboards: charts, current data and arbitrary frames, for example, CCTV camera stream. Settings of each dashboard allow to specify column count and widget aspect ratio.

Installation

First you need to perform the general sequence of installing plugins, and then perform several additional actions:

  1. Go to Main Menu > Registration > Dashboard.
  2. Register the plugin using the hyperlinks on the page.
  3. Add registration key to the project by downloading the Webstation settings using the Administrator application.

Configuring

Specifying Dashboards

Configuration of each dashboard is stored in a separate XML file. The dashboard example, DashboardExample1.xml, is included in the plugin installation package. Dashboard files can be located in the interface directory, or in the Webstation storage directory. The 1st option is preferred.

In order to display the dashboard links in the explorer tree of Webstation, perform the following settings in the project:

  1. Create and edit a dashboard file in the interface directory.
  2. Specify the dashboard path in the Interface table of the configuration database.

Dashboard file

Editing the Interface table

The @DashboardView path suffix indicates the type of view. The access rights to dashboards are configured using the Rights table of the configuration databse. It is similar to editing the rights to table views and schemes.

In addition, dashboard files can be located in the storage directory of Webstation. In this case, click the Dashboards item of the Webstation main menu to display the list of available dashboards. Examples of the dashboard locations in the storage:

ScadaWeb\storage\allusers\Dashboard\ - dashboards available to all users;
ScadaWeb\storage\myuser\Dashboard\ - dashboards available to MyUser.

Dashboard File Structure

Consider the contents of a dashboard configuration file:

<?xml version="1.0" encoding="utf-8" ?>
<DashboardConfig>
  <DashboardOptions>
    <Name>Dashboard Example 1</Name>
    <ColumnCount>2</ColumnCount>
    <AspectRatio>1.33</AspectRatio>
  </DashboardOptions>
  <Widgets>
    <Widget type="Chart" cnlNums="101,102" viewIDs="2,2" period="2" />
    <Widget type="Chart" cnlNums="101,103" viewIDs="2,2" mode="fixed" period="2" title="Sample Chart" config="PlgChartPro.xml" />
    <Widget type="CurData" cnlNums="101,102,103,104,105,106,107,115" viewIDs="2,2,2,2,2,2,2,2" title="Sample Data" />
    <Widget type="View" viewID="2" />
    <Widget type="CustomUrl" url="https://www.youtube.com/embed/EEIk7gwjgIM" />
  </Widgets>
</DashboardConfig>

The DashboardOptions section contains common dashboard parameters:
Name - dashboard name,
ColumnCount - number of columns from 1 to 4 (widgets are shown in a single column anyway on small screens of mobiles),
AspectRatio - ratio of widget width to its height.

The Widgets section contains a list of widgets that are displayed on a dashboard. Number of widgets is arbitrary. However, too many widgets on the same dashboard can reduce the performance of the web application.

Widgets of the following types are supported:
Chart - a chart of the specified input channels,
CurData - a table contains current data of the specified input channels,
View - a view having the specified ID,
CustomUrl - custom web page.

Configuration of widgets of the Chart and CurData types must define input channel numbers and also identifiers of the views that include these input channels. View IDs are required for user access rights validation.

Elastic Report Plugin

Overview

Elastic Report Plugin allows to generate reports according to a custom configuration. Using this plugin, you can build almost any desired report. A user simply selects the period and clicks the generate report button. An administrator creates report configurations which define a set of different report sections and bind report columns and rows to the system data.

Installation

First you need to perform the general sequence of installing plugins, and then perform several additional actions:

  1. Go to Main Menu > Registration > Elastic Report.
  2. Register the plugin using the hyperlinks on the page.
  3. Add registration key to the project by downloading the Webstation settings using the Administrator application.

Report Configuring

A report consists of a set of sections, which are listed in the output document, one by one. Each section has its own type, parameters, and data binding. In addition, the report has the general parameters that affect all sections. The same report can be generated in a variety of formats. Currently supported Excel, PDF and HTML formats. The appearance of the same report, generated in different formats may slightly differ.

Report Configuration File

The configuration file specifies the report format and defines the binding of the report data to the input channels. There must be a separate configuration file for each of the reporting form. The configuration file is in XML format. It must be saved in the interface directory or in its subdirectory within a project.

The plugin distributive contains the example of the report configuration file SCADA\Interface\ElasticReport\ElasticRepExample.xml. This example includes the detailed description of the settings and demonstrates the generation of the report sections of all possible types.

Configuration files may be edited using any text editor. For example, the free text editor Notepad++ supports comfortable work with XML files by the special plugin.

Report Styling

It is possible to customize the report styles: fonts, colors, cell sizes, etc.

The file SCADA\ScadaWeb\plugins\ElasticReport\templates\ElasticRepExcel.xml specifies the styles of the reports in Excel format.

To create custom styles, open this file in Excel and go to the Custom Styles page where the additional styles are located. Use the styles from the Default Styles page as an example.

Custom styles for PDF format are specified in the file
SCADA\ScadaWeb\plugins\ElasticReport\templates\ElasticRepPdfCustom.xml

XML file, which defines PDF styles, is edited manually using any text editor. Use the default styles located in ElasticRepPdfDefault.xml as an example.

The report styles for HTML output are configured in the file
SCADA\ScadaWeb\plugins\ElasticReport\css\customstyles.css according to the rules of Cascade Style Sheets.

Add Report in Configuration Database

To make the report visible in the list of available reports, it is necessary to specify it in the Interface table using the Administrator application. Specify the path to the report configuration file related to the interface directory, specify the ElasticRep report type and enter the report title (see the Figure). After the project is uploaded to the server, the report is available on the Main Menu > Reports page.

Report file

Editing the Interface table

Map Plugin

Overview

Map Plugin displays the status and parameters of locations on OpenStreetMap interactive maps. The plugin allows to monitor geographically distributed systems and navigate to the details page of a location.

Installation

First you need to perform the general sequence of installing plugins, and then perform several additional actions:

  1. Go to Main Menu > Registration > Map.
  2. Register the plugin using the hyperlinks on the page.
  3. Add registration key to the project by downloading the Webstation settings using the Administrator application.

Creating Map

Map is a view in terms of Rapid SCADA. Creating and editing of maps is similar to work with scheme and table views.

Map File

Display options and map locations are stored in a file with the map extension. A map file must be placed in the interface directory or its subdirectory within a project.

The plugin installation package contains an example of the map file SCADA\Interface\Map\MapExample.map. To edit map files, use any familiar text editor, for example, Notepad++. To create your own map, create a copy the example file with a new name and edit it. The name of the map file is arbitrary, the file extension is map.

The Tiling section contains parameters for connecting to a tile server. Tiles are used for composing a map background. There are tile servers from different vendors, both paid and free.

<Tiling>
  <UrlTemplate>https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png</UrlTemplate>
</Tiling>

The InitialView section specifies the initial coordinates and scale of the map. A scale is an integer from 0 to 18.

<InitialView>
    <Lat>48.861111</Lat>
    <Lon>2.336389</Lon>
    <Zoom>13</Zoom>
</InitialView>

The Locations section describes a set of locations that are displayed on the map. Let's consider an example:

<Locations>
  <Location>
    <Lat>48.858222</Lat>
    <Lon>2.2945</Lon>
    <Name>Eiffel Tower</Name>
    <Descr>Avenue Anatole France, Paris, France</Descr>
    <StatusCnlNum>0</StatusCnlNum>
    <Data>
      <DataItem cnlNum="101" />
      <DataItem cnlNum="115">Avg. temp</DataItem>
    </Data>
    <Link viewID="2" />
  </Location>
  ...

Lat и Lon - latitude and longitude of a map location,
Name - location name,
Descr - additional description,
StatusCnlNum - number of an input channel which means the status of this location; 0 - channel not specified; positive channel value means the location is normal, otherwise the location needs attention,
DataItem - displayed data item associated with an input channel,
Link - reference to a view that contains detailed information about the location.

Adding Map into Configuration Database

To make the map visible in the tree of views, it is necessary to register it in the Interface table using the Administrator application. Specify the path to the map file relative to the interface directory and enter the title which is the text of the tree node (see the figure).

Map file

Editing the Interface table

To display the changes in the the Web Station application, upload the project to the server and re-login the web application. The result is:

Map example

Notification Plugin

Overview

Notification Plugin helps an operator to pay attention to the most important events. The plugin generates notifications based on events according to specified rules and displays them in the notification panel that appears on the right side of the web page. In addition, the plugin turns on an audible alert depending on the notification type.

Installation

First you need to perform the general sequence of installing plugins, and then perform several additional actions:

  1. Go to Main Menu > Registration > Notification.
  2. Register the plugin using the hyperlinks on the page.
  3. Add registration key to the project by downloading the Webstation settings using the Administrator application.

If the plugin is installed correctly, there is a bell in the top right corner of the web page.

Configuring

Configuration of the Notification plugin is stored in the PlgNotification.xml file. This file must be included into the project and locate in the configuration folder of Webstation. On runtime the plugin configuration file locates in C:\SCADA\ScadaWeb\config\

Consider the contents of the configuration file:

XML Tag Description
GeneralOptions Section of general options
EvPeriod Period (in days) of taking events to create notifications
DispNotifCnt Number of displayed notifications
NotifOptions Section containing the options determine how to generate notifications
InfoCondition
WarningCondition
ErrorCondition
Specify the conditions of generating notifications of the information, warning and error types
Statuses Input channel statuses that cause a new notification
ParamIDs Quantity IDs of an input channel allowed to notification
Tips Section that specifies the notification tips
Tip Section determines a one tip
TipCondition Condition of the tip
Link If defined, specifies link to navigate by the tip
Html Tip markup instead of link

Additional Applications

Auto Report Application

Overview

The Auto Report application is designed to automatically generate various reports, save them to disk and send by email. The schedule for generating reports is set using Automatic Control Module. Sending reports by email is provided by the corresponding KpEmail.dll driver, which is included in the standard Rapid SCADA installation.

The following types of reports are supported:

Work Algorithm

Auto Report works as a service. It connects to the Server application and is permanently ready to receive commands. Automatic Control Module, which operates as part of Server, sends commands to execute tasks for generating reports at specified time. Due to a command, a set of reports is generated and saved to disk in a format of office files or archive. If the corresponding option is set, the Auto Report application passes a command to Server to send the generated reports by email.

Installation

  1. Unzip the application installation package.
  2. Copy all files from the SCADA folder of the installation package to the Rapid SCADA installation directory, the default is C:\SCADA, with the hierarchy of directories retained.
  3. Execute the file ScadaAutoReport\svc_install.bat as administrator to register the service.
  4. Execute the file ScadaAutoReport\svc_start.bat as administrator to run the service.
  5. Open the application ScadaAutoReport\ScadaAutoReportConfig.exe, go to the Registration tab and register the application.

Configuring

The configuration of Auto Report is stored in the file C:\SCADA\ScadaAutoReport\Config\ScadaAutoReportConfig.xml. To edit the configuration, the ScadaAutoReportConfig.exe application is intended. Its user interface is shown in the following figures:

General options of Auto Report

Task options of Auto Report

To make Auto Report work, it is necessary to perform certain settings in the project:

  1. Create a communication line, device, and output channel to send reports by email to the specified recipients.
  2. Create a device and an output channel to send and receive commands for generating reports.
  3. Add a new user, which is used to connect the application to Server.
  4. Configure Automatic Control Module to send commands on a schedule.
  5. Set up email sending in Communicator.

Actions 1, 2, and 3 are shown in the following figures:

Communication lines

Devices

Output channels

Users

The settings of Automatic Control Module (item 4) are shown below:

Automatic control module

An example of Communicator settings for sending emails (item 5) is contained in the DemoProject.en-GB.rsproj project. The following figure shows the device properties:

Email settings

Operation

After completing the configuration or changing the existing configuration, restart the Auto Report service. To do this, run the file ScadaAutoReport\svc_restart.bat as administrator or use the Windows management console. The service name is ScadaAutoReportService.

To perform a check, run a task of generating report by the Administrator application. Open the Generator form and send a standard command, specifying the control channel that is responsible for generating reports. In this example, the output channel number is 201. Use the task ID as the command value. Then check the log files located in the directory C:\SCADA\ScadaAutoReport\Log\

Telecontrol command

If the application works well, generated reports are saved in the directory specified in the general options, by default C:\SCADA\Reports\

Use Cases

Connecting Devices Using Modbus Protocol

Written by Rapid SCADA on January 5, 2015
Updated on July 10, 2019

This article describes how to configure communication with devices using Modbus protocol. Simple and robust, Modbus has since become a de facto standard communication protocol, and it is now a commonly available means of connecting industrial electronic devices (see Wikipedia). Rapid SCADA supports Modbus RTU, ASCII and TCP modes.

The general sequence of configuring:

  1. Create a project using the Administrator application.
  2. Create a new object, a communication line and devices.
  3. Configure communication between Communicator and the devices.
  4. Create input channels in the configuration database according to the tags of the devices. Create output channels according to the commands.
  5. Create views (tables or schemes) to display data in the Webstation application. Define the views in the configuration database.

The following is a step by step guide to setup a new Modbus device.

Creating Project

Run Administrator and click the New Project button. Enter a project name in the dialog and click the OK button. The setup process fully consistent with the article if the empty project named EmptyProject.en-GB is selected as a template.

Creating a project
Fugire 1. Creating a project

Preliminary Database Configuration

Expand the Configuration Database node, open the Objects table and add a new row for the object 2 "Test object" (see Figure 2). Click the toolbar button to open the communication line wizard. Using the wizard, add the line 1 "Test line" (see Figure 3). After that click the button and add the device 1 "Test device" (see Figure 4).

Adding an object
Fugire 2. Adding an object

Adding a communication line
Fugire 3. Adding a communication line

Adding a device
Fugire 4. Adding a device

Pay attention to the following fields when adding a device:

Device type: Modbus
Address: Modbus address of your device, for example, 1
Call number: IP address, if the device is connected via Ethernet. Otherwise, leave blank
Communication line: "Test line", which was recently created

Open the Communication lines and Devices tables to check that the communication line and device were successfully added to the tables. Make sure that the corresponding communication line and device were created in the Communicator settings.

Configuring Communication with Devices

In the project explorer, go to the Communicator settings, expand the node of the just created communication line and double click the Line Parameters node. Configure the communication channel which settings are presented on the Main Parameters page (see Figure 5). In case of Modbus communication, the most common channel types are TCP client and Serial Port.

The main parameters of the communication line
Figure 5. The main parameters of the communication line

If communication is performed via a serial port, the typical serial port parameters, depending on the Modbus type, are listed in the table below. In the RTU and ASCII modes, the baud rate specified in the Communicator settings and set on the devices must match. All devices connected to a one communication line must operate using the same Modbus type and with the same baud rate.

Modbus RTU Modbus ASCII Modbus TCP
8 data bits,
Even parity,
1 stop bit
7 data bits,
Even parity,
1 stop bit
-
8 data bits,
No parity,
2 stop bits
7 data bits,
No parity,
2 stop bits
-

Go to the Request Sequence page and select the "Test device" row (see Figure 6). If device polling time and period are not specified, the devices are polled cyclically. Commands are sent immediately after a poll is completed.

Device request sequence
Figure 6. Device request sequence

Click the Properties button to open the device properties form (see Figure 7). In the form choose the Modbus type, which have to be specified in the device manual. In our case, Modbus TCP.

Device properties
Figure 7. Device properties

Press the button to select an existing device template, or click to create a new template. When the create button or the edit button is clicked, the Device Template Editor is shown (see Figure 8). This article uses the existing template KpModbus_Adam6015.xml, which was previously copied to the project directory C:\SCADA\Projects\ModbusTest\Instances\Default\ScadaComm\Config\

Device template editor
Figure 8. Device template editor

Device template reflects the structure of Modbus packages. Requested data are combined into groups of elements. Each group has its name, data table, start address and element count. Each element is a tag of a device. Rapid SCADA identifies a tag by its signal number. A command is described by its name, data table and address. A command number identifies the command within Rapid SCADA.

Names of groups, elements and commands are arbitrary. The available data tables and element addresses are usually described in device manual. Depending on the manufacturer, addressing of elements can be zero-based or one-based, specified as decimal or hexadecimal numbers. By default, addresses start with 1 and represented as decimals. To switch template addressing, click the button. Template settings dialog is opened (see Figure 9).

Template settings
Figure 9. Template settings

When editing the device properties (see Figure 7) is completed, click OK. The Command line field of the device parameters contains the template file name KpModbus_Adam6015.xml. Upload the project to the server by the button.

Double click the device node in the project explorer to check device status and data availability (see Figure 10). Data for this example was provided by Modbus Simulator.

Device data
Figure 10. Device data

In case of losing communication with the device, use a communication line log to realize the problem cause. To open the log, double click the Line Stats tree node and go to the Line Log page. Data packages can be decoded by Online Modbus Parser.

Creating Channels

After communication with the device is established, create input channels and output channels in the configuration database. The most fast way to create channels is the wizard called by the button. If several devices of the same type are added to the system, configuring can be accelerated by the channel cloning tool.

Perform the wizard steps (see Figures 11-13), selecting the communication line, device and object created earlier from the drop-down lists. To check the available channel numbers, use the channel map in step 3.

Creating channels. Step 1
Figure 11. Creating channels. Step 1

Creating channels. Step 2
Figure 12. Creating channels. Step 2

Creating channels. Step 3
Figure 13. Creating channels. Step 3

Clicking the Create button creates channels. The channels are created automatically based on the device template that has been created and assigned to the device in the previous section of this article. To view created channels, open the Input channels > Test device table and the Output channels > Test device table. It is recommended to manually fill in the Quantity and Unit fields of the input channels and the Command values field of the output channels. However, in the case of the first experiment it is unnecessary. Useful to understand that the input channels are bound to the device tags using the Signal field. The output channels are bound to device commands in accordance with the Command number field.

After editing the configuration database is complete, upload the project to the server by the button. Open the device data page in the Communicator settings and make sure that the input channels are bound to the device tags. The Channel column must contain numbers of the created input channels (see Figure 14).

Device data bound to channels
Figure 14. Device data bound to channels

As a result of above actions, data should be collected from the device and stored in the archive. It remains to customize user interface for an operator.

Customizing Operator User Interface

Consider creating a table view for the Webstation application. If it is necessary to display data on a scheme, the steps to create a view are similar.

Right click the Interface node of the project explorer. First, select New Folder in the context menu and create the ModbusTest folder. Then in the context menu of the created folder, select New File (see Figure 15). In the opened window, set the table view type, specify the filename ModbusDevice.tbl and click the OK button (see Figure 16).

Menu for creating a view
Figure 15. Menu for creating a view

The view creation dialog
Figure 16. The view creation dialog

The created view file appears in the project explorer. Double clicking the file opens Table Editor. Enter a title and fill in the view items, as shown in Figure 17. Save the changes and close the editor.

Editing a view
Figure 17. Editing a view

After the view file is created, specify the parent directory and the file in the Interface table of the configuration database (see Figure 18).

Adding a view in the Interface table
Figure 18. Adding a view in the Interface table

Upload the project to the server by the button. Now start your browser and enter the address http://localhost/scada/. On the login form use admin / 12345 (see Figure 19). If the configuration carried out correctly, after logging in, you will see a table with the data obtained from the device, similar to Figure 20.

Login form
Figure 19. Login form

The Webstation application
Figure 20. The Webstation application

Modbus Tags Conversion

Received element values may need a conversion. A device template allows choosing a number of bytes used by an element and order of bytes. These settings define an initial conversion. An additional conversion, if needed, is performed by SCADA-Server based on formulas of input channels in the configuration database.

The simplest conversion is a proportional which is described by the following formula:

X * (B - A) / 2N + A, where A and B are the bounds of the element values range, N – number of bits in value, X – received value.

Another commonly used conversion is two’s complement. See Wikipedia for the details. Formulas can be defined inline in input channel rows of the configuration database or separately by using the Formulas table. Using of formulas is described in this section.

Connecting Devices Using OPC Standard

Written by Rapid SCADA on January 5, 2015
Updated on July 15, 2019

This article describes how to configure communication with devices using OPC standard. OPC is designed to provide a common bridge for the software and process control devices from different manufacturers (see Wikipedia). Rapid SCADA supports the following OPC specifications:

Rapid SCADA implementation of OPC client is provided by the Communicator application, to be exact, by KpOpc.dll driver. The goal of this article is learning about the details of Communicator configuring for using OPC.

The general configuration sequence:

  1. Download and install OPC Core Components. These components can be found at opcfoundation.org and rapidscada.org.
  2. Create a project using the Administrator application.
  3. Create an object, a communication line and devices in the configuration database.
  4. Configure communication between Communicator and OPC servers as described in this article.
  5. Create input channels in the configuration database according to the tags of the devices. Create output channels according to the commands.
  6. Create views (tables or schemes) to display data in the Webstation application. Define the views in the configuration database.

The details of the above steps, excluding the step #4, are described in the Software Configuration section. It is recommended to see the project DemoProject.en-GB, which is installed together with Rapid SCADA. Device 21 "OPC Demo" is an example of using OPC. The device tags are displayed by the table view OpcDemo.tbl. This example requires MatrikonOPC Simulation Server, which provides data.

Create a separate communication line for each OPC server that is used. This is the most efficient approach because it allows communicating with the OPC servers in parallel. Set Undefined communication channel type for the created communication lines in Communicator. Then add devices to the communication lines.

Go to the Communicator settings and open the device properties. The configuration form, shown in Figure 1, allows to select which OPC tags are received from OPC server.

Selecting OPC tags
Figure 1. Selecting OPC tags

OPC servers installed on the local computer are available to Communicator. If data from an OPC server, installed on another computer within a network, are required, deploy an extra instance of Communicator on that computer and properly configure it to connect to the Server application.

There are two ways how to bind OPC tags to input channels of the configuration database:

  1. Using the Signal field of device tags and input channels to identify tags.
  2. Setting input channel numbers directly in the configuration form shown in Figure 1.

Select the way that is more suitable in a particular configuration of an automated system.

When the configuration is completed, upload the project to the server by the button. Check OPC communication state and received data using Communicator logs (see Figure 2). If the data in Communicator seem to be true, open a browser and look for the same data in the Webstation application.

Values of OPC tags
Figure 2. Values of OPC tags

Known issue of using OPC: unable to receive data from OPC server while OPC tag properties are available in the device configuration form, no error messages are raised.

Possible reason is that the Communicator service operates as system user but OPC server forbids interacting with system user.

Solution 1. Specify a user account that is used to run OPC server. To open DCOM configuration (see Figure 3), follow the path Control Panel\System and Security\Administrative Tools\Component Services or just run comexp.msc

DCOM configuration
Figure 3. DCOM configuration

Solution 2. Specify a user account that is used to run the Communicator service. Go to Control Panel\System and Security\Administrative Tools\Services or run services.msc, find ScadaCommService and open the service properties. Then enter user account and password on the Log On page as shown in Figure 4. The specified user must be a computer administrator.

Service properties
Figure 4. Service properties