GeoScada Cvhelp
GeoScada Cvhelp
TABLE OF CONTENTS
TABLE OF CONTENTS ................................................................................................................................. 2
INTRODUCTION ...................................................................................................................................... 15
ClearView Features ..................................................................................................................................... 15
System Requirements ............................................................................................................................. 16
Operating System ................................................................................................................................ 16
Hardware............................................................................................................................................. 16
ClearView Server minimum requirements 16
ClearView Client minimum requirements 16
Run ClearView-SCADA as User or Power User ............................................................................................ 16
Registering ClearView ................................................................................................................................. 17
Running ClearView for the First Time ......................................................................................................... 20
Technical Support........................................................................................................................................ 21
SECTION 1 ............................................................................................................................................... 22
ClearView Environment............................................................................................................................... 22
Dockable Windows ................................................................................................................................. 23
Application Explorer................................................................................................................................ 23
Main Menus ............................................................................................................................................ 28
File Menu ............................................................................................................................................ 29
Edit Menu ............................................................................................................................................ 30
View Menu .......................................................................................................................................... 31
Project Menu....................................................................................................................................... 32
Format Menu ...................................................................................................................................... 33
Mode Menu ........................................................................................................................................ 34
Help Menu........................................................................................................................................... 34
Toolbar .................................................................................................................................................... 35
Status Bar ................................................................................................................................................ 37
Drawing Pad (Screen) .............................................................................................................................. 38
ActiveX Objects ................................................................................................................................... 38
Object Library Window ....................................................................................................................... 39
Properties Window ............................................................................................................................. 40
SECTION 2 ............................................................................................................................................... 42
Project Setup ............................................................................................................................................... 42
Project Files ............................................................................................................................................. 43
File Types............................................................................................................................................. 43
Creating a Project File ......................................................................................................................... 43
Client Settings ......................................................................................................................................... 45
Login Options ...................................................................................................................................... 45
Screen Settings .................................................................................................................................... 46
Server Settings ........................................................................................................................................ 46
Primary Server..................................................................................................................................... 46
Redundancy......................................................................................................................................... 46
Server Scripting ................................................................................................................................... 47
OPC Update Interval ........................................................................................................................... 47
Create Database ...................................................................................................................................... 47
Source/Destination ............................................................................................................................. 48
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 3
Alarms/Events ............................................................................................................................................. 67
Alarm Database ....................................................................................................................................... 68
Viewing the Alarm Database ............................................................................................................... 68
Understanding the Alarm Database Menu ......................................................................................... 68
Working with Alarms........................................................................................................................... 69
Alarm Groups .............................................................................................................................................. 71
Enabling/Disabling Alarm Groups ........................................................................................................... 71
Group Alarms .............................................................................................................................................. 72
Setting Group Alarm ............................................................................................................................... 72
Alarm/Event Viewer .................................................................................................................................... 74
Alarm/Event Viewer Menu ..................................................................................................................... 75
Alarm Banner ActiveX Control .................................................................................................................... 76
Alarm Banner Example............................................................................................................................ 77
Setting Default Colors ............................................................................................................................. 78
Alarm Banner Design Properties ............................................................................................................. 78
Alarm Banner Run-Time (Scripting) Properties....................................................................................... 79
Alarm Banner Methods ........................................................................................................................... 81
Alarms Set-Point Interface .......................................................................................................................... 81
Log Book...................................................................................................................................................... 82
Making an Entry in the Log Book ............................................................................................................ 82
Viewing Past Log Book Entries ................................................................................................................ 84
Alarm/Event Reports ................................................................................................................................... 84
How to Open a Log Report...................................................................................................................... 84
Alarm Log Report Fields .......................................................................................................................... 85
Event Log Report Fields........................................................................................................................... 85
Emailing Alarms .......................................................................................................................................... 85
Step 1 – Configure Project Email............................................................................................................. 85
Step 2 – Configure Users ......................................................................................................................... 86
Step 3 – Configure Alarms....................................................................................................................... 86
Referencing Alarms through Scripting ........................................................................................................ 87
SECTION 5 ............................................................................................................................................... 88
Security........................................................................................................................................................ 88
User Groups ............................................................................................................................................ 88
Add a New Group ................................................................................................................................ 89
Modify an Existing Group .................................................................................................................... 89
Delete Existing Group.......................................................................................................................... 90
Users ....................................................................................................................................................... 90
The User Form Toolbar ....................................................................................................................... 90
Create a New User .............................................................................................................................. 91
Delete User ......................................................................................................................................... 92
Scripting .................................................................................................................................................. 92
Scripting Examples .............................................................................................................................. 92
Logging In/Out ........................................................................................................................................ 93
Setting Up Auto Login User ................................................................................................................. 93
ClearView-SCADA Security Module ........................................................................................................ 94
ClearView-SCADA Security Interface to Active Directory ................................................................... 94
Active Directory Login (DomainLogin Method) .................................................................................. 98
Operational Functionality ................................................................................................................... 99
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 5
INTRODUCTION
Thank you for your purchase. Over the last twelve years ClearView has evolved into the most feature-rich SCADA
package in the world. Whether you have 1000 data points or 50,000 data points, ClearView increases your control while
lowering your overall cost.
Let’s face it – in today’s high-speed, high-tech environment, access to data is power. With ClearView, collecting,
analyzing, and reporting critical plant-floor information is now done easily and quickly across the enterprise.
This manual should have everything you need to get started on your next project. If you would like further information
on some of the “open” aspects of ClearView, just follow the web links in each section. You’ll find explanations of OPC,
ODBC, ActiveX®, Visual Basic, DCOM, and many more.
All of us understand the trust you have placed in our team with your purchase of ClearView. We are proud that you have
made this decision. We stand ready to help your success along.
ClearView Features
Open access to industrial data stored in off-the-shelf, ODBC standard databases such as Microsoft Access, SQL Server,
and Oracle, reducing the time and effort needed for reporting and sharing information with other applications.
Easy to use software reduces programming effort, making implementations quick and straightforward. Screen changes
can be made while the process remains running, increasing productivity and eliminating unnecessary downtime.
Client – server architecture, provides a flexible, network platform for distributed automation solutions and allows
remote access while securing critical data.
Redundancy can be implemented to increase system availability.
Economical and simple licensing to meet customer budgets without surprising development or increased tag count
license fees. One low price includes development, runtime, and unlimited tag count licenses.
Complete control software package includes reporting, trending, alarm e-email paging, statistical process control, and
database backup utilities for implementing total automation solutions. A complete package simplifies ordering,
budgeting and ensures you have all the tools necessary to deliver a complete solution.
Standards based software allows communication with virtually any brand of embedded controller and programmable
logic controller (PLC) with OPC drivers. ActiveX ensures easy integration with other applications.
Security features provide network-wide, individualized access and control down to the specific object level, creating fine
balance between system security and access.
Run-Time Localization provides multilingual support for run-time SCADA environment.
System Requirements
To run ClearView, we recommend the following hardware and software:
Operating System
Workstations:
- Windows 10 Professional
- Windows 8, 8.1 Professional
- Windows 7 Professional & Embedded
Servers:
- Windows Server 2008, 2012, 2012-R2, 2013 and 2016
Hardware
• Processor i5.
• 4GB RAM (multiple clients and over 1000 tags).
• 120 GB hard drive disk space.
• TCP/IP network interface adapter.
• Second TCP/IP network interface adapter for fast network communication (recommended for Redundant Server).
• Processor i5.
• 4GB RAM (multiple clients and over 1000 tags).
• 120 GB hard drive disk space.
• TCP/IP network interface adapter.
Registering ClearView
When you first start ClearView Client or ClearView Server, you can evaluate the product for 14 days. To continue using
the product after the evaluation period, you must purchase a license.
To register ClearView Client and ClearView Server software, perform the following steps:
1. Start ClearView Client/Server.
2. Open Registration interface.
a. For ClearView Server:
i. Double-click on ClearView Server Icon on the task bar. ClearView Server interface will open.
Figure #1
Figure #2
Note: Once the software is registered, the Register window will not appear. Each PC that the software will be used on
requires a purchased license.
Figure #3
Figure #4
Warning: Pressing the “Reset” would reset the current ClearView-SCADA server Customer ID. The new license Key Code
would be required. The “Reset” is only required when switching between ClearView-SCADA Server (256 tags limit, 1000
tags limit, 5000 tags limit, 10000 tags limit and Unlimited tags), and ClearView-SCADA Enterprise Server.
6 Configure tag(s).
Technical Support
ReLab Software LLC.
2401 Stanwell Drive, Suite 300
Concord, CA 94520
MAIN: 925-262-4244
FAX: 925-262-4245
[email protected]
www.relabsoft.com
SECTION 1
ClearView Environment
ClearView combines Run and Design modes into a single application interface. On creation of a new project, ClearView
displays the first screen in Design mode. Once a project is saved and reopened, all screens open in Run mode.
Thereafter, security settings control the ability of the logged-in user to switch between Run and Design modes. The
security settings also control what elements of ClearView environment are displayed and/or accessible.
This chapter discusses the key components of the ClearView environment.
The following figure illustrates the key elements of a ClearView screen in Design mode. When ClearView is switched to
Run mode, the run-time Screen replaces the Drawing Pad and hides the Object Library and Properties windows. Each
screen can be individually switched between Design and Run modes.
Drawing
Pad
Status
Bar Property
Browser
Figure # 1.1
Application Explorer – An organized dockable window that can access the complete project configuration
Menus – Access commands available
Toolbar – Provides easy access to common menu commands
Drawing Pad – A container for holding ActiveX controls and interacting with ClearView Server. When you switch to Run
mode, the Drawing Pad becomes your screen interface. You can drag and drop graphics from the Object Library to the
Drawing Pad.
• Object Library – A dockable window that accesses a library of ActiveX controls
• Properties – A dockable window that displays the properties of the selected control
• ActiveX Objects – Any graphical, numeric, text, drawing tool built on ActiveX technology
• Status Bar – Displays both alarm status and general project information
• Wizard Script – Accesses the application’s scripting capability
• Quick View – Tag database access
Dockable Windows
Dockable windows are windows that can be moved or resized within the ClearView workspace. There are three dockable
windows: The Application Explorer, the Object Library, and Properties.
To dock/undock a window, double click its title bar. You can also click and drag the window.
Note: If the Properties or Object Library windows becomes inaccessible because of moving/resizing the window beyond
window boundaries, switch to Run mode, then switch back to Design mode.
If the Application Explorer becomes inaccessible, save the project; then exit and reopen ClearView.
Application Explorer
ClearView Application Explorer uses a hierarchal representation to display ClearView project configuration tools and
screens. It shows the screens created in the project and gives quick access to database configuration tools.
Figure # 1.2
Note: Settings in Security Groups can be set to hide/unhide the Application Explorer depending on the security
classification of the user who is logged in.
To navigate Application Explorer:
Double-click the folder or click the [+] sign to expand and view folder contents.
Double-click the folder or click the [-] sign to collapse the folder.
The following table briefly describes each item in ClearView Application Explorer with possible actions and results
Item Description
Screen Name
Double Click the screen name to Open/Show screen.
Note: To edit the screen properties, right-click the screen name to see a pop-up
menu:
Screens
Item Description
Opens Alarm & Event/Event Viewer Interface.
GIS Viewer
Opens the GIS Viewer, see SECTION 13 below.
Log Book
Trend Viewer
Trends
Opens Trend Viewer Interface.
Client Scripting
Scripting Opens Client Scripting development interface.
Server Scripting
Opens Server Scripting development interface.
Item Description
Data Spy
Executes Data Spy command to open Data Spy. Allows you to see all or a
filtered list of current tag values.
Tag Database
Executes Tag Database command to open the Tag Editor to Add, Delete, or Edit
tags.
Alarm Database
Executes the Alarm Database command to open the Alarm Tag Editor to add,
delete, and edit tags.
Alarm Groups
Executes the Alarm Groups command on the Project\Setup menu to open the
Alarm Group dialog box, allowing you to select which alarm groups will be
active on the current ClearView Client station. Note: ClearView Server may
require reboot after removing an Alarm Group.
SQL Builder
Executes the SQL Builder command on the Project\Setup menu to opens the
SQL Builder dialog box.
Setup
Users Database
Executes the Users Database command to open the Users window, which
provides ability to add/edit/delete users and edit Group Security.
Object Toolbar Editor
Executes the Object Toolbar Editor command to open Object Toolbar Editor
dialog box.
Backup
Executes the Backup Command to open the File Backup dialog box, which
allows you to select files to backup in *.ZIP format.
Note: The Backup command on the File menu provides a backup of the
database and selected files
Report Editor
Opens ClearView Reports Configuration Interface (Reportizer), see SECTION 12.
Item Description
Reports Note: The Reports folder has links to display historical logs for Alarms, Events,
Audited Activities, tag Data, and Security access. A Users Report and an option
to open any external report is also available
Main Menus
This section describes the different commands available under the different menus. When the current ClearView screen
is in Run mode, the menu options for the user are different than when the screen is in Design mode. The Edit and
Format menus are hidden when the top screen is in Run mode. Mode control is accessed under the Mode menu. Each
screen has its own mode setting.
Security can be configured to allow or deny access to various commands on the menus.
File Menu
The table below describes the commands available on the File menu.
File Menu New Project Closes current project and opens Windows Open File dialog box.
If the current project has been modified, a dialog box to save the
project will display before exiting.
Open Project Closes current project and opens Window’s Open File dialog
box. If the current project has been modified, a dialog box to
save the project will display before exiting.
Save Project Saves project. The location of the saved file is specified in the
Project Settings window.
Save Project Opens Windows Save As dialog box to save the current project
As… with a different name.
Backup Project Opens the Backup Project dialog box to create a file that has all
the project information in a compressed format (*.zip).
Restore Opens the Restore Project dialog box to recreate a project from
Project a compressed file (*.zip).
Import Screen Displays Window’s Open File dialog box, allowing you to browse,
select, and import a ClearView screen file (*.css). The imported
screen is appended at the end of the screen list.
Export Screen Displays Window’s Save File dialog box, allowing you to save the
current screen in ClearView screen file (*.css) format.
Print Screen Opens the Print Screen preview window, displaying a preview of
what the screen image will look like when it is printed.
Connect The Connect command makes the client reconnect to the server.
Login/Logout The Login command on the File menu opens the Login window,
allowing you to enter a username and password to access a
project. The Logout command logs out the current user. As a
default, a logged out user is not allowed to modify screens,
project settings, database table entries, or close the application.
A project can also be set up to Auto Logout a user after a
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 30
Password Opens a dialog box that allows the user can change their login
Change password.
Edit Menu
The Edit menu commands only apply to screen edits. While the ClearView Client program is in Run mode, the Edit menu
is disabled.
Note: The Undo and Redo edit commands do NOT apply to properties within objects.
The table below describes the commands available on the Edit menu.
Edit Menu Undo Changes the screen as if the last action you preformed had never
happened. This command can be used after a deletion or undesired
change has been made.
Redo Restores the changes to the screen performed by the Undo command.
This command can be used to compare major changes in the project.
Cut Deletes an item or object from the screen while storing a copy to the
Clipboard.
View Menu
The table below describes the commands available on the View menu.
View menu App Explorer Shows/Hides the Application Explorer window. The
Application Explorer has links to most parts of a project
and can access all screens.
Show Zoom Shows the Zoom Box window, which lets a user see an
enlarged section of the screen. The Zoom Box is
centered on the section of the display that the mouse
occupies
Project Menu
The table below describes the commands available on the Project menu.
Project menu Add Screen Opens the Create Screen window that allows a user to
specify the dimensions of a new screen. The new screen is
then added to the Screens folder of the Application Explorer
window submenu
Alarms & Events sub-menu Alarm and Event Displays the Alarm/Event View window, which displays the
Viewer information View of the alarms and events that can happen
in the project.
LogBook Displays the Log Book window that lets users record the
events that happen in the project. The Log Book is described
in SECTION 4 below.
Format Menu
The commands on the Format menu are only available while a screen is in Design mode.
Note: The “Align” and “Make Same” format commands organize the object in reference to the last object selected in the
group selection.
Mode Menu
Note: The commands on the Mode menu do not apply globally to all screens; they are used to change individual screen
properties.
The Grid and Screen size have no effect when the project is in Run mode.
The table below describes the commands available on the Mode menu.
Mode menu Design Toggles the mode of the screen between design and run-time
mode. If there is no checkmark on the left side of Design,
then the topmost screen is in Run mode. Each screen has its
own mode setting.
Grid
Grid sub-menu Show Grid (Sub Shows/Hides the foreground grid consisting of the pixel point
menu) of intersecting equal distance vertical and horizontal lines.
Grid Size Displays an entry form for specifying how many pixels
between the grid lines.
Note: The screen Foreground Color property controls the grid color.
Help Menu
The table below describes the commands available on the Help menu.
Toolbar
Figure #1.3
The tools on ClearView main toolbar provide easy access to common ClearView tasks. The tools are organized and
grouped according to similar functions. A ToolTip displays the tools name when the mouse hovers over it.
The following table briefly describes each tool:
Executes the Login command on the File menu to open the Login window.
Shortcuts: [Shift] + [L] – Login
Executes the Logout command on the File menu to Logout the current user.
Shortcuts: [Shift] + [U] - Logout
Executes the Open Project command on the File menu to display the Open Project dialog
box, allowing you to browse for existing projects.
Executes the Save Project command on the File menu to save the current project to an
already specified location.
Executes the Add Screen command on the Project menu to display the Create Screen
window.
Executes the Print Screen command on the File menu to open the Print Screen window.
Executes the Undo command on the Edit menu to reverse the last screen edit. ClearView
retains the last 100 object edits.
Executes the Redo command on the Edit menu to reverse the last Undo command.
Executes the Delete command on the Edit menu to delete the selected object or group of
objects.
Executes the Cut the Object command on the Edit menu to delete the object from the
screen and store it on the Clipboard.
Executes the Copy the Object command on the Edit menu to copy the selected object or
groups of objects to the Clipboard
Executes the Paste the Object command on the Edit menu to paste the contents from the
Clipboard to the screen, if compatible
Executes the Script Assistant command on the File menu to show/hide the Script Assistant
widow.
Note: The Dynamo Object Library is not accessible under the main menus.
Status Bar
The Status Bar at the bottom of the screen displays the overall status of the project running on the ClearView Client
station.
Figure # 1.4
Note: Settings in Security Groups can be set to hide/unhide the Status Bar depending on the security classification of
each user who is logged in.
The following table describes the items contained in the Status Bar.
Item Description
Hides the Status Bar items shown to the left of the Hide button.
Figure # 1.5
ActiveX Objects
An ActiveX control is an object with properties, functions, and methods that allow interaction with ClearView Server and
the OPC Servers. ActiveX controls are programmed in various programming languages and compiled into an *.ocx or
*.dll object file.
Figure # 1.6
ClearView Screens are built totally with ActiveX objects. The objects are added to the Drawing Pads of each screen while
in Design mode. Once the screen is switched to Run mode, the ActiveX Controls become active.
Custom third-party controls can be added to ClearView library environment using the Object Tool Editor, accessible from
the Application Explorer or from the Project > Settings menu.
For information on ActiveX Technology see Appendix A.
Figure # 1.7
Properties Window
The Properties window is a dockable window. The Properties window displays the list of properties for the selected
ActiveX object. Common properties shared among a selected group can also be viewed.
The Properties window is only visible when the current screen is in Design mode.
Figure # 1.8
Note: Many ActiveX objects provide their own custom property dialog boxes. If available, use the custom properties
interface to configure the object.
SECTION 2
Project Setup
Both the ClearView Client and ClearView Server rely on the ClearView project file (*.cvp). This file is a text file containing
the configuration information defining the following settings.
Note that Tags and Alarms for a particular project are stored in the project data base. Both Client and Server are using
the data base source and credentials specified in the [ClientDB] section of the project’s .cvp file. There is a possibility to
have Client and Server to work with different databases, meaning that Client and Server are working with different sets
of Tags of Alarms. For more information visit chapter “More than one database per a setup” at the end of this section.
[ClientMisc] [ServerRedundancy]
Modified=11/21/2013 3:23:57 PM RedundancyEnabled=0
UpdateCurrScreenOnly=1 ServerName=MIKES
EnableAutoLogin=1 [ClientDB]
Autousername=admin DataProvider=ODBC
EnableGIS=0 DataSource=ClearControls
AutoLogout=0 DataSourceBack=
AutoLogoutInterval=15 DBInterval=0
AutoLogoutUser= OraUsername=User Name
EnablePsuedoPassword=0 OraPassword=Password
AnimationInterval=0 OraUsernameBack=
OPCTagInterval=500 OraPasswordBack=
OPCTagInterval1=1000 DBPurgeThreshold=
OPCTagInterval2=5000 [ClientUserInformation]
Group=Administrator Login=admin
QueueSize=10 Password=
AutoSaveIntervalMinutes=0 [EventViewer]
[ClientServer] AlarmBannerAutoResetAckAlarms=0
ServerName=127.0.0.1 AlarmBannerKeepSortingBySeverity=0
[ServerMisc] [Enterprise]
EmailServer=SMTP_Server EnableProducerRedundancy=0
[email protected] SendUpdatesInBackupMode=1
EmailSubject=Alarm
[email protected]
EmailPassword=
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 43
EmailOnAck=0
EmailOnNew=0
EmailOnClearAck=0
HBInterval=5000
HBTimeOut=10000
SSPath=C:\Program
Files\ClearControls\ClearView
EnableSS=0
SSFile=
Note: The ClearView Server should be shutdown and restarted after changing any project settings in the *.cvp file.
Project Files
File Types
The following table lists file types of files used by ClearView
File contains project settings. A corresponding *.ccp file must be located in the
*.cvp
same directory. Open the *.cvp file for normal operations
A binary graphics file. Open this file type in cases where the *.cvp file does not
exist or is corrupt. To select this file type, change the Save As Type drop-down
*.ccp
list in the Save As dialog box. A corresponding *.cvp file will be created
automatically when the project is saved.
The zip file contains at least the *.cvp and *.ccp files, and may contain more files.
The ZIP file is automatically created when a user saves a project. To select this
*.zip
file type change the Save As type drop-down list to “All Files” in the Save As
dialog box
Figure #2.1
Figure #2.1A
11. By default ClearView Client’s logs are stored in the same directory where ClearView was installed. To override
default location change the ClearView-SCADA Client Log files location path
Note: After you press OK the project file is not saved yet. It will only be saved when the project set up is complete and
the user selects Save from the File Menu. See Menus. It is possible to open a file with the extensions *.cvp, *.zip or
*.ccs.
Client Settings
The Client tab on the Project Settings dialog box defines how ClearView Client stations may log in or out and how often
the screens are updated.
Figure #2.2
Login Options
Enable Pseudo Passwords Check this option to make the Login dialog box to only require a valid
password to log into the system.
Auto Login to User Check this option to auto3matically log in the system using the selected
user account.
Auto Logout Interval Check this option to automatically log out a user after an idle interval of
time has expired.
Auto Logout to User Select this option from a drop-down list to allow a particular user account
to be logged in after an automatic logout has occurred.
Tip: You can create a user account called No User with no security
privileges for use with the Auto Logout to User account.
Screen Settings
Only Update Active Screen Several screens may be opened at once; however, only the top screen is visible.
To save system resources, only the top-most visible screen will be updated with
the latest tag values and animation.
Screen Queue Size Microsoft’s Operating Systems have limits to the number of objects opened in its
window environment. For this reason, it may be necessary to limit the number of
ClearView screens to load/open in a project. The Screen Queue Size determines
the maximum number of screens allowed to be loaded into memory. If this value
is set to 0, then all projects screens can be loaded into memory.
Server Settings
The Server tab on the Project Settings dialog box defines what ClearView Server to connect to and what, if any, server
script files to run on the Server.
Figure #2.3
Primary Server
Specify the ClearView server name to which you want to connect. Click the button to the right to browse for the running
servers.
WARNING: Do not enter or select a server if the ClearView database has not yet been created or setup.
Note: The server name can also refer directly to the IP address (XXX.XXX.XXX.XXX) of the machine where the ClearView
Server is running.
Redundancy
Specifies ClearView Server redundancy, see SECTION 19 for more information on ClearView Redundancy.
Server Scripting
Use the Server tab to select the Enable Server Scripting check box. Select a CCS file in the Server Script File setting. A
CCS file is created using the Server Script Editor. This editor is only accessible in the Application Explorer of ClearView
after a project has been created.
If you have created and saved a server script file, click the right button to browse and select the script file (*.ccs) that will
run after starting the ClearView Server.
Create Database
Note that Create Database Dialog below is designed to work with MS SQL and MS Access Database. Oracle Data base can
be created by using sql script provided with ClearView, see Create Oracle Database below.
ODBC is a type of driver that provides access to a variety of different databases. Most MS Access and SQL SERVER
databases are accessed via an ODBC driver. If you have an Oracle database installation, you may use an Oracle driver.
The data source is an instance of an ODBC connection. You can define data sources via Control Panel > Administrative
Tools >Data Sources (ODBC). The data sources that are currently defined will be displayed in the Data Source drop-down
list. During a ClearView installation a ClearControls data source is created.
Figure #2.4
User Name and Password are not required for MS Access. These settings are required for SQL SERVER and Oracle. Click
Test… to see if the database connection has been established with your configured settings.
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 48
Create DB will display the Create Database dialog box shown on Figure #2.5 below.
Source/Destination
The source file will have the (*.zip) extension. This file has to be created by the ClearView backup utility. The backup
utility is accessible via the File menu (File > Backup).
The destination folder can be any folder.
Figure #2.5
Restore Database
If the backup database was selected during the backup process, then the zip file (selected for the Source setting above)
contains a database called structure.mdb. Check Restore Database to restore the data to a new database specified in
the following settings.
Create DSN
Creates a new Datasource Name. A DSN is an instance of an ODBC driver, for example, an MS Access driver that points
to a MS Access database file (*.mdb). This new DSN will be required in the Database Settings section for the project
setting named Datasource. The Datasource setting will be saved in the ClearView project file (*.cvp).
Database The name of the database to create on the SQL Server. A user will be created for this database.
For general connection non-administrative duties, it is recommended this user be specified when
connecting to SQL Server. Specify this user in the ClearView username/password project settings
in the section Database Settings.
Access Database
If creating a MS Access database, specify a MDB filename. MS Access databases do not require a username/password to
log in.
Figure #2.6
Note: The script is designed to run only once on the same database. In case of script errors and if the database was
already created the database has to be dropped before running the script again.
Figure #2.7
To avoid unnecessary network traffic and minimize Client’s CPU consumption it is recommended to create the
configuration where ClearView server is working with a database containing all Tags and Alarms, and Clients that need
only small subsets of Tags and Alarms are reading them from other databases.
Figure #2.8
A configuration like this can be achieved by creating different projects for Clients and Server and pointing them to
different data bases. The Tags or Alarms in Clients’ databases must exist in Server’s data base, otherwise the missing
tags would receive a bad quality.
SECTION 3
Tags
A tag is a name used to refer to an associated data point, the value of which can be displayed directly or indirectly,
stored for retrieval at a later time, or read from or written to an IO device such as a PLC. The value of a tag can be based
on an address in a PLC or derived from a function that may involve several defined tags.
ClearView Server communicates to field devices using OPC 2.0 protocols. There is an intermediate layer between
ClearView Server and the PLC device known as an OPC Server. ClearView Server writes a tag value to an OPC Server and
the OPC Server writes this value to a PLC device.
ClearView provides an OPC server called CVOPC for specific PLC devices. There are other OPC Server options, for
example Kepware, which provide communication to a myriad of PLC devices.
Note: An OPC Server maintains its own set of tags. ClearView tags can be exported to a comma-separated text file to
facilitate the creation of tags for an OPC Server.
Tag Database
A summary of tag names properties in the ClearView database can be viewed using the Tag Database window. Once
open, use the scroll bars or arrow keys to select or view the tags listed in the database, or enter a filter string in the Filter
Entry field. Access to the Tag Database is controlled by the security setup.
To view the Tag Database:
1. Open Application Explorer
2. Expand the Setup folder
3. Double-click Tag Database
Note: The Tag Database can also be viewed from the Project menu, pointing to Setup, and clicking Tag Database.
Figure #3.1
Imports a *.csv file into the Tag Database. All fields must match when manually editing a
*.csv file. Imported tag names that match the existing tag name will have its fields updated,
while new tags will be appended to the database.
Exports the entire tag database to a *.csv file. An Export dialog box will appear. If you have
special characters such as “#” then select that option and specify your own delimiter,
Opens the Windows Print dialog box to print the Tag Database. The printout will show similar
columns as shown in the Tag Database window.
Tag Types
ClearView supports three types of tags:
• OPC Tags. ClearView Server communicates to IO through common OPC servers. The actual tag value may represent
any data type: string, real, long, short, floats, Boolean, or other as defined in the OPC server.
• Derived Tags. Derived tag values are the result of an expression or formula consisting of other tags in the database
and/or combined with available VB Script functions. The expression is built with the Expression Builder. The tag
value may be displayed, trended, logged, used for triggering alarms, and/or written to an IO device if assigned an
OPC address.
• Variable Tags. Variable tags are tags not tied directly to an OPC Server. They represent constants or system
information that is passed between server and client PCs.
To create a Tag, press New from the Tag Database window. The Tag Properties dialog box appears.
Figure #3.2
1. Enter a Tag name in the Name field. A Tag name can be 256 alphanumeric characters long. No spaces or dashes are
allowed in the tag name. The name should only use alphanumeric charters and the underscore character.
2. In the Description field, enter a description representing the IO point. Field length is 256 characters.
WARNING: Do not use the comma character in the description or expression fields. If you do, the importing/exporting to
a comma separated variable file (*.csv) will not function correctly.
Figure #3.3
When you select OPC Tag in the Type field, the following options will appear:
• To scale the OPC tag in ClearView, click Scale and fill in the Raw Min, Raw Max, Scale Min, and Scale Max fields.
• To clamp the values within the scaled ranges, click Clamp Low and/or Clamp High.
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 56
• To log the tag value to the History table at minimum interval, click Log and enter a log Interval. The default interval
value is set at 60 seconds.
• If you want to log a tag only during the time that a condition or event is active, then click Event Logging and select a
Tag that evaluates to a Boolean type.
• If you want to log sequence of events data (SOE logging) click SOE Logging checkbox.
Note: Logged tags are written to the database if the value changes during the log interval. If the value doesn’t
change for over a day, then there will be no additional repeated values recorded during that day. This also applies to
event correlated logged tags
Note: The timing of change depends on device respond time, OPC Server poll time and network performance.
Figure #3.4
Figure #3.5
1. On the Tag Builder dialog box, select Derived Tag in the Type drop-down list.
2. To save your changes and move to a new tag, press Add, or press OK to save and close.
Figure #3.6
The variable tag type is a system memory tag. It is not tied to any existing tag or OPC IO. Its value can represent any data
type. The length of the value field is limited to 256 characters.
1. On the Tag Builder form, select Variable Tag in the Type dropdown list.
2. To save your changes and move to a new tag, press Add, or press OK to save and close.
Trending a Tag
Check the trending option in the tag builder to allow the tag to be listed on the Trend Viewer form. The Trend Viewer
form is accessible via the Application Explorer in the Trends folder. A trend is a graphical view of tag values over a
specific period of time. Real-time trends are updated every 500 milliseconds. Historical trends must access the History
table of the ClearControls database to retrieve historical data values for a tag.
To turn on trending of a tag:
1. Create new OPC or derived tag.
2. Select the Trend property.
3. After tag set up, restart ClearView Server.
4. Open the Trend Viewer that is available via the Application Explorer in the Trends folder.
Trend Viewer
Figure #3.6A
Set’s the trend time interval for selected records (see Figure 3.6B)
Time Interval
Figure #3.6B
Save Trend
Figure #3.6c
Open Trend
Figure #3.6c
Data Logging
It is possible to log tag values based on time, interval, or event. The logged values are visible via log reports. The Data
Log Report is accessible from the Application Explorer in the Reports folder. While setting up a tag, specify in seconds
how often you want to log tag values.
Disable Data Change Logging Logs data regarless of tag change Variable Tags ONLY
Note: It is possible to overburden a system by setting the log interval too short. The log interval should be based on
computer processing power and the total number of tags logged. Event logging allows a tag to be logged whenever an
event is occurring. The event is actually another tag. Whenever the event tag resolves to true, logging will occur.
Note: A tag resolves to true for any value except for zero. An event logging causes a tag to be logged once when the
event has occurred.
Importing/Exporting Tags
Exporting tags is a convenient way to move tags from one database to another in CSV format. You may also modify a
large number of tags at once via Microsoft Excel and then re-import them into ClearView. Finally, exporting tags to a CSV
format can aid in the creation of OPC Server tags.
To export tags:
1. Navigate to the Tag Database, which is accessible via the Application Explorer in the Setup folder.
2. Click Export on the Tag Database toolbar. An Export dialog box will appear.
3. Accept the default options in the Export dialog box and click Export.
Figure #3.7
Figure #3.8
Importing tags requires a strict format. Any manual modifications to a CSV file may cause an import to fail. Therefore,
make sure all fields are correct before importing a CSV file.
1. Click Import on the Tag Database toolbar.
2. Select a CSV file in the Open dialog box.
After importing, ClearView will either report an error or the number of tags that were updated and/or inserted.
Data Spy
The DataSpy allows a user to read and write values of any tag. The Quality and Error of a tag are also visible. If the
quality is bad for a tag that is of type OPC then corrective action must be taken. This may involve checking the memory
location on the PLC device or the OPC Server configuration.
Figure #3.9
Note: Tag Quality and Tag Error fields are relevant to OPC tags only.
Figure #3.10
QuickView
QuickView is a smaller version of the DataSpy. It is useful for viewing and comparing a small number of tags.
To view a tag:
1. Click the Add Tag button on the QuickView toolbar.
2. The Select Tag dialog box will appear.
3. Select a tag from the list and click Select.
The tag will now be listed in the QuickView window. You may select another tag using the same procedure.
Figure #3.11
Figure #3.12
Now any value can be written to this tag but it would be NO updates coming to OPC Server.
On ClearView client DataSpy the color of this tag would change (white background & black text) and column “Tag
Quality” would receive a text “Local Override”.
If the user needs to put the tag back to normal the string “IO_ONLINE” should be written to the value of this tag.
Figure #3.13
The quality would immediately change to 192 [Good] and the value would be updated from OPC Server.
SQL Builder
The purpose of the SQL Builder is to perform queries and operations on a database. The grey textbox in the center of
SQL Builder dialog box will contain the SQL statement to execute. It is not possible to manually type in the statement. It
must be built using the SQL Expression Builder. Users should have a basic knowledge of Structured Query Language
before using SQL Builder.
• To view the SQL Builder, open the Application Explorer and select SQL Builder in the Setup folder.
Figure #3.14
WARNING: Please be aware that update and delete commands will update or delete the record permanently.
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 66
3. Select a table.
4. Enter a condition clause.
To execute the SQL statement:
• Alter or delete database records via the SQL Builder
To import the SQL statement:
• Import a saved SQL statement from a SQL (*.sql) file.
To export the SQL statement:
• Save current statement to an SQL file
SECTION 4
Alarms/Events
An alarm is typically a notification of an abnormal condition that exists in your process. An event is a notification of a
change in a system condition, for example a user logging on or a ClearView Client connecting to the server. ClearView
Server distributes Alarms and Events between clients and server through an alarm object that resides on both clients
and server machines. The alarm object contains the collection of alarms created by a user and the events monitored by
the system. As alarm conditions change or system events occur the server notifies all connected clients of the change.
The status of alarms can also be distributed remotely to offsite personnel. ClearView can email through an SMTP email
server to maintenance or other personnel responsible for operating the system. Alarms and events are logged through
the database server to a common table called Event_Log. Historical or current Alarms and Events can be viewed on a
ClearView Client using the Alarm/Event Viewer. Current alarms can also be viewed and acknowledged using ClearView
Alarm Banner ActiveX control.
To distinguish between active alarms and the names of individual records contained in the alarm collection, you can use
the Alarm Tag name to identify the configured record.
An Alarm Tag is added to the database by entering its properties though the ClearView Alarm Properties dialog box. The
alarm configuration includes setting the Alarm Tag name, description, alarm group, the conditional setting that raises
the alarm. It may also include who should be notified if the alarm condition changes. Alarm Tag records are stored in the
database server’s Alarms table.
Each ClearView Client station must have its Alarm Groups registered on the PC to receive notification of the alarms
assigned to the group. This allows selected groups of alarms to be viewed by selected Client stations.
When an alarm occurs it is also possible to create an entry in the Log Book.
Alarm Database
A summary of alarm tags in the ClearView Server database can be viewed using the Alarm Database window. The Alarm
Database window is used to add, edit, delete, import/export, and print the alarm tags contained in the Alarms table.
Once open, use the scroll bars or arrow keys to select or view the alarms listed in the database, or enter a filter string in
the Filter Entry field. Access to the Alarm Database is controlled by the security setup.
Tip: The Alarm Tag Editor can also be accessed from the Project menu: Select Setup and click Alarm Database.
Figure #4.1
Opens the Alarm Properties dialog for editing the selected alarm.
Imports a *.csv file into the Alarm Database. All fields must match when manually editing a
*.csv file. Imported alarm names that match an existing alarm name will have its fields
updated, while new alarm names will be appended to the database.
Exports the entire alarm database to a *.csv file. An Export dialog box will appear. If you have
special characters as a separator such as “#”, then select that character as an option.
Opens the Windows Print Dialog box to print the Alarm Database. The printout will show
similar columns as shown in the Alarm Database window.
Figure #4.2
• Alarm Name. A text string, maximum 256 characters, consisting of alphanumeric characters. No spaces or hyphens
or any non-alphanumeric character is allowed except underscore.
Tip: ISA standards provide tag-naming conventions similar to the device/tag that raises the alarm, using a
combination of prefixes and suffixes to define the particular condition that activates the alarm.
Example: LI607 may be the analog level indicator for device 607. Therefore, LAHH607 would be the alarm tag name
for the High-High Level Alarm or device 607.
• Alarm Description. A text string, maximum 256 characters. The alarm tag name and its description are
communicated when an alarm condition occurs
Note: Do not use commas in the description field, as this will cause errors when importing/exporting the alarm table
• Alarm Group. Select from existing Alarm Group names in the dropdown list or enter a new alarm group name.
Note: Alarm notifications will not be received on a ClearView Client PC until the associated Alarm Group is
enabled/registered. See Enabling Alarm Groups.
• Alarm Tag Quality. Specifies if alarm would be generated based on Tag Quality rather than on Tag Value.
• Severity. Classify the alarm by selecting one of the available severity types: Warning, Critical, Shutdown, or Interlock
plus 32 types named Priority-1, Priority-2, … , Priority-32.
• Enable Alarm. Check this to enable/disable alarm notification for this alarm.
• System Event. Check this to enable/disable system events notification. When selected the new System Group will be
created with [SE] appended to the group name entered.
• Group Alarm. Creates a group alarm. A Group Alarm is an alarm that can be queried and acknowledged as an entire
group.
• Alarm Condition. An alarm becomes active when the Selected Tag value meets the predefined condition. Likewise,
an alarm becomes inactive when the Selected Tag value does not meet the defined condition. For discrete or
Boolean (0=false=OFF, 1=true=ON) type Tags, select Alarm When Tag is OFF or Alarm When Tag is ON.
For analog type Tags, select Alarm On Value, then chose a Conditional Operator and enter the Limit value when the
alarm is to be active. To reduce alarm nuisances, enter a Deadband Absolute Value. (A value of 0 deadband applies
no deadband to the alarm evaluation.)
• Alarm Notification. If the Alarm needs to be emailed to users, enable the email notification and select the users
(Recipients) to be notified. For more information, see Emailing Alarms.
• Conditional Operators. You can use the following conditional operators:
Operator Description
= Equal to
10 = 100 < 100 + 5 or > 100 – 5 <> 100 < 100 + D/2 or > 100 – D/2
10 <> 100 > 100 + 5 or < 100 – 5 = 100 > 100 + D/2 or < 100 – D/2
• Time delay. Specifies a delay between alarm condition occurrence and notification.
Alarm Groups
Alarm notifications will not be received on a ClearView Client PC until the associated Alarm Group has been registered.
To register an Alarm Group requires enabling the Alarm Group on the client PC.
Note: Alarms associated with the selected alarm Groups will become active on the client station; however, deselecting
an alarm group requires a restart of the ClearView Client to stop receiving alarm notifications for the alarm group
removed.
Figure #4.3
Group Alarms
Group alarm is the alarm that represents all alarms in the group it belongs to. Group alarms are calculated and delivered
by ClearView-SCADA Server. Group alarms states are calculated based on the states of all (non-group) alarms in the
group.
• If one or multiple alarms in an Alarm Group is Active the Group Alarm would receive a status of Active Alarm
• If all alarms in an Alarm Group are Active and Acknowledged the Group Alarm would receive Active and
Acknowledged status, otherwise the previous state would remain
• If all alarms in an Alarm Group are Cleared and Unacknowledged the Group Alarm would receive Cleared and
Unacknowledged status, otherwise the previous state would remain
• If all alarms in an Alarm Group are Cleared and Acknowledged the Group Alarm would receive Cleared and
Acknowledged status, otherwise the previous state would remain
• If all alarms in an Alarm Group are Cleared, Reset and Acknowledged the Group Alarm would receive Cleared,
Reset and Acknowledged status, otherwise the previous state would remain
Figure #4.4
Property Required
Alarm Description No
Severity Yes
Enable Alarm No
System Event No
Email No
Note: It is recommended to have only one Group Alarm per an Alarm Group. In case if user creates more than one
Group Alarm per a group the following Message Box will be shown.
Figure #4.5
Alarm/Event Viewer
The alarm event viewer is a built-in window displaying historical and/or current alarms and security & events logs. To
open the Alarm Event Viewer:
1. Open Application Explorer.
2. Expand the Alarms and Events folder.
3. Double-click Alarm/Event Viewer.
Note: The Alarm/Event Viewer is also accessible from the Project menu:
• Choose Alarm & Events and then click Alarm & Event View.
Figure #4.6
Enter and apply a filter to historical events and security listings by a date interval.
Figure #4.7
Tip: Alarms can be acknowledged individually or collectively using the Alarm Banner control. However, if only certain
users are to be allowed to acknowledge alarms, then turn off the Alarm Banner’s User Can Acknowledge Alarm
property. To set individual user’s ACK permissions see ClearView Security SECTION 5 below.
Figure #4.8
Figure #4.9
Field Description
General
Select to allow any user the ability to acknowledge alarms through the Alarm Banner
User Can Acknowledge Alarm
Control.
Filter Group Alarms (Only) If checked then the control will display only Group Alarms.
Select to allow any user the ability to sort Alarm Banner by any column. Sorting can
Enable Sorting by Column
be descending or ascending.
Enable Adjust Column Width Select to allow any user the ability to manually adjust the column widths.
Acknowledge Alarm Group If checked then a user can acknowledge an entire Alarm Group at once.
Enter the date time format. Example: mm/dd/yy hh:mm:ss am/pm. You can enter “c”
Displayed Date Format
for common format.
Columns
Figure #4.10
Log Book
The Log Book provides a convenient method for recording notes and setting up follow-up reminders after an alarm
condition change has been detected by the operator.
To view the Log Book, navigate the Alarms and Events folder in the Application Explorer and select Log Book.
Figure #4.11
Tip: The Log Book Entry is also accessible from the Application Explorer under the Alarm and Events folder. Double-click
Log Book to open the Log Book window to view all past entries. Then press New Entry.
Figure #4.12
Alarm/Event Reports
The Alarm and Event Log Reports are built-in Crystal Reports modified to recover data from the Event_Log database
table. They provide detailed reports of when alarm/event conditions change.
Note: As the database table gets large, the reports will open slower.
Field Description
Alarm Message Displays the Alarm Description as defined in the Alarm table.
Displays the name of the user who acknowledges the alarm. The other events will
User Name
display the username as system.
Field Description
User Name Displays the name of the user associated with the event
Emailing Alarms
Alarm conditions can be transmitted as text messages to cell phones via SMTP server or to an email address over the
Internet.
There are three steps to configuring emailing alarms: (1) Configure Project Email, (2) Configure Users and (3) Configure
Alarms.
Figure #4.13
Tip: Email a message to user Joe Maintenance by entering his email address ([email protected]). Or enter a cell
phone number that can receive text messaging ([email protected]). Where the format is the cell phone
number without the dashes (925-123-4567)
Figure #4.14
Note: See the Script Reference help in the appendix for detailed information on the SubscribedAlarms Collection.
SECTION 5
Security
ClearView security controls access to the File menu, Application Explorer, Login/Logout and screen graphics. When
creating a user it is necessary to assign that user to a group. The group indicates the capabilities the user will have. To
fine tune settings for a user, a new group can be created.
In addition to access, ClearView also has built-in 21CFR part 11 requirements. These include tracking tag writes.
User Groups
ClearView security is made up of groups. Each group has permission to do certain tasks. These tasks include menus,
forms, reports, etc. It is possible to create a new group and customize the permissions for the group.
A group has a set of permissions. Each user must belong to a group. The default groups that already exist in a ClearView
database are:
• Administrator
• Operator
• Supervisor
• View Only
You access the User Groups dialog box by clicking Setup Groups on the User Form toolbar.
Figure #5.2
Figure #5.3
Users
To open the Users Form:
• Go to Application Explorer and select the Users Database icon from the Setup folder
This form is an interface to the ClearView Users database table. It contains application access security information,
telephone numbers and e-mail addresses. All fields displayed can be modified. Changes take effect immediately.
Figure #5.1
Item Description
Displays Groups dialog box. Create new, edit existing and delete existing groups.
Refreshes view.
Delete User
To delete a user, select a record and press the Delete key on the keyboard.
Scripting
Sometimes it may be necessary to use security in scripting. The following may be accomplished via scripting:
• Block users from gaining access to Menus and Forms.
• Specify zones for controls on a ClearView screen.
• Automatically login a user.
Scripting Examples
To block a user from gaining access to menus and forms:
• Create a new security group that does not include the prohibited menus, forms, toolbars, etc. There is no
scripting involved for this task. When this user logs in the security settings will take effect.
To restrict access to certain controls on a screen:
1. Use the ControlSecurity property of a control to specify a zone. For this example select 1 – Zone A.
Figure #5.4
5. After the user logs into ClearView they will receive an “Insufficient security” message box upon clicking the control.
Figure #5.5
Logging In/Out
On the main ClearView toolbar. Click Login
Figure #5.6
Note: To make this module work properly, a domain user must be assigned to just one group on the list of user’s groups
in the Domain Active Directory. These user’s group names must be identical to the names of groups that were created in
ClearView SCADA Security.
Property Description
Call DomainLogin
Note: The default user password that is automatically created by Project.AddDomainUsers would be combined of
“CV_” & “User
‘If the user doesn’t exist in ClearView database the Sub would check if the user exists in Domain Active Directory
tmpX = Security.DomainUserExists (Application.GetWindowsLoginUser, “relabsoft”, n)
‘If the user exists in Domain Active Directory the Sub will automatically add a new user based on information
retrieved from
‘the database, with the password “CV_” & “User Name” ‘First Name, Last Name and User Group
If tmpX Then
If Security.DomainUserFirstName = “” Or Security.DomainUserLastName = “” Or Security.DomainUserGroup = “”
Then
Application.MsgBox “Domain User is not properly configured”
Security.LogOut
Security.Login
Exit Sub
End If
If Security.DomainUserMiddleName <> “” Then ‘Retrieving Middle Name,
MN = “ “ & Security.DomainUserMiddleName
Else
MN = “”
End If
tmpY = Project.AddDomainUsers (Application.GetWindowsLoginUser, Security.DomainUserFirstName & MN,
Security.DomainUserLastName, Security.DomainUserGroup)
End If
‘If operation to add user was successful then the user would be logged in automatically
If tmpY Then
If Security.UnsecureLogin (Application.GetWindowsLoginUser) <> “” Then
Security.LogOut ‘ClearView logout
‘ClearView Login based on retrieved password to allow user to login
Security.Login Application.GetWindowsLoginUser, Security.UnsecureLogin (Application.GetWindowsLoginUser)
End If
End If
End If
End Sub
Figure #5.7
If such user is validated but did not exists in Clear View Users Database the user will be added to the database with the password
“CV_”&”User Name from Active Directory”, see Figure # 5.8 below.
Operational Functionality
The diagram below shows the operational flow of ClearView Security Module Interface to Active Directory.
NO No Success
YES 3 NO 2
2 Message to the user
Exit Function
YES 4 NO 6 7
Testing if user belongs to specified
3
group(s)
Figure #5.8
SECTION 6
Reports
ClearView generates reports from the data logged or stored in the database tables via a Crystal Reports Interface.
Reports can be filtered (selected), sorted, previewed, printed, or exported.
Figure #6.1
Alarms log, Audit Trail Log, Security Log, Lockout/Tagout , Data Log and Users Log are accessed from the Application
Explorer (Figure #6.1). In addition, a browser dialog box can be used to open any Custom Reports stored within your
network.
Reports Interface
Using the Application Explorer, double-click a report in the Reports folder. The “Reportizer Viewer” Interface will be
displayed (Figure #6.2). Please see the “ClearViewReports“ for further details.
Figure #6.2
Built-In Reports
To open a built-in report:
1. Open ClearView Application Explorer.
2. Expand the Report folder/subfolder (Figure #6.1).
3. Double-click the required report.
Figure #6.3
Clicking on Set Database, Set Filter or Set Sort will open the Report Settings Dialog.
Using Report Settings Dialog you can:
1. Select previously configured DSN on Database tab.
Figure #6.4
2. Filter data by Start Time and End time using Filter Tab
Figure #6.5
Figure #6.6
Alarm log
Security Log
Lockout/Tagout Log
Data Log
Note: Opening a report may take excessive time if the database table is very large. Database management should be
implemented to minimize the active tables, back up the data tables, and purge old data on a daily basis.
Note: The filter settings selected on a report are retained even when a project is closed and reopened.
Opening “Custom Reports” from a script will show a Windows file explorer. User can browse for and open a
particular report file.
SECTION 7
Tools
SQL Expression Builder
The SQL Builder is a tool to build/execute simple SQL statements. Depending on the statement built, a return value will
be displayed. SQL expressions can also be imported or exported to/from a saved file.
WARNING: The DELETE, UPDATE and INSERT INTO expressions will alter a database. Therefore, security access to the
SQL Builder should be limited.
The SQL Expression Builder allows a user to build an executable SQL statement using the following format:
ExecuteSQL( <select database>; <SQL command>)
The ACCEPT button becomes available when a valid SQL command is properly built. Press Clear, Entry, or Cancel to start
over.
You can build SQL commands using the following formats:
SELECT <select field> FROM <select table> WHERE <select field> = [enter expression] ORDER BY <select
field> DESC/ASC
DELETE FROM <select table> WHERE <select field> = [enter expression] ORDER BY <select field> DESC/ASC
UPDATE <select table> SET <select field> = [enter expression] WHERE <select field> = [enter expression]
ORDER BY <select field> DESC/ASC
INSERT INTO <select table> ( <field 1>, <field 2>, … <field N>) VALUES ( ‘[value 1]’, ‘[value 2]’, … ‘[value N]’)
Note: The <select field> or <select table> provide valid fieldname and tablename selections. For the [enter
expression], right-click to select from a popup menu for clearing the entry, entering your own string or
numeric value, or selecting a Tagname or Value from the current ClearControls database.
Backup Control
Figure #7.1
Files
The Files tab shows the list of files a user has selected for Backup. To select files and edit the list of Files to be backed up
the user should use the Add and Remove button.
Add
When the user selects Add, the Select window is displayed and the user can then select which files will be backed up.
Figure #7.2
Remove
Select a file and click Remove when you want to delete a file from the list of files to be backed up.
Option
The Option tab lets users select where the files will be copied to when they are backed up. Any folder on the computer
can be used to hold files.
Figure #7.3
Backup Enabled
The check box Backup Enabled appears dimmed if no files are in the file list in the Files tab. When the user selects a file
the Backup Enabled check-box is usable and is used to control whether the files are saved or stored. This option is
convenient for users who have many files to back up. They can make the large list and then use the check box to control
if the backup happens instead of having to create a large list every time they want to backup files.
Schedule
The Schedule tab lets a user set a time and interval for the backup or set a tag-based event to trigger the backup.
Figure #7.4
Backup Starting
The Backup Starting area has a drop-down menu you can use to select a date and time for the beginning of a backup.
Backup every
The Backup every area has a number field and drop-down menu to schedule backups on a time interval.
Event-driven Backup
The Event-driven Backup has a Select Tag button and a display box to show what tag was selected.
The Select Tag window lets you select from a list of tags and has a filter if you only want to view a smaller number of
tags.
Figure #7.5
SECTION 8
Project Backup/Restore
In order to move the project to a different location/host it is recommended to use default ClearView-SCADA
Project Backup and Restore functions
Project Backup
To create a project backup
1. Create a folder somewhere on your system.
2. Open the project which you have plans to backup.
3. On the Main Menu select Backup Project.
Figure #8.1
4. Specify the folder where the backup file would be stored – Figure #8.2.
5. If it is required additional files can be included into Backup Project by clicking on “Files…” button – Figure 8.3.
Such files could be for example GIS Configuration maps used in the project, reports and any other files related to
a project.
6. After clicking on “Backup” button the .zip files will be created which later can be used to restore the project.
Figure #8.4
Project Restore
To restore the project:
1. Create a folder somewhere on your system where you have plans to restore the project.
2. Through Main Menu select Restore Project.
Figure #8.5
Figure #8.6
Figure #8.7
SECTION 9
Designing a Graphical Interface
Screens
Screens are windows containing controls. For example, controls may be graphical objects such as a pipe, report
controls, or trend controls. After a project has been created, users with security privileges may add or edit screens.
After a screen is created, objects shown in the Object Library, the Dynamo Library, or the Shapes Toolbar can be placed
on the screen’s Drawing Pad.
Each individual screen can be placed in Design or Run mode. When a saved project is opened, all screens are placed in
Run mode.
Screen Settings
Screen settings may be set while in Design or Run mode, or programmatically through scripting.
Add a Screen
1. On the Project menu, click Add Screen.
2. Press OK when done with screen settings
Saving Screens
Screens are saved when the project is saved.
Opening/Showing a Screen
1. Open Application Explorer.
2. Double-click the screen you want to open or Right-click the screen you want to rename, and then click Open.
Screens.OpenScreen screen-name.
Rename a Screen
1. Open Application Explorer.
2. Right-click the screen you want to rename, and then click Edit. The Edit Screen dialog box appears.
3. Change the screen name to a unique name and press OK.
Delete a Screen
1. Open Application Explorer.
2. Right-click the screen you want to delete, and then click Delete.
Export a Screen
1. Open Application Explorer.
2. Right-click the screen you want to export.
Import a Screen
1. Open Application Explorer.
2. On the File menu, select Import. The Open File dialog box appears.
3. Select the file to import and press Open.
4. Provide a unique screen name and press OK.
Figure #9.1
Note: Saving a project saves the last screen size. Use Scripting to maintain desired size.
Tip: You can also size a screen by enabling Sizable and disabling Fixed Position; then in Run mode, resize the screen to
the desired size and position by dragging its borders. Finally, disable Sizable and set screen to Fixed Position.
Tip: Four popup screens are reserved for project menus (always on top)
• Project_Menu#1
• Project_Menu#2
• Project_Menu#3
• Project_Menu#4
To switch Project Menu screens in Design mode, check Edit Menu. To switch back to Run mode, uncheck Edit Menu.
Note: A project saved after a screen is resized (opens the screen at the new position and size).
Note: You cannot resize a screen when its window behavior property is not set to Sizable or Fixed. A project saved after
a screen has been resized will open the screen at the new position and size.
• Normal – The screen will be loaded and unloaded into memory as dictated by the Screen Queue Size (project
setting).
• Always Open – The screen will be loaded into memory when the project is opened, and will always be loaded
into memory.
• Never Close – The screen will not be loaded into memory until it is opened for the first time. Once opened it will
always remain in memory.
1. Press OK when done with window screen settings
Drawing Pad
Each screen consists of a Drawing Pad available when in Design mode. Color, background picture, design grid, script
update, and debug mode properties are available at that time.
Note: The Use Picture property can be used to hide the picture. This does not, however, remove the picture from
the project’s memory.
Drawing Tools
The following drawing tools are available (in order of appearance on Figure #9.2): line, arch, circle, triangle, rectangle,
rounded rectangle, free curve, free shape, and custom multisided shapes (the name “Customize” is used at the time of
mouse pointing to an icon). Each tool has settable properties. Once drawn, a drawing tool can be reshaped, resized, or
rotated.
Figure #9.2
Line
Arch
Circle
Triangle
Rectangle
Rounded Rectangle
Free curve
Free shape
Figure #9.3
2. Right-click the Drawing Tool, select Design Frame, and then click “Reshape”, “Resize” or “Rotate” Frame. The object
will now have a frame with pick points.
3. Use the mouse to grab a pick point and drag it to reshape, resize or rotate the object.
Dynamos
The Dynamo Library contains hundreds of ActiveX objects licensed from Software Toolbox Inc. to be used with
ClearView. The Dynamo library interface provides a menu list of ClearView template files (*.cvt), located in the
/ClearView/Bin/Objects/CVT directory. These template files contain similar grouped objects. Custom template files can
also be created and saved for access through the Dynamo Library interface.
Note: Each dynamo has its own unique properties. To see a dynamo’s properties, first right-click Dynamo then click an
object to see its unique properties, if available.
WARNING: If an original object is deleted from the library and the library saved, the object can only be restored by
reinstalling ClearView.
WARNING: If an original object template file is deleted or saved over, the file can only be restored by reinstalling
ClearView.
Object Library
ClearView provides a library of ActiveX objects. These objects are specifically designed for use with ClearView. ClearView
Object Library can also be customized by deleting or adding ActiveX controls using the Object Toolbar Editor. The
Object Toolbar Editor is available via the Application Explorer.
Figure #9.4
Figure #9.5
Tip: You can also select the group name by clicking the group shown in the Object Toolbar Preview window.
Note: If the file you selected has multiple ActiveX objects, then they will overlap each other. The object(s) can be moved
around in the sample Drawing Pad. ClearView uses Windows regsvr32.exe to register the control.
5. Press Accept.
6. Press Save & Exit when done editing the Object Toolbar.
Tip: You can also select the object or group by clicking the group and object shown in the Object Toolbar Preview
window.
Keyboard Shortcuts
Shortcut Description
Shortcut Description
SECTION 10
Scripting
ClearScript was created to extend the capabilities of ClearView SCADA. Scripting increases flexibility with useful
functionality. ClearScript scripting uses VB Script, a high-level scripting language developed by Microsoft®.
There are several ClearScript properties available. To access them, make sure you are in Design mode and there is no
screen objects selected. The properties box will then list the following properties: ScriptUpdate, ScriptUpdateInterval,
and DebugMode.
ScriptUpdate returns or sets a Boolean value indicating whether the CCPad is sending an Update event.
ScriptUpdateInterval returns or sets the interval between subsequent Update events.
DebugMode indicates if the script debugger will start on script execution. If DebugMode = False, then all syntax and run-
time errors will be bypassed (the script would not execute). To bypass run-time errors, use “On Error Resume Next” in
your script. This procedure will bypass errors such as division by zero, overflow, wrong data type, etc.
In the ClearScript Editor, Procedure mode displays code only for a particular procedure and Full mode displays all code.
There are two ways to enter ClearScript:
You can right-click an object and select ClearScript on the menu. This will start ClearScript in Procedure mode and only
the code for the selected object.
You can unselect all objects, right-click the workspace, and choose ClearScript from the menu. This action will start
ClearScript in Full mode and all code will be displayed
Note: Refer to MSDN article on VBScript Users Guide and VBScript Language Reference.
ClearScript Editor
To view the ClearScript Editor (Figure #10.1) double-click the Drawing Pad work area, or right-click the Drawing Pad work
area and select Edit Script.
Figure #10.1
Figure #10.2
Run/Debug Script
Undo Changes
Redo Changes
Find Text
Replace text
Opens a dialog box which displays a list of COM Objects which may
be added to the scripting
Insert/Remove Breakpoint
Figure #10.3
Description BackColor property gets or sets the background color of the Pad Object
Access Read/Write
Access Read/Write
Access Read/Write
Access Read/Write
Access Read/Write
Description PanEn property gets or sets pan enabling used for partial ZOOM
Access Read/Write
Access Read/Write
Access Read/Write
Access Read/Write
Access Read/Write
Methods
Parameter(s) N/A
Parameter(s) N/A
Events
Sub Pad_CCPadUpdate( )
Syntax ‘Your Code here
End Sub
Parameters None
Note: All standard events are implemented: Key Events, Click Events, and Mouse Events
Application Object
Properties
None.
Methods
Syntax ‘Application.ExitClearView
Private Sub Object1_Click( )
Application.ExitClearView
End Sub
Note: If the project has changed, the save Project dialog box will appear before
shutting down.
Parameter(s) N/A
Syntax
‘Application. OnScreenKeyboard
Parameter(s) N/A
Syntax ‘Application.OpenProject
Private Sub Object1_Click( )
Application.OpenProject “C:\Project\MyProject.cvp”
End Sub
Note: If the currently opened project has changed, the save Project dialog box will
appear before loading the new one.
Syntax Application.GetAvailPhysRAM
Parameter(s) N/A
Syntax Application.GetTotalPhysRAM
Parameter(s) N/A
Syntax Application.GetUsedPercentRAM
Parameter(s) N/A
Syntax Application.GetLocalComputerName
Parameter(s) N/A
Syntax Application.GetLocalIP
Parameter(s) N/A
Syntax Application.GetTotalCPU_Load
Parameter(s) N/A
Description ShellApp (Path) method opens/runs any executable file (with parameters)
Syntax ‘Application.ShellApp
Private Sub Object1_Click( )
Application.ShellApp “C:\Project\MyProject.exe /n”
End Sub
Events
None.
Screens Object
Properties
Syntax ‘Screens.ActiveScreen
Sub Pad_CCPadUpdate( )
If Screens.ActiveScreen = “Screen Name” Then
‘Your Code Here
End If
End Sub
Data Type Boolean: True – enable screens change logging, False – disable screens change
logging
Access Read/Write
Methods
Syntax X = Screens.ScreenLeft(“Screen_Name”)
Syntax X = Screens.ScreenTop(“Screen_Name”)
Syntax X = Screens.ScreenWidth(“Screen_Name”)
Syntax X = Screens.ScreenHeight(“Screen_Name”)
Note: It’s not necessary to pass any information to the other screens – Optional
Warning: When addressing ActiveX controls via PublicMethod make sure that the
referenced control is available. Make sure that the object exists (not deleted) and the
screen is not unloaded (check the screen properties)
Parameter(s) Reference
Notes:
5 prop_SystemClose Specifies customizable screen would System Close Integer Optional 0/1
8 prop_Height Specifies the Height of the customizable screen Integer Optional Numeric
9 prop_Width Specifies the Width of the customizable screen Integer Optional Number
10 prop_Left Specifies Left position of the customizable screen Integer Optional Number
11 prop_Top Specifies Top position of the customizable screen Integer Optional Number
Events
End Sub
Parameter(s) Reference
Project Object
Properties
Syntax X = Project.ClientGlobalAlarmState
ServerConnTest property gets Boolean True if the client is connected to the primary or
Description
redundant server and False if it’s disconnected.
Syntax X = Project.ServerConnTest
Syntax X = Project.PrimaryServerName
Methods
Syntax X = Project.ConnectedServer(“Server_Name”)
Syntax Project.DB_Reconnect
Parameter(s) None
Syntax Project.WindowState 1
Description IEExplorerPos(Left, Top , Width , Height ) sets Internet Explorer position and size,
return value - none
Syntax Project.ProjectDirectory
Parameter(s) None
Syntax Project.ProjectPath
Parameter(s) None
Parameter(s) None
Description ImportDomainUsers (path) method imports users from .csv file and returns the
number of successfully imported users as Long.
Syntax Project.DisableReconnectMsg(True)
Description MonitorPos (Monitor) sets monitor position for the project, return value - none
Description MousePos (Monitor) sets mouse position either to primary or to the secondary
monitor, return value - none
Description ZoomLensShape (Shape) method sets the magnifying lens shape, return value - none
Description ZoomLensSize (Width, Height) method sets the magnifying lens size in pixels, return
value - none
Description ZoomMagnification (Level) method sets the magnifying lens magnification level in
percent
Description ZoomViewMode(Mode) method sets the zoom view mode to either a lens or full
screen
Description SetGISMapPath (map As String, Path As String) set’s new path for a specific GIS map file
Description ReadArray (TagValue, cDim) method reads array of data received from OPC, returns
values in an array
Description WriteArray (Array) method returns compiled string that can be written to a tag
Description DBConfigMismatch method returns TRUE if the data bases of the ClearView Server(s)
and the ClearView Client (s) aren’t identical (tags and alarms) and FALSE if the data
bases are identical
Syntax Project.DBConfigMismatch
Parameter(s) None
Syntax
Project.AlarmEnable
Parameter(s) None
"Alarm Log"
"Audit Trail Log"
"Security Log"
"Lockout/Tagout Log"
"Data Log"
"Users Log"
For custom reports:
"Custom Reports"
Description CustomEvent “Event Message” creates user defined event and adds this event to the
database
Description CustomEvent “Event Message” creates user defined event and adds this event to the
database
Parameter(s) NoteTag (String) – specify variable tag to which the note would be assigned
0 – Opens note interface for view only
1 – Opens for view and edit
Syntax Example:
ButtonCtrl3.ControlItem0 = “test1,test2,test3,test4”
Msgbox Project.ControlItemArray ( ButtonCtrl3.ControlItem0, 2)
Events
Syntax
Private Sub Project_ExitProjectEvent( )
‘Your Code Here
End Sub
Parameter(s) None
Security Object
Properties
Description IsLoggedIn property gets Boolean value indicating if the ClearView User is Logged In
Syntax ‘Security.IsLoggedIn
Sub Pad_CCPadUpdate( )
If Security.IsLoggedIn= True Then
‘Your Code Here
End If
End Sub
Syntax ‘Security.CurrentUser
Sub Object1_Click ( )
If Security.CurrentUser= “User Name” Then
‘Your Code Here
End If
End Sub
Methods
Description Check (Zone, Reserved, ShowMsg) method checks Zone Permissions, return Boolean
(True/False). If the current user has permissions to the Zone the Security.Check will
return True , otherwise - False
Syntax ‘Security.Check
Private Sub Object1_Click( )
If Security.Check(“1”,,0) = True Then
“Your Code Here”
End If
End Sub
Description Login [UserName, Password ] method logs in a user. Using the Login method without
parameters will open user login screen, using the Login method with parameters will
login the specified user
Syntax ‘Using the Login method without parameters will open user login screen
Private Sub Object1_Click( )
Security.Login
End Sub
‘Using the Login method with parameters will login the specified user
Private Sub Object1_Click( )
Security.Login “Admin”, “ClearView”
End Sub
Syntax ‘Security.LogOut
Private Sub Object1_Click( )
Security.LogOut
End Sub
Parameter(s) None
Events
Syntax ‘Security_LoggedIn ()
Private Sub Security_LoggedIn()
‘Your Code Here
End Sub
Parameter(s) None
Syntax ‘Security_LoggedOut ()
Private Sub Security_LoggedOut()
‘Your Code Here
End Sub
Parameter(s) None
Tag Object
Properties
AuditTrailed property gets the Boolean value indicating if the tag’s Audit Trail is set,
Description
returns True if it is set and False otherwise
Syntax ‘Tags.item("Your_Tag_Name").AuditTrailed
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").AuditTrailed = True Then
‘Your Code Here
End If
End Sub
ClampHigh property gets the Boolean value indicating if the tag’s “Clamp High” is set
Description
(True/False)
Syntax ‘Tags.item("Your_Tag_Name").ClampHigh
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").ClampHigh = True Then
‘Your Code Here
End If
End Sub
ClampLow property gets the Boolean value indicating if the tag’s “Clamp Low” is set
Description
(True/False)
Syntax ‘Tags.item("Your_Tag_Name").ClampLow
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").ClampLow = True Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item("Your_Tag_Name").DeadBand
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").Deadband >= 100 Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item("Your_Tag_Name").Description
Syntax ‘Tags.item("Your_Tag_Name").Error
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").Error > 0 Then
‘Your Code Here
End If
End Sub
EventLogged property gets the Boolean value indicating if the tag is using Event
Description
Logging (True/False)
Syntax ‘Tags.item("Your_Tag_Name").EventLogged
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name"). EventLogged = True Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item("Your_Tag_Name").EventLogTag
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").EventLogTag = "Your_Tag_Name1" Then
‘Your Code Here
End If
End Sub
Expression property gets the expression for Derived Tag , applicable to derived tags
Description
only
Syntax ‘Tags.item("Your_Tag_Name").Expression
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").Expression = "Your_Text" Then
‘Your Code Here
End If
End Sub
Description Item property gets OPC Item path, for OPC Tag only
Syntax ‘Tags.item("Your_Tag_Name").Item
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").Item = "Your_Text" Then
‘Your Code Here
End If
End Sub
Description Logged property gets the Boolean value indicating if the tag is Logged (True/False)
Syntax ‘Tags.item("Your_Tag_Name").Logged
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").Logged = True Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item("Your_Tag_Name").LogInterval
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").LogInterval >= 60 Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item("Your_Tag_Name").Node
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").Node = “Your String Here” Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item("Your_Tag_Name").ProgID
Description Quality property gets OPC Tag Quality. Returns 192 for Good Quality
Syntax ‘Tags.item("Your_Tag_Name").Quality
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").Quality <> 192 Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item("Your_Tag_Name").RawMax
Syntax ‘Tags.item("Your_Tag_Name").RawMin
Syntax ‘Tags.item("Your_Tag_Name").ScaleMax
Syntax ‘Tags.item("Your_Tag_Name").ScaleMin
Private Sub Object1_Click( )
If Tags.item("Your_Tag_Name").ScaleMin < 1 Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item(Your_Tag_ID).Tag
‘ The Tag Name is retrieved based on TagID (index)
Private Sub Object1_Click( )
If Tags.item(2).Tag = “Your Tag Name” Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item(Your_Tag_Name).TagID
Private Sub Object1_Click( )
If Tags.item(“Your_Tag_Name”).TagID = 2 Then
‘Your Code Here
End If
End Sub
Description TagScale property gets the Boolean value indicating if OPC Tag Scaling is applied
(True/False)
Syntax ‘Tags.item(Your_Tag_Name).TagScale
Description TagType property gets Tag Type. OPC Tag = 0, Derived Tag = 1, Variable Tag = 2
Syntax ‘Tags.item(Your_Tag_Name).TagType
Private Sub Object1_Click( )
If Tags.item(“Your_Tag_Name”).TagType = 2 Then
‘Your Code Here
End If
End Sub
Description Trended property gets the Boolean value indicating if the Tag is Trended (True/False)
Syntax ‘Tags.item(Your_Tag_Name).Trended
Private Sub Object1_Click( )
If Tags.item(“Your_Tag_Name”).Trended = True Then
‘Your Code Here
End If
End Sub
Syntax ‘Tags.item(Your_Tag_Name).Value
Private Sub Object1_Click( )
If Tags.item(“Your_Tag_Name1”).Value = 100 Then
Tags.item(“Your_Tag_Name2”).Value = 0
End If
End Sub
Access Read/Write
Methods
None.
Events
Parameter(s) None
Description Tags_Changed ( Count, Tag, Value, Quality, Timestamp ) event occurs on Tag Change
(Update)
SubscribedAlarms Object
Warning: SubscribedAlarms’ Properties and Methods can be used only if there are subscribed alarm groups with alarms
configured. In case of no subscribed alarms the Methods and Properties below will generate errors.
Properties
End If
Next
End Sub
Description Acknowledged property gets the Boolean value indicating if the Alarm is
Acknowledged (True/False)
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").Acknowledged
Private Sub Object1_Click( )
If SubscribedAlarms.item("Your_Alarm_Name").Acknowledged = True Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").AcknowledgedTime
ACKTime = SubscribedAlarms.item("Your_Alarm_Name").AcknowledgedTime
Description Active property gets the Boolean value indicating if the Alarm is Active (True/False)
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").Active
Private Sub Object1_Click( )
If SubscribedAlarms.item("Your_Alarm_Name").Active = True Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").ActiveTime
ActiveTime = SubscribedAlarms.item("Your_Alarm_Name").ActiveTime
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").ClearedTime
ClearedTime = SubscribedAlarms.item("Your_Alarm_Name").ClearedTime
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").State
Private Sub Object1_Click( )
If SubscribedAlarms.item("Your_Alarm_Name").State = 0 Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").AlarmConfig.AlarmConditionDisplay
Private Sub Object1_Click( )
If SubscribedAlarms.item("Alarm ").AlarmConfig.AlarmConditionDisplay = “Sim1 not
in range (1:3)“ Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").AlarmConditionOperator
Private Sub Object1_Click( )
If SubscribedAlarms.item("Alarm_Name").AlarmConditionOperator = 5 Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").AlarmConditionTag
Private Sub Object1_Click( )
If SubscribedAlarms.item("Alarm_Name").AlarmConditionTag = “Tag_Name“ Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").AlarmConditionType
Private Sub Object1_Click( )
If SubscribedAlarms.item("Alarm_Name").AlarmConditionType = 2 Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").AlarmDescription
Private Sub Object1_Click( )
If SubscribedAlarms.item("Alarm_Name").AlarmDescription= “Text” Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").AlarmGroup
Private Sub Object1_Click( )
If SubscribedAlarms.item("Alarm_Name").AlarmGroup= “Text” Then
‘Your Code Here
End If
End Sub
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").Emailed
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").EmailTo
Syntax ‘SubscribedAlarms.item("Your_Alarm_Name").Severity
Private Sub Object1_Click( )
If SubscribedAlarms.item("Alarm_Name").Severity= 2 Then
‘Your Code Here
End If
End Sub
Methods
Syntax ‘SubscribedAlarms.AcknowledgeAll
Private Sub Object1_Click( )
SubscribedAlarms.AcknowledgeAll
End Sub
Parameter(s) N/A
Syntax ‘SubscribedAlarms.Item("Your_Alarm_Name").Acknowledge
Private Sub Object1_Click( )
SubscribedAlarms.Item("Your_Alarm_Name").Acknowledge
End Sub
Parameter(s) N/A
Events
Parameter(s) N/A
Description AlarmStateChanged ( AlarmID, OldState, OldIsReset ) event occurs when alarm state
changes
Parameter(s) AlarmID – Alarm Index (Alarm Name can be retrieved based on AlarmID)
OldState – The previous Alarm State. Alarmstates are:
0 - No Alarm
1 - Cleared and Unacknowledged
2 - Active and Acknowledged
3 - Active and Unacknowledged
4 – Reset
OldIsReset - Boolean: True if previously the alarm was reset or False if alarm wasn’t
reset
Debug Object
The debug object is used to troubleshoot the syntax in run-time. The debug will print errors into debug window.
Properties
Description Enable property sets or gets the Debugging mode (True/False). Debugging output
goes to the “Debug” window that can be opened through Menu: View->Debug
Window
Syntax ‘Debug.Enable
Private Sub Object1_Click( )
If Debug.Enable = False Then
Debug.Enable = True
End If
End Sub
Access Read/Write
Methods
Description SetMaxLines (lines) method sets Debug Print Maximum Lines Limit
Events
None.
LocalMemory Object
Local Memory is a GLOBAL variable for ClearView client. The variable can be access by any ClearView screen scripting
(ClearScript). The LocalMemory functions are very useful for passing references of tags, alarms or security settings.
Properties
None.
Methods
Syntax ‘LocalMemory.Value
Events
None.
Blink Object
There are four Blink objects in ClearView: Blink_F, Blink_FF, Blink_S, Blink_SS. The objects change “Interval” property
between True and False in configured time intervals.
Note: choose the Blink object that has time interval that is less than CCPad update interval.
Properties
Syntax ‘Switching (Blinking) object’s color between Red and Black if tag’s quality is bad
If Tags.item("Your_Tag_Name").Quality <> 192
If Blink_SS.Interval = True Then
Object1.BackColor = VBRed
else
Object1.BackColor = VBBlack
End If
End if
Methods
None
Events
None
Left Returns/Sets left poison (in pixels) of the control Long Read/Write
Top Returns/Sets top poison (in pixels) of the control Long Read/Write
Tag Returns/Sets any extra data for your application String Read/Write
ControlFrameColor Returns/Sets Control Mouse Over frame Color OLE Color Read/Write
ControlItem0 Returns/Sets any extra data for your application String Read/Write
ControlItem1 Returns/Sets any extra data for your application String Read/Write
ControlItem2 Returns/Sets any extra data for your application String Read/Write
ControlItem3 Returns/Sets any extra data for your application String Read/Write
ControlItem4 Returns/Sets any extra data for your application String Read/Write
ControlItem5 Returns/Sets any extra data for your application String Read/Write
ControlItem6 Returns/Sets any extra data for your application String Read/Write
ControlItem7 Returns/Sets any extra data for your application String Read/Write
ControlItem8 Returns/Sets any extra data for your application String Read/Write
ControlItem9 Returns/Sets any extra data for your application String Read/Write
Tags
Code:
Private Sub Object1_Click( )
Dim TagDesc
TagDesc = Tags.Item("Blink").Description
MsgBox TagDesc
Dim TagVal
TagVal = Tags.Item("Blink").value
MsgBox TagVal
Tags.Item("Test").value = 99
End Sub
Result: The tag by the name of Test value changed to 99.
Subscribed Alarms
Code:
Dim IsActive
Dim myAlarmState
Dim myAcknowledeged
Private Sub Object1_Click( )
'Notice the use of the alarm name test instead of a numerical index
myAlarmState = SubscribedAlarms.Item("TEST").state
MsgBox myAlarmState
IsActive = SubscribedAlarms.Item(1).active
MsgBox IsActive
myAcknowledged = SubscribedAlarms.Item(1).acknowledged
MsgBox myAcknowledged
End Sub
Result: The alarm state message box is shown. It displays a value of 0, which indicates there is no
alarm. Also, note the Alarm Group “TEST” is checked – which is required in order to access the alarm
properties. Two more message boxes will follow the state message box.
Screens
Code:
Result: The first call to ShowScreen uses a name without quotes and a name that is not a screen or a
ClearView form. This call results in an error.
Local Memory
Code:
Result: After running the LocalMemory.Save function, LocalMemory.Value can be used from any screen
to retrieve this value (100) using the key, Mystring.
Result: This code utilizes an existing system tag, Blink, which the server sets on/off every second or
example to achieve the same result without the system tag - Blink
Server Scripting
Server scripting is convenient when a script needs to run all the time. For example, after a computer is restarted and no
one has yet logged in, the ClearView client cannot be started and cannot run a script. This is called client-side scripting.
Alternatively, the script running on the ClearView Server has the ability to run as a process in the background and starts
regardless of a user logging into the computer. This is called server-side scripting.
The script is created in the ClearView client using the Server Scripting Editor. The editor can be accessed via the
Application Explorer in the Scripting folder.
Double-clicking Server Scripting will launch the Server Scripting Editor.
After you have created a script and saved the VBS file, you can exit the Server Scripting Editor and return to the
ClearView client.
Figure #10.5
Figure #10.5A
Server Logic
Server Logic is convenient way to create automatic recipe switching based on user configurable steps. The logic is
executed by ClearView-SCADA Server and runs as a process in the background regardless of a user logging into the
computer similar to server-side scripting.
The logic is created in the ClearView-SCADA Client using the Server Logic editor. The editor can be accessed via the
Application Explorer in the Scripting folder.
Double-clicking Server Logic will launch the Server Scripting Editor.
After you have created logic and saved the logic project, you can exit the Server Logic Editor and return to the
ClearView-SCADA Client.
Figure #10.1A
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 189
Figure #10.1B
Save Project As… Saves Server Logic file in different location (.vbs)
I/O Editor
Adds Project I/O which would be used later to create project functions
Figure #10.1C
Figure #10.1D
Figure #10.1E
Wizard Scripting
The Wizard Script is a set of tools developed to help user to create VBScript code automatically.
To open the Wizard Script dialog box:
1. Select your ActiveX object.
2. Click Wizard Script button
The Wizard Script dialog box appears. Use the dialog box to select scripts if you would like to animate properties or
create events.
Figure #10.6
For example, if you want the BorderColor to have the property Red:
3. Select BorderColor, then select the value Red.
Note: To delete a property from the list you will need to select the property and click icon
Figure #10.7
Note that you can select an ActiveX Control Object Property by using “ActiveX Control Object Property” dropdown list
and check Tags quality by pressing “Check Quality”
3. Select the Events tab in the Wizard Script if you want to modify your events script.
Figure #10.8
Note: To delete event from the selected list, select the event and click .
5. Double-click the event to open the script editor.
6. The script editor has the most commonly used VBScript function and procedure for your object event creation
7. Verify your script by clicking “Evaluate” button prior to clicking “OK” button
Client Scripting
Starting from version 7.1 ClearView supports Client Scripting that provides a flexible way to create global client project
scripting.
Figure #10.9
To open Client Scripting interface, double click “Client Scripting” on ClearView Application Explorer. Client Scripting
configuration window will appear (Figure #10.10)
Figure #10.10
Figure #10.11
SECTION 11
ClearView Server
The ClearView server is responsible for distributing information to all clients. This is accomplished via socket connections
using the TCP/IP protocol. The server maintains tag values and alarm states. The server also connects with an OPC Server
to retrieve OPC tag values. An OPC server is responsible for retrieving data from a PLC, relay, or other device.
Setup
The administrator must specify server settings when a new project is being created. The settings relevant to the Server
can be found under the Server and Database tabs in the Project Settings dialog box. The settings are then saved to the
project file (*.cvp). The server will prompt you for the (*.cvp) file to retrieve settings upon startup.
Connecting to Clients
Clients will constantly attempt to connect to the server. A connection will be established once the server has been
started.
The (*.CVP) file includes the following settings that are used by the server:
Database Tab
• Data Provider
• Data Source
• User Name
• Password
Server Tab
• Enable Redundancy
• Enable Server Scripting
• OPC Tags Update Interval
Please see Project Settings for more information.
Changing Database
Initially, you may have developed the project using a less capable database, for example, MS Access. However, as the
system grows you may want to upgrade to a full database management system. There are several possible scenarios for
doing this.
Scenario Instructions
Note: You must create a ClearView Project file (*.cvp) before starting the server. The project file is built using ClearView
Client software: ClearView.exe.
1. On Window’s Start menu, select Programs\Clear Controls\ClearView\ClearView Server. A message box will prompt
you to select a project.
2. Press OK.
3. On the Open dialog box, select and open your ClearView Project file (*.cvp). The ClearView Server dialog box, shown
below, will appear. The ClearView Server icon will also appear in the system tray.
4. On the ClearView Server dialog box, click Autoload Settings to always open the same project file each time the
server is restarted.
5. Hide the Server dialog box without shutting down the server by pressing the Cancel button.
Figure #11.1
Figure #11.2
Note: To redisplay the ClearView Server dialog box, double-click the server icon in the system tray.
Server Redundancy
Server redundancy requires two servers to be running on the same network. In the case of a primary server failure, the
client will connect to the Redundant Server.
To setup Server Redundancy, check the option in Project Settings on the Server tab.
After loading the project file, if redundancy is enabled, the server will automatically connect to the redundant server.
If redundancy is not enabled, then return to Project Settings and follow the procedure to enable redundancy.
If the connection is successful, the Connection Status changes from “not connected” to “connected”.
Figure #11.3
Note: The Backup Server does not accept tag updates and does not send updates to clients.
Client List
The ClearView Clients section, directly below the Redundancy section, displays a list of clients connected to the server.
The Refresh button will update the information about server redundancy and client connections.
Figure #11.4
Server Settings
Click Settings to display the server configuration settings. To make changes to the server settings, configure
the ClearView Client settings, save the project file, restart the server, and select the saved project file.
Figure #11.5
Trace
Click Trace to display a list of server events. This screen displays a list of all events that have occurred on the server.
Figure #11.6
Data View
Click Data to display Alarm & Tags information. The Data View screen allows the user to view two displays, a list of tags
and their current values and a list of active alarms.
Figure #11.7
NT Service
Figure #11.8
2. Click Add.
Figure #11.9
Figure #11.10
Tip: To ensure that the database server, like SQL Server, has had enough time to startup, add an additional service
placed before starting CVServer. A possible simple service would be a *.bat file that synchronizes time to a server on the
network. Enter a comfortable time before starting the next process, CVServer or set proper service dependencies.
Note: ClearView Server will fault on startup if the database server, like Microsoft SQL or ORACLE, has not had sufficient
time to startup first. Make sure that service dependencies are configured:
Cancel
The Cancel button will minimize the server window, making it appear as an icon in the system tray but not in the
Taskbar.
Shutdown
The Shutdown button will close or end the ClearView Server session.
Autoload Setting
The Autoload Settings check box lets the Server program “remember” which project was used last. When the check box
is selected, the Server program will automatically open the last project file that was used. When the Server is first
started the user must select a project and all the settings come from that project. If a user is working on one project for
they should use the Autoload Settings feature by checking the check box so they do not have to repeatedly select the
same project.
SECTION 12
ClearView Reports
Figure #12.1
To open report editor, double click “Report Editor” on ClearView Application Explorer.
Figure #12.2
Reports Interface
This chapter describes command-line interface between ClearView-SCADA and ClearView Reporting Module. ClearView
“Open File” ActiveX object provides ability for a direct interface to user-configured reports by executing command-line
arguments procedures.
Figure #12.3
SECTION 13
ClearView-SCADA Geographic Information System (GIS)
Registering GIS
1. Open ClearView-SCADA Client.
2. Navigate to Menu > Help > Activate GIS.
Figure #13.1
3. Contact ReLab Software and provide the Customer ID number displayed in the dialog box.
Figure #13.2
6. Restart ClearView-SCADA.
Enabling GIS
To enable GIS for a specific project:
1. Navigate to Menu > File > Project Settings.
2. Select Enable GIS check box
3. Save the project.
4. Restart Clear View – SCADA client.
Figure #13.3
Configuring GIS
Opening the Configuration Interface
In Application Explorer, double-click GIS Configuration under the Setup folder. You will be asked if you want to create a
new configuration if there is no such in the project yet. After answering “Yes” you need to provide the location for the
first map. Answering “No” will stop GIS Configuration.
Figure #13.4
ClearView installation provides sample maps. The maps by default are installed to C:\Program
Files\ClearControls\ClearView\Projects\GIS_MAPS folder.
Figure #13.5
To delete a map: select the map and then click Remove Map.
Figure #13.6
Renaming a Map
To rename a map:
1. Select the map and then click Rename Map.
2. Enter a new map name in the Map Name textbox and click OK.
Figure #13.7
Figure #13.8
To draw a junction, select the first location, click Draw Junction, then click the second location. The line will appear
between these two locations.
Figure #13.9
Figure #13.10
Changing Settings
To change the design settings, click Settings. User can change settings for Locations, Junctions and Maps.
Locations Tab
User can create multiple styles for Locations and then use them to create new or modify existing locations.
To add new location Style:
1. Switch to Locations tab.
2. Press Add. A new Style will be added.
3. Specify Style Name, Use as Default, Shape, and other properties.
You can choose one of the standard Shapes like Box, Circle or Triangle or specify a custom picture.
There could be only one Style with Use as Default property set to True. If you set it to True for one style this property
will be automatically set to False for all other styles.
Note: Use as Default property sets the style as a Global Default Style that will be used for a map for which the Map
Default Style is not specified. For example, if you open a new map and add a Location or Junction they will be added
with Global Default Style. User can also specify a map specific default style, see Maps Tab below.
Note: GIS is compatible with standard picture formats like Bmp, Jpeg, Gif, Icon, etc. When using Icons make sure they
are a single image Icons; the icon size for Normal Size should be 16x16 pixels, icon size for Selected Size should be 32x32
pixels. If you choose to use a picture instead of a shape be aware that the size of the location image is defined only by
the picture size and there is no border as it is for a shape.
Figure #13.11
Junctions Tab
User can create multiple styles for junctions and then use them to create new or modify existing junctions.
To add new junction Style:
1. Switch to Junctions tab
2. Press Add. New Style will be added.
3. Specify Style Name, Use as Default, Normal Size, and other properties.
There could be only one Style with Use as Default property set to True. If you set it to True for one style this property
will be automatically set to False for all other styles.
Figure #13.12
Maps Tab
Any time a user creates a new location or junction they will be created with a default style. If the default style is not
specified (left as <none>) then the Global Default Style will be used. The Global Default Style can be specified in style’s
properties on the Location and Junction tabs.
Maps tab allows user to specify and apply the default Location and Junction styles per a map.
To specify a map specific default style:
1. Select a map from the Maps drop-down list.
2. Select default location style from Default Location Style drop-down list (for selected map only).
3. Select default junction style from Default Junction Style drop-down list (for selected map only).
4. If you want the default style to be applied to all locations or junctions on the selected map - press Apply to All
Locations on the Map or Apply to All Junctions on the Map. You will be prompted with a confirmation message
box; press Yes to confirm the change. Note that actual change will happen after you press Ok on the GIS Settings
window. The change will not happen of you close the GIS Settings window by pressing Cancel.
Warning: Be aware that as the result of using this feature all locations and junctions’ styles will be replaced on the
selected map.
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 222
Figure #13.13
Figure #13.14
Figure #13.15
Item Description
Saves a project.
GIS Viewer
Opening the GIS Viewer
To open the GIS Viewer in Application Explorer, double-click GIS Viewer under Alarms and Events folder.
Figure #13.16
Alarm Acknowledgment
Select a specific location or junction and click Acknowledge.
If the alarm was already acknowledged the button will display Reset instead of Acknowledge.
Item Description
Private Sub Event is fired when Clicked Location or Junction Name Private Sub
Project_OnGISDblClick(ObjectName ) location or junction Project_OnGISDblClick(ObjectName )
double-clicked.
‘Place your code here
End Sub
Private Sub Project_OnGISDblClickEx( Event is fired when Clicked location or junction name, Private Sub Project_OnGISDblClickEx(
ObjectName, MapName, Device, location or junction clicked map name, Device and ObjectName, MapName, Device,
Custom ) double-clicked. Custom properties of the location Custom )
or junction.
‘Place your code here
End Sub
Map_Name = "Map_Name"
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 227
Loc1 = "Pole1"
Loc2 = "Pole2”
Loc3 = "Fault”
Zoom-in To zoom in, hold Shift key and draw a rectangle from left to right using mouse.
Zoom-out To zoom out, hold Shift key and draw a rectangle from right to left using mouse
Pan To pan, hold the left mouse button and move the mouse to the Pan position.
SECTION 14
Graphical Reports
ClearView Graphical Reports (CVGR) feature is designed for developing chart-like reports and adding those reports into
ClearView client screens. The ClearView Graphical Reports Feature is an option for ClearView Client; it is not a standard
feature.
CVGR consists of three executables:
• Report Editor (CVGraphReports.exe) – Report Editor is a design tool providing GUI for graphical report
development;
• Report Control (PrjGraphRepCtrl.ocx) – Report Control is an ActiveX control that may be placed into any ActiveX
container (ClearView Client screen, in particular) and makes possible displaying and printing graphical reports;
• Runtime Report Server (GraphRepServer.exe) – Runtime Report Server is out-of-process ActiveX server used by
PrjGraphRepCtrl.ocx for asynchronous (non-blocking) execution of long lasting operations.
Graphical Reports are stored in “report books.” These are XML files of specific structure containing definitions of one or
several reports. Reports within report book are identified by name and assigned to report book folders. The report book
folders themselves are organized into tree-like structure similar to Windows file system. A report book file’s default
extension is *.grb.xml.
Figure #14.1
Figure #14.2
3. Enter the key code (license) in the Key Code field and click Register.
Report Editor
When Report Editor starts its user interface, as shown in Figure #14.1. Here you can open a report book, select required
report, set required values for report parameters, as well as build and print the report.
Figure #14.3
• Open report book. Click Open and select a report book file. The drop-down list shows recently opened report books.
When Report Editor starts, the most recently opened report book is opened automatically. In case that report book
does not exist, an empty report book appears.
• Select required report. Using the Report Explorer panel navigate to the required report. The Report Explorer panel
may be shown/hidden using Hide Explorer.
• Set required values of parameters. Use parameters control over the chart in the right panel for this purpose.
• Provide connection string. Commonly, reports use information from the database and require database connection
information (connection string). Usually that would be an ODBC data source name (DSN). Connection string is
set/changed using “Connect” button. The database connection is not kept open, connectivity is checked when
connection string is set/changed and corresponding status is indicated on the status bar of the Report Editor. When
editor is started the most recent connection string is used automatically.
• Build the report. Click Refresh to build the report using the selected parameters.
• Print the report. Click Print to print current chart. This will show the Print Preview dialog box where the user may
select print settings and send the report to a printer.
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 244
In order to create new reports or update existing reports the user should switch to Design mode by pressing Design
Mode.
Visual Appearance
The chart types are:
• Area
• Bar
• Line
• Pie
Selecting a chart type may provide additional settings such as colors, fonts, sizes, scale, etc.
Report Data
Below is an algorithm for supplying the chart with data. That algorithm is provided in the form of a VBScript with a
specific structure. When the user requests to build the report, the script is executed using report parameters provided
by the user. The script should have code that fills the chart with the necessary data. The details will be provided in
section 3.0 Understanding Script.
Report design is stored in the report book under tag <item> with nested tags <script> and <chart> like shown below:
<report-book name="reports">
...
<item name="SimpleTagValues" type="report">
<script> ……… </script>
<chart> ………… </chart>
</item>
…
</report-book>
The chart setting and script text are stored in binary form and are not available for manual editing. Report Editor must
be used to design, build and edit reports
General Functions
In the Design mode Report Editor has extra functionality.
Figure #14.4
Main toolbar has additional buttons for creating new and saving current report book.
The Report Explorer panel has toolbar with buttons for manipulating report book contents
(adding/deleting/renaming/moving reports and folders)
• Add adds report to the current folder. The dropdown list provides possibility to choose between adding report or
subfolder.
• Delete deletes selected item from the report book.
• Rename renames selected item. A check is performed for providing name correctness: name must be unique (case
insensitive), start with letter, and contain letters, digits and underscore only.
• Organize is intended for moving reports between folders using the Cut/Copy/Paste approach. It has not yet been
implemented.
• An additional panel is shown that is intended for defining currently selected report.
• Property Advanced on the tab General tab is used for showing universal Chart Edit dialog box. This dialog box
provides rich list of settings that makes it possible for very fine-tuning of the chart.
• Property Data Source is used for defining VB Script. The details are provided below.
Understanding Script
Creating Simple Reports
In a simple case the report requires just single function BuildReport(params) to be implemented. This function is called
by the Report framework from 3 places. The value passed in the params argument depends upon the context where
BuildReport is called.
Script has access to the built-in object ChartController. This object has a set of methods facilitating report creation. The
main method is FillSeries. It has 3 arguments:
• SeriesIndex. When BuildReport is called by the framework, the chart controlled by ChartController has single series
with index 0. At this point, FillSeries may be called with SeriesIndex = 0 (in this case an existing series will be filled
with supplied data) or with SeriesIndex = 1 (in this case a new series will be created first by cloning series 0, and then
series 1 will be filled with data). When there are 2 series in the chart the method, FillSeries may be called with
SeriesIndex = 2. Here, again, a new series will be first created from series 0 and then filled with data, etc. In general,
SeriesIndex should point at available series of series next to the last available series.
• SeriesColor. Color used to draw the series. If -1 is passed for this argument, then color will be selected automatically
by some default rule.
• SeriesData. SeriesData is a two-dimensional array of series points. In case of Pie, the point is (<numeric value>,
<textual label>), for the rest of the report types the point is (<numeric X-value>, <numeric Y-value>).
The script below builds pie with slices representing Fibonacci numbers:
Function BuildReport(params)
ReDim arrChartData(6,2)
arrChartData(0,0) = 1
arrChartData(0,1) = "slice0"
arrChartData(1,0) = 1
arrChartData(1,1) = "slice1"
For i = 2 To UBound(arrChartData)
arrChartData(i,0) = arrChartData(i - 2,0) + arrChartData(i - 1,0)
arrChartData(i,1) = "slice" & i
Next
ChartController.FillSeries 0, -1, arrChartData
End Function
Result of the script execution for hard-coded Pie Report.
The script below builds 3 straight lines under different angles to X axis.
Function BuildReport (params)
ReDim arrChartData (9, 2)
For i = 0 To 9
arrChartData(i,0) = i
Next
For i = 0 To 9
arrChartData (i,1) = i
Next
ChartController.FillSeries 0, -1, arrChartData
For i = 0 To 9
arrChartData(i,1) = 2 * i
Next
ChartController.FillSeries 1, -1, arrChartData
For i = 0 To 9
arrChartData(i,1) = 3 * i
Next
ChartController.FillSeries 2, -1, arrChartData
End Function
The results of the script execution for hard-coded Line report are shown in Figure #14.6
The same result may be represented in different ways, by changing the chart settings. For the Hard-Coded Line Report,
the stairs function under the Line tab is changed to true, generating the chart in Figure #14.7.
Note: There is one special case of SQL query parameter. If parameter name starts with dollar sign ($) the value of this
parameter is considered to be comma separated list of values, and SQL query is expanded before being executed. This is
useful in case of SQL clause IN. The construct IN(@$MyParam~) is expanded the following way – if $MyParam value is
“val1,val2…valN” the result is IN(“val1”,”val2”,…,”valN”)
2. Write function GetParamDefs in the script that includes among other parameters all query parameters. Then, when
calling GetParamDefs, pass it params for the first argument and True for the last argument (or just skip the last
argument).
Sub GetParamDefs (Names, Captions, Types, DefVals, DefValTexts)
Names = Array ("DateTo", "SomeParam1", "DateFrom", "TagName")
Captions = Array ("Date To", "Some Param 1", "Date From", "Tags")
Types = Array (2, 1, 2, 1)
DefVals = Array (Now, "Def Val of Some Param", DateDiff (d, -1, Now), "Tag1")
DefValTexts = Array ("Now", "Def Val of Some Param", "DateDiff (d, -1, Now)", "Tag1")
End Sub
Sub BuildReport(param)
…
ChartController.RetreiveData SQL, params, arrResult
…
End Sub
Data Aggregation
In the special case where the data represent time sequence of numeric values that data may be processed for obtaining
a sequence of the aggregated values; The method Aggregate of ChartController may be used. That method has the
following arguments:
RawData – This is an array of the source data for aggregation. It should be 2-dim array of points (<date/time>, <numeric
value>).
AggrData – This is an output array of aggregates. It is 2-dim array of points (<interval ID>, <aggregated value>). Here
<interval ID> may be either 0-based interval index or date/time of the interval’s starting point. This depends upon the
value of the last argument of Aggregate.
AggrInterval – This variable is duration of the intervals for data aggregation (per second, minute, hour, day, month, and
year). The possible values are:
a. Const dpSec = 0
b. Const dpMin = 1
c. Const dpHour = 2
d. Const dpDay = 3
e. Const dpMonth = 4
f. Const dpYear = 5
AggrType – This variable is the type of aggregated values (simple sum, weighted sum, simple average, weighted average,
and minimum, maximum). The possible values are:
a. Const aggrSimpleSum = 0
b. Const aggrWeightedSum = 1
c. Const aggrSimpleAvg = 2
d. Const aggrWeightedAvg = 3
e. Const aggrMin = 4
f. Const aggrMax = 5
UseDateTimeAtAxisX – If this argument is True then <interval id> of the result is Date/Time, otherwise it is interval
index.
Time 9:13:30 9:13:40 9:13:50 9:14:00 9:14:10 9:14:18 9:14:32 9:14:40 9:14:50 9:15:00
Value 0 1 2 3 4 5 6 7 8 9
Time 9:15:10 9:15:20 9:15:30 9:15:40 9:15:50 9:16:00 9:16:10 9:16:20 9:16:30 9:16:40
Value 10 11 12 13 14 15 16 17 18 19
The result of aggregation over minute depending upon aggregation type will be as follows (the first column show 2
possible values of the <interval id>).
Simple Sum
Interval ID Value
0 / 9:13:00 0+1+2
1 / 9:14:00 3+4+5+6+7+8
2 / 9:15:00 9 + 10 + 11+ 12+ 13+ 14
3 / 9:16:00 15 + 16+ 17+ 18+ 19
Weighted Sum
Interval ID Value
0 / 9:14:00 3 * 10 sec + 4 * 8 sec + 5 * 14 sec + 6 * 10 sec + 7 * 10 sec + 8 * 10 sec
1 / 9:15:00 9 * 10 sec + 10 * 10 sec + 11 * 10 sec + 12 * 10 sec + 13 * 10 sec + 14 * 10 sec
As you can see here we have just 2 intervals because there are insufficient data for the first and last minute of the initial
data to calculate the weighted sum.
The value is multiplied by the time in seconds when this value holds. It is always 10 seconds in our example except the
red points like shown in the table with the source data.
Simple Average
Interval ID Value
0 / 9:13:00 (0 + 1 + 2) / 3
1 / 9:14:00 (3 + 4 + 5 + 6 + 7 + 8) / 6
2 / 9:15:00 (9 + 10 + 11+ 12+ 13+ 14) / 6
3 / 9:16:00 (15 + 16+ 17+ 18+ 19) / 5
Weighted Average
Interval ID Value
0 / 9:14:00 (3 * 10 sec + 4 * 8 sec + 5 * 14 sec + 6 * 10 sec + 7 * 10 sec + 8 * 10 sec) / 60 sec
1 / 9:15:00 (9 * 10 sec + 10 * 10 sec + 11 * 10 sec + 12 * 10 sec + 13 * 10 sec + 14 * 10 sec) / 60 sec
Minimum
Interval ID Value
0 / 9:13:00 0
1 / 9:14:00 3
2 / 9:15:00 9
3 / 9:16:00 15
Maximum
Interval ID Value
0 / 9:13:00 2
1 / 9:14:00 8
2 / 9:15:00 14
3 / 9:16:00 19
Function BuildReport(params)
ReDim params (2)
params (0) = "tag1,tag2,tag3"
params (1) = DateSerial (2011,1,1) +TimeSerial (0,0,0)
params (2) = DateSerial (2011,1,1) +TimeSerial (0,0,10)
SQL = "SELECT DateTimeStamp, HistoryValue " & vbNewLine _
& "FROM History " & vbNewLine _
& "WHERE Tag = @TagName~ " & vbNewLine _
& " AND DateTimeStamp >= @DateFrom~ AND DateTimeStamp <= @DateTo~ " & vbNewLine _
& "ORDER BY DateTimeStamp"
With ChartController
cntSeries = .GetSeriesCount(params)
For i = 0 To cntSeries - 1
arrSeriesParams = .GetSeriesParams(params, i)
.RetrieveData(SQL, arrSeriesParams, arrRawData, False)
.FillSeries i, -1, arrRawData
.SetSeriesLegendTitle i, arrSeriesParams(0)
Next
SetReportCaption "Chart for period from " & params (1) & " to " & params (2)
End With
End Function
The Script Wizard has three-tab pages for defining report settings that are used for code generation.
• On the SQL tab, define SQL Select query with parameters. The default SQL query depends upon chart type – for Pie
it selects average values of several tags for given time range, for the rest of chart types it selects all values for given
tag and time range. Use the default query or create your own query.
• On Parameters tab define the properties for the report parameters. The list of the parameters is obtained from SQL
query when Refresh from SQL is pressed. Initially parameters have order of their appearance in the query. Then the
parameters may be reordered using GUI. The order of the parameters is important because the first parameter may
be different as described in the Accessing Database Data section above (see note). Also, parameters are shown in
the Report Editor Runtime form just in this order.
• The Execution tab provides information if data aggregation should be done before showing the data in the chart. If
“Show Raw Data” is selected then the data returned by the SQL query will be shown in the chart, otherwise
corresponding data aggregation will be done.
If chart type is Pie, the Execution tab is not present.
Press OK and the Wizard will generate ready-made script for filling the chart with data.
When the Wizard is next opened, it fills its pages SQL and Params via executing script functions SQL and GetParamsDef,
correspondingly. If script functions were edited manually then corresponding changes will be reflected in the Wizard.
That is not the same for Execution. It cannot be reconstructed from the BuildReport function. Checking Update Script
makes it possible to prevent from overwriting BuildReport function by the Wizard. To prevent Script Wizard from
overwriting manual changes to Execution the Update Script check box should be unchecked.
g. The functions are executed asynchronously. For instance, Refresh returns immediately, while chart contents
are changed after refresh. When operation is completed an event OperationFinished is raised. During
execution of the current operation (refresh, print, or print preview) the functions Refresh, PrintChart, and
PreviewChart do nothing immediately returning False until the operation is finished.
‘ There are two ways to specify connection parameters, use one of them:
‘ 1 – to specify ConnectString Property where the user has to specify the ADO connection string
ctlChart.ConnectString = "Provider=MSDASQL.1; Data Source=DSN name; User ID= UserName; Password=Password"
End If
End Sub
SECTION 15
Historical Alarm and Events Control
Executable: CVDataControls.dll
Type Library: CVDATACONTROLSLib
Control: HistoryViewCtrl
Active View
Control shows historical data in 4 views.
Events 1 cvViewEvents
Security 2 cvViewSecurity
All 3 cvViewAll
Figure #15.1
Control shows data from the database that is defined using SetConnectParams method. The control does not keep a
permanent connection to the database; the database is connected only at the time of data retrieval.
Example:
Sub RefreshData ()
historyViewCtrl.SetConnectParams “ClearView”, “sa”, “password”
historyViewCtrl.ActiveView = cvViewSecurity
historyViewCtrl.Refresh
End sub
In case of an error in the Refresh method (usually this is due to missing access to the database), the control keeps
showing data that it had before Refresh called.
Default Time Range Property
The time interval is used to select data from the database while an additional filter is applied to show just those data
retrieved from database that meets some extra criteria.
Example:
historyViewCtrl.DateFrom = “20111003 183045000”
historyViewCtrl.DateTo = “20111010 183045000”
Figure #15.2
Filtering
Time Range Filtering Method
The range time interval is used to query the database for a specific time range.
Figure #15.3
Name 1 cvColAlarmName
Description 2 cvColAlarmDescription
Source 3 cvColAlarmSource
Severity 4 cvColAlarmSeverity
Group 5 cvColAlarmGroup
Status 6 cvColAlarmStatus
Source 1 cvColSource
Severity 2 cvColSeverity
Message 3 cvColMessage
Source 1 cvColSource
Severity 2 cvColSeverity
Message 3 cvColMessage
Source 1 cvColSource
Severity 2 cvColSeverity
Message 3 cvColMessage
No Filter 0 cvCompNoFilter
Equal 1 cvCompEqual
No Equal 2 cvCompNotEqual
Greater 3 cvCompGreater
Less 5 cvCompLess
Includes 8 cvCompIncludes
Is One Of 9 cvCompIsOneOf
No Filter 0 cvCompNoFilter
Equal 1 cvCompEqual
No Equal 2 cvCompNotEqual
Greater 3 cvCompGreater
Less 5 cvCompLess
Includes 8 cvCompIncludes
Is One Of 9 cvCompIsOneOf
No Filter 0 cvCompNoFilter
Equal 1 cvCompEqual
No Equal 2 cvCompNotEqual
Greater 3 cvCompGreater
Less 5 cvCompLess
Includes 8 cvCompIncludes
Is One Of 9 cvCompIsOneOf
No Filter 0 cvCompNoFilter
Equal 1 cvCompEqual
No Equal 2 cvCompNotEqual
Greater 3 cvCompGreater
Less 5 cvCompLess
Includes 8 cvCompIncludes
Is One Of 9 cvCompIsOneOf
Resizing Columns
To resize columns programmatically, use the ColumnWidthXXX properties. XXX identifies the column and is the name of
corresponding column on cvViewAlarms view or column name plus suffix identifying view for other views.
• View Alarm History [Width Property]
o ColumnWidthTimestamp
o ColumnWidthAlarmName
o ColumnWidthAlarmDescr
o ColumnWidthSource
o ColumnWidthSeverity
o ColumnWidthGroups
o ColumnWidthStatus
• View Events [Width Property]
o ColumnWidthTimestamp_Events
o ColumnWidthSource_Events
o ColumnWidthSeverity_Events
o ColumnWidthMessage_Events
• View Security [Width Property]
o ColumnWidthTimestamp_Security
o ColumnWidthSource_Security
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 270
o ColumnWidthSeverity_Security
o ColumnWidthMessage_Security
• View All [Width Property]
o ColumnWidthTimestamp_All
o ColumnWidthSource_All
o ColumnWidthSeverity_All
o ColumnWidthMessage_All
Figure #15.4
An alternative way is to have the ColumnWidth property use the ColumnIndex parameter. This method applies to the
current view.
Columns Visible/Invisible
To resize columns programmatically, use the ColumnVisibleXXX properties. XXX identifies the column and is the name of
corresponding column on cvViewAlarms view or column name plus suffix identifying view for other views.
• View Alarm History [Visible Property]
o ColumnVisibleTimestamp
o ColumnVisibleAlarmName
o ColumnVisibleAlarmDescr
o ColumnVisibleSource
o ColumnVisibleSeverity
o ColumnVisibleGroups
o ColumnVisibleStatus
• View Events [Visible Property]
o ColumnVisibleTimestamp_Events
o ColumnVisibleSource_Events
o ColumnVisibleSeverity_Events
o ColumnVisibleMessage_Events
• View Security [Visible Property]
o ColumnVisibleTimestamp_Security
o ColumnVisibleSource_Security
o ColumnVisibleSeverity_Security
o ColumnVisibleMessage_Security
• View All [Visible Property]
o ColumnVisibleTimestamp_All
o ColumnVisibleSource_All
o ColumnVisibleSeverity_All
o ColumnVisibleMessage_All
An alternative way is to have the ColumnVisible property use the ColumnIndex parameter. This method applies to the
current view.
Changing Colors
Figure #15.5
• Control Back Color (BackColor)
• Acknowledged Alarm Raw Color (BackColorAcknowledged)
• Active Alarm Raw Color (BackColorActive)
• Cleared Alarm Raw Color (BackColorCleared)
• Header Color (BackColorHeader)
• Acknowledged Font Color (ForeColorAcknowledged)
• Active Alarm Font Color (ForeColorActive)
• Cleared Alarm Font Color (ForeColorCleared)
• Header Font Color (ForeColorHeader)
The properties change the colors used when in Design and Run mode.
Changing Fonts
Figure #15.6
The properties are for changing colors when in Design and Run mode.
ctrlHistoryView.Font.Bold ctrlHistoryView.HeaderFont.Bold
ctrlHistoryView.Font.Charset ctrlHistoryView.HeaderFont.Charset
ctrlHistoryView.Font.Italic ctrlHistoryView.HeaderFont.Italic
ctrlHistoryView.Font.Name ctrlHistoryView.HeaderFont.Name
ctrlHistoryView.Font.Size ctrlHistoryView.HeaderFont.Size
ctrlHistoryView.Font.Strikethrough ctrlHistoryView.HeaderFont.Strikethrough
ctrlHistoryView.Font.Underline ctrlHistoryView.HeaderFont.Underline
Methods reference
“password” is password
historyViewCtrl. ClearSortCols
Data are sorted via clicking the control’s historyViewCtrl. AddSortCol 1, cvSortAscending
header. It is also possible to sort data
AddSortCol historyViewCtrl. AddSortCol 4,
programmatically. This way the data may
be sorted by several columns. cvSortDescending
historyViewCtrl. Refresh
historyViewCtrl. SetCustomColors
SetCustomColors Changing colors programmatically
cvAlarmCleared, VBRed, VBWhite
Applies filter:
Figure #15.7
Figure #15.8
SECTION 16
ClearView Historian Control
Executable: CVDataControls.dll
Type Library: CVDATACONTROLSLib
Control: TagHistoryCtrl
Active View
Control shows historical data in 4 views.
Simple 0 cvViewTagValues
Aggregates 1 cvViewTagAggregates
Maximums 2 cvViewTagMax
Minimums 3 cvViewTagMin
Figure #16.1
Example:
Sub RefreshData()
TagHistoryCtrl.SetConnectParams “ClearView”, “sa”, “password”
TagHistoryCtrl.ActiveView 0
TagHistoryCtrl.Refresh
End sub
In case of an error in the Refresh method (usually this is due to missing access to the database), the control keeps
showing data that it had before Refresh was called.
Example:
TagHistoryCtrl.DateFrom = “20111003 183045000”
TagHistoryCtrl.DateTo = “20111010 183045000”
Figure #16.2
Filtering
Time Range Filtering Method
The time range interval is used to query the database for a specific time range.
Figure #16.3
Filtered Columns
TagFilterColumn (property)
Name 0 cvTagName
Decryption 1 cvTagDecr
Filtered Operators
TagFilterOper (property)
No Filter 0 cvCompNoFilter
Equal 1 cvCompEqual
No Equal 2 cvCompNotEqual
Greater 3 cvCompGreater
Less 5 cvCompLess
Includes 8 cvCompIncludes
Is One Of 9 cvCompIsOneOf
Aggregation
Figure #16.4
Time Aggregation
AggregationRange (Property)
Use SQL Filter (ServerFiltering) Property. Provides more efficient database querying.
Resizing Columns
To resize columns programmatically, use the ColumnWidthXXX property. XXX identifies the column and is the name of
corresponding column name.
TimeStamp ColumnWidthTimestamp
Tag Name ColumnWidthTagName
Tag Description ColumnWidthTagDesc
Tag Value ColumnWidthTagValue
Tag Max Value ColumnWidthTagMax
Tag Min Value ColumnWidthTagMin
Tag Simple Average ColumnWidthTagSimpleAvg
Tag Weighted Average ColumnWidthTagWeightedAvg
Tag Sum ColumnWidthTagSum
Figure #16.5
Columns Visibility
To change columns visibility programmatically, use the ColumnVisibleXXX property. XXX identifies the column and is the
name of the corresponding column.
Description Property
TimeStamp ColumnVisibleTimestamp
Tag Name ColumnVisibleTagName
Tag Description ColumnVisibleTagDesc
Tag Value ColumnVisibleTagValue
Tag Max Value ColumnVisibleTagMax
Tag Min Value ColumnVisibleTagMin
Tag Simple Average ColumnVisibleTagSimpleAvg
Tag Weighted Average ColumnVisibleTagWeightedAvg
Tag Sum ColumnVisibleTagSum
Changing Colors
Figure #16.6
Changing Fonts
Figure #16.7
The properties are for changing the colors when in Design and Run mode.
TagHistoryCtrl.Font.Bold TagHistoryCtrl.HeaderFont.Bold
TagHistoryCtrl.Font.Charset TagHistoryCtrl.HeaderFont.Charset
TagHistoryCtrl.Font.Italic TagHistoryCtrl.HeaderFont.Italic
TagHistoryCtrl.Font.Name TagHistoryCtrl.HeaderFont.Name
TagHistoryCtrl.Font.Size TagHistoryCtrl.HeaderFont.Size
TagHistoryCtrl.Font.Strikethrough TagHistoryCtrl.HeaderFont.Strikethrough
TagHistoryCtrl.Font.Underline TagHistoryCtrl.HeaderFont.Underline
Methods Reference
“password” is password
TagHistoryCtrl. ClearSortCols
Data are sorted via clicking the control’s
header. It is also possible to sort data TagHistoryCtrl.AddSortCol 1, cvSortAscending
AddSortCol
programmatically. This way the data may TagHistoryCtrl.AddSortCol 4, cvSortDescending
be sorted by several columns.
TagHistoryCtrl.Refresh
Applies filter:
Figure #16.8
Figure #16.9
Implementation
Hourly data range assumed. The single tag is considered.
Example 1
T1 = 10:00:00.000
T2 = 15:00:00:000
The output will be as follows:
Example 2
T1 = 10:00:00.100
T2 = 15:01:00:000
The output will be as shown in the table below:
Calculating Aggregates
v2
v1 v5
v4 v6
v7
v3
10 11 12 13 14
t t2 t3 t4 t5 t6 t7
1
T1 T2
Figure #16.10
So, we have time range from sometime before 10:00 and sometime after 14:00. The History table contains records for
times t1, . t7, and their corresponding values v1, … v7.
The table below shows how Max, Min SimpleAVG and WightedAVG are calculated.
11 Max(v1,v2,v3) Min (v1, v2, v3) (v1+v2+v3) / 3 (v1*(t2-t1) + v2*(t3-t2) + v3*(11-t3)) / (11 –
t1)
12 Max (v4, v5) Min (v4, v5) (v4+v5)/2 (v3*(t4-11) + v4*(t5-t4)+v5(12-v5)) / (12 -
11)
Drawbacks
Calculation of the Min, Max, and SimpleAvg does not have a clear mathematical meaning. Just formal values over
sample points are calculated.
Let us consider Min value of the tag over the interval from 11 to 12. The above formula proceeds from the assumption
that on that time interval the tag had just values v4 and v5 (v6 belongs to the next interval). The value there must be
somewhere between v3 and v4; hence, the minimal tag value is less than v4 as the current example shows.
So, when telling about mathematically-justified approach, one should consider statistical assessment of tag value
changes based on the sample points provided in the History table. Sure, for this one must first interpolate function
describing tag value change over the time.
11 For 11 there is no data because we do not have sufficient information for the interval from 10 to 11.
WeigtedAVG requires no correction.
12 Max (v3, v4, v5) Min (v3, v4, (v3+v4+v5)/3 (v3*(t4-11) + v4*(t5-
v5) t4)+v5(12-v5)) / (12 - 11)
14 max (v6, v7) min (v6, v7) (v6 + v7) / 2 (v7 * (t6 - 13) + v7 * (14
– t7)) / (14 – 13)
SECTION 17
CVPLOT ActiveX Object
Follow these steps to configure the CVPLOT ActiveX Object:
1. Select Plot Object from Object Library | Data Controls folder. See A in Figure #17.1).
2. Draw the object on ClearView SCADA screen.
Figure #17.3
AuxLinesColor Set’s or returns auxiliary line Long (OLE Color) Plot1.AuxLinesColor = 255
color
BackColor Set’s or returns control back Long (OLE Color) Plot1.BackColor = 255
color line color
ForeColor Set’s or returns the plot frame Long (OLE Color) Plot1.ForeColor = 255
color
PlotBackColor Set’s or returns the plot back Long (OLE Color) Plot1.BackColor = 255
color
X_TextColor Set’s or returns the color of the Long (OLE Color) Plot1.X_TextColor = 255
X-Axis text color
Y_TextColor Set’s or returns the color of the Long (OLE Color) Plot1.Y_TextColor = 255
Y-Axis text color
Figure #17.4
Figure #17.5
Figure #17.6
Plot1.AuxLinesStyle = 1
0 - Solid line
1 - Dashed line
AuxLinesStyle Set’s or returns auxiliary line style Integer 2 - Dotted line
3 - Dash-Dotted line
4 - Dash-Dot-Dot line
5 - Invisible line
Dim i
Dim n(100)
Dim m (100)
R = CDbl (60)
For i = 0 To 360
n(i) = Sqr (R ^ 2 - i ^ 2)
m(i) = Sqr (R ^ 2 - (Sqr (R ^ 2 - i ^ 2) ^ 2))
Next
Plot1.SetCurve 0, vbRed, 0, n, m
R = CDbl (80)
For i = 0 To 360
n(i) = Sqr (R ^ 2 - i ^ 2) + 15
m(i) = Sqr (R ^ 2 - (Sqr (R ^ 2 - i ^ 2) ^ 2)) + 8
Next
Plot1.SetCurve 1, vbBlue, 0, n, m, 2
x = Abs(Rnd(50)) * 10
y = Abs(Rnd(50)) * 10
Plot1.SetPoint 6, vbGreen, 11, 0.7, x, y
Plot1.ClearData 0
Plot1.ClearData 1
Plot1.ClearData 3
Plot1.ClearData 4
Plot1.ClearData 5
Plot1.ClearData 6
2 - Dotted line
3 - Dash-Dotted line
4 - Dash-Dot-Dot line
5 - Invisible line
Plot1.UserScaleXY 2, vbRed, 1, 1
SECTION 18
CVTREND ActiveX Object
Follow these steps to configure the CVTREND ActiveX Object:
1. Select Trend Object from Object Library | Data Controls folder. (See A in Figure #18.1)
2. Draw the object on ClearView SCADA screen.
Figure # 18.1
3. Right click CVTREND object and select the CVTrend1.CVTrend Object property.
Figure #18.2
Figure #18.3
CVTrend1.EnablePropertiesDlg=
Enable Property True (or False)
Enables or disables property dialog box in run-time. Boolean
Dialog
Enable Follow Enables or disables property “X” axis follow mode CVTrend1.EnableFollowModeBT
Boolean
Mode Control (button). = True (or False)
CVTrend1.EnableZoom = True
Enable Zoom Enables or disables area zooming. Boolean
(or False)
X_Axis Color Specifies the color of the X-Axis. OLE_COLOR CVTrend1. X_Axis_Color = 16576
Curve1_Color (1-10) Specifies colors for each of the OLE_COLOR CVTrend1. Curve1_Color = &H000040C0&
pens.
Figure #18.5
Pen Line Type Specifies pen line types Integer CVTrend1.Curve1_LineType = 1 ‘**
Warning 1: The trend values can only be of a double data type. It is recommended you check the value before executing
the script.
Warning 2: When the line width on the curve is not equal to 1px (default), the trend draw procedure is very
complicated. This may lead to a considerable restriction of the system performence when large datasets are processed.
If IsNumeric(Tags.item("Sim1").Value) = True
CVTrend1.CurveValue1 = Tags.item("Sim1").Value
End If
** Line Types
• Normal line = 0
• Dashed line = 1
• Dotted line = 2
• Dash-Dotted line = 3
• Dash-Dot-Dot line = 4
• Invisible line = 5
Figure # 18.6
Figure #18.7
Note: Click A to refresh the table names. Click B to refresh table field names.
DSN Name Specifies the ODBC data source name String CVTrend1.DSN_Name = "ClearControls"
User Name Specifies the database user name String CVTrend1.User_Name = "Admin"
Tag Field Name Specifies tag name filed String CVTrend1.Tag_Field = "Tag"
Figure #18.8
Figure #18.9
SECTION 19
Redundancy
Basic ClearView-SCADA Redundancy
Figure #19.1
Figure #19.2
Description of Redundancy
Two ClearView-SCADA servers work in parallel; one of them, however, is configured to be the primary, while the other is
configured to be the backup. At any given time only one server can be operating in active mode. The active server may
be either of the servers. The decision as to which is the primary or backup as well as when to change is made via
heartbeat exchange between servers. The following rules apply here:
• If the server is inactive, and the peer also reports its mode as inactive, the conflict is resolved in favor of the
primary server. That is, the primary server steps up to active mode, while the backup server remains in inactive
mode.
Database Redundancy
• On startup each ClearView-SCADA server would establish a connection to its corresponding database. If the
database is not available the server would continue testing connection until connection is established. After the
fourth attempt the server will show a window notifying that the connection is not established yet. The user will
have an option to cancel connection attempts by pressing Ok button. If eventually the server connects to the
database the notification window will be closed.
• After successful startup each ClearView-SCADA Servers periodically checks the health of its own database based
on setting specified in project file “Database Connection Interval Timeout”. If connection to the database is lost
and current status ClearView-SCADA server is Primary the state of the server would change to Backup and peer
ClearView-SCADA server would be promoted to Primary.
Configuration Settings
Each client and server instance should have its own individual configuration, even though these configurations have
much in common. The configurations should be consistent in order to make redundancy work correctly.
The following options from the *.cvp file are involved in configuring the basic redundancy and they must have values as
described in the table below.
Used by Used by
Name Description
Server Client
[ClientServer]
[ClientDB]
Used by Used by
Name Description
Server Client
[ServerRedundancy]
[ServerMisc]
HBTimeOut Defines how long the server should wait for the x
subsequent heartbeat from the peer before stepping
down to the inactive mode.
Note: Option values of [ClientServer]. ServerName and [ServerRedundancy] ServerName are used in the following way:
• ClearView-SCADA Client - for connecting to the primary and backup servers. In client’s *.cvp file, the value may be a
host that is pingable from the ClearView-SCADA client’s host. User can specify an IP Address, Machine Name, or
Domain Name of the host where corresponding ClearView-SCADA server is configured to run.
• ClearView-SCADA Server – to identify itself at runtime as primary or backup server by comparing itself against the
computer name where it is running. Also, it is used by the primary server to establish a heartbeat connection with its
peer. If IP address or domain name is used for this option value, the server attempts to resolve the computer name
from that information. Depending, however, upon the configuration on the computer when the server is running,
this may not always succeed. In particular, “localhost” and “127.0.0.1” should never be used. Hence, it is highly
recommended you use short computer names for the discussed option values.
Figure #19.3
backup ClearView-SCADA Server. For the client, primary server and backup server the settings should be the same
(Figure #19.4).
Figure #19.4
Database Connection Timeout Interval – specifies how often ClearView-SCADA Server would check database
connectivity health.
MS SQL Server objects. These objects are generated on top of the basic redundant configuration using a special utility
that will be described later.
Figure # 19.5
HistoryBuf Table The same as History table but having extra [id] column
EventLogBuf Table The same as EventLog table but having extra [id] column
LastReplicatedIDs Table This table has single record having columns for storing id of
the last records from HistoryBuf and EventLogBuf tables,
correspondingly, that were merged by the peer SQL server
into its History and EventLog tables.
tr_History Trigger Trigger for insert into History table. Duplicates inserted
records in the HistoryBuf table
tr_EventLog Trigger Trigger for insert into EventLog table. Duplicates inserted
records in the EventLogBuf table
sp_PurgeHistoryReplicationData Stored Deletes records from HistoryBuf table that were already
Procedure merged by the peer into its History table.
sp_PurgeEventLogReplicationData Stored Deletes records from EventLogBuf table that were already
Procedure merged by the peer into its EventLog table.
sp_PullHistoryReplicationData Stored Copies records from HistoryBuf table of the peer into this
Procedure server’s History table and purges copied records.
sp_PullEventLogReplicationData Stored Copies records from EventLogBuf table of the peer into this
Procedure server’s EventLog table and purges copied records.
Any time the records are inserted into the History or EventLog tables they are copied into corresponding buffer tables.
The [id] column of these tables automatically acquires a sequence number of the record.
Once a minute the job_PullDataFromPeer is called. It selects from the peer server the records from the buffer tables
with [id] larger then “last replicated id” taken from the LastReplicatedIDs table, inserts those records into the
corresponding table, modifies LastReplicatedIDs table, and purges the buffer tables on the peer server.
Note: there is special provision in the triggers that prevents from duplication of the records that are inserted during
job_PullDataFromPeer execution.
Figure # 19.6
The user needs to input the necessary information to connect the primary and backup database servers and then click
Configure. The utility will create required objects on SQL Servers.
Note: the user must provide logins that have privileges sufficient for creating and/or modifying SQL Server objects
described above.
Figure #19.7
Description
Provided that there is a primary and a redundant Consumer, the Producer just needs to communicate with the two
Consumers in parallel.
Configuration Settings
The options Host and BackupHost are used for making the Producer connect to primary and backup Consumers. These
options are from ProducerAPI.cfg file located in the “Bin” folder of the ClearView-SCADA deployed on the Producer’s
machine. The options should be edited manually, and their values should be IP addresses of the corresponding hosts.
Figure #19.8
<Producer Name> may be provided in the option Name located in the ProducerAPI.cfg file. If not provided, the producer
uses computer name for producer name.
WARNING: One cannot guarantee that the computer name resolved by the producer on startup will stay the same
among restarts because it depends upon an OS setup that may change over time. Hence, in order to provide a robust
configuration, it is highly recommended to set producer names explicitly even if they coincide with the computer names.
If the client application behind the Consumer knows how names of the primary and backup Producers match, it may
match corresponding tags. This way the ClearView-SCADA Server works behind the consumer. This is done in the
following way.
The project for this server includes tags for the items of the primary producer only. For instance, for the “SomeTag”, the
above tags database should include the tag “SomeTag” with the ID Producer.PrimProd.$SomeTag.
In addition, the server uses a file that maps primary-backup producers. This file name is similar to <Project
Name>.cvp.prod, is located in the same folder as the <Project Name>.cvp file, and contains the lines:
<Primary Producer Name>=<Backup Producer Name>
For Each Primary/Backup Producer Pair when ClearView-SCADA server opens a project, it checks for the value of the
EnableProducerRedundancy option in the *.cvp file. If the value equals 1, it reads information from <Project
Name>.cvp.prod file. Then for each tag in the project, it registers two items against the consumer OPC Server—one with
the item ID in the tags database, and another with the item ID of the matching tag. In our example, “SomeTag” would
have the item ID Producer.PrimProd.$SomeTag. In this case, the following two items would be registered:
Producer.PrimProd.$SomeTag and Producer.BackProd.$SomeTag.
After that the updates from consumer OPC Server (write from the ClearView-SCADA Client) for any of the items
Producer.PrimProd.$SomeTag and Producer.BackProd.$SomeTag are considered by CV Server as updates of the
“SomeTag”. Symmetrically, the writes for “SomeTag” will trigger writes for both items.
In this way, the ClearView-SCADA Client connected to ClearView-SCADA Enterprise Server will be aware of a single tag;
the fact that it is duplicated in two producers will not be noticed.
Recommended Configuration
1. Configure basic redundancy for Producer ClearView Servers
2. In ProducerAPI.cfg files of each producer set the value for option Name equal to the name of the corresponding
computer
3. In the project file (cvp) used by each producer set option SendUpdatesInBackupMode equal 0 and
EnableProducerRedundancy equal 1. Or use ClearView-SCADA project settings GUI interface form
Figure #19.9
7. On the Tag Database screen create required tags for items from primary producer(s) only.
Figure # 19.10
8. Click Producers.
9. On the form that appears, define Primary/Backup producer pairs.
10. Save the project.
Figure # 19.11
Figure #19.12
SECTION 20
Enterprise ClearView Server
Registering ClearView-SCADA Server (Enterprise Producer)
1. Open ClearView-SCADA Server Interface
2. Navigate to Main Toolbar > Settings > Register
Figure # 20.1
Figure #20.2
Figure #20.3
Figure #20.4
3. Copy the code and forward the customer code to ReLab Software
4. Enter the license code provided by ReLab Software
5. Click Register button
6. Restart OPC Server
Figure #20.5
Figure #20.6
2. Expand all folders (Producer, OPC, Derived, Variable and Alarm) and map required items
3. Save Configuration
Now all of the Producers tags and alarms are available to any connected OPC Client (ClearView –SCADA Enterprise)
Figure #20.7
Figure #20.8
SECTION 21
SQL Server Backup and Restore
Registering SQL Server Database Backup and Restore Application
How to register your software
1. Start Database Backup/Restore Configuration Console
2. Retrieve Customer ID number
3. Contact ReLab Software and provide the Customer ID number
4. Enter the Key Code provided by ReLab Software
5. Click Register button
Figure #21.1
Figure #21.2
NT Service
The ClearView-SCADA server requires that you start the SQL Server Database Backup and Restore application as an NT
Service. To do this, perform the following steps:
1. Click the NT Service icon
Figure #21.3
2. Click Register. The message box will appear confirming that the service is has been registered.
Figure #21.4
3. Select Service Type- Automatic from the drop-down list, and then click Start Service. A message box will appear
confirming that the service is has been started.
4. Click Exit to return to the Backup and Restore configuration console.
Figure #21.5
Tip: To ensure that the SQL Server database starts before SQL Server Backup/Restore Service “CVB” Service
Make sure that service dependencies are configured:
Configuring Databases
Click Databases in the SQL Server Database Backup and Restore configuration console to configure SQL Server
databases. You will need to authenticate yourself to SQL Server database before proceeding with database
configuration. The interface provides two options depending on which primary database has been selected:
• Configure the existing database
• Create a new database
Figure #21.6
Figure #21.7
Restoring Data
To restore data, specify day or days of the data that needs to restored, then click Restore.
The data will be restored to the database that was specified above.
Figure #21.8
Figure #21.9
SECTION 22
ClearView-SCADA Object Animation Interface
ClearView-SCADA introduces new expression driven object animation module which allows for example dynamic
coloring of objects such as power lines, switches, breakers, etc. The new feature is capable of coloring and animating
very complex systems such as multi-source topology. Internal logic execution provides high performance and
configurability in SCADA graphics animation.
The idea of ClearView Animation is to provide a User Interface to configure logical conditions that will trigger changes of
an object’s control items that in turn can be used in ClearView Wizard to change other object properties like Foreground
Color, Background Color, line type, thickness, etc.
Configuration
Adding Objects (Controls) to Animation Configuration
Objects can be added only to a currently active screen
1. To make a screen active, double-click it in the Application Explorer.
2. Put selected screen in Design mode.
3. Right-click selected screen and select List Controls (Figure #22.1).
Figure # 22.1
Two methods are available to add objects to animation configuration console. Added objects will appear in Controls list.
• A user can select required objects from dropdown of List Controls (Shift + Mouse Click) (Figure #22.3)
• A user can select objects on the screen (Shift + Mouse Click, Figure #22.4)
Note: Single click without holding the Shift key would select a single object
• Right-click selected items in List Controls to display a context menu as shown on Figure #22.2
Figure # 22.2
• Add Object(s) – Adds object references to the Animation Editor and opens Animation Editor (Figure #22.5)
Figure # 22.3
Right clicking selected items on the screen will display a context menu as shown on Figure #22.4.
Figure # 22.4
Figure #22.5
Figure #22.6
Figure #22.7
Figure #22.8
Note: The list in Source Tags and Triggered Tags are used to optimize animation performance; therefore, it is
recommended that you use only the tags that are necessary for the Animation and will be used in Conditions.
Figure #22.9
Note: Because aliases can be used instead of tags, the Alias name should not be the same as another tag name. Also, the
Animation Editor will prevent you from having an Alias name the same as another tag name and will generate an Error
Message.
Figure # 22.10
Each ControlItem property has 10 states. Each state is triggered by a corresponding Condition. If the first Condition is
evaluated to as TRUE, then the value of 1 will be assigned to the ControlItem. If the second Condition is TRUE, then the
value of 2 will be assigned to the ControlItem, and so on until 10. Note that the Conditions are evaluated in order, from
one 1 to 10. The first TRUE condition triggers an assignment of corresponding values to the Control Item and further
evaluation stops.
See also information provided in the tables on Table 22.1 and Table 22.2. The tables show the returned value of control
property in abnormal cases.
Figure #22.11
User has an ability to evaluate an expression before submitting it. Clicking Evaluate Expression opens the Tags Value
Simulation interface (Figure #22.12). The user can enter any values for a particular tag and evaluate an expression by
clicking Evaluate.
Figure #22.12
Figure #22.13
• Operators (multiple buttons) – any mathematical or logical function can be added by utilizing the Expression Builder
interface. Although the operators and tags can be added manually, it is recommended that you use the drop-down
lists and buttons.
Copying Expressions
ClearView Animation Editor allows you to Copy and Paste conditions. A condition can be copied by using Copy and Paste
buttons at the bottom of the screen or by using context menus. The last can be invoked by right-clicking the mouse
(Figure #22.14).
Figure #22.14
Figure #22.15
ControlItem(s)
Description
Values
11 Expression evaluation returns Bad Tag Quality Error - tag(s) quality is BAD
Any negative value Expression evaluation returns expression error: the error is written in the
following format <Error Code>.<expression ordinal number>. See error codes
below in the table for Script Error Codes Written to ControlItem(s) Properties (see
below).
Table #22.2
-6 Overflow
-7 Out of memory
-432 File name or class name not found during Automation operation
Exports configuration.
Note: Controls that have no properties assigned are not saved in Export file.
Table #22.3
10/22/2013
DateTime 18:12
_SysConsumerBackupIP Tag1
_SysPrimaryServerRole Tag2
_SysSquare Tag4
CVSecurityLogin Tag6
_SysRedundancySwitch Tag3
_SysTickMin Tag5
<<Tag1>> <<Tag2>>
ATextCtl45 ControlItem0 = 50 = 120
<<Tag3>>
BKR6 ControlItem3 = 100
Figure #22.16
Implementation
Before you configure the animation, add a Wizard Script to the object that you want to animate. You can create your
Wizard Script for one object and it you copy the object the script will be copied too. If, for example, the object name you
want to animate is 35KVLine1, then the copied object would receive the new name 35KVLine2 and all associated scripts
would be transposed to the new object.
Figure #22.17
Table #22.4
Green Bus35K_Line1.ControlItem0 = 1
Red Bus35K_Line1.ControlItem0 = 2
Brown Bus35K_Line1.ControlItem0 = 3
Blue Bus35K_Line1.ControlItem0 = 4
A previously configured animation will automatically set ControlItem(s) property according to configured expressions.
SECTION 23
Screen zooming and resizing
ClearView allows you to specify how object will be located on the screen at runtime. The following modes are available:
Original size, Fit Screen, Fit Screen Width, Fit Screen Height, and Zoom. The Zoom mode allows you to change the zoom
ratio at runtime, either programmatically or with the keyboard or mouse.
Zoom and Resize properties can be changed either in Design mode by changing Drawing Pad properties or at runtime
from the script.
Figure #23.1
Code Description
Pad.FitMode = 1 Set ClearView-SCADA screen to fit the monitor (width and height)
Figure #23.2
SECTION 24
Lockout/TagOut
Overview
North American Electric Reliability Corporation (NERC) and Critical Infrastructure Protection (CIP) Common standards
require that any mechanical or electrical equipment can be locked out and tagged out before being worked on.
ClearView-SCADA lock-out/tag-out function ensures that controllable objects (tags) in the application are properly
secured prior to and during maintenance or servicing work. The tag-out state can easily be identified by the user. When
a specific Data Item is tagged a user would not able to execute a write to the specified lockout tag.
In multiuser environment number of people can lockout specific equipment. All users are allowed to request a
supervisor acknowledgement in order to remove the equipment lockout. The supervisor acknowledgement can be done
only after all users would remove equipment lock.
ClearView-SCADA provides a historical view of all changes which were made to the system. The changes such as lockouts
can be easily retrieved and analyzed.
Figure #24.1
Upon successful login the LockOut/TagOut screen is opened in Current Tagging mode.
Figure #24.2
Figure #24.3
Figure #24.4
Figure #24.5
Note: Any user with permissions for the zone is considered as a Supervisor for the Tagging meaning he can acknowledge
and remove tagging for a Data Item.
Supervisor Acknowledgement
If current user has the same zone permissions as it is set for the acknowledgement, the Acknowledge button is enabled.
Pressing Acknowledge will clear the tagging and the Data Item will be moved from Current Tagging to History.
Tagging History
Figure #24.6
History view has two windows similar to Current Tagging – Tagged Items and Tagging and tagging information for all
cleared Data Items. The view can be filtered by date (from/to), tag name and equipment name.
If redundant ClearView server and redundant database are not specified then on tagging changes ClearView client
updates database and then sends update notification to ClearView server. If at the moment of changes ClearView
Server is not running the changes are still saved in data base and server will read tagging information upon startup.
If redundant ClearView server and redundant database are specified in the configuration the client will update primary
database and then update backup database. If for some reason backup database is not accessible the ClearView Client
will revert the changes in primary database. ODBC error message will be displayed. In the last case the changes to
tagging will not be made. To resolve this situation a user needs to make sure that both (primary and redundant)
databases are available at the moment of changes.
In the case if primary or redundant ClearView Server is not available the Tagging Editor will generate the following
message (Figure 24.7).
Figure #24.7
Figure #24.8
The exclamation mark means that such record will become active only after Repair is pressed. Option to Repair the
records is available when both CV Servers are running and accessible.
Figure #24.9
After successful Repair the record becomes active meaning the Data Item is tagged.
Note that Repair action for a record can be performed only by the user who created the record.
Figure #24.10
Scripting example:
If Tags.item("BREAKER 1").Tagged = True then
‘Indicate that the BREAKER 1 is locked out here
Else
‘Indicate that the BREAKER 1 not locked out here
End If
SECTION 25
Users database synchronization module (CVDBSync)
ReLab ClearView SCADA includes a module that performs Users and User Groups synchronization between multiple
instances of ClearView Database.
CVDBSync files
1. CreateMR.sql – script to create Master Repository if MSSQL is used;
2. CVDBSync.cfg.xml –saved configuration;
3. CVDBSyncConsole.exe – configuration utility to create configuration, register, start and stop
CVDBSyncSvc.exe service;
4. CVDBSyncExe.exe – internal use;
5. CVDBSyncLib.dll – internal use;
6. CVDBSyncSvc.exe – service for User(s) database synchronization, appearing under the name CVDBSyncSvc in
Services when registered;
7. DBSyncLR.mdb – internal application use, Local Repository for application, must not to be moved or
changed;
8. DBSyncMR.mdb – Master Repository for MS Access type of DB. Must be the only one for the whole set of
Clear View SCADA User databases assigned for synchronization;
Where to install
• One CVDBSync Service is required per one instance of Clear View SCADA database, so you need to install as
many instances of CVDBSync Services as the number of CV databases you need to synchronize.
• Only one CVDBSync Service per host can be installed.
• If you are using MS Access for Clear View SCADA databases it is advised to install CVDBSync Service on the same
hosts where the Clear View databases reside. Otherwise it is advised to setup CVDBSync Service on the same
host as Clear View SCADA that has access configured to Clear View database.
• Master Repository must be the only one for all CVDBSync Services, and must be accessible for read/write
operations from all hosts where CVDBSync Services installed.
Installation procedure
1. Install CVDBSync Service on all hosts included into synchronization process and install only one Master
Repository for the whole system.
2. Follow the installation procedure and choose what you need for each host. During the installation you will
be asked what type of setup you want, see Figure #25.1.
Figure #25.1
If you choose Complete - the Master Repository will be installed to specified location.
Custom setup type allows installing either CVDBSync Service with Local Repository or only Master Repository (no service
files will be included) or both (default).
Custom screen is shown on Figure #25.2.
Figure #25.2
- Choose the features you need, change installation directory if needed and press Next.
- Follow the installation wizard to finish the installation.
Note: Master Repository files will be ignored if not used (not configured to use).
Warning: When you install CVDBSynch Service an empty file for Local Repository (DBSyncLR.mdb) is always present. Do
not change or move it.
Configuration
Make sure to provide full permissions to access Master Repository. If you use MS Access for Master Repository – it will
be the directory where the file DBSyncMR.mdb resides.
If you use MS SQL for Master Repository - create a database in MSSQL Server and run script CreateMR.sql to create
required database structure.
Create DSN to access Master Repository. It must be done on each host where CVDBSync Service is installed.
1. Go to Control Panel;
2. Open Administrative Tools;
3. Open Data Sources (ODBC);
4. Open tab System DSN and add either MSSQL type of DSN or MS Access type in case you choose to use file
DBSyncLR.mdb as Master Repository.
5. Create DSN for CVDBSync Service to access Clear View SCADA database (Figure 3).
6. Start CVDBSyncConsole.exe, open tab Configuration (Figure 3) and provide DSN name to access Master
Repository and DSN to access Clear View Users database. Configure also how often service should access Clear
View database to check for an update and how often service should report to Master Repository about the
changes in local Clear View Users database.
7. Provide user names and passwords For MSSQL type of Master Repository and Clear View database.
8. Save configuration.
Figure #25.3
Figure #25.4
Figure #25.5
To stop CVDBSync Service start CVDBSyncConsole.exe and click “Stop Service” (Figure 6) or use Services from Control
Panel.
When service is stopped you may unregister it (Figure #25.5) by clicking “Unregister”.
Figure #25.3
Note: It might happen that during the time service was requested to be terminated it was at the stage of accessing
database. In this case it will continue to run in order to avoid database corruption. In this case (even status for service is
not defined anymore as running) you will see CVDBSyncSvc.exe on the list of running processes (make sure you check
“Show processes from all users” to see it). The safest way to start service again is to reboot a host (if service is assigned
to be run automatically). For manual type of service reboot the host and start service again manually.
- Operations with User or Group record in Clear View database (deleted, updated or added) will be reported into
Master Repository by local service and replicated to all hosts by other services.
Troubleshooting
- If replication services experience a problem to access Master Repository because of the database corruption it
might be restored to the initial state without stopping local services. It is recommended to keep copy of an
empty Master Repository file or MSSQL script for creating Master Repository from scratch in case something
goes wrong with Master Repository database. Make sure host with Master Repository location is NOT accessible
for the local services during fixing a problem.
- Replacing Master Repository with an empty one or restoring MSSQL type of Master repository to the initial
condition will fix Master Repository database issues and local services will restore the content again when
Master Repository is fixed and.
- Check log files CVDBSync.log and CVDBSync_Critical.log for errors and problems. The synchronization services
are able to restore connection to Clear View database and to Master Repository in cases like network disruption,
SQL server unavailability, host reboot etc.
SECTION 26
ClearView Localization
Figure #26.3
Figure #26.4
Figure #26.5
Select appropriate language from “Current System locale” dropdown and click “OK”. The system will prompt you to
restart your machine.
Note: ClearView provides an ability to add additional languages programmatically. All translated words are entered into
comma separated value (CSV) file. To modify or to add additional languages open and edit the CVLocalization file
Program Files\ClearControls\ClearView\Bin\Objects\CVLocalization.csv.
SECTION 27
Text to Speech Interface
ClearView-SCADA provides an interface to Microsoft Text to Speech Engine. This functionality can be used, for example,
to enable audible alarms.
Prerequisites: Microsoft Text to Speech SDK version 5.1 or higher must be installed on the computer:
• SpeechSDK51.exe - required
• SpeechSDK51LangPack.exe – Optional (if another than English Language is required)
Speech SDK 5.1 is available from Microsoft and can be downloaded from: www.microsoft.com/en-
us/download/details.aspx?id=10121
Property Description
Gets and sets the alert boundary, which specifies how a speaking
AlertBoundary
voice pauses itself for alerts.
Gets and sets the flag that specifies whether the voice is allowed to
AllowAudioOutputFormatChangesOnNextSet
adjust its audio output format automatically.
AudioOutput Gets and sets the current audio output object used by the voice.
AudioOutputStream Gets and sets the current audio stream object used by the voice.
EventInterests Gets and sets the types of events received by the voice.
Gets and sets the interval, in milliseconds, after which the voice's
SynchronousSpeakTimeout synchronous Speak and SpeakStream calls will time out when its
output device is unavailable.
Voice Gets and sets the currently active member of the Voices collection.
Volume Gets and sets the base volume (loudness) level of the voice.
Method Description
Pauses the voice at the nearest alert boundary and closes the output device,
Pause
allowing it to be used by other voices.
Causes the voice to skip forward or backward by the specified number of items
Skip
within the current input text stream.
Speak Initiates the speaking of a text string, text file or wave file by the voice.
Gets an event handle from the voice that will be signaled when the voice finishes
SpeakCompleteEvent
speaking.
SpeakStream Initiates the speaking of a text stream or sound file by the voice.
Blocks the caller until either the voice has finished speaking or the specified time
WaitUntilDone
interval has elapsed.
APPENDIX A
OLE for Process Control Overview (OPC)
This specification describes the OPC COM Objects and their interfaces implemented by OPC Servers. An OPC Client can
connect to OPC Servers provided by one or more vendors.
OPC
Server
Vendor A
OPC
OPC Client Server
Vendor B
OPC
Server
Vendor C
Different vendors may provide OPC Servers. Vendor-supplied code determines the devices and data to which each
server has access, the data names, and the details about how the server physically accesses that data. Specifics on
naming conventions are supplied in a subsequent section.
OPC
Server
Vendor A
OPC
OPC Client 1 Server OPC Client 2
Vendor B
OPC
Server
Vendor C
OPC Client 3
At a high level, an OPC server is comprised of several objects: the server, the group, and the item. The OPC server object
maintains information about the server and serves as a container for OPC group objects. The OPC group object
maintains information about itself and provides the mechanism for containing and logically organizing OPC items.
Group
Item 1
Item 2
Item 3
The OPC items represent connections to data sources within the server. An OPC item, from the custom interface
perspective, is not accessible as an object by an OPC client. Therefore, there is no external interface defined for an OPC
item. All access to OPC items is via an OPC group object that contains the OPC item; in other words, where the OPC item
is defined.
Associated with each item are a Value, Quality, and Time Stamp. The value is in the form of a VARIANT, and the Quality
is similar to that specified by Fieldbus.
Note: Items are not the data sources. They are just connections to them. For example, the tags in a DCS system exist
regardless of whether an OPC client is currently accessing them. The OPC item should be thought of as simply specifying
the address of the data, not as the actual physical source of the data that the address references.
Scada Physical
OPC I/F Physical I/F
System I/O
OPC
Application OPC I/F
Server
Figure #A.4
Figure #A.5
The OPC Specification specifies COM interfaces (what the interfaces are), not the implementation of those interfaces
(that is, not the how of the implementation). It specifies the behavior that the interfaces are expected to provide to the
client applications that use them. Included are descriptions of architectures and interfaces that seem most appropriate
for those architectures. Like all COM implementations, the architecture of OPC is a client-server model where the OPC
Server component provides an interface to the OPC objects and manages them. There are several unique considerations
in implementing an OPC Server. The main issue is the frequency of data transfer over non-sharable communication
paths to physical devices. Thus, we expect that the OPC Server will either be a local or remote EXE, which includes code
that is responsible for efficient data collection from a physical device.
An OPC client application communicates to an OPC server through the specified OPC custom and automation interfaces.
OPC servers must implement the custom interface, and optionally may implement the automation interface.
An inproc (OPC handler) may be used to marshal the interface and provide the additional item-level functionality of the
OPC Automation Interface. Refer to the figure below:
Physical device
Database
Data
It is also expected that the server will consolidate and optimize data accesses requested by the various clients to
promote efficient communications with the physical device. For inputs (Reads), data returned by the device is buffered
for asynchronous distribution or OLE for Process Control (OPC) synchronous collection by various OPC clients. For
outputs (writes), the OPC Server updates the physical device data on behalf of OPC Clients.
For more information please visit: http://www.opcfoundation.org/
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 383
APPENDIX B
ActiveX Technology
An ActiveX control is essentially a simple OLE object that supports an interface called IUnknown. It usually supports
many more interfaces in order to offer functionality; but all additional interfaces can be viewed as optional and, as such,
a container such as the ClearView Drawing Pad should not rely on any additional interfaces being supported. By not
specifying additional interfaces that a control must support, a control can efficiently target a particular area of
functionality without having to support particular interfaces to qualify as a control. As always with OLE, whether in a
control or a container, it should never be assumed that an interface is available, and standard return-checking
conventions should always be followed. It is important for a control or container to degrade gracefully and offer
alternative functionality if a required interface is not available.
It is important for controls that require optional features, or features specific to a certain container, to be clearly
packaged and marketed with those requirements. Similarly, containers that offer certain features or component
categories must be marketed and packaged as offering those levels of support when hosting ActiveX Controls. It is
recommended that controls target and test with as many containers as possible, and degrade gracefully to offer less or
alternative functionality if interfaces or methods are not available. In a situation where a control cannot perform its
designated job function without the support of a component category, that category should be entered as a
requirement in the registry to prevent the control being inserted in an inappropriate container.
These guidelines define those interfaces and methods that a control can expect a container to support, although as
always, a control should check the return values when using QueryInterface or other methods to obtain pointers to
these interfaces. A container should not expect a control to support anything more than the IUnknown interface. These
guidelines identify what interfaces a control can support and what the presence of a particular interface means.
APPENDIX C
OLE DB/ODBC
OLE DB Providers Overview
OLE DB architecture is built upon the precept of an application accessing diverse data stores through a small application
built specifically for that purpose. The application that uses OLE DB functionality is called the consumer, while the one
that accesses the data by exposing OLE DB interfaces is called the provider.
How does this relate to ClearView?
Providers fall into two categories: those providing services and those providing data. A service provider encapsulates a
service by producing and consuming data through OLE DB interfaces. It does not own its own data and, in reality, serves
a dual role of consumer and provider. A service provider may also be further defined as a service component, which
must work in conjunction with other service providers or components. The Cursor Service for OLE DB is an example of
this. A data provider owns its own data and exposes it in tabular form. It is not dependent on other providers—service
or data—to provide data to the consumer. Providers can be simple or complex, depending on the needs of the
consumer. They can return data intact or perform operations on the data. A set of mandatory interfaces is required to
expose the minimal level of functionality supported by the data store. OLE DB providers are not required to support the
complete OLE DB interface. Optional interfaces can be used for additional functionality.
Because providers are made up of COM components that contain a series of standard interfaces, consumers can access
them using any programming language.
For more information please visit: http://msdn.microsoft.com/
ODBC Overview
®
The Microsoft Open Database Connectivity (ODBC) interface is a C programming language interface that makes it
possible for applications to access data from a variety of database management systems (DBMSs). The ODBC interface
permits maximum interoperability—an application can access data in diverse DBMSs through a single interface.
Furthermore, that application will be independent of any DBMS from which it accesses data. Users of the application can
add software components called drivers, which interface between an application and a specific DBMS.
For more information please visit: http://msdn.microsoft.com/
APPENDIX D
Meeting 21 CFR Part 11 Requirements
ClearView-SCADA software offers components and tools to help the user in meeting the requirements of the 21 CFR part
11 regulations applicable to FDA validated processes. It will be assumed, in this specification, that these components and
tools will only be used in “closed” systems. Digital signatures are used in “open” systems and so are not applicable in this
specification.
Definition of a closed system: A closed system is an environment in which access is controlled only by persons who are
responsible for the content of electronic records of the system.
Persons who use closed systems to create, The ClearView customer shall ensure
modify, maintain, or transmit electronic electronic record authenticity, integrity and
records shall employ procedures and confidentiality.
controls designed to ensure the
authenticity, integrity, and, when
appropriate, the confidentiality of
electronic records; and to ensure that the
signer cannot readily repudiate the signed
record as not genuine. Such procedures and
controls shall include the following:
Use of secure, computer-generated, time- ClearView logs all alarms and events in the
stamped audit trails to independently Event Log. Additionally, tags can be
record the date and time of operator configured to be audited, such that any
entries and actions that create, modify, or user-initiated changes to the tag are
delete electronic records. Record changes recorded in the Event Log.
(e) shall not obscure previously recorded
information. Such audit trail documentation
shall be retained for a period at least as
long as that required for the subject
electronic records and shall be available for
agency review and copying.
Use of authority checks to ensure that only ClearView uses a two-part User ID and
authorized individuals can use the system, password combination to authenticate a
electronically sign a record, access the user. ClearView can be programmed to
(g)
operation or computer system input or automatically log out a user after a period
output device, alter a record, or perform of inactivity.
the operation at hand.
Use of device (e.g., terminal) checks to The ClearView customer should reference
determine, as appropriate, the validity of any applicable validation protocols, e.g.,
(h)
the source of data input or operational the hardware IQ.
instruction.
The establishment of, and adherence to, The ClearView customer shall be
(j) written policies that hold individuals responsible for developing policies and
accountable and responsible for actions procedures to support the use of the
initiated under their electronic signatures,
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 387
(1) Adequate controls over the distribution of, The ClearView manuals are offered in a
access to, and use of documentation for read-only format. Customers should ensure
system operation and maintenance. that operation and maintenance manuals
are protected and maintained.
(2) Revision and change control procedures to The ClearView manuals are maintained
maintain an audit trail that documents under a revision control system.
time-sequenced development and
modification of systems documentation.
Persons who use open systems to create, The ClearView customer shall be
modify, maintain, or transmit electronic responsible for developing policies and
records shall employ procedures and procedures to support the use of the
controls designed to ensure the application in an FDA-regulated
authenticity, integrity, and, as appropriate, environment.
the confidentiality of electronic records
from the point of their creation to the point
of their receipt. Such procedures and
controls shall include those identified in §
11.10, as appropriate, and additional
measures such as document encryption and
use of appropriate digital signature
standards to ensure, as necessary under the
circumstances, record authenticity,
integrity, and confidentiality.
(1) The printed name of the signer Each ClearView Event Log entry includes
the full printed name of the user.
(2) The date and time when the signature was Each ClearView Event Log entry includes a
executed. time stamp of the event.
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 388
The meaning (such as review, approval, Each ClearView Event Log entry includes a
(3) responsibility, or authorship) associated message with a description of the event.
with the signature.
The items identified in paragraphs (a)(1), The ClearView Event Log can be exported
(a)(2), and (a)(3) of this section shall be in a human-and-machine-readable format,
subject to the same controls as for as well as included in reports using Crystal
(b) electronic records and shall be included as Reports.
part of any human readable form of the
electronic record (such as electronic display
or printout).
Each electronic signature shall be unique to The ClearView User Manager prevents the
(a) one individual and shall not be reused by, creation of duplicate user IDs.
or reassigned to, anyone else.
(2) Persons using electronic signatures shall, The ClearView customer shall be
upon agency request, provide additional responsible for certifying the equivalence of
certification or testimony that a specific electronic and traditional handwritten
electronic signature is the legally binding signatures.
equivalent of the signer's handwritten
signature.
(1) Employ at least two distinct identification ClearView uses a two-part User name and
components such as an identification code password combination to authenticate a
and password. user.
(i) When an individual executes a series of ClearView scripting has the ability to force
signings during a single, continuous period user logout and login before a variable can
of controlled system access, the first signing be changed.
shall be executed using all electronic
signature components; subsequent signings
shall be executed using at least one
electronic signature component that is only
executable by, and designed to be used
only by, the individual.
(ii) When an individual executes one or more ClearView supports login time-out, after
signings not performed during a single, which the two-part user name and
continuous period of controlled system password must be re-entered to resume a
access, each signing shall be executed using session. The ClearView customer should
all of the electronic signature components. also implement policies requiring a user to
log out before leaving the workstation.
(2) Be used only by their genuine owners The ClearView customer should implement
policies to enforce non-sharing of user
information.
Maintaining the uniqueness of each The ClearView User Manager prevents the
combined identification code and creation of duplicate user names.
(a) password, such that no two individuals have
the same combination of identification code
and password.
Initial and periodic testing of devices, such The ClearView customer is responsible for
as tokens or cards, that bear or generate testing devices.
identification code or password information
(e)
to ensure that they function properly and
have not been altered in an unauthorized
manner.
APPENDIX E
ActiveX Grid Control - CVGRID
Figure 25.0
Properties
Property Description Example
Returns/sets whether clicking on a column or
AllowBigSelection row header should cause the entire column or Grid.AllowBigSelection = False/True
row to be selected
Returns/sets whether the user should be
AllowUserResizing allowed to resize rows and columns with the Grid.AllowUserResizing = False/True
mouse
Returns/sets whether a control should be
Appearance Grid.Appearance = False/True
painted with 3-D effects
Returns/sets the background color of the
BackColor Grid.BackColor = OLE Color
CVGRID
Returns/sets the background color of the
BackColorBkg Grid.BackColorBkg = OLE Color
CVGRID control
Returns/sets the background color of the fixed
BackColorFixed Grid.BackColorFixed = OLE Color
rows
BorderStyle Returns/sets the border style for an object Grid.BorderStyle = 0 (none) or 1 (border)
Grid.ColAlignment(ColumnIndex) = 1
0 - The cell content is aligned left, top
1 - The cell content is aligned left, center (default)
2 - The cell content is aligned left, bottom
3 - The cell content is aligned center, top
ColAlignment Returns/sets the alignment of data in a column 4 - The cell content is aligned center, center
5 - The cell content is aligned center, bottom
6 - The cell content is aligned right, top
7 - The cell content is aligned right, center (default for numbers)
8 - The cell content is aligned right, bottom
9 - The cell content is of general alignment
Cols Determines the total number of columns Grid.Cols = 10
Determines the width of the specified column in
ColWidth Grid.ColWidth (2) = 2500
Twips
Edit Enable Edit of the specific cell Grid.Edit = False/True
Returns/sets a value that determines whether
Enabled Grid.Enabled = False/True
an object can respond to user-generated events
Methods
Method Description Example
Grid.SortCol ColumnIndex, SortType
0 - None. No sorting is performed.
1 - Generic Ascending. An ascending sort, which estimates
whether text is string or number, is performed
2 - Generic Descending. A descending sort, which estimates
whether text is string or number, is performed
3 - Numeric Ascending. An ascending sort, which converts
strings to numbers, is performed
4 - Numeric Descending. A descending sort, which converts
SortCol Sorting by column strings to numbers, is performed
5 - String Ascending. An ascending sort using case-insensitive
string comparison is performed
6 - String Descending. A descending sort using case-insensitive
string comparison is performed
7 - String Ascending. An ascending sort using case-sensitive
string comparison is performed
8 - String Descending. A descending sort using case-sensitive
string comparison is performed
9 - Custom. This uses the Compare event to compare rows
Grid.Sort SortType
0 - None. No sorting is performed.
1 - Generic Ascending. An ascending sort, which estimates
whether text is string or number, is performed
2 - Generic Descending. A descending sort, which estimates
whether text is string or number, is performed
3 - Numeric Ascending. An ascending sort, which converts
strings to numbers, is performed
Action-type property that sorts selected rows 4 - Numeric Descending. A descending sort, which converts
Sort strings to numbers, is performed
according to selected criteria 5 - String Ascending. An ascending sort using case-insensitive
string comparison is performed
6 - String Descending. A descending sort using case-insensitive
string comparison is performed
7 - String Ascending. An ascending sort using case-sensitive
string comparison is performed
8 - String Descending. A descending sort using case-sensitive
string comparison is performed
9 - Custom. This uses the Compare event to compare rows
RemoveItem Removes a row from a CVGRID control Grid.RemoveItem RowIndex
Sets the row background colors of individual Grid.SetRowBackColor CInt(RowIndex),
SetRowBackColor
cells OLE_COLOR
Sets the column background colors of individual Grid.SetColBackColor Cint(ColumnIndex),
SetColBackColor
cells OLE_COLOR
Sets the cell background colors of individual Grid.SetCellBackColor Cint(RowIndex),
SetCellBackColor
cells Cint(ColumnIndex), OLE_COLOR
Grid.SetRowForeColor CInt(RowIndex),
SetRowForeColor Sets the row font colors of individual cells
OLE_COLOR
Grid.SetColForeColor Cint(ColumnIndex),
SetColForeColor Sets the column font colors of individual cells
OLE_COLOR
Grid.SetCellForeColor CInt(RowIndex),
SetCellForeColor Sets the cell font colors of individual cells
CInt(ColumnIndex), OLE_COLOR
Functions
Function Description Example
Returns/sets the background colors of
CellsBackColor X = Grid.CellsBackColor (OLE_COLOR)
individual cells or ranges of cells
Returns/sets the background colors of
CellsForeColor X = Grid.CellsForeColor (OLE_COLOR)
individual cells or ranges of cells
Determines the starting or ending column for a
ColSels X = Grid.ColSels (ColumnIndex)
range of cells (Read/Write)
Determines the starting or ending row for a
RowSels X = Grid.RowSels (RowIndex)
range of cells (Read/Write)
Determines the starting or ending row for a
GetRowSels X = Grid.GetRowSels
range of cells (Read Only)
Sets the active cell in a CVGRID column
SetGridCol X = Grid. SetGridCol (ColumnIndex)
(Read/Write)
Sets the active cell in a CVGRID row
SetGridRow X = Grid.SetGridRow (RowIndex)
(Read/Write)
Events
Event Description Example
Private Sub Grid_Click ( )
Fired when the user presses and releases
Click ‘Code here
the mouse button over the control
End Sub
Private Sub Grid_DblClick ( )
Fired when the user double-clicks the
DblClick ‘Code here
mouse over the control
End Sub
Private Sub Grid_KeyDown ( KeyCode, Shift )
KeyDown Fired when the user pushes a key ‘Code here
End Sub
Private Sub Grid_KeyPress ( KeyAscii )
KeyPress Fired when the user presses a key ‘Code here
End Sub
Private Sub Grid_KeyUp ( KeyCode, Shift )
KeyUp Fired when the user releases a key ‘Code here
End Sub
Private Sub Grid_MouseDown ( Button, Shift, x, y )
Fired when the user presses a mouse
MouseDown ‘Code here
button over the control
End Sub
Private Sub Grid_MouseMove ( Button, Shift, x, y )
Fired when the user moves the mouse over
MouseMove ‘Code here
the control
End Sub
Private Sub Grid_ MouseUp ( Button, Shift, x, y )
Fired when the user releases a mouse
MouseUp ‘Code here
button over the control
End Sub
Private Sub Grid_SelChange ( )
Fired when the selected range of cells
SelChange ‘Code here
changes
End Sub
Private Sub Grid_ RowColChange ( )
RowColChange Fired when the current cell changes ‘Code here
End Sub
Private Sub Grid_ EnterCell ( )
EnterCell Fired before the cursor enters a cell ‘Code here
End Sub
Private Sub Grid_ LeaveCell ( )
LeaveCell Fired after the cursor leaves a cell ‘Code here
End Sub
APPENDIX F
Comtrade Viewer ActiveX Control
The Comtrade Viewer ActiveX Control is high-resolution graphic interface for management, display and
analysis of fault and periodic load Comtrade files (C37.111-1991/1999). The control supports the latest IEEE
long file naming format (C37.232).
The advanced analysis interface offers a wide range of flexible analysis tools for navigating traces, peak
hopping, amplitude and time scaling, superimposing, peak detecting, RMS and phase calculating,
instantaneous values, primary and secondary values, sequence components, triggers, envelopes, merge files,
append files and time synchronization of multiple records.
Computed Software Channels are also provided for advanced analysis. Software Channels can be used to
compute +, - and 0 Sequence, Resistance, Envelopes, Missing Phases, Convert to Primary or Secondary Values,
Current Imbalances, % of Rating...
Features:
• Phasors • Super Impose Channels
• Harmonics • Software Analog Channels
• Circular Charts • Convert to Comtrade
• Primary & Secondary Values • IEEE Long Filenames
• Change Frequency • SOE Tables on Multiple Records
• Truncate Cycles • Fault Summaries
• Add Cycles • File Sort & Queries
• User Defined Views • Specialized Copy/Move
• Time Synchronization • ASCII & Binary Editors
• Frequency Calculator • Save Sample Values
• Complex Calculator • Disturbance Reports
• Double Ended Fault Location • Append Multiple Files
• Single Ended Fault Location • Merge Multiple Files
• Sequence Components Calculator • Adjust Files Time
• Thiran Filter - Align Channel Data • Play Channels Audio
Fig A
Fig B
➢ Enter key code (license) into Key Code entry box and click register button
➢ In Design view select Comtrade Viewer object from Data Controls in Object Library and place the
object on screen
Fig C
C H A P T E R 1
Analysis Features
The Analysis Display offers a high-resolution graphical interface for displaying, analyzing, and manipulating analog and
digital channels of an oscillography record or a periodic load file. Displayed channels can be marked, moved, zoomed,
removed, restored, superimposed, scaled, numerically processed, exported and summarized.
The Analysis Display contains two sections: the analog view and the digital view. The analog view plots the oscillography
or load data. The analog table displays values such as the channel’s highest peak, RMS, phase, reference, instantaneous,
maximum, and minimum values. The cursor bars are used to view the data values. The digital view plots the events and
sensors and displays the channel’s original state, the channel’s final state, time of the first change, time of the last
change, and the number of times the channel changed state.
Up to 256 analogs and 1024 digital channels can be displayed. The main features are described below.
Phasors
The phasor diagram shows a vector for each visible analog channel. The diagram is displayed to the right of the analog
information window. To increase or decrease the size of the phasor window place the cursor over the vertical separator
between the analog information window and the phasor window and drag the mouse to the left to increase or to the
right to decrease. To close the phasor window, click the close button located in the header. To navigate the phase angles
use the left arrow, right arrow, home, end, page up and page down keys or the data scroll bar. To increase/decrease the
length of a channel's vector, mark the channel and use the increase/decrease amplitude menu buttons or the Ctrl-Up
and Ctrl-Down keys. To increase/decrease only the length of the vectors, use the up and down phasor buttons.
To toggle between the phasor display and the circular chart display click the “P” button above the phasor display for
phasors or the “C” button for a circular chart.
There are two types of phasor displays: non-referenced and referenced. The non-referenced display shows the phase
angle for each sample in the display. The reference display shows the phase angle for each sample with respect to the
reference channel. The reference channel is the first marked channel in the window. All angles at a sample are
subtracted from the reference angle. If there are no marked channels the non-referenced display is shown.
Harmonics
The harmonics window displays as many harmonics as possible based on the file’s sampling frequency. A maximum of
200 harmonics can be displayed in the table. To display the harmonics window, click on the menu button or select
the Harmonics table menu option under the “View” menu. The harmonics window displays the first marked analog
channel or if no channels are marked, the first visible channel. Changing the marked channel in the data plotting window
will update the harmonics window with the appropriate channel.
The harmonic calculation is performed on a one cycle window, starting at the RMS bar and going forward to the data
bar. There are three fields displayed at the bottom of the harmonics table and histogram; TrueRMS, CalculatedRMS and
Total Harmonic Distortion (THD). The TrueRMS field displays the RMS value calculated by using the samples in the active
cycle displayed in the waveform trace window. The CalculatedRMS field displays the square root of the summation of
the squares of the DFT Magnitudes from harmonics 2 to the maximum harmonic divided by square root of 2. The THD
field displays the square root of the summation of the squares of the DFT Magnitudes from harmonics 2 to the
maximum harmonic and that quantity divided by the DFT Magnitude of the Fundamental.
The harmonics can be viewed in a table format or in a histogram. Click on the harmonics toggle button to change
the view. The histogram can show only one column from the table. To change the data displayed click the histogram
drop down menu and select the column. The default view is the % of Fundamental.
.
Figure 1.3 Histogram Drop Down Menu
The harmonic histogram bars can be resized using the resize up and down arrows to display more or less
harmonics in the window. The text displayed above the histogram bars can be shown or hidden be clicking on the
Show/Hide text bar button . The harmonics window can be resized by dragging the edge of the window to show
more or less harmonics per window.
Also, a vector for each harmonic is displayed in the phasor diagram. To hide/show the harmonic vectors toggle the
"Vector Harmonics" menu option under the "View" menu from checked=on to unchecked=off.
Circular Chart
The Circular Chart diagram shows a circular display for each visible channel. The diagram is displayed to the right of the
analog information window. The amount of data displayed in the circular chart is equal to the amount of data displayed
in the waveform trace window. The duration of the data displayed is shown at the bottom of the circular chart. To
increase or decrease the size of the circular chart window place the cursor over the vertical separator between the
analog information window and the circular chart window and drag the mouse to the left to increase or to the right to
decrease. To close the circular chart window, click the close button located in the header.
To navigate the circular chart, use the left arrow, right arrow, home, end, page up and page down keys or the data scroll
bar. The cursor bar on the circular chart displays where the data bar is in the chart. To increase/decrease the display
area of a channel on the circular chart, mark the channel and use the increase/decrease amplitude menu buttons or the
Ctrl-Up and Ctrl-Down keys or use the up and down arrow button located in the circular chart header.
To open a waveform file, click the open menu button and select some files from the dialog.
Navigating
Use the up and down arrow keys or the vertical scroll bar to browse the analog channels. The tab key toggles between
the analog and digital views.
The analog and digital values are displayed in a table to the right of the channel traces. Hold the mouse button down
and drag the table separator bars to resize the viewing area. To view the analog sample values, use the following
navigation tools:
Left and right arrow keys to navigate sample by sample
Ctrl+left or ctrl+right keys to peak navigate
Shift+ctrl+left or shift+ctrl+right keys to cycle hop
Home and end keys to display the channel’s first and last samples
Triangle at the bottom of the data bar to drag the data bar through the samples
Page up and page down keys to page through the samples
Left button displayed to the left of the data scroll bar to move the sample at the data bar to the position of the first
sample displayed
Left button displayed to the right of the data scroll bar to move the trace and table separator to the position of
the data bar
Click the left/right arrow button (located to the right of the analog table headers) or use the shift-right/left
arrows to scroll through the analog table columns. Refer to the “Viewing Analog Data” section for field descriptions.
NOTE: If no channels are marked then the peak navigate and cycle hop features navigate through the first
channel’s data.
Data Bar
The data bar is displayed as a black solid line with a white triangle below the line. The data bar is automatically displayed
at the end of the first cycle in the data window when it is first displayed. To move the data bar, use the left and right
arrow keys to move one sample, use the Ctrl-left and Ctrl-right keys to peak hop, use the Shift-Ctrl-left and Shift-Ctrl-
right keys to cycle hop, use the page up and page down keys to move one page up or down or left click the mouse to
move to any position in the data or drag the triangle to scroll through the data. When the mouse is held over the
triangle a hint message displays the sample number at the data bar and the delta time from the first sample. The time of
the sample at the data bar is displayed in the second status bar field. The channel values at the data bar are displayed to
the right of the traces in the analog channel information table.
Reference Bar
The reference bar is displayed as a blue dotted line. The reference bar is defaulted to the fault time specified in the file.
To move the reference bar to the position of the data bar use the "Move Reference Bar to Data Bar" option inside the
“View” menu or press Ctrl-A or click the SetRef menu button . Click the opposite mouse button to move the
reference bar to any position in the data area. The status field Delta X in the status bar at the bottom of the screen
shows the time difference (in milliseconds or seconds) between the reference bar and the data bar. It also shows how
many cycles are between the two bars.
RMS Bar
The RMS bar is displayed as a black dotted line. The RMS bar is defaulted to one cycle away from the data bar, except
when the data bar is positioned at the beginning of the data. This bar is used for calculating the RMS value displayed in
the analog information table. The RMS value in the analog table is calculated using all of the sample values displayed
between the data bar and the RMS bar. To move the RMS bar to the position of the reference bar (blue dotted line) use
the "Move RMS Bar to Reference Bar" option inside the “View” menu or press Ctrl-Z or click the SetRMS menu
button.
Fault Bar
The fault bar is displayed as a red dotted line. The fault bar is fixed and positioned at the fault time defined in the file’s
configuration information. The fault bar can be shown or hidden by selecting the “Yes” or “No” options for the “Show
Vertical Fault Bar” field in the properties dialog under the “Display Settings” tab.
Horizontal Bars
When the “Horizontal Bars” menu option under the “View” menu is checked two horizontal bars will be displayed. The
solid black line follows the data bar and the dotted blue line follows the reference bar. The bars will be positioned at the
first marked analog channel (displayed in red), if no channels are marked, then they are positioned at the first displayed
channel. The Delta Y field in the status bar shows the difference between the two bars.
To automatically resize the RMS sliding window click on the Resize Sliding Window menu button . To manually resize
the RMS sliding window click the opposite mouse button to set the reference position and the mouse button to set the
data bar position then click the SetRMS menu button. The RMS bar is moved to the reference position. The Delta X
field displayed in the status bar at the bottom of the screen shows the time difference (in milliseconds or seconds)
between the date bar and reference bar and the number of cycles between the two bars. Use the left, right, ctrl+left,
and ctrl+right, shift+ctrl+left, and shift+ctrl+right keys or the horizontal scroll bar to move the sliding window.
• ++ - The ++ view plots the signal using the number of maximum pixels allocated for the channel. The highest
value is plotted at the maximum position and the smallest value is plotted at the lowest position. This feature
was added to clearly show the profile of a frequency channel, a Vdc channel and load data channels.
To increase or decrease a channel’s amplitude, along with the phasors and circular chart first mark the channels then
click the AmpUp or AmpDn menus buttons or use the ctrl+up/down arrow keys. The auto scale multiplier (ASM) is
used to amplify or attenuate the channel’s data values. For example, when the amplitude increases the ASM value is
multiplied by the channel’s current “Pixsdisp” and when the amplitude decreases the ASM value is divided by the
channel’s current “Pixsdisp”. To change the ASM value, select the “Properties” menu option under the “File” menu then
click the “Display Settings” tab, enter a number and click OK. This value is initially defaulted to 2.00. To
increase/decrease only the analog channels amplitude, click the up and down arrow buttons located to the right
of the data scroll bar. To increase/decrease only the phasor magnitude or circular chart click the up and down arrow
buttons located in the phasor/circular chart header.
To increase or decrease the channel’s time scale, click the Condense or Expand menu buttons or press the
ctrl+page up and ctrl+page down keys.
NOTE: If no channels are marked all the visible channels are scaled accordingly.
Zooming Channels
To zoom in on specific analog or digital channels, first mark the channels then press <enter> or click the ViewMrks
menu button. The unmarked channels are removed from the display window and the marked channels are rescaled to
fit in the window. To restore the hidden channels press the <esc> key, the <backspace> key, or click the ViewAll
menu button.
When returning to the original view all channels in the previous view remain marked for quick selection of additional
channels for a new view.
Repositioning Channels
Analog channels can be repositioned in the display window. To move an analog channel up one position mark the
channel and press the “+” key or select “Shift Marks Up” from the “Channel” menu. To move a channel down one
position mark the channel and press the “-” key or select “Shift Marks Down” from the “Channel” menu. To move a
group of analog channels, mark all the desired channels then press the “+” or “- “keys.
Saving as
The visible analog and digital channels can be saved in the COMTRADE ASCII or Binary format or in a CSV format. The
Comtrade versions supported are: the 1991 and 1999 format. The CSV formats supported are: RMS Values,
Instantaneous Values, Vector Values (Mag &Ang or RMS & Ang).
Mark the analog and digital channels to save and press <enter> or click the ViewMrks menu button . To save the
channel values file select the “Save as menu option from the “File” menu. Enter the destination path and filename (do
not define the filename extension) and select the Save Type then click OK.
To automatically name the file using the IEEE long file naming format check the “Use the ComNames Naming Convention
to Name the Comtrade File(s)” field in the “Save As” dialog and leave the “File Name” field empty. The selected channels
are converted to the specified format and are named using the IEEE long file naming convention.
A maximum of 256 analog channels can be displayed in one window. The values displayed in the analog table and
combination view are described below.
Analog Table View:
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 412
The analog table view is the default view. Use the view button or the shift-right/left arrow keys to navigate through
the columns of the table. The original sample values are plotted according to one of the following data types:
• Peak to Peak data
• RMS Calibrated data
• Log files.
All of the display drivers in the system are defaulted to peak to peak except the predefined log drivers. To change the
settings for a driver select the "Window Properties" option under the "File" menu. Click on the "Driver Data Type" tab
and select the type from the "Data Multiplier Type" drop down list. Periodic Log File’s data type cannot be changed.
The following tables describe the analog data for the sinusoidal peak-to-peak, non-sinusoidal, and sinusoidal RMS data
types:
Peak to Peak
Field Description
Title The analog channel titles.
RMS The TrueRMS value is calculated by taking the summation of the square of
all the sample values that are between the RMS bar (black dotted line) and
the data bar. The result is divided by the total number of samples between
the two bars and takes the square root of that result.
InstPeak The highest absolute value of all of the samples between the two zero
reference crossings surrounding the data bar (black solid line).
Phase The phase angle of each channel.
InstVal The sample value at the data bar (black solid line).
RefVal The sample value at the reference bar (blue dotted line).
MaxPeak The maximum peak value of the channel.
MinPeak The minimum peak value of the channel.
Units The analog channels prefix and units.
PixsDisp The number of pixels allocated for displaying the trace.
DFT Peak The DFT Magnitude calculated between the RMS bar (black dotted line)
and the data bar (solid data bar).
Crest The DFTMag column divided by the RMS column.
Field Description
RefVal The RMS sample value at the reference bar (blue dotted line) multiplied by
Root 2.
MaxPeak The RMS maximum peak value of the channel multiplied by Root 2.
MinPeak The RMS minimum peak value of the channel multiplied by Root 2.
Units The analog channels prefix and units.
PixsDisp The number of pixels allocated for displaying each trace.
DFT Peak The DFT Magnitude calculated between the RMS bar (black dotted line)
and the data bar (solid data bar).
Crest The DFTMag column divided by the RMS column.
Combination View:
The combination view shows all of the channel information in a signal view. This view is only available if there is
sufficient room between analog channels to display two or more lines of text.
Default Display format:
Peak to Peak:
Channel Title
RMS MaxPeak RefVal
InstVal MinPeak Units ASV
RMS Calibrated:
Channel Title
RMS MaxPeak RefVal
InstVal MinPeak Units ASV
Load Files:
Channel Title
MaxWin MaxVal RefVal
InstVal MinVal Units ASV
The peak sample values are displayed in red when the data bar is on the channel’s maximum value and displayed in blue
when the data bar is on the channel’s minimum value. Use the Tab key to toggle between the analog and digital
channels. To hide the channel information, select the "Channel Information" menu option from the "View" menu.
The analog table and combination views can be resized by selecting the vertical separator bar and dragging it to the right
or left. The mouse icon changes to the vertical resize cursor when the mouse is positioned over the separator bar.
To change how the analog data is displayed in the analog table and combination view select the "Properties" menu
option from the "File" menu or click on the “Properties” menu button from the speed bar. The “Analog Table” tab
and the “Analog Combination” tab allows for changing the appearance of the analog information window.
Some of the functions of the “Properties” dialog is reordering, hiding, and showing the analog table columns; changing
the data positions in the combination view; changing the background colors and trace colors; and for changing the
driver’s data type and trace/phasor scale multipliers.
Use the scroll bar or the up and down arrow keys to navigate through the digital channels and use the tab key to toggle
between the analog and digital views.
• Colors – The Colors tab is used to define the background colors of each display section and to set the default
analog channel colors.
• Values File – The Values File tab is used to define the Values File and general information used when saving
samples values to a file.
• Display Settings – The Display Settings tab is used to define the Scale Multiplier for the traces and
phasor/circular chart scaling. It also can define general display information for the window such as: setting the
display trace type (sample based or time based), defining the Phase Angle Convention (Sine or Cosine), showing
the time reference bar between the analog channels and the digital channels, showing the separator bar
between multiple events displayed in one window, showing or hiding the fault bar (red dotted vertical bar), and
defining the option to reference angles across windows when Sync mode is active. When “Yes” is defined for
reference angles across windows all phase angles for the currently opened windows will be referenced from the
first marked channel in the active window.
• Append / Merge – The Append/Merge tab is used to define from which file the samples will be discarded from
when the discard common times option is used. It also is used to determine whether the station name should be
added to the analog/digital titles when an append/merge option is executed.
• Driver Data Type – The Driver Date type tab is used to define the type of data that is saved to the displayed
device’s data file: RMS Type or Peak Type, convert the analog sample values between primary and secondary
and for editing the ratio values.
• Filters – The Filters tab is used to define if spikes detected in the data file should be ignored when the maximum
and minimum values are calculated and at what level they should be ignored.
All calculations are designed to operate "on the fly". For the forward-looking SAC operator ("@" some positive angle)
care must be taken. Upon opening a file and while the system is reading the data samples, the forward samples are not
available. In that case, the system uses the current sample instead of the requested forward sample. To execute forward
looking SAC instructions, wait until the file is read and displayed.
SAC title and operators can be saved to an ASCII text file on disk by using the “Save” and “Save As” buttons located to
the right of the SAC operators. The “Open” button allows for opening existing SAC files without having to manually enter
the SAC titles and operators. These features are useful for reusing existing SAC operations on like files. The “New”
button clears the existing SAC title and operators.
The SAC and SDC instructions are composed of an operator and an operand. An operand can be a channel defined by the
channel number or a constant. Constant values must have a “^” operator before each value to distinguish
The CT and PT ratio values can be edited by clicking on the “Edit Ratio Values” button in the “Driver Data Type” tab. The
values are listed in a table format for each analog channel. The modified ratio values are not saved to the original file. To
save the edited ratio values use the “Save As: Comtrade” option under the “File” menu.
between channel numbers and constant values. To phase shift analog channels, use the “@” sign before each angle
defined. All angles must be defined in degrees. Following is a list of all the software operators that are available:
NOTE: All SAC operations are performed in Reverse Polish Notation (one operation at a time). The instruction set must
always terminate with a “/”. An operation error is generated if the instruction formats are not followed.
Operators are formatted as a stacked set of instructions. An instruction is composed of four attributes:
1. The operator: +, -, *, :, ...
2. The operand: channel index (1, 2, 3, ...) or constant value (such as ^3.14)
3. The function: @, h, x, y, m, d, f, ...
4. Instruction terminator: /
To display the SAC dialog, select “Software Analog Channels” from the Channels menu. Below are some examples:
Absolute Value +7/+8/+9/|/p=k/u=Volts/ Add channels 7, 8, & 9 and store the absolute
value of the result in the SAC then set the
SAC’s prefix and unit.
Engineers can use the additional channels as a generic tool for monitoring or modeling tasks. A virtual channel can be
used to compute one of the phases of a monitored line by adding the remaining phases then subtracting the result from
the residual channel. This in turn frees up a hardware channel for other monitoring needs.
The SAC operators and titles can be saved to an ASCII text file on disk to save time when re-entering SAC operator and
titles. The SAC files can have any filename but the extension must be .SAC. If an extension is entered when saving a SAC
file then the extension is deleted and .SAC is added to the filename. The active SAC path and filename is displayed in the
first status field. The second status field indicates if the SAC title or operator fields where modified.
There are 4 options for the SAC files, Open, New, Save and Save As. Each option is explained below:
Save Save the active SAC title and operators to the SAC file listed in the first status
field. If the SAC filename is listed as Untitled then the “Save As” dialog is
displayed.
Save As Save the existing SAC title and operators to a new SAC file. The Window’s “Save
As” dialog is displayed. Navigate to the desired folder and enter the new name
in the “File name” field and click the “Save” button or press enter.
• Save As CSV - RMS Values: Save the RMS Values in a comma delimited format.
• Save As CSV - Instantaneous Values: Save the Instantaneous Values in a comma delimited format.
• Save As CSV - Vector Values (Mag & Ang): Save the DFT Magnitude and Angle in a comma delimited format.
• Save As CSV - Vector Values (RMS & Ang): Save the RMS Value and Angle in a comma delimited format.
The file format saved is a comma delimited text file and the .CSV extension is automatically assigned. The first line in the
file defines the header information. The first two columns are the samples date and time. Below is an example of the
header:
DATE(0/DATE), TIME(1/TIME), IA(4/Amps), IB(4/Amps), IC(4/Amps), VA(4/Volts), VB(4/Volts),VC(4/Volts)
System Keys
This section lists the function keys, cursor keys, and menu buttons available in the device manager, query fields and DXF
display.
Analysis
Cursor Keys Description
Left Arrow Move the data bar to the left one sample.
Right Arrow Move the data bar to the right on sample.
Ctrl+Right Arrow Move the data bar to the next peak for the first display channel or the first
marked channel.
Ctrl+Left Arrow Move the data bar to the previous peak for the first display channel or the first
marked channel.
Shift+Ctrl+Right Move the data bar ahead one cycle for the first displayed channel or the first
Arrow marked channel.
Shift+Ctrl+Left Arrow Move the data bar back one cycle for the first displayed channel or the first
marked channel.
Shift+Left Arrow Shift the analog information table to the left by one column.
Shift+Right Arrow Shift the analog information table to the right by one column.
Page Up Page up through the data.
Page Down Page down through the data.
Home Move the data bar to the first data sample.
End Move the data bar to the last data sample.
Ctrl+Up Arrow Increase the amplitude for all or marked channels.
Ctrl+Down Arrow Decrease the amplitude for all or marked channels.
Ctrl+Page Up Expand the time scale for all visible channels.
Ctrl+Page Down Condense the time scale for all visible channels.
Tab Toggle between the analog and digital channels.
Up Arrow Move the cursor up one channel.
Down Arrow Move the cursor down one channel.
Shift+Page Up Display the analog/digital channels on the previous page.
Shift+Page Down Display the analog/digital channels on the next page.
Ctrl+Home Display the first page of the analog/digital channels.
Ctrl+End Display the last page of the analog/digital channels.
Spacebar Mark or Unmark the channel at the cursor position.
Shift+Up Arrow Mark or Unmark a group of channels while moving the cursor up.
Shift+Down Arrow Mark or Unmark a group of channels while moving the cursor down.
Insert Display the hidden channels that were removed by the delete keys.
Delete Hide the marked channels and respace the unmarked channels.
Enter Hide the unmarked channels and respace the marked channels.
Copyright © 2006-2017 ReLab Software LLC. All Rights Reserved
Document Version: 10.5.0.1
ClearView-SCADA Manual 428
Esc Display all the hidden channels or exit the data window.
Backspace Display all the hidden channels.
+ Shift all the marked channels up one position.
- Shift all the marked channels down one position.
Ctrl-A Move the reference bar to the sample at the cursor bar.
Ctrl-Z Move the RMS bar to the sample at the reference bar.
APPENDIX G
Basic SMTP Email Control
Method
Parameter(s) None
Parameter(s) None
Properties
Figure #AG1
Figure #AG2
Figure #AG3