0% found this document useful (0 votes)
30 views209 pages

E3tutorial Developer Enu

Uploaded by

TRƯƠNG GIA Huy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views209 pages

E3tutorial Developer Enu

Uploaded by

TRƯƠNG GIA Huy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 209

E3 Developer's Tutorial

© 2013 Elipse Software Ltda. All rights reserved.


02/04/2013 - Version 4.0
Table of Contents
1 Presentation 6
1.1 Elipse 6
1.2 E3 Modules 6
1.3 The Training 7
2 Elipse Knowledgebase 11
2.1 Elipse Knowledgebase 11
2.2 Search the Knowledgebase 12
2.3 Categories 12
2.4 Notes 14
3 Starting the Application 15
3.1 Creating the Application 16
3.2 Running a Domain 18
3.3 Exercises 18
3.4 Additional Exercises 20
3.5 Notes 21
4 Data Server 22
4.1 Rules for Naming Tags 23
4.2 Exercises 23
4.3 Notes 27
5 Screens and Frames 28
5.1 Screens 28
5.2 Frames 29
5.3 Viewer 30
5.4 Exercises 33
5.5 Notes 36
6 Screen Objects 37
6.1 Microsoft Forms Controls 37
6.2 Gallery 38
6.3 Exercises 39
6.4 Additional Exercises 44
6.5 Notes 45
7 Links 46
7.1 Link Types 46
7.2 Boolean Values 50
7.3 Exercises 51
7.4 Notes 56
8 Communication 57
8.1 I/O Driver 57
8.2 OPC Driver 62
8.3 Additional Exercises 65
8.4 Notes 66
9 Scripts 67
9.1 Defining Scripts 67
9.2 Events 74
9.3 Methods 76
9.4 Properties 77
9.5 Exercises 77
9.6 Additional Exercises 79
9.7 Notes 80
10 Security 81
10.1 Users 81
10.2 Groups 82
10.3 Permissions 82
10.4 Protection 84
10.5 Exercises 85
10.6 Additional Exercises 87
10.7 Notes 90
11 ElipseX Libraries 91
11.1 Creating User Libraries 92
11.2 When to Create an ElipseX 94
11.3 Exercises 95
11.4 Additional Exercises 102
11.5 Notes 104
12 Databases 105
12.1 Exercises 105
12.2 Additional Exercises 109
12.3 Notes 110
13 Alarms 111
13.1 Alarm Server 111
13.2 Alarm Configuration 111
13.3 E3Alarm 115
13.4 Exercises 116
13.5 Additional Exercises 122
13.6 Notes 123
14 Queries 124
14.1 Creating a Query 124
14.2 E3Browser 126
14.3 Exercises 127
14.4 Additional Exercises 132
14.5 Notes 133
15 Historics 134
15.1 Primary Key 134
15.2 Indexes 135
15.3 Exercises 135
15.4 Additional Exercises 137
15.5 Notes 138
16 E3Chart 139
16.1 Pen Configuration 140
16.2 Exercises 141
16.3 Additional Exercises 144
16.4 Notes 146
17 Reports 147
17.1 Report Objects 149
17.2 Exercises 150
17.3 Notes 156
18 Formulas 157
18.1 Exercises 157
18.2 Additional Exercises 159
18.3 Notes 161
19 Storage 162
19.1 Functionality 162
19.2 Configuration 163
19.3 Internal Queries 163
19.4 Exercises 165
19.5 Additional Exercises 167
19.6 Notes 168
20 E3Playback 169
20.1 User Interface 169
20.2 Restrictions and Comments 171
20.3 Licensing 172
20.4 Exercises 173
20.5 Additional Exercises 174
20.6 Notes 175
21 Hot-Standby 176
21.1 Hot-Standby Settings 176
21.2 Exercises 179
21.3 Additional Exercises 182
21.4 Notes 183
22 Remote Domains 184
22.1 Studio Configuration 184
22.2 Sharing the Server Domain Folder 184
22.3 Licenses 189
22.4 Links Syntax 190
22.5 Local Alias 190
22.6 Access Permissions 191
22.7 Exercises 191
22.8 Additional Exercises 195
22.9 Notes 197
23 Revision Exercises 198
23.1 Exercise 198
23.2 Resolution 201
23.3 Notes 208
CHAPTER

1
Presentation

This tutorial works as a support material for the training module for executing and
programming E3. With it, you will follow the course's content. During the classes, feel free to
practice what you have learned and to share your questions with our instructor. In this
training, we will present you a case study that simulates a real application, a supervisory and
control system.

1.1 Elipse
Elipse software is a genuine Brazilian company, focusing in the production of supervisory
software for industrial automation; we began operating in Porto Alegre in the beginning of the
1990s.

Our first product was Elipse 21, a software program written for the DOS platform, which was
known for being both easy to operate and compatible with different manufacturers.

In 1996, our company released the first version of Windows Elipse, which later became Elipse
SCADA. Since then, this software had about 3,500 installed copies in Brazil.

In 2000, Elipse started developing E3, the third generation of company's supervisory software.
Since it was first commercially released in 2001, there had been about 500 licenses of this
software installed; E3 has been used in several systems, such as Operation Centers of power
companies, industrial plants with many different purposes, telemetry and energy control
systems, automation and building control, mining, and others.

Elipse Software works in partnership with international providers located in strategic


countries such as Germany, the Netherlands, Taiwan, India, Canada, and others; we also have
an office in the United States in the city of Avon, North Carolina.

1.2 E3 Modules
The first thing you will notice is that E3 comprises four modules, which are described on the
next sections.

1.2.1 E3 Server
It is the Application Server, where main processes run, including real time communication
with control devices. The server is also responsible for sending data and screens to connected
clients anywhere in the network (Intranet and Internet). A Server can run many projects at the
same time and exchange data with other E3 Servers in order to accomplish a fail-over
(standby) or distribute processing loads among the machines. It is developed to run on

6 Presentation
Windows XP SP3, XP x64 SP2, Server 2003 SP2, Vista SP2, Server 2008 SP2, Server 2008 R2 SP1,
and Windows 7 SP1.

1.2.2 E3 Studio
It is a unique configuration tool, acting as a universal development platform with a modern
and friendly environment, including a full graphical and scripts (VBScript) editor. This allows a
project to be edited by many people at the same time, or many E3 Studios to be connected to
the same remote server with multiple configurations.

1.2.3 E3 Viewer
E3 Viewer allows operating applications residing in the server in any computer either with the
Viewer executable program (Windows XP, 2003, Vista, and Windows 7) or with an Internet
browser. In either case, it is not necessary to install the application in the client machine,
because all components (screens, libraries, ActiveX controls, etc.) will be automatically
downloaded and registered.

1.2.4 E3 Admin
This module is responsible for E3 Server's (and other modules') interface with the user. It is
used to send commands to E3 Server, using the icon in the Notification Area on Windows
Taskbar, and to control the Domain via command line.

1.3 The Training


The learning sequence being used in this tutorial reflects what we at Elipse Software consider
a set of the best practices in the development of supervisory and control applications, for E3
(which is the subject of this tutorial), as well as for Elipse SCADA or other supervisory software.

This tutorial follows a hypothetical application, which presents the most important resources
of E3 software. This hypothetical application does not cover all development possibilities
offered by this tool. However, the amount of quality information presented in this first contact
with the software is enough to learn how to use it with autonomy to create applications.

The training sequence is the following:

· Presenting the tool

· Screens and Screen Objects: how to create graphical interfaces for your applications

· Using Links: an easy and effective way to show information or to create animations in
Screens

· Data communication: using Drivers and OPC

· Using ElipseX Libraries: powerful tool of functional libraries available only in E3

· Database Integration: using functions and tools to access and search for Databases,

Presentation 7
focusing on processes

· Alarms: using and controlling Alarms in E3

· Reports: powerful tool incorporated to E3. It brings easiness and a great amount of
resources for report creation

· Advanced resources: redundancy, access to the application via browser, user security
configurations, among others

Your feedback is very important for us. At the end of the training course, you will be asked to
evaluate several aspects of the training course, just like the quality and the amount of
information transmitted in lessons and about the tutorial, the instructor's work and the
quality of our facilities. Any suggestions are welcomed by the development team of this
tutorial.

Elipse Software wishes you an excellent training course and a good experience with E3!

1.3.1 Training Application


In the training, we present to you a case study that simulates a real application, a supervisory
and control system. The instructor develops the application together with the students, step
by step, making it easy to understand and learn with the tool.

This system presents a synoptic of an ink plant, showing several aspects and resources
available in Elipse E3.

The system operator can view tank level and temperatures, ink color to produce, and control
pumps.

Main screen of the application

To ensure the execution of the application, we will implement the concept of Hot-Standby.
Thus, if the main server fails, a backup server automatically takes over, without loosing

8 Presentation
process continuity.

Application menu

The system also displays alarm conditions in case any parameter exceeds established limits
(for example, if there is an excessive increase in temperature).

Alarms

There is a procedure for querying alarms, which allows viewing and printing historic data.

Screen for Alarm queries

You can also create trend charts of the variables, with an option to print and export the
historic chart.

Presentation 9
Trend chart

Finally, you will access information from other E3 server using Remote Domains.

Remote Domain

10 Presentation
CHAPTER

2
Elipse Knowledgebase

Elipse Knowledgebase was created to help users of Elipse software programs to find quick
answers to any question or problems faced during their use, be they found while developing
applications or after completing them. This space is a web portal where technical information
and tips are concentrated. Its information database is constantly updated and has a simple
language, focused on a quick understanding for users.

After opening the address kb.elipse.com.br, you will be on the main page.

KB's main page

2.1 Elipse Knowledgebase


In the page header, these are the options:

· Glossary: allows accessing the whole word glossary of the tool

· Favorites: a link displaying all articles from the database marked as favorites

· Login: for Elipse use only

Elipse Know ledgebase 11


2.2 Search the Knowledgebase
This field searches the whole database for a user-typed word or words, returning all articles
with the target word. Just type the word and click Search.

Searching the KB

There is also a possibility of using an Advanced Search, which allows refining the search. Just
click the Advanced Search option.

Advanced Search

In the Advanced Search option, users can type the word or words they are looking for, filter by a
specific category, author, and also by article rating. That is, if it helped a lot, just helped, did
not help, or helped a little.

2.3 Categories
Users have the possibility of accessing all articles by choosing directly the category it belongs
to. For this, in the Browse by Category field, just select the category to search for and then click
Go.

Choosing categories

All articles of that category are returned as the search result. It is important to notice that the
whole database is divided into two main categories: English and Portuguese. Inside each one
there are Elipse E3, Elipse SCADA, Elipse 21 DOS, Elipse Drivers OPC, Altus TCP/IP, and Drivers
categories. Inside these six categories there are several others, each one dealing with a

12 Elipse Know ledgebase


specific subject. Accessing articles of English - E3 category returns:

English categories

Notice that inside each one of these subcategories there is a number. This number indicates
the amount of existing articles inside that category.

The other existing sections in the main page of the Knowledgebase are:

· Featured Articles: Displays all articles marked to appear as highlighted. Generally this
section is used to highlight an article which deserves a special attention for Elipse software
users

· Most Popular Articles: Displays a list of the 10 most popular articles in the Knowledgebase

· Recent Entries: Displays a list of the last 10 articles added to the Knowledgebase

· Most Popular Searches: Displays the 10 most used words in searches by the Knowledgebase
search tool

Elipse Know ledgebase 13


2.4 Notes

14 Elipse Know ledgebase


CHAPTER

3
Starting the Application

After installing the software, your computer will have a program group called Elipse E3, and the
icon to open E3 Studio. When E3 is launched, the system opens a dialog box with the
following options:

E3 Studio initial dialog box

The available options are:

Available options in the E3 initial dialog box

OPTION DESCRIPTION
Start E3 Studio Starts E3 Studio, but does not open any
Domain.

Create a new Domain Creates a new Domain using the E3


Application Wizard, which asks for the name
and path of the new Domain.

Open an existing Domain Opens an existing Domain among the last


edited ones. By clicking Other files, you can
browse for a Domain on a specific directory.

Starting the Applic ation 15


3.1 Creating the Application
To create a new application, use the Application Wizard. To open it, click the New button on
the Standard toolbar.

Application Wizard

E3 has three different types of projects, described on the next sections.

3.1.1 Projects
Projects contain object definitions, Tags, Screens and other application components. .prj files
are created using the Standard Application and Blank Application options. The first option
creates a pre-configured project with some basic objects and a project creation wizard, while
the second option creates an empty project, which can be implemented by the user.

3.1.2 Libraries
Libraries contain user-created object definitions (ElipseX) to use in projects. These libraries
can be reused in different projects and maintain a link with the application. This means that if
users modify the library, all objects of this library are automatically updated in all projects.

16 Starting the Applic ation


3.1.3 Domain Configuration
It stores four types of information: configuration options; a list of .prj and .lib files; server
configurations running the Domain; and security configurations (users and permissions).
Without this file, a project cannot be executed in E3, as shown later in this Tutorial.

3.1.4 Organizer
The Organizer allows you to view the application as a whole, in a simple and organized way. It
helps editing and configuring all objects involved in the system using a hierarchical options
tree. It has two viewing modes, Domain and Explorer.

Organizer window in Domain mode

The Domain mode shows only information about open objects belonging to the Domain. This
information is divided into four groups: Settings, Objects Library, View, and Server Objects.

The Explorer mode shows all projects and libraries currently open in E3 Studio, whether they
belong to the Domain or not. Objects are shown inside the project or library they belong to,
sorted out alphabetically.

Starting the Applic ation 17


3.1.5 Properties List
The Properties List is a window that shows all the properties of the object in use, allowing its
configuration in a simple and fast way. Whenever a property is configured in the Properties
List, its value does not change automatically, except if you create a Link (this is shown further
in this Tutorial). The Properties List can be opened using the View - Properties List menu, or the
equivalent button on the Toolbar.

Properties List

3.2 Running a Domain


To execute or view a project in E3, it is necessary to start the Domain. To do so, these are the
existing buttons in E3 Studio:

· Execute application: Saves all project and library configurations, and executes the
Viewer

· Run or stop Domain: Starts or stops Domain execution

· Execute or stop E3 Viewer: Starts or stops Viewer execution

3.3 Exercises

18 Starting the Applic ation


3.3.1 Domain
1. When E3 starts, select the Create a new Domain option. The Application Wizard is then
opened.

Application Wizard

2. In the Application Wizard, click Next, select the Standard application option, and name the
project as MainProject.

3. Set the file path to C:\TrainingE3 and click Next.

4. In the next Wizard window, select the Create a new Domain option and use the same project
name.

5. Select a screen resolution.

Starting the Applic ation 19


Viewer resolution

6. Answer No to the questions about communication, databases, and alarms.

7. At the end of these procedures, you have access to the Studio's working area.

3.4 Additional Exercises

3.4.1 KB
· KB-28984: Execution time for an E3 Studio license.

20 Starting the Applic ation


3.5 Notes

Starting the Applic ation 21


CHAPTER

4
Data Server

A Data Server is the module responsible for executing and managing Tags and objects that are
not directly involved with the communication. With a Data Server, you can configure Internal
and Simulation Tags, in addition to inserting XObjects, which are data objects from ElipseX
libraries (see later on this chapter). Below there are some objects that can be inserted into a
data server.

Objects which can be inserted into Data Servers

OBJECT DESCRIPTION
Counter Tag Object that counts time (in seconds) up to a
pre-determined value, or performs a certain
count indefinitely.

Demo Tag It is an object that generates values


according to a wave form. It is used for
simulating values. It allows generating
defined curves or random values.

Internal Tag A generic purpose object, used for storing


values of any type, including numbers, texts,
and other objects.

Timer Tag Object for counting time and scheduling


activities. Establishes certain periods of time
(with repetitions) to execute actions.

Data Folder It defines groups and subdirectories for


organizing information. New folders may be
inserted inside others, if needed.

NOTE: Objects inserted in the Data Server are executed by the E3 Server; therefore, they will
be present in the Server. This information shows how E3 works.

22 Data Server
4.1 Rules for Naming Tags
There are some details you must consider when naming Tags:

· A Tag name cannot be formed only by numbers

· A Tag name cannot contain logical and arithmetical operators like / * + -

· A variable name cannot contain reserved characters such as / ? . , { } [ ] º - ,


etc. These characters are replaced by the underscore character. Thus, the system applies
the Brackets Rule.

4.1.1 Brackets Rule


When you refer an object via scripts, or if you use it in a Link, the following rules apply:

· If the first character is not a letter or an underscore character, the name must be inside
brackets

· If some of the characters (from the second on) are not letters, numbers or an underscore
character, the name must also be inside brackets

· If there are special characters (for example, diacritical marks), the name must be inside
brackets

4.2 Exercises

Data Server 23
4.2.1 System Time
To get the current system time, you must create a Demo Tag that accesses this information.

1. In the Data folder of E3Training, insert a Demo Tag named CurrentTime. Configure
the Type property of the Demo Tag to 3 - CurrentTime.

Insert a Demo Tag

4.2.2 Simulation of Values


Sometimes we need values which simulate movements. Generally, these values are real and
come from I/O Tags, but in these Tutorial exercises we will use Demo-type Tags.

1. In the Data folder, insert Demo Tags with the following properties configured:

NAME DOCSTRING MINIMUM MAXIMUM PERIOD SCAN TYPE


Level1 Level of 0 100 2000 200 0 - Random

24 Data Server
NAME DOCSTRING MINIMUM MAXIMUM PERIOD SCAN TYPE
Tank1

Level2 Level of 0 100 2000 200 0 - Random


Tank2

Temp1 Temperatu 20 80 20000 500 1 - Sine


re of Tank1

Temp2 Temperatu 20 80 10000 500 0 - Random


re of Tank2

4.2.3 Tanks
The application represents a plant which uses as raw materials red, green, and blue inks,
producing other inks as a combination of these three ones.

1. In Data folder, create a Data Folder called Tank1 and insert three Internal Tags, Red,
Green, and Blue.

2. Configure the initial value of those three Tags to Integer.

Selecting a datatype

3. Create a copy of folder Tank1 to create Tank2.

Data Server 25
Data Folders

26 Data Server
4.3 Notes

Data Server 27
CHAPTER

5
Screens and Frames

Screens are windows for monitoring processes, where objects are inserted, and that will be
operator's interface with the system. Each application can have an unlimited number of
Screens.

Frames are objects for organizing and structuring the interface, creating composed views for
users inside Viewer's main window or using an internet browser.

5.1 Screens
A Screen is the basic user interface object. The following objects can be inserted into it:

· Primitive shapes of the graphical editor (straight lines, circles, rectangles, polygons, etc.)

· ActiveX controls supplied by Elipse (E3 Alarm, E3Chart, E3Browser)

· ActiveX controls supplied by other vendors

· Non-vector images (BMP, JPG, GIF, etc.)

· Vector images (WMF and EMF files, etc.)

· Standard Windows controls (List, Text Editor, Combo Box, etc.)

· E3 graphical libraries (XControls) composed of any of the above objects

A Screen uses the Himetric standard for measuring size and coordinates, which is given in
1/100 mm and not in pixels. In this system, if a positive value is added to x, the x coordinate
moves to the right. When we add a positive value in y, the y coordinate lowers, which is the
data origin for the upper left corner of the Screen.

Screens can be opened in Full-Screen mode, occupying all the Viewer area, or as Typical
Screens, occupying only the height and width size of the coordinates.

28 Sc reens and Frames


Example of Screen

5.2 Frames
A Frame is the object that organizes and structures the interface, creating composed views for
users inside Viewer's main window or inside an internet browser.

In a Frame, you can create Splitters to view different screens at the same time. Each Splitter
can also show an URL, an Excel spreadsheet, a Word document, or a PDF file.

Splitters disposition inside a Frame can be horizontal or vertical. Other Splitters can be
inserted inside each other. For each pair of Splitters created by options Split Horizontal and
Split Vertical, there is always a Main Splitter and a Secondary Splitter. Only the former has
values explicitly defining its position, the latter will only get remaining values. In order to use
this resource, follow these procedures:

1. Right-click project name in Viewers and Frames and choose option Insert Frame.

2. To create a Splitter, right-click the open Frame and select Splitter type (Horizontal or
Vertical).

Sc reens and Frames 29


Select splitter type

3. Drag Splitter bar to the desired position and left-click to fix it.

Splitters

5.3 Viewer
A Viewer object configures the way E3 Viewer is displayed.

E3 Viewer can be launched from any point on a network that has access to an E3 Server. It is
not necessary to copy the application for every machine where E3 Viewers are executed,
because Screens and bitmaps are retrieved from server when needed, at run time.

NOTE: A Domain can have only one Viewer object.

On Viewer tab of Property window, Viewer's visual configurations are set.

30 Sc reens and Frames


E3 Viewer tab

By using Settings tab, you can configure Viewer window, title, and resolution.

Sc reens and Frames 31


Settings tab

On Communication Errors tab, you can define a pattern so that application's Displays and
Setpoints indicate communication errors.

Communication Errors tab

32 Sc reens and Frames


NOTE: You can also insert Tags inside a Viewer.

5.4 Exercises

5.4.1 Frames
1. Right-click folder Viewer and Frames and choose option Insert Frame in - E3Training.prj.

2. On Frame's viewing area, right-click it and select option Split Horizontal, according to the
figure below.

Split Horizontally

3. Place the bar about 10% of the Screen, from its upper limit, and left-click it to fix its position.

4. Configure Splitter size to 10% in SplitValue property.

5. Call this Splitter you just created as Upper_Area. To change an object's name, there are
three options:

· Select object in Organizer and press F2 key. Name editing is then enabled

· Select object in Organizer and, in object's Properties List, change Name property

· Right-click object in Organizer and select Rename

6. Split the bottom Frame horizontally about 10% of the Screen, from its bottom limit. Call
these Splitters as Central_Area and Bottom_Area, respectively.

Frame Splitters

7. Configure Bottom_Area Splitter as Main. This forces E3 to comply to Splitter size and then
the remaining Screen is Central_Area Splitter's size. Right-click Bottom_Area and
choose Set as Main Splitter.

Sc reens and Frames 33


Set as Main Splitter

8. Configure Bottom_Area Splitter's size as 10% (SplitValue property).

5.4.2 Screens
1. Right-click Screens folder and choose Insert Screen in - E3Training.prj.

Insert Screen

2. Choose Upper_Area Splitter from dropdown list. This causes the Screen to be created
with this Splitter's exact size. Choose Set as Main Screen, and type "MenuScreen" in Name
field.

34 Sc reens and Frames


Screen size

3. Create an AlarmScreen to be opened in Bottom_Area Splitter. Check option Set as


Initial Splitter's Screen.

4. Create a SynopticScreen, to open in Central_Area Splitter. Check option Set as


Initial Splitter's Screen.

Sc reens and Frames 35


5.5 Notes

36 Sc reens and Frames


CHAPTER

6
Screen Objects

Screen Objects are graphical elements that can be inserted into Screens in order to create a
visual interface with processes. They can be created using Objects toolbar or menu.

Once you have selected the object that you want to create, just keep the left mouse button
pressed on the Screen area while moving the mouse (a dotted rectangle shows the object size
and form). When you release the left mouse button, the object is placed inside the specified
area.

6.1 Microsoft Forms Controls


Microsoft Forms objects are software components based on Microsoft COM (Component Object
Model) technology. E3 installs and uses Microsoft Forms controls, which are ActiveX objects
created by Microsoft. They might be inserted into application screens to handle several tasks.
A description of Microsoft Forms objects is displayed on the next table.

Microsoft Forms Controls

ICON OBJECT DESCRIPTION


Check Box You can use it to give the user
a choice between two values
such as Yes and No, True and
False, or On and Off.

Option Button You can use it to show if an


individual item of a group is
selected.

Command Button You can use it to execute a


specific action by pressing it.

Label You can use it to show a


descriptive text, like titles,
captions, etc.

List Box Displays a list of values.

Scroll Bar Returns or defines the


property value of another
object according to the scroll
box position.

Sc reen Objec ts 37
ICON OBJECT DESCRIPTION
Spin Button You can use it to increase or
decrease a value.

Text Box You can use it to display


information typed by the user
on the screen.

Toggle Button It is similar to a Command


Button, except that it needs a
second user command to
return to normal state.

Combo Box It combines resources from a


List Box and from a Text
Editor. The user can type a
new value or select an
existing value.

NOTE: Other ActiveX objects made by third parties can also be used in E3, if they are properly
registered. They can be added using Tools - Manage ActiveX menu.

6.2 Gallery
The Gallery is a library of vector symbols, divided into categories, which can be dragged to
Screens. After inserting it, the object can be freely edited and manipulated according to
features applicable to image objects (the fill color, for example, can be changed on the
OverrideFillMode, OverrideFillColor, and OverrideLineColor properties without transforming
the object into a graphical E3 object).

In addition to symbols library, the Gallery also displays XControls belonging to the current
Domain libraries.

38 Sc reen Objec ts
Gallery

NOTE: When running E3 Studio in Demo mode (no license), only the first element in each
symbols category set is available.

6.3 Exercises

Sc reen Objec ts 39
6.3.1 Figures
All figures used in this application are saved on a folder inside the main project, so that there
are no concerns about figure paths when executing the application on another computer.

1. Right-click Resources and choose the Insert Resource in - E3Training.prj option.

Insert Resource

2. Choose all figures from folder C:\E3Training\Figures.

40 Sc reen Objec ts
6.3.2 Initial Screen
The Initial Screen will look like this:

Initial Screen

1. Configure the FillStyle property to 12 - bkPicture, to enable a background figure.

2. To place the InitialScreenBackground figure as the background, drag the bitmap from
Resources to Screen's PictureFile property. This forces E3 to use the inserted resource
instead of the image file (which is external to the application). To choose the best position
for the figure, you can change the PicturePosition property.

3. Create two Text objects : one with the text "Enter", and another one with the text "Quit".

TIP: To edit an existing text on the Screen, right-click it and select Edit Text.

4. In the center of the Screen, place the text "E3 Studio Training".

TIP: Use the Center Horizontally and Center Vertically buttons.

Sc reen Objec ts 41
5. Right under the text "E3 Studio Training", insert a second text with the message "Elipse
Software Ltd".

6.3.3 MenuScreen

MenuScreen

1. On MenuScreen, place the MenuScreenBackground as the background image.

2. Insert a Command Button object and in its Caption property, type "Initial".

3. Repeat this procedure to create a button for each screen of the application: Events, Chart,
Synoptic, Communication, Remote, and Playback.

4. On the right side of the Screen, insert a Display to show the name of the user logged in.

5. Next to the Display, insert a button with the text "Login".

6. Insert a Display on the corner of the Screen to show the current time.

7. Go to the object properties and select the Format tab. Define the format as Time, and in the
Type item, choose 13:06:03. This formatting displays hours, minutes, and seconds.

8. To view the previous configuration, go to Display's Value property and choose the Date
option.

Time format

6.3.4 AlarmScreen
This Screen displays active alarms of the application.

1. Configure the Screen with the background you wish. Use the Fill Style button.

42 Sc reen Objec ts
6.3.5 SynopticScreen

SynopticScreen
1. On SynopticScreen, place the image SynopticScreenImage as the background.

6.3.6 Setpoint
1. On the color tanks, insert Setpoints where you can type the amount of each color
component.

· Enable the Setpoint limits, changing the EnableLimits property to True.

· Configure the MaxLimit property to 255 and MinLimit to 0.

Configuring limits

6.3.7 Gallery
1. Insert the figure 5GallonBucket from the folder Tanks, in the graphical objects library -
Gallery) onto the conveyor belt.

6.3.8 Rectangle
1. On the tanks on the right, draw a Rectangle object and configure the following properties:

· BackgroundStyle: 1 - opaque

· BackgroundColor: Black (RGB(0, 0, 0))

Sc reen Objec ts 43
· VerticalPercentFill: 20

6.3.9 Display
1. On the side of each tank, insert a Display .

2. Configure the initial value to display a Double.

3. Format the Display as percentage and one decimal place.

6.4 Additional Exercises

6.4.1 KB
· KB-36216: Inserting objects in the E3 Gallery.

44 Sc reen Objec ts
6.5 Notes

Sc reen Objec ts 45
CHAPTER

7
Links

Links (or Connections) are associations made between properties and objects, or even
between properties. Links make creating animations and other types of common logics easier,
minimizing the use of scripts.

By using the Link tab of the Properties window, you have access to all available object
properties and to all possible link types for these properties.

Links

You can link an object or create an expression. When creating an expression or linking an
object or property to the Source field, the text will appear in blue, in case this object
corresponds to an item existing or loaded in E3 Studio. If the item does not exist, or if it does
not belong to an existing module in the Domain, the text will appear in red, and this item will
be shown as an error, until it is corrected or excluded with the Verify Domain option.

7.1 Link Types

46 Links
7.1.1 Simple Link
In a Simple Link, the value of Source field is copied to the property every time the first one is
modified.

Simple Link

7.1.2 Bidirectional Link


A Bidirectional Link is similar to a Simple Link, except that if there is also a variation in the
property, its value is copied to the Source field, two-way path.

Bidirectional Link

Links 47
7.1.3 Digital Link
In a Digital Link, when the variable or the expression of the Source field is a digital property, its
True and False status are connected to certain values in the destination, including the Blink
option (toggling values).

Digital Link

7.1.4 Analog Link


The Analog Link allows establishing a conversion scale between the source and the
destination variable. With the four specified values, a linear scale is made between the
property and source values.

Analog Link

48 Links
7.1.5 Table Link
You can establish conditions between the variable, its values, and the destination. On the
table, you will specify minimum and maximum values, and values for the property referring to
these conditions.

Table Link

7.1.6 Reverse Link


The Reverse Link is a unidirectional link from the object to the source.

Reverse Link

Links 49
7.1.7 Link Edition
E3 has a tool for link edition, called Edit Links. That way, you can change one or more links
made in the application faster than you would in the usual window. To access this tool, right-
click one or more objects, and select the Edit links option.

Link edition

7.2 Boolean Values


In VBScript, 0 equals False and any other value different from 0 is True. Take, for example, a Tag
representing a digital input or output, and whose its values are 0 and 1. When using Tag values
for links with Boolean-type properties, E3 considers the following:

TAG VBSCRIPT
0 False

1 True

When using the NOT command, E3 considers:

TAG NOT TAG VBSCRIPT


0 -1 True

1 -2 True

50 Links
Therefore, NOT of 1 is not False because its value is not equal to 0. In case you want to use the
NOT command, first convert the Tag value to a Boolean using the CBool method:

TAG CBOOL(TAG) NOT CBOOL(TAG)


0 False True

1 True False

CBool method

Another option would be working with Tag's Bit00 property, which is already a Boolean
property, instead of working with Tag's Value property.

Bit00 property

7.3 Exercises

7.3.1 Simple Link


This section contains exercises about the topic Simple Link.

7.3.1.1 System's Time


1. On MenuScreen, open the properties of the Display showing system time, Links tab.

2. In the Value property use the AppBrowser to search the Demo Tag CurrentTime (Server -
Data) on the Source column. On the right, select the Value property and click Paste.
Information goes from Tag to Display, therefore it is a Simple Connection (Property «
Source).

Simple Link

Links 51
7.3.1.2 Logged In User
1. In the Display showing the user name, link Display's Value property with Viewer's User
property.

Link with the User property of the Viewer

7.3.1.3 Tank Level


1. To simulate movement of a liquid in a tank of the SynopticScreen, create a Link from
tank cut's VerticalPercentFill property to Level1 Tag's Value property.

Link with the VerticalPercentFill property

2. Repeat the previous procedure for Level2 Tag.

7.3.1.4 Fill Color


1. In order to change liquid color, create the Link on the next figure.

Link in the ForegroundColor property

2. Search the AppBrowser for VBScript's RGB method.

3. Replace the words "Red", "Green", and "Blue" by Red, Green, and Blue Tags, respectively.

TIP: Work with Copy (CTRL + C) and Paste (CTRL + V). To edit a previously created Link, use F2
key.

4. Repeat previous procedures for the second tank.

7.3.2 Bidirectional Link


1. For each Setpoint in SynopticScreen, create a Bidirectional Link with its respective
Tag, Red, Green, and Blue.

Bidirectional Link

52 Links
7.3.3 Analog Link
1. The value of Level Tag varies from 0 to 100, while a formatting of type Percentage displays
values from 0 to 1. To apply a scale to the value, insert an Analog Connection in the Display
which shows numerically the Level variable.

Analog Link

7.3.4 Table Link


The Display showing the level must change the background color according to the following
table.

MINIMUM MAXIMUM COLOR


0 10 Green

10 30 Blue

30 70 White

70 90 Yellow

90 100 Red

1. In Display's ForegroundColor property, insert a Table Connection with the Level1 Tag.

Table Connection

Links 53
7.3.5 Copying Links
To copy the Link to the Display Level2, follow these steps:

1. In the Display already configured with a Table Connection, right-click it and choose the Copy
Links option.

Copy Links option

2. In the Display you want to format, right-click it and choose the Paste Links option.

3. If there are any Links already in this object, a message box is displayed asking whether you
want to ignore it or overwrite it.

Ignore or overwrite a Link

4. Change the reference from Level1 Tag to Level2.

7.3.6 Animation

1. Select the Gallon object and press the button to insert a Translation Animation. The
shadow of the object appears. Move it to wherever you want.

Translation Animation

The beginning of the movement represents position 0, and the end represents position 100.
For the movement to happen, you need a variable varying from 0 to 100, linearly. Because you
use this variable only to animate a Screen object, create a Demo Tag (simulation) in the
Viewer object.

54 Links
2. Right-click the Viewer and insert a Demo Tag named Animate.

Insert Demo Tag

3. Configure the Animate Tag with the following values:

· Minimum: 0

· Maximum: 100

· Period: 5000

· Scan: 100

4. Right-click the Animation and open its properties. Create a Link in the Value property with
the Animate Tag.

Link in the Value property

5. Change Animation's Enabled and EnabledSlider properties to False.

Links 55
7.4 Notes

56 Links
CHAPTER

8
Communication

E3 allows communication with data acquisition devices, controllers, PLCs (Programmable


Logic Controllers), RTUs (Remote Terminal Units), or any another type of device, by using I/O
Drivers or OPC Servers, according to the necessary type of device or communication. I/O
Drivers and OPC servers work in this case as the variable servers, that is, they provide
information from external world to E3, so that process supervisory can be performed. The
involved variables in the process are known as Tags and can be of various types, according to
the intended use. In E3, two types of drivers can be inserted, I/O Drivers (.dll files) and OPC
Drivers.

8.1 I/O Driver


The I/O Driver is an E3 module that enables communication with certain devices using DLL
Drivers supplied by Elipse Software. A manual is supplied alongside each Driver and contains
important information regarding the configuration of its [P] parameters and other properties.
The types of Driver objects, which are available for communication, are the following:

Available objects in I/O Drivers

OBJECT DESCRIPTION
Folder Defines groups and subdirectories for
organizing variables. It does not have direct
relationship with field devices.

I/O Tag It can be used to define communication with


a variable (a memory address) of the
acquisition device.

I/O Block It is used to define the communication with


several variables (various memory addresses
in sequence) of the acquisition device.

Block Element Represent each one of the block addresses


and are used as if they were I/O Tags. Block
Elements can point to each index inside a
Block (corresponding to each variable of
interest).

Communic ation 57
8.1.1 Exercises

8.1.1.1 Driver
1. Right-click the folder Drivers and OPC and choose the option Insert I/O Driver in - E3Training.
prj.

2. Select the Driver file (.dll) in the dialog box opened for file selection.

3. In case this dialog box is not automatically opened, choose the Driver file in the
DriverLocation property.

4. Check if the DriverName property is filled in.

5. In newer Drivers, all communication settings must be performed in the Extra configuration
windows of IOKit, which is a shared component used by E3 I/O Drivers.

6. For Drivers using IOKit, the configuration interface is opened using the Configure the Driver
button, in the Driver toolbar.

Configure the Driver

7. The following window is opened.

58 Communic ation
Driver configuration window

8. On Setup tab, choose the physical interface to use from the Option List of the Physical Layer
property. The options are Serial, Ethernet, Modem, and RAS.

9. Configure the time the Driver waits for a response from the field device in the Timeout field.

10.After choosing the Physical Layer option, the other tabs are disabled, and you will just need
to configure the chosen interface. From this point on, the Driver is configured to access the
physical layer.

8.1.1.2 Tag Browser


1. In case the Tag Browser dialog box does not open automatically, open it by using the button
.

2. On Tag Browser window, drag the I/O Block IO.IOKitEvent (from folder General) to the
left.

Communic ation 59
Tag Browser

3. Close the window after selecting all variables you want.

8.1.1.3 I/O Tags


1. Right-click the Driver and go to the option Insert - I/O Tag or click the Add button on Driver
toolbar.

Insert I/O Tag

2. Choose the amount of Tags to be inserted and their names.

Amount of Tags

60 Communic ation
3. Configure properties from N1/B1 to N4/B4 according to the Driver manual.

4. Right-click again the Driver and choose the item Activate Communication to test the
configurations, or click the Activate/Deactivate communication button. If the
configuration is correct, the Tag row will become blue.

Activate Communication

5. Create other Tags and Blocks and configure their properties from N1/B1 to N4/B4.

6. Set the scan time for each Tag according to your needs.

7. On CommunicationScreen, create a Setpoint for each Tag and link it to its respective
Tag.

CommunicationScreen

8.1.1.4 CommunicationScreen
1. Insert a new Screen on the project, called CommunicationScreen, to be opened on
Central_Area Splitter. Check option Set as initial Splitter's Screen.

2. On CommunicationScreen, create a Setpoint for each Tag you created, and link it to its
respective Tag.

Communic ation 61
CommunicationScreen

8.2 OPC Driver


The OPC Driver is the module responsible for collecting data from external devices through an
OPC Server, which can be developed by any company with knowledge on network and
protocols used by a certain device. OPC Tags can be imported to the OPC Driver in E3 (an OPC
driver in E3 acts like an OPC client), or they can also be created in E3. In this case, it is
necessary to know the ItemId of each Tag.

Available objects in an OPC Server

OBJECT DESCRIPTION
OPC Folder Defines groups or subdirectories for
organizing variables.

OPC Group Groups a series of OPC Tags which share the


same update parameters (scan time and
dead band). It is mandatory to have an OPC
Group in order to create OPC Tags.

OPC Tag Object for reading or writing values from/to a


device. Tag reading is performed
automatically by the OPC Server, with a scan
time defined in the OPC Group where it is
inserted.

OPC Block Allows writing or reading a set of values. To


perform writing, you must only attribute a
new value to the Value property.

62 Communic ation
OBJECT DESCRIPTION
OPC Block Element Allows writing or reading one of the Elements
of the OPC Block where it is inserted. The OPC
Block reads a data table and this object is
always linked to the position defined by its
Index property, corresponding to the
monitored variable.

8.2.1 Exercises
E3 works as an OPC server and also as an OPC client. Just like the previous exercise, this one
serves to show how the OPC Driver configuration works, as this procedure is similar for any
OPC server being used. This script is described in the next steps.

1. Right-click folder Drivers and OPC and choose option Insert OPC Client Driver in - E3Training.
prj.

2. Right-click the inserted OPC Driver, select option Properties and go to OPC Driver tab. Click
Select.

Select server

3. A window is opened with OPC Server options on your local machine or network. Select the
Elipse OPC Server of your instructor's machine in the option Network Servers and click OK.

OPC servers on the network

4. When returning to the properties window of the OPC Driver, click Activate Communication.

Activate Communication

5. From this point on, you will be able to check communication with the server by clicking
option Information.

Communic ation 63
Information about the server

6. The next step for configuration is importing Tags. Select option Import Tags.

Import tags

7. The E3 Import OPC Tags Wizard is then opened. Click Fetch.

Fetching Tags

8. The previous figure shows the appearance of the importing window. On the right side there
is a list of server Tags, and on the left side the E3 area for importing. To import, select the
item and drag it to the desired OPC Group.

64 Communic ation
OPC Groups

9. After importing some Tags or properties, check if imported Tags are working.

Imported Tags

10.Just like when configuring Elipse Drivers, the way to work with Elipse OPC servers is the
same for all servers.

8.3 Additional Exercises

8.3.1 KB
· KB-14918: Tag count in an I/O Driver.

Communic ation 65
8.4 Notes

66 Communic ation
CHAPTER

9
Scripts

Scripts are pieces of source code (programming) with which you can create procedures linked
to specific events, allowing greater flexibility in the development and use of applications. All
scripts are linked to events, and every E3 object has a list of previously defined events; also, it
is possible to define new user-generated events.

According to the concepts of object-oriented programming languages, Properties define


attributes of an object, such as the appearance of a screen control, or the initial value of an
object when starting the application.

NOTE: Until now, we have been working only with E3 properties. We already know some E3
properties, and also that there are two ways to modify them: via Properties window, or via
Links.

Methods are previously defined functions, which execute certain actions on object's
properties calling these actions. For example, functions that modify screen visibility (Hide or
Activate methods), that write on Tags (Write or WriteEx), among others. In object-oriented
programming languages, you must create methods to work on a property. For every method in
E3, you must define the event to which it is linked, because E3 scripts are event-oriented.

Events are occurrences related to an object that can be handled in order to perform an action
(a method).

9.1 Defining Scripts


The language used by E3 Studio for its scripts is VBScript, a subset of Visual Basic language,
developed by Microsoft. VBScript has a fast, light and portable interpreter, developed for
internet browsers using ActiveX Controls, Automation Servers, and Java Applets. Scripts are
always linked to events of a specific object. However, to facilitate development and increase
its speed, E3 already incorporates some common actions that could be handled by scripts via
assistants (wizards) named Picks. You can define whether a certain event executes a script, a
Pick, or a combination of both, in a sequence defined while creating the script (at E3 Studio).

9.1.1 Picks
Picks implement a friendlier way to perform common procedures in scripts, saving time while
writing code. Among them there are actions like Screen toggling or value attributions, which
are common when creating projects.

Sc ripts 67
9.1.1.1 Run Scripts
It allows editing a custom script to be executed whenever a certain event occurs.

Pick Run Script

68 Sc ripts
9.1.1.2 Open Screen
Opens a certain Screen or Frame.

Pick Open Screen

Sc ripts 69
9.1.1.3 Open Modal Screen
Opens a modal Screen.

Pick Open Modal Screen

70 Sc ripts
9.1.1.4 Run Application
Launches a specific program.

Pick Run Application

Sc ripts 71
9.1.1.5 Load Value
Loads a certain value into a Tag.

Pick Load Value

72 Sc ripts
9.1.1.6 Toggle Value
Allows toggling a Tag's value. If the Tag's value is equal to Value1, then the Tag receives
Value2. If the Tag's value is equal to Value2, then the Tag receives Value1. If the Tag's
value is equal to neither Value1 nor Value2, then the Tag receives Value1.

Pick Toggle Value

Sc ripts 73
9.1.1.7 Print Report
Allows printing a Report on a Screen or to a printer.

Pick Print Report

9.2 Events
Events are object-related occurrences that trigger programmed actions. There are basically
two types of events: Physical (or external), and Internal.

Physical events are, for example, any keyboard or mouse actions. In this case, the important
information would be the pressed key, or the cursor position and the button status. Internal
events are, for example, the temperature change of a room from 10 to 11 Celsius degrees.

In E3, there is a list of available events sorted by object, starting by standard events, present
in all objects. These events can be modified using the Scripts tab, which can be searched by
using the object properties to which you want to write a script.

74 Sc ripts
Event list

9.2.1 User-Defined Events


Although E3 comes with an extensive variety of events, sometimes users need to create a
specific event for an application. An example of a user-defined event is to perform a
calculation (or a more complex task) in an object, when the generated event comes from
another Tag or property.

You can create user-defined events using option Create new event in the event list, or using
button Create user event .

Sc ripts 75
Create user event

9.3 Methods
Methods are procedures that can be executed by objects. For example, a Screen object has
both a method to open it (Open) and another one to close it (Close). Because they are
encapsulated, that is, stored inside objects, a method call must always declare to which
object it is referring.

Many pre-defined methods have parameters, which can (or must) be passed in the method's
call. To do so, VBScript has a rule that must be obeyed. If the method is used in an attribution,
its parameters must be enclosed in parenthesis. The parenthesis used when declaring
methods in this tutorial is only setting them apart from properties. In scripts, you must follow
this rule.

AppBrowser

76 Sc ripts
9.4 Properties
All objects have Properties, which store information regarding its features. For example, a
Rectangle object has the Name property, which contains its name, and the Width and Height
properties, for its width and height respectively, among others. To modify these properties,
use the same specifications described in the previous section, but select the Properties
folder.

9.5 Exercises

9.5.1 Pick Open Screen


Let's implement navigation between application's Screens. InitialScreen must call
Frame1, and each button on MenuScreen must open its respective Screen at
Central_Area Frame or in full screen.

1. On InitialScreen, select text "Enter" and switch to Scripts tab.

2. On Click event, create a new Open Screen script.

Pick Open Screen

3. In Open Screen field, select Frame1.

4. Leave In Frame option empty.

5. On MenuScreen, for each button linked to a Screen, create a script to open its respective
Screen. InitialScreen must open in _top Frame and the other ones in
Central_Area Frame.

9.5.2 Pick Script


On InitialScreen, you can close the application when clicking text "Quit".

1. On InitialScreen, create a new Script-type Pick at text "Quit".

Pick Script

2. Using AppBrowser , search for Viewer's Exit method and click Paste.
Application.Exit

Sc ripts 77
3. Execute the application and test its new functionalities.

78 Sc ripts
9.6 Additional Exercises

9.6.1 KB
· KB-25172: Creating hot keys in E3.

Sc ripts 79
9.7 Notes

80 Sc ripts
CHAPTER

10Security

E3 has access control to Screens, Alarms, and Domains on a list of users, where each name has
a password and a login name. Depending on the configured options, the system allows access
to registered users or unlimited access to project Screens.

10.1 Users
When using the Users option, you can configure information regarding which users will have
access to the system. To use this resource, it is necessary to go to the File - Users menu and
click the Users tab.

Users tab

Sec urity 81
IMPORTANT: After configuring security, only listed users will have access to the system.

10.2 Groups
Groups option allows creating groups whose features are common to all of its members
(users). A group can also belong to other groups, but a group cannot belong to a group already
belonging to itself, that is, a circular reference. To use this resource, it is necessary to go to
the Files - Users menu and select the Groups tab.

Groups tab

10.3 Permissions
Permissions tab allows configuring user and group permissions for Screens, Alarms, Domains,
and the Viewer. A permission check consists of information that the member of the group has
about a command acting upon a specific object.

For example, User1 has permission to use Open command on the Screen1 object. Each
group member can deny or enforce a command permission, regardless on the group they
belong to. This way, they will not take into account information about the group. They can also
decide to always use information defined for the group. If group information is conflicting, the
following order is used: Deny » Enforce » Indifferent.

82 Sec urity
Permissions tab

Sec urity 83
10.4 Protection
E3 has a protection tool for projects and libraries. With this item, you can protect file content
against non-authorized editing, viewing, and execution. To use this resource, right-click the
project name in the Organizer and select the Protection option.

File protection

This option has two protection types, Edition and Execution.

· Edition Protection: It protects a file against non-authorized changes or views. This resource
is used to prevent a certain library or object from accidental changes, or restricted
procedures by a developer from being copied. E3 has a control over editing these project or
library files

· Execution Protection: This option is used to protect a file against non-authorized execution.
For this, it is necessary to request the recording of a password in the protection device,
which is performed by Elipse Software. This protects non-authorized copies of the project,
for example

84 Sec urity
When a .lib or .prj file is opened in E3 Studio, it starts by showing a gray icon with a padlock
indicating that it is protected and its content cannot be accessed. To access file content, right-
click the icon and select Open with password. After typing the password, and after the system
has granted access, the icon becomes colorful , indicating the accessibility of the file.

IMPORTANT: The implemented protections cannot be undone in case of password loss.


Therefore, when protecting a certain file, you must keep the password in a safe place. This
guarantees that you will be able to use this file when needed.

10.5 Exercises
Let's see how to configure users in an E3 Domain and how this resource can be used to deny or
grant access to Screens, controls, alarms, etc.

10.5.1 Users
1. On File menu, select the option Users.

File - Users menu

2. Go to Groups tab and create two user groups, called Administrators and Operators.

3. On Users tab, create three users. Notice that this feature is case-sensitive.

Sec urity 85
User data

4. Configure one of the users to belong to the Administrator group and the other two to belong
to the Operators group.

10.5.2 Permissions
1. On Permissions tab, select the option Groups. Block one of the Screens for Operators group.

2. Under user permissions, grant access to one of the users in Operators group to access the
blocked Screen for that group.

10.5.3 Login
1. On MenuScreen (the Login button), create a new Script-type Pick on Click event.

2. In AppBrowser, search for Viewer's Login method and click Paste.


Application.Login(true)

86 Sec urity
10.6 Additional Exercises

10.6.1 User Management


Let's create, delete, and edit users at run time. Only users configured as administrators (the
This is an administrator user option) have access to this resource.

1. Insert a button on the MenuScreen with the text "Users".

2. In this button, create the following script on Click event.


'User management
Application.UserAdministration()

3. Using the AppBrowser, search for Viewer's UserAdministration method.

10.6.2 Permission by Groups of Users for Screen Objects


Many times you just want a user to access a Screen, but not to view or to enable some objects.
To program that functionality, let's first discover if the user belongs or not to a restricted
group. This information varies according to the user logged in; remember: we may have more
than one viewing station and, consequently, more than one user logged in.

1. Right-click the Viewer and insert an Internal Tag named TagAdmin.

TagAdmin

2. On Viewer's OnLogin event, insert the following script:


'Checks if the user belongs to the Administrators group
Item("TagAdmin").Value = IsUserMemberOfGroup("Administrators")

3. On InitialScreen, create a Link between the Visible property of the Text Enter and the
Tag TagAdmin. Only users from the Administrators group can view this object.

Sec urity 87
10.6.3 Event Recording
1. Right-click the E3 icon on Windows Notification Area and go to Domain - Options.

Domain - Options

2. On Security tab, configure its options according to the following figure.

Security tab

NOTE: Security settings are not applied to existing users, only when changing or creating a
user.

3. Go to the Event Recording tab and configure it to record events in the Events table on an
automatically selected database.

88 Sec urity
Event Recording tab

NOTE: You must have a configured database in the application.

10.6.4 KB
· KB-32881: User and password administration in runtime.

Sec urity 89
10.7 Notes

90 Sec urity
CHAPTER

11ElipseX Libraries

E3 has tools that allow transforming any object or set of objects of your applications into a
user library. The concept of user libraries (called ElipseX) comes from object-oriented
programming languages, where several components can be shared among projects without
the need to develop each object again. Using E3 libraries is highly recommended due to the
productivity they bring to your application. Some of ElipseX advantages are:

· Code reuse

· Less tests during development

· Standard interface creation for developed objects

· Reduced time when developing new projects

· Protection for project content

Using libraries is recommended in most applications.

Object Libraries

ElipseX Libraries 91
11.1 Creating User Libraries
ElipseX objects may contain, in addition to drawings, internal variables that can be exported
to the application, and programming logics (scripts) that are present in all copies of the object
being developed, thus diminishing the need for repeating code in several parts of the
application.

To create a new library in E3, follow these procedures:

1. Go to File menu, select New Project item, and then click Next.

2. At Application Type option, select E3 Object Library option.

Application Wizard

3. Determine the name of the library and the folder where it will be saved, and click Next.

4. Set the specifications regarding the Domain.

5. Click Finish.

There are two types of objects that can be inserted into an ElipseX library: XControl graphical
objects and XObject data objects.

All items available for Screens can be inserted into XControls. Among these items are
primitive drawings, graphical vector objects - including symbol library objects (WMF, EMF,
etc.), non-vector graphical objects (BMP, JPEG, GIF, etc.), E3 ActiveX controls (E3Chart,
E3Browser, E3Alarm), XControls made by third parties, and other ActiveX controls.

92 ElipseX Libraries
Data libraries can contain any type of non-graphical objects, which are executed in E3 Servers.
You can insert the following objects in an XObject: I/O Drivers, Data Servers, Databases,
Formulas, Alarm Configurations, Alarm Servers, COM objects, and other XObjects, among
others.

In the same .lib file, you can have any number of ElipseX components, whether they are
XControls or XObjects. You can also have many different libraries (several .lib files) in the same
Domain.

11.1.1 XControl
An XControl defines a graphical interface for the user, which can comprise any E3 objects,
intended to be easily multiplied by your project. You can create an XControl by right-clicking
the .lib file created in the Domain (Organizer - Explorer) or in Object Libraries, XControl, and
choosing the Insert - XControl option.

XControl

Before you insert an XControl, please notice that on the lower part of the screen there are
three tabs: Design, Properties, and Scripts. On Properties tab, you can insert properties that
are exported by the object. These properties can be linked to a Tag or to any other property
when the object is used in a project. On Design tab, which is equivalent to a Screen, you can
insert the graphical objects previously described.

The properties to be exported (XProperties) can be inserted with the INS key or by using the
button, and can be excluded by using the button. The available options are:

Available options in XControls

OPTION DESCRIPTION
Name Determines XControl's property name.

Type Determines property's supported data type.

Public Enables or disables property's visibility


outside library, that is, determines whether

ElipseX Libraries 93
OPTION DESCRIPTION
property is public or not.

Initial Value Determines property's initial value.

Help text Text for property's declaration and


documentation.

You can notice that other Data objects (XObjects) can be declared as a Type. This allows you to
control the whole functionality of an object, so that the maintenance of a library will become
easier.

The edition of graphical objects has the same graphical resources and options as Screen's
edition. You can insert XControls in any Screen or even inside another XControl, by right-
clicking the destination Screen or XControl and choosing option Insert.

From this moment on, the XControl has a name inside the Screen, and it is considered as a
copy of the original definition. Thus, you must define (if needed) values or links that this
specific copy has in this context.

11.1.2 XObject
In addition to graphical objects, you can also create a data library, called XObject. With that
library, you can define a data structure to be executed in the server. Such structure can
perform calculations, links, communications, alarm checking, historic recording, etc., which
do not depend on any open graphical interface (Viewer) or executing at that moment. To
create an XObject, right-click the .lib file in the Organizer and choose the Insert - XObject
option.

The available options for XObject properties are the same as the ones for XControls, as
previously mentioned. In addition to XProperties, any E3 module can be inserted into an
XObject to be executed in the server. To get a complete list of XProperties, just press the
button defining object type and check the list of available options. This allows you to define a
complex management system as a library that can be easily replicated as many times as
needed in your application.

You can insert XObjects in any Data Server by right-clicking the Data Server and choosing Insert
option. Even if your library file has several XControls and XObjects, when you are trying to
insert a library, E3 Studio will only show XControls for Screens and XObjects for Data Servers.

11.2 When to Create an ElipseX


There are some criteria which indicate the need to build objects in Elipse E3:

· Repetition in use: if a device or process is used more than once on the same project

· Known user procedures: often, a process created by a certain company must be copy-

94 ElipseX Libraries
protected. This is common in case of service integrators or machine manufacturers

· Using controllers: a process controller, whose memory mapping is fixed, can be


implemented with all available functions. The available flexibility for building and using E3
objects allows you to use the variables you want, while ignoring the others

NOTE: It is not possible to copy a library and use both files (the original and the copy) in the
same Domain. For example, you cannot copy the .lib file and then split it into two new files.

11.3 Exercises
Let's develop a Display to show temperature value. The Display is formatted with one decimal
place and suffix "°C". Display's background color varies according to temperature value.

11.3.1 Library
1. Click New Project and, in Application Wizard, select option E3 Object Library. Name it
TrainingLib and specify folder path C:\TrainingE3\Library. Click Next, add it to current
Domain, and then finish the process.

11.3.2 XControl
1. Insert an XControl and name it DisplayTemp.

DisplayTemp

2. On Design tab, draw a Display.

3. Format that Display with expression "0.0 °C".

Display format

4. In order to receive any external value, we must create properties. Switch from Design tab to
Properties tab at screen bottom.

Properties tab

5. Create a Double-type property called Temperature.

ElipseX Libraries 95
Property Temperature

6. Switch back to Design tab. In the Display, create a Simple Link between Temperature and
Value properties.

Simple Link

7. To change color according to temperature, create a Table Link in ForegroundColor property,


informing limits and colors. In Source property, search for the previously created property
Temperature.

Table Link

8. In order to use this new object, you must register it. Save changes, right-click Libraries, and
then choose option Register loaded libraries.

Register loaded libraries

9. Insert two XControls DisplayTemp on Screen, next to each tank.

96 ElipseX Libraries
DisplayTemp

10.For each DisplayTemp on Screen, create a Simple Link between Temperature property and
Temp Tag.

11.3.3 PumpTag
1. In library LibTraining, insert a new XObject and name it PumpTag.

2. Create three Boolean-type properties: OnOff, Automatic, and Failure.

PumpTag properties

3. Save and register the library.

11.3.4 Data Server


1. Create, inside Data, a Data Folder named Pumps.

2. In folder Pumps, create six PumpTag objects, from P01 to P06.

PumpTag objects

ElipseX Libraries 97
11.3.5 Pump

Pump

1. Insert a new XControl and name it Pump.

2. Insert an object 3DISABlower from category Blowers of Symbol Library. Change the following
properties:

· OverrideFillMode to 3 - ByBrightness

· OverrideFillColor to green (0, 255, 0)

3. Insert Failure and Automatic figures, which are Resources in project.

4. Insert a Display under the valve, to show the name "Pump".

5. Create a PumpTag-type property called Source (previously created XObject).

PumpTag type

6. To save later work, write in field Help Text the message "Associated object PumpData.
Properties: OnOff, Automatic, and Failure".

98 ElipseX Libraries
7. In order to display figure only when valve is on failure, create a Simple Link between
object's Visible and Failure properties.

· Using the AppBrowser, locate Source property.

· In the bottom field, insert PumpData property after Source property, in this case,
Failure.

AppBrowser

8. Repeat the previous step for Automatic object with Automatic property.

9. In the Display under the valve, the name of the associated XObject PumpData should
appear. Create a Link between Display's Value property and Pump.Source.Name.

10.When property OnOff is True, pump color must be green, and when this property is False,
color must be red.

· On Links tab, create a Digital Link between OverrideFillColor and OnOff properties.

Digital Link

11.Save and register the Library.

ElipseX Libraries 99
11.3.6 SynopticScreen
1. On SynopticScreen, insert a Pump object above each background pump.

2. Link Pump's Source property from SynopticScreen to previously created Pump XObject.

Source property

TIP: You can drag an object to the property you want to link.

Dragging an object to a property

11.3.7 PumpCommand

Command

Let's create an XControl to change OnOff, Automatic, and Failure properties of XObject
PumpTag. There will be a single Screen in this object, which configures all application pumps.

1. Insert a new XControl in Library LibTraining and name it PumpCommand.

2. Create a PumpTag-type property called Source.

3. Create a Check Box , and in its Caption property type "Failure".

4. Create a Bidirectional Link between Check Box's Value property and Source's Failure.

100 ElipseX Libraries


Bidirectional Link

5. Copy Check Box twice. Change Caption property of those objects to "Automatic" and "OnOff",
respectively, and link them to corresponding properties.

6. Insert a text above objects where the name of the associated XObject ValveData
appears.

Creating a Link to the Value property

7. Save and register the library.

11.3.8 CommandScreen
Insert a new Screen on the project, called CommandScreen, 200 by 200 pixels.

1. On CommandScreen, insert a PumpCommand object.

2. On CommandScreen's OnPreShow event, insert the following script:


Item("PumpCommand1").Source = Arg

3. Using AppBrowser, get XControl PumpCommand1, which is inside CommandScreen, and


on the right select Source property.

4. Type " = Arg".

11.3.9 Indexed Screen


When clicking a pump, its command screen must be opened. As we have a single command
screen and several pumps, when opening that screen we must inform pump's name in order to
send commands to it.

1. In XControl Pump, create a script on Click event of the figure depicting the pump:
'Pump's full name
Arg = Pump.Source.PathName
'Open CommandScreen
Application.DoModal "CommandScreen", "Command", 0, 0, , , Arg, 1+2+64+2048

2. Type "Arg = " to create an auxiliary script variable, which holds the clicked pump's name.

3. Using AppBrowser, select XControl Pump, and Source property on the right. Click Paste.

4. Finish the line by typing ".PathName". This property returns the associated XObject
PumpTag's full name.
Arg = Pump.Source.PathName

5. Using AppBrowser, select Viewer's DoModal method and click Paste.

ElipseX Libraries 101


Application.DoModal(Screen, Title, Left, Top, Width, Height, Arg, Flags)

6. Change Screen parameter to Screen's name to open, CommandScreen.

7. Change Title parameter to "Command". This is Screen's title, as long as Screen's Caption
property is blank.

8. Change Left and Top parameters to 0. Forcing Screen to open centralized is done on another
parameter.

9. Change Width and Height parameters to a space, thus using Screen's original size.

10.Arg is an information passed to the opening Screen. This parameter has been already
defined as pump's full name.

11.Change Flags parameter to 1+2+64+2048, which means title bar (1), close button (2),
movable (64), and centered (2048).

11.4 Additional Exercises

11.4.1 Multiple Links


Many times you want to change a Link's source, depending on one or more variables. For
example, you can link the final color of a tank considering whether pump is turned on or off.

There are eight possible combinations for three pumps. To change Boolean values into
decimals, use the following expression:
4 * Pump1 + 2 * Pump2 + Pump3

Since in VBScript a True value is numerically equivalent to -1, previous expression must be:
-4 * Pump1 - 2 * Pump2 - Pump3

Final color must be:

RED GREEN BLUE STATUS DESCRIPTION


0 0 0 0 RGB(0, 0, 0)

0 0 1 1 RGB(0, 0, Blue)

0 1 0 2 RGB(0, Green, 0)

0 1 1 3 RGB(0, Green,
Blue)

102 ElipseX Libraries


RED GREEN BLUE STATUS DESCRIPTION
1 0 0 4 RGB(Red, 0, 0)

1 0 1 5 RGB(Red, 0, Blue)

1 1 0 6 RGB(Red, Green,
0)

1 1 1 7 RGB(Red, Green,
Blue)

To apply this logic, you can use a Multiple Link.

1. In tank's rectangle, change Link's ForegroundColor property, according to the following


table:

ForegroundColor property

11.4.2 KB
· KB-28547: Using a library developed in a different Domain.

ElipseX Libraries 103


11.5 Notes

104 ElipseX Libraries


CHAPTER

12Databases

An E3 Database is used to store information of the project referring to Historics, Formulas, and
Alarms. It supports MDB (Microsoft Access), Oracle, and Microsoft SQL Server formats. To use
this resource, follow these procedures:

1. Right-click the project name and then Insert - Database.

2. In case of an Access database, type the desired file name (whether it exists or not) in the
MDB file field.

3. Leave the User and Password fields blank. These fields are used only if the specified
database for the connection already has a user and a password.

4. Leave the DB password field blank. As it was previously specified, this field is only used in
case the specified database has a password.

5. Click OK to finish these settings.

12.1 Exercises
This database will be used to store all project's Alarm and Historic data.

12.1.1 SQL Server Management Studio


1. Open SQL Server Management Studio using the Start - Programs - Microsoft SQL Server 2008
menu.

SQL Server Management Studio

2. To connect to a database, you must type the server, the user, and the password.

Databases 105
Connect to a database

3. In the Server name field, click the Combo Box and select the server on the list.

List of available servers

4. In the Authentication field, select the option SQL Server Authentication. In the Login field,
type "sa" and in the Password field, type the password created during installation.

5. Click Connect. If information is correct, Studio connects to the database server.

Connected to the database server

106 Databases
12.1.1.1 Creating Databases
1. Right-click the item Databases and choose the option New Database.

Add new database

2. In the Database name field, type "E3Training". Click OK.

Database Name field

3. Check if the database just created appears in the list of databases.

E3Training database

Databases 107
12.1.2 Database
1. Insert a new Database in the E3Training project, named Database.

Insert Database

2. Choose type as 2 - stSqlServer.

3. Configure connection parameters.

108 Databases
Database configuration

4. Test database connection.

12.2 Additional Exercises

12.2.1 KB
· KB-29527: Other databases supported by E3.

Databases 109
12.3 Notes

110 Databases
CHAPTER

13Alarms

E3 Alarm module comprises basically two units, whose functionality is connected logically:

· Alarm Server: Organizes the way events and alarms are handled

· Alarm Configuration: The object responsible for creating and configuring alarm sources

13.1 Alarm Server


The Alarm Server object centralizes all the project's alarms. There, you can find the total active
alarms of the application (whether acknowledged or not). It is also responsible for reporting
alarm events for all connected Viewers, as well as sending these events to Databases.

IMPORTANT: There can only be one Alarm Server object per Domain, and its presence is
mandatory for alarm verification.

With Configuration tab, you can specify if the alarms will be stored in the Database. Alarms
can either be viewed in an E3Alarm or in an E3Browser, which are Screen objects seen later in
this Tutorial.

13.2 Alarm Configuration


The Alarm Configuration object is where alarm sources are created. To insert this object in a
project, right-click the Organizer, choose the Insert - Alarm Configuration option, and then the
name of the project.

13.2.1 Area
The Area object allows grouping a set of Alarm Sources, as well as other Alarm Areas. This
facilitates the management, operation, and monitoring of a set of related alarms, allowing, for
example:

· Filtering the set of visible alarms in the summary

· Enabling or disabling a set of Alarm Sources

· Acknowledging a set of Alarm Sources

Alarms 111
· Checking the amount of active or unacknowledged alarms of a set of Alarms Sources

In case you need it, new Areas can be inserted inside other Areas.

13.2.2 Alarm Sources


Alarm Sources define all information regarding alarm conditions. In each Alarm Source you will
be able to configure its limits, the message regarding the event, its severity, and whether or
not this event needs acknowledgement. All Alarm Sources have the following general
properties:

PROPERTY DESCRIPTION
Message text This is the text linked to the alarm condition
that appears in the viewing object (E3 Alarm),
Database, etc. It may contain up to 255
characters.

Severity This indicates the severity of the alarm. It


may be Low, Medium, or High. Severity is
used for filtering and sorting messages.

Need Ack This indicates that the alarm must be


acknowledged by the operator in order to be
removed from the alarm list in an E3Alarm, or
whether it is automatically acknowledged
when the variable leaves an alarm condition.

Return message Whenever an Alarm Source leaves the alarm


condition, this message is displayed on
viewing objects.

There are several types of Alarm Sources that can be inserted into an Alarm Area.

112 Alarms
13.2.2.1 Analog
Allows monitoring analog variables, by specifying up to four alarm levels, which are LOLO (very
low), LO (low), HI (high), and HIHI (very high).

Analog Alarm Source

13.2.2.2 Digital
Allows monitoring a digital variable (or expression), by specifying an alarm when in a rising
edge (in -1 or True) or in a falling edge (in 0 or False).

Digital Alarm Source

Alarms 113
13.2.2.3 Dead Band
Allows monitoring an analog variable by specifying a maximum difference limit (dead band
value), relative to a reference value (Setpoint).

Dead Band Alarm Source

13.2.2.4 Rate of Change


Allows monitoring really fast variations in a process variable. The Rate of Change Alarm
Source's values are specified in variable units per second.

Rate of Change Alarm Source

114 Alarms
13.3 E3Alarm
The E3Alarm object is a tool for monitoring active or unacknowledged alarms in a system. By
using this object, you can verify alarm status in the system, as well as acknowledge them
manually. To use this object, right-click the working area, and then select the Insert - E3Alarm
option.

E3Alarm

On E3Alarm's General tab, you can specify information regarding the Alarm Server and its
filters.

General tab

Alarms 115
13.4 Exercises

13.4.1 Alarm Server


An application can only have one object of this type, and its presence is mandatory for alarm
verification. It is responsible for reporting alarm events to all connected Viewers, as well as
sending these events to a Database, if desired.

1. Insert an Alarm Server object in E3Training.

Insert Alarm Server

2. Go to the Alarm Server properties and, on Configuration tab, enable the Store alarm events
in the database option.

3. In the Use this database server option, choose Database.

4. Enable the Discard data from the main table option.

· Keep data from last 3 months

· Checking must occur every 1 month

5. Click the Fields button and select the fields you want. In order to have E3Playback working
properly, insert the following fields:

116 Alarms
· EventTimeDbl

· FullAlarmSourceName

· ConditionActive

· Acked

· AckRequired

6. At last, click the Create Table button. A success message is displayed.

Generating table structure

13.4.2 Alarm Configuration


1. Insert an Alarm Configuration object in the project.

Insert Alarm Configuration

Alarms 117
13.4.3 Analog Alarm
1. Create, inside the Alarm Configuration, a new Area by pressing the Add button and change
its name to Level.

Add an Alarm
Area

2. Select the Area just created and click the Add button. Insert an Analog-type Alarm Source.

Add Analog Alarm

3. Rename the Analog Alarm to Tank1.

4. Click the editing area of the Alarm Source Tank1 and, with the AppBrowser, select the
Value property of the Tag Level1 from folder Data.

5. Go to the alarm properties of Tank1, Analog tab.

· Check the item LoLo, with a limit of 10 and a message "Level 1 Very Low"

· Check the item Lo, with a limit of 30 and a message "Level 1 Low"

· Check the item Hi, with a limit of 70 and a message "Level 1 High"

· Check the item HiHi, with a limit of 90 and a message "Level 1 Very High"

· In the item Return message, type "Level 1 normalized"

6. Copy the Alarm Tank1 to create the Alarm Tank2.

7. Link Tank2 to Tag Level2 and change alarm messages.

Linking alarms with Tags

118 Alarms
13.4.4 Dead Band Alarm
1. Insert a new Area named Temperature.

2. In Temperature, insert a Dead Band Alarm named Tank1.

3. Link this Alarm to Tag Temp1 from folder Data.

4. Go to the alarm properties, Dead Band tab.

5. Configure the following properties:

1. Setpoint:50

2. BM: 10

3. Message text: Temperature outside the recommended range

Dead Band Alarm

6. Copy the Alarm Tank1 to create the Alarm Tank2.

7. Link the Alarm Tank2 to the Tag Temp2 and change Alarm messages.

Link from Alarms to Tags

Alarms 119
13.4.5 Digital Alarm
1. In the PumpData object, insert an Alarm Configuration.

2. Select the Alarm Configuration and create a new Area named Pump.

3. In the Pump area, insert a Digital Alarm named Failure.

Digital Alarm Failure

4. Link the Alarm Failure to the Failure property of the object.

5. Go to the properties of the Alarm Failure, Digital tab:

· Check the option Digital Alarm

· Choose the option True in Alarm Value

6. In order to display the name of the pump in the Alarm messages, create the Links as in the
next figure.

Digital Alarms

13.4.6 E3Alarm
Viewing Alarms in real time can be performed using an E3Alarm object.

1. Place an E3Alarm object in the AlarmScreen.

2. In the properties of the E3Alarm, General tab, select the name of the Alarm Server.

120 Alarms
Selecting an Alarm Server

3. The same configuration can be performed using the Properties List. In the AlarmServer
property, type the name of the Alarm Server, or drag it to the property.

AlarmServer property

4. Go to E3Alarm properties. On Columns tab, select DateTime, Operator, Message,


Acknowledged, and Value fields.

5. On Colors tab, configure it as you want.

6. Run the application and check its functionalities.

Alarms 121
13.5 Additional Exercises

13.5.1 Acknowledging All Alarms


Let's create a button to acknowledge all active alarms.

1. In the AlarmScreen, create a button with the text "Acknowldedge".

2. In this button, create the following script on Click event.


'Acknowledge all alarms
Screen.Item("E3Alarm1").AckAll(Application.User)

3. With the AppBrowser, search for the object E3Alarms1 in the AlarmScreen, and on the
right the AckAll method.
Screen.Item("E3Alarm1").AckAll([Operator])

4. Replace the Operator parameter by the name of the user logged in the Viewer. With the
AppBrowser, search for the User property of the Viewer.

13.5.2 KB
· KB-29110: Playing a sound file whenever the alarm becomes active.

· KB-17370: Playing sound whenever alarm is active.

122 Alarms
13.6 Notes

Alarms 123
CHAPTER

14Queries

The Query object helps in the process of defining queries in the application's Database. Every
time E3 needs to search for data in the Database, a command needs to be sent in order to
know which data is needed for that object. For this search, every time an application needs to
record or to search for stored data in a Database, commands in SQL (Structured Query
Language) format are sent to the database.

The Query presents a friendly interface that allows building SQL queries using a graphical
interface and following the immediate results of the generated SQL code. The Query allows
showing the last data from n days, hours or months, initial or ending date and queries,
depending on the implemented filter.

The Query Configuration Wizard is responsible for creating the text that makes the filter or the
query, but it is not necessary for the user to know implementation details such as dates, etc.
To use this resource, right-click the project Screen and select the Insert - Query option.

NOTE: When a Report, an E3Chart, or an E3Browser object is created, a Query object is


automatically added to it. However, you can insert a Query into a Data Folder or onto a
Screen and also use its data via scripts.

14.1 Creating a Query


1. Defining a Query starts when the user selects the Database Server where the Query
retrieves data.

Defining the Database Server

2. After defining the Database, a new window is opened with the tables that were found,
allowing their selection.

124 Queries
Selecting tables

3. Select the tables which are part of the Query and click Add.

4. On Fields tab, you can add fields returned by the Query, as well as define filters and sorting.

5. On Variables tab, the variables created for filters are displayed.

6. On Visualize tab, you can preview the Query.

7. On SQL tab, you can view and edit SQL code.

Window for configuring the Query

The previous window can be accessed by right-clicking the Query object and selecting the
option Configure.

Queries 125
14.1.1 Creating and Accessing Variables
On Query's configuration window, you can add filters directly into the fields. These filters can
be formed by variables defined by script, via Query's SetVariableValue method. How variables
can be declared depends on the data type they represent, as follows:

· Number: <%Variable_Name%>

· String: '<%Variable_Name%>'

· Date and time: #<%Variable_Name%>#

14.2 E3Browser
An E3Browser is an ActiveX control (developed by Elipse Software) used to view data stored in
a Database, generated by E3 or by any other software. You can configure Queries by using
filters of several data types and by setting colors for each column, among other settings. This
object is used for viewing Historics, Alarms, or any other table existing in the Database.

E3Browser

To use this resource, insert an E3Browser in the project by right-clicking the working area and
selecting the option Insert - E3Browser.

126 Queries
Insert E3Browser

An E3Browser uses the Query object to help the user define queries on the application
database.

14.3 Exercises
Let's view alarm data stored on a Database as a table, using an E3Browser.

14.3.1 EventScreen
1. Insert a new Screen in the project, called EventScreen, to be opened on
Central_Area Splitter. Check option Set as initial Splitter's Screen.

2. On MenuScreen, insert a button to open EventScreen.

14.3.2 E3Browser
1. Insert an E3Browser on EventScreen.

2. To configure data displayed by this E3Browser, double-click it and select Query tab.

3. Select Query1 and click Configure.

Queries 127
Query tab

4. Select the Database containing the table to query.

5. Choose Alarms table.

6. Select all fields on Alarms table.

Alarms table

7. Go to Visualize tab and click Execute Query to check Query's result.

Execute Query

8. Click OK. After finishing this step, all fields listed on the Query are available in E3Browser.
Configure each field with color, formatting, and size you want.

128 Queries
Query configuration

14.3.3 Query Filters


Oftentimes, accessing the whole content of a table becomes impossible due to the amount of
stored data, number of fields, or number of records. In such cases, you must add filters to the
Historic.

1. Insert on EventScreen two Setpoints named spStartDate and spEndDate, and two
texts according to the following figure.

Setpoints for choosing dates

2. Use a Viewer method to display a calendar for users to choose a date. Create a new script
on Setpoint's Click event.
'Calls a Calendar function
If Application.ShowDatePicker(DateTime, 0, 0) Then
'Passes the chosen date to the SetPoint
Value = DateTime
End If

3. With the AppBrowser , search for Viewer's ShowDatePicker method, and then click Paste.
Application.ShowDatePicker(DateValue, Left, Top, [DefaultDate])

4. The DefaultDate parameter is optional and informs the selected date in the calendar.

Queries 129
Delete it because we need a default value, which corresponds to the current date.

5. Replace the Left and Top parameters by 0 or the coordinate you want when opening a
calendar.

6. The DateValue parameter must be replaced by an internal script variable. Call this variable
as DateTime.

7. The ShowDatePicker method returns true if users click OK, and false if users click Cancel.
Only when clicking OK you should pass the calendar value to the Setpoint. Type "If" at the
beginning of the command line ShowDatePicker and "Then" at the end.
If Application.ShowDatePicker(DateTime, 0, 0) Then

8. To pass the calendar date to the Setpoint, type the following text on the next line.
Value = DateTime

9. Since you are writing a script in the Setpoint and you want to reference its Value property,
you can directly type the name of the property without its full path.

10.End the script by typing "End If".

11.Open E3Browser's Query object. This can be performed by double-clicking the object in the
Organizer or on E3Browser's Query tab.

E3Browser Query

12.On Filter column of E3TimeStamp field, click the button.

13.To be able to choose a starting and ending date, you must create query variables. Configure
the filter according to the following figure.

Configuring a filter

130 Queries
14.Type an initial value for variables created on Variables tab.

Variables of the Query

15.Open the Visualize tab and click Execute Query to check the Query result. Make sure the
filter was applied and then click OK.

16.On EventScreen, below the Setpoints, create a Query button, and insert a new script on
its Click event with the following lines.
'Reference to Setpoints
StartDate = Screen.Item("spStartDate").Value
EndDate = Screen.Item("spEndDate").Value
Set query = Screen.Item("E3Browser1").Item("Query1")
'Configure Query variables
query.SetVariableValue "StartDate", StartDate
query.SetVariableValue "EndDate", EndDate

17.Type the script's internal variable, "StartDate = ".

18.With the AppBrowser, search for the Setpoint spStartDate and on the right for its Value
property.
StartDate = Screen.Item("spStartDate").Value

19.Repeat the previous step to create the internal variable EndDate, referencing the value
of the Setpoint spEndDate.
EndDate = Screen.Item("spEndDate").Value

20.With the AppBrowser, search for the Query1 inside E3Browser1. On the right select
the SetVariableValue method.
Screen.Item("E3Browser1").Item("QUery1").SetVariableValue(VarName, Value)

21.Place a line break after ("Query1").


Screen.Item("E3Browser1").Item("Query1")_
.SetVariableValue(VarName, Value)

22.Type, at the beginning of the line, the text "set query = ". This way you will create an internal
script variable which references the Query object.
Set query = Screen.Item("E3Browser1").Item("Query1")

23.At the beginning of the line containing the SetVariableValue method, type "query.".
query.SetVariableValue(VarName, Value)

Queries 131
24.The VarName parameter references the name of the variable created in the Query. Type
"StartDate".

25.In the Value parameter, inform the value you want to pass to the variable. In this case, you
want to pass the Setpoint value referenced the internal variable StartDate.
query.SetVariableValue "StartDate", StartDate

26.Remove the surrounding parentheses of the SetVariableValue method.

27.Copy the line to implement the same logic to the variable EndDate.
query.SetVariableValue "EndDate", EndDate

28.Compile the script and test it.

14.4 Additional Exercises

14.4.1 KB
· KB-20214: SQL function to calculate maximum, minimum, and average values.

132 Queries
14.5 Notes

Queries 133
CHAPTER

15Historics

Historics are modules responsible for storing application data in a database. They allow
storing process data for future analyses, in E3 or in any other tool.

You can create as many historic files as you want, each one containing several Tags or
expressions. Each Historic can create or use an independent table inside the Database, whose
storage can be defined by Time or by Event. You can also determine which Database inserted
into the project is used for data storage. To use this resource, right-click the project name and
select the Insert - Historic option

To create the historic table, it is important to create its fields. Such fields can be inserted with
the (Add a field) button. To remove any unwanted field, click the (Remove field) button.

Historic

15.1 Primary Key


A Primary Key is a field or a set of fields that identify a record in a table in a unique way. Just
like the main index for a table, it is used to link data between tables. After defining a field to be
the primary key of a table, the Database itself guarantees that duplicate data are not inserted
into primary key fields.

There are two types of primary keys, Simple and Compound. A Simple Primary Key is a field that
uniquely identifies every record in a table. A Compound Primary Key can be formed by the
combination of two or more table fields. There are cases when a single field is not capable of
behaving as a primary key because it may have repeated values. In addition, a table can have
only one primary key, either simple or compound. That means you cannot define two or more
fields of a table to be separated single primary keys. Do not confuse this with compound
primary keys, where two or more fields form a single primary key on a table. When choosing
Primary Key fields, consider the following details:

· Duplicated or null values are not allowed

· In case there is no single identifier for a certain table, you can use a field that generates

134 Historic s
sequential numbers

The primary key can be configured in two ways: by verifying in the Historic Screen the table
field that you want to turn into a Primary Key and enabling it using the , or by clicking the
icon , which opens the configuration window.

15.2 Indexes
An Index is a field or a set of fields which are previously sorted by the Database in order to
improve the performance of queries using this index. They are used to find out records with a
specific value in a column. Without an index, the Database must start at the first record and
then read all the records until it finds out the relevant records. The larger the table is, the
higher the cost of processing time will be. If the table has an index for these columns, the
Database can rapidly get a position to search for in the middle of data files without having to
scan all records. The available index types are Primary, Unique, and Index.

You may create indexes in multiple columns. A multiple column index can be considered a
sorted array which contains values created by concatenating values of indexed columns.

Indexes can be configured using the icon, which opens the configuration dialog box, shown
on the next figure.

Index Editor

15.3 Exercises

Historic s 135
15.3.1 Historic

1. Right-click the item Databases and insert a new Historic in the project E3Training,
naming it as LevelHist.

Insert Historic

2. In the Historic just created, insert two new fields and configure them as follows.

Field configuration

3. Click the option Historic Properties , and on Historic tab, configure the following
properties:

· Database: Database

· Table: Level

· Write time: 2000 ms

4. Click the Create Table button. The message "The database table structure was created

136 Historic s
successfully" should then appear.

Table successfully created

15.4 Additional Exercises

15.4.1 KB
· KB-24714: Number of fields in a Historic.

Historic s 137
15.5 Notes

138 Historic s
CHAPTER

16E3Chart

An E3Chart is an ActiveX component specially created to work alongside E3. With it, you can
display charts with Tags varying in real time and also display historic data stored in a
Database.

Each data sequence is represented by Pens on an E3Chart. Each Pen has data linked to it, and
this data can either be Tags or Query fields. You can create several axes with different scales
to be linked to Pen's data.

E3Chart

To insert this object on a Screen, right-click it and select option Insert - E3Chart.

E3Chart 139
16.1 Pen Configuration
A Pen Collection object represents a set of Pens contained on an E3Chart. Each Pen is
configured to show real time or historic data coming from a Query. On Pens tab, you can
configure the number and type of Pens to be created in Pens Collection. When you go to this
tab and click Add, a new Pen is created in E3Chart.

Pen properties

16.1.1 Real-Time
To configure a Pen as Real-Time, select Realtime option on Pen properties' Data tab, available
at Pen Type item. After that, define Tags at Vertical axis link and Horizontal axis link options.

140 E3Chart
16.1.2 Historic
A Query object is also used to show historic values on an E3Chart. On Queries tab you can add,
delete, or configure Queries. To create a Historic Pen, a Query must have been previously
created. To do so, go to Pen properties' Data tab, select Historic option, available at Pen Type
item, and define a Query. Then define Query fields at Vertical axis field and Horizontal axis field
items.

16.1.3 Real-Time and Historic (Mixed)


To configure a Pen as both Real-Time and Historic, go to Pen properties' Data tab, and select
item Realtime & Historic at Pen Type option. This Pen type is used when you want to have old
data and current Tag values on the same Pen.

16.2 Exercises
Let's create a Real-Time and Historic chart with level variables. Using a button, let's choose
between a chart displaying its horizontal axis as real-time or historic.

16.2.1 ChartScreen
1. Insert a new Screen named ChartScreen in the project, to be opened on Splitter
Central_Area. Check option Set as main screen.

2. On MenuScreen, insert a button to open ChartScreen.

16.2.2 E3Chart
1. Place an E3Chart on ChartScreen.

16.2.3 Scale
Higher values are from Tag Level, which varies from 0 to 100, so let's change vertical scale to
display values inside that range.

1. On Axes tab, select Vertical Axis and then click Configure.

2. On Scale tab, configure numeric scale limits between 0 and 100.

16.2.4 Query
As we want to view historic data, we must configure a Query.

1. Go to E3Chart properties, on Queries tab.

2. Click Add. Select "Database" in field Server Name, and then choose table Level.

E3Chart 141
3. Select fields E3TimeStamp, Level1, and Level2.

4. View query results on Visualize tab and then click OK.

16.2.5 Pens
1. On Pens tab, click Add.

2. Double-click the Pen, and open its properties.

3. Change Pen's name to Level1.

Pen properties

4. On Data tab, leave option Pen type as Real Time.

5. In option Vertical axis link, select Value property of Tag Level1 from folder Data.

6. On item Historical data configuration, fill in the following fields:

· Local query: Query1

· Vertical axis field: Level1

· Horizontal axis field: E3TimeStamp

Pen data

7. Repeat the last two items to create Level2 pen, linked to Level2 Tag, and then click OK.

142 E3Chart
16.2.6 Legend
1. On Legend tab, select option Show legend, size 60, and add all columns you want.

2. Configure column Value of tag X to display its value in the format "HH:mm:ss".

16.2.7 Pen Visibility


1. To enable or disable Pen visibility, add a Check Box on ChartScreen.

2. In this Check Box, create a script at Change event, and search for Level1's Visible property.

Pen's Visible property

3. Add the following code to the script:


Screen.Item("E3Chart1").Pens.Item("Level1").Visible = Value

4. With AppBrowser, search for the E3Chart inside ChartScreen, Pens collection, Pen
Level1, and on the right select Visible property. Click Paste.

5. Type " = Value". Since you are writing this script for a Check Box, when typing "Value", you are
creating a reference to object's value itself.

6. Configure Check Box's initial value (Value) to True.

7. Repeat this procedure for Pen Level2.

16.2.8 Historic Horizontal Axis


To navigate through charts querying old data, horizontal axis must be configured as Historic.

1. Go to E3Chart properties, on Axes tab.

2. Select HorizontalAxis, and then click Configure.

3. On Scale tab, choose option Time interval (historic).

E3Chart 143
Time interval

4. Choose a small initial interval (five minutes), so that Screen loads faster.

16.2.9 Chart Interval


1. To choose initial and final dates viewed in an E3Chart, copy Setpoints with initial and final
date from EventScreen to ChartScreen.

Starting and ending Date

2. In the Setpoint with starting date, create a Bidirectional Link with Initial date, and create a
Bidirectional Link with E3Chart's HorScaleBegin property.

Bidirectional Link

3. In the Setpoint with ending date, create a Bidirectional Link with E3Chart's HorScaleEnd
property.

16.3 Additional Exercises

16.3.1 Recent Minutes


Let's open this Screen by displaying the last 10 minutes in the chart. The easiest way to do this
is by using VBScript's Now command. To move back one day, use Now - 1. To move back one
hour, Now - 1 / 24.

1. On ChartScreen's OnPreShow event, insert the following script:


'Chart displays last 10 minutes.
Item("E3Chart1").HorScaleBegin = Now - 10 / 1440
Item("E3Chart1").HorScaleEnd = Now

2. With AppBrowser, search for the E3Chart inside ChartScreen, and on the right select

144 E3Chart
HorScaleBegin property.

3. Type " = Now - 10 / 1440".

4. With AppBrowser, search for the E3Chart inside ChartScreen, and on the right select
HorScaleEnd property.

5. Type " = Now".

16.3.2 KB
· KB-18257: Creating a chart with digital points.

E3Chart 145
16.4 Notes

146 E3Chart
CHAPTER

17Reports

A Report is an ActiveX component called ActiveReport, which allows viewing and printing
snapshots of system's variable values and data stored in a Database (Alarms, Historic
Queries, and Formulas). To use a Report, right-click item View - Reports in Organizer, in Domain
mode, and select Insert Report in, and then project's name.

A Report also uses a Query object. This object allows specifying Database's data source to be
displayed in a Report.

A Report contains several sections. Each Report section contains a group of controls,
processed and printed at the same time, as if they were a single unit.

Report sections

A Report is structured in the following way:

Report structure

SECTION DESCRIPTION
Report Header This section prints at Report's beginning. It is
used to print Report headings, sum tables,
charts, or any other information that needs
to appear only at Report's beginning.

Report Footer This section prints at Report's end. It is used

Reports 147
SECTION DESCRIPTION
to print a Report sum, grand totals, or any
another information that needs to be printed
once at Report's end.

Page Header This section prints on top of each Report


page. It is the first section printed on a page,
except when a page contains a Report Header
section. It is used for printing column
headings, page numbers, page titles, or any
other information that needs to be printed at
each page's beginning.

Page Footer This section prints once at the bottom of


each Report's page. It is used for printing
page totals, page numbers, or any another
information that needs to be printed once at
each page's bottom.

Detail This section is the Report's body, which prints


once for each data source's record.

Group Header, Group Footer A Report can have multiple nested groups.
Each group has a Header section and a Footer
section. A Header section is printed right
before any Detail section in a group. A Footer
section is printed right after a group's Detail
section.

A Report's toolbar has three configuration items that allow editing and viewing a Report, as
well as creating scripts. These items are:

· Preview Report: By using this option, you can preview a Report. With it, you will be able
to check margin settings, figures, etc.

· Report Settings: With this option, you can configure Page Settings, Preview Settings, Grid
Settings, and Report Style

· Script Editor: By using this option, you can edit scripts for a Report. In Object field, it is
necessary to specify for what object you want to create the script, and in Events field, the
Report event where action takes place

148 Reports
17.1 Report Objects
The Report tool has several specific objects that can be used, and they can be accessed on
Report's toolbar.

Report's toolbar

The available options on this toolbar are:

· Line: Basic straight line object that connects any two points. It allows you to draw
straight lines, by specifying two points when creating it, or in polygons

· Rectangle: This object allows you to draw a rectangle, using up the complete object's
width and height. It is created with at least two vertices

· Round Rectangle: This object is created by using two vertices, and you have the option
of rounding the edges by a rounding factor. When inserted or edited, it shows a small point
next to the object's upper left edge, which allows modifying the rounding factor

· Ellipse: This object allows drawing circles and ellipses, using up the complete object's
width and height, and defining the center of the circle in rectangle's center

· Picture: This object allows displaying images stored inside or outside an application file

· Text: It allows creating text labels. When defining Screen's area, you can directly type
the text, which also accepts multiple lines

· Setpoint: By using a Setpoint object, you can link it to a table field in a Database. This
field is specified in DataField property

· BarCode: It allows generating a figure that converts a sequence of numbers and


characters into a barcode. This code is a numerical or alphanumerical representation, used
to facilitate different processes. This code is recognized by scanners and optical reading
devices

· Page Break: It marks where a page finishes and another one starts on a Report. For
example, you can force a page break to make sure a chapter title always starts at a new
page

· Table: It is an object composed by rows and columns, where text or charts are inserted.
Tables in Reports are used to organize and present information. You can also use tables to
create page layouts

· E3Chart: This object is used to view Report data on a graphical format. For further
information on this object, please refer to E3Chart's specific chapter

Reports 149
· / Bring to Front / Send to Back: Using these buttons, you can bring an object to the
front or send it to the back of another object. When choosing Bring to Front or Send to Back
options, the selected object is placed on layer order's first or last position, respectively

· Load RPX File: Imports Report configuration from an external file

· Save as RPX File: Exports Report configuration to an external file

NOTE: The Printer option in E3 icon on Windows Notification Area displays a list of printers
found either locally or remotely, and allows you to choose one to be used by E3 Server.

17.2 Exercises
Let's create a Report to print Screen's chart, and then all data displayed in that chart.

17.2.1 Chart Report


Let's create a chart report, which copies Screen's chart settings. This report will be printed and
exported as PDF.

1. Insert a Report in the project, called ChartReport.

2. On PageHeader section, insert an E3Chart object.

3. Go to Script Editor, by clicking .

4. On field Object choose PageHeader, and on field Events choose OnBeforePrint.

5. Between texts "Sub OnBeforePrint" and "End Sub", type the following script:
Set Chart = Report.Sections("PageHeader").Controls("E3Chart1")
Set ScreenChart = Application.GetFrame("Central_Area").Screen.Item("E3Chart1")
Chart.CopyConfig(ScreenChart)
Chart.LoadData()

17.2.2 Print
Before exporting the Report, we can view how it looks like when printed.

1. On ChartScreen, insert a Command Button labeled "Print".

2. Create a script on Click event, which uses a Print Report Pick. Select ChartReport, and
then choose Screen on Output option.

150 Reports
17.2.3 Export
To help users to choose the name and directory of the file to generate, let's open a dialog box
for this.

1. Insert a button on ChartScreen and change its text to "Export".

2. Create the following script on button's Click event:


'Export
If Application.ShowFilePicker(False, FileName,"pdf", _
128, "PDF Files|*.pdf|All files|*.*") Then
Set Report = Application.LoadReport("ChartReport")
Report.Export "PDF", FileName
End If

3. With AppBrowser, search for Viewer's ShowFilePicker method.


Application.ShowFilePicker(Open, FileName, Extension, Flags, Filter)

4. Since you want to save a file, replace Open parameter with False.

5. FileName parameter must be an internal script variable to store file name. Replace it by
"FileName".

6. In case you do not inform a file extension, default is whatever is in Extension parameter.
Type "pdf".

7. To display a user's confirmation message in case a file already exists, change Flags
parameter to 128.

8. These file dialog boxes allow filters to search for file types.

File types

9. A filter is always a pair of Strings separated by a vertical bar (|), first item being the name
displayed to the user and second one being a Windows identifier.

10.Replace Filter parameter by "PDF files|*pdf | All files| *.*".

11.A file can only be generated if a user clicks Save. If a user cancels this action, nothing will
happen. At the beginning of ShowFilePicker command type "If", and at the end type "Then".

12.To export a Report, use AppBrowser to search for item Tasks - Load Report - ChartReport, and
on the right select Export method.
Set Report = Application.LoadReport("ChartReport")
Report.Export([ExportFilter], [ExportFileName])

Reports 151
13.Replace ExportFilter parameter by "PDF", and ExportFileName parameter by FileName
variable previously created.

14.Test application's new functionalities.

17.2.4 Alarm Report


1. Right-click project and insert a Report object. Rename it to AlarmReport.

2. In Report's Query1 object, right-click it and choose option Configure.

Configuring a Query

3. Select all fields you want from Alarms table.

4. Create a filter for E3TimeStamp field, according to the following figure.

Configuring a filter

5. Test Query by informing values to variables.

152 Reports
17.2.5 Page Header
This section is printed on top of each Report page. It is the first section printed on a page,
except when this page contains a Report Header section. It is used to print column headings,
page numbers, page titles, or any other information that needs to be printed at each page's
beginning.

1. For each chosen field in Query, insert new Text objects in Page Header section, and configure
them with field names. These are column titles.

17.2.6 Detail
The Detail section is the Report's body, which prints once for each data source's record. For
this application, let's display alarm data.

1. In Detail section, insert a Setpoint for each field, aligning it with its respective text. In
DataField and Text properties, type the exact column's name configured in Query.

2. To preview the Report, click .

17.2.7 Page Footer


This section is printed once at the bottom of each Report's page. It is used to print page totals,
page numbers, or any another information that needs to be printed once at each page's
bottom.

1. Using data fields in an E3 Report is very flexible, being configured in the field executing that
function. For example, let's create an indication of "Page 1 of 12" in PageFooter section.

2. Insert two Texts, "Page" and "of".

3. Between these Texts, insert a Display and configure it to show current page number.

· SummaryType: 4 - ddSMPageCount

· SummaryRunning: 2 - ddSRAll

4. After the "of" Text, insert a Display and configure it to display total page count.

· SummaryType: 4 - ddSMPageCount

· SummaryRunning: 0 - None

Page Footer section

Reports 153
17.2.8 Report Header and Footer
These sections are printed at Report's beginning or end. They are used to print Report titles,
sum tables, charts, or any other information that needs to be displayed once at Report's
beginning or end.

1. Right-click the Report and choose Insert - Report Header/Footer. This option inserts both a
start and a final page in the Report.

Insert Report Header and Footer

2. In Report Header section, draw a Report's cover.

3. In Report Footer section, insert a Setpoint object and configure its DataField property with
Clock path from Data folder, Data.Clock.

4. Insert a second Setpoint and configure it to display the name of Viewer's logged in user.

DataField property

5. Insert two Text objects, "Report generated in" and "By the user", according to the following
figure.

Report Footer section

17.2.9 Print
1. To view the Report at run time, on EventScreen copy the Query button to create a new
button labeled "Print".

2. On button's Click event, create the following script:

154 Reports
' Prints the Report
' Referencing Setpoints
IniDate = Screen.Item("spInitialDate").Value
EndDate = Screen.Item("spEndDate").Value

' Referencing Report's Query


Set Report = Application.LoadReport("ChartReport")
Set Query = Report.Item("Query1")
' Sets Query variables
Query.SetVariableValue "InitialDate", IniDate
Query.SetVariableValue "EndDate", EndDate
' Preview printing
Report.PrintPreview()

3. On the line referencing Query object, use AppBrowser to go to Tasks - LoadReport -


AlarmReport - Query1.
Set Report = Application.LoadReport("ChartReport")
Set query = Report.Item("Query")

4. At the end of the script, again using AppBrowser, go to Tasks - Load Report - ChartReport, and
on the right select PrintPreview method.

5. Delete the line referencing the Report, because it was already declared at the beginning.
Report.PrintPreview()

6. Test Print(PrintPreview) method. Only data inside a specified interval can be printed.

Reports 155
17.3 Notes

156 Reports
CHAPTER

18Formulas

Formulas are modules created to store and transfer value sets to certain groups of variables,
in order to create pre-defined configurations, being basically an implementation of recipes.
Formulas are basically composed of three parts:

· Templates: Define data types that can be stored in any formula variable and their
restrictions. These restrictions allow enabling or disabling value changes in formulas at run
time, or else defining limits for changes

· Units: Define Tags that will be linked to a formula template. You can create several units,
that is, several Tag groups that will be able to receive values from a formula

· Value Sets: These are values that will be transferred to Tags, that is, to Units

Formulas are always linked to a Database, because they need to make sure that data
(Templates, Units, and Values), configured at any moment, remain valid whenever needed. To
work with Formulas, you can use any database type, and E3 Studio or E3 Server themselves
create necessary tables and relationships for use with Formulas.

NOTE: When using MDB (Microsoft Access) databases, it is interesting to create specific files
for Formulas and Historics, in order to avoid data loss in case of any problem.

18.1 Exercises
The Formula object will store information about ink colors, formed by a combination of red,
green, and blue.

18.1.1 Database
1. Insert a new Database in E3Training, named FormulaDB.

2. In field MDB file, locate folder E3Training, and type "Formula.mdb", no quotation marks.

Formulas 157
18.1.2 Formula

1. Insert a Formula object in E3Training.

Insert Formula

2. In field Database type "FormulaDB", and in field Table type "TrainingFormula".

Formula's Database configuration

3. Name the object as Formula.

4. On Templates tab, add three new Integer-type Templates: Red, Green, and Blue. For all
these Templates, choose 0 to 255 as their absolute limit.

Templates

158 Formulas
5. On Units tab, select any row from column Unit1, and then click Rename . Change Unit
name to Tank1.

6. Click to add a new Unit, Tank2.

7. Search for, in these two Units, the path of Tank1 and Tank2 Value property in Data.

Unit configuration

8. On Values tab, add more Value Sets, filling in columns with your preferred values.

Value Sets configuration

9. To load Formula data, insert a button on SynopticScreen, set its Caption property to
"Load", and on its Click event, create a script with Viewer's LoadFormulaDlg method.
Application.LoadFormulaDlg "Formula"

18.2 Additional Exercises

18.2.1 KB
· KB-28508: Incorrectly loaded Formula values.

18.2.2 Combo Box


Instead of using a ready-made command to load Formula values using a Viewer's dialog box,
you can use methods from Formula object itself. A combo box will be filled in with all
registered Value Sets, and when selecting one of them, values will be loaded. To search for
Value Sets already registered in a Database, you must use a Query object.

1. Insert a Query object on SynopticScreen.

2. Configure Query1 to get table TrainingFormula_Values in Database FormulaDB.

Formulas 159
Selecting values' table

3. Select only Name column, and then view Query. All registered colors should appear.

4. Now fill in combo box with data returned from Query.

5. Insert a Combo Box , near Tank1.

6. On Combo Box's OnStartRunning event, create the following script:


' Clears Combo Box
Clear()
' Searches for Query data
Set RS = Screen.Item("Query1").GetADORecordset()
' Adds all records found to Combo Box
For i = 1 To RS.RecordCount
AddItem RS.Fields("Name").Value
RS.MoveNext
Next

7. On Combo Box's Click event, create the following script:


Application.GetObject("Formula").LoadFormulaValuesQuiet "Tank1", Value

160 Formulas
18.3 Notes

Formulas 161
CHAPTER

19Storage

The Storage is a historic E3 module developed to improve database usage, allowing


information to be stored occupying the smallest possible space.

There is a whole set of specific functionalities for this module, like pre-built queries and data
compressing algorithms, among others. By using this tool you can accurately recover all
changes in process variables, while occupying minimum space in a database.

Using Storage is strongly recommended for processes where the objective is to follow trends
that need to keep essential process information. By using a mathematical algorithm widely
spread, the Storage can provide relevant information about a certain process occupying less
disk space than data stored by a Historic recorded periodically.

In processes where data must be precise, like measurements used for input billing (water,
energy, or gas), or processes where data must be paid up on a period, using conventional
Historics is recommended.

19.1 Functionality
Storage recording is performed the following way:

· After defining the table, data is stored according to its settings. If there is a variation in Tag
quality, data is also recorded

· Data is not stored only if variation occurred on a time period smaller than the minimum
configured

As new values are obtained for variables, a record checking algorithm interprets the sequence
and decides whether each point is stored or not.

This checking, however, only occurs for analog fields. For text and digital fields, it is enough to
have any value or quality variation to store them.

For each type of magnitude stored, a set of tables is generated, one for each analog Tag,
another one for texts and a third one for digital Tags. This way, each Storage can manage up to
seven tables (backup), in case you specify that all three Tag types must be stored:
<NomeTabela>_Fields
<NomeTabela>
<NomeTabela>_Text
<NomeTabela>_Bit
<NomeTabela>_Backup
<NomeTabela>_Text_Backup
<NomeTabela>_Dig_Backup

162 Storage
19.2 Configuration
When a Storage is created on the Screen, a list of recording field definitions is displayed.

Storage

For later data querying, the search is performed by the Tag path or the property being stored
(the Source field). The Name property is only used if the Source field contains an expression.
Therefore, if expressions are not used in the Source field, there is no need to import it with its
name.

19.3 Internal Queries


The Query tool makes it relatively easy to perform data queries in a Storage. When configuring
a Query, instead of displaying tables, there is a tree with all stored variables.

Query configuration

Users may choose between seven functions to consolidate data, as described next.

Storage 163
19.3.1 LastValue
Returns the last value stored in the Database.

19.3.2 ArchivedValue
Returns a stored value relative to a given point in time defined on the TimeStamp variable.
The type of relationship can be:

· Previous: value stored immediately before the provided timestamp

· Next: value stored immediately after the timestamp

· Interpolated: a calculated value, based on the previous and the next value

· ExactTime: value stored at the exact moment of the provided timestamp

19.3.3 TagAttribute
Returns a Tag attribute, which can be:

· FieldDescription: Tag's meaning or description

· FieldSource: Tag's path being stored

· FieldType: data type (Double, Bit, String, or Integer)

· FieldEU: engineering unit

· FieldLowEng: lower limit

· FieldHighEng: upper limit

· FieldDeadBand: dead band for storage

· FieldDeadBandUnit: dead band unit (absolute or percentage)

· FieldMinRecTime: minimum time for storage

· FieldMaxRecTime: maximum time for storage

19.3.4 CompressedDataNValues
Returns, to a single Tag, n values stored from an initial instant in time.

164 Storage
19.3.5 CompressedDataStartEndTime
Returns, to a single Tag, values stored between an initial and final interval.

19.3.6 SampledData
Returns, to one or more Tags, interpolated (estimated) values at fixed intervals between the
instants defined by StartTime and EndTime variables.

19.3.7 CalculatedData
Returns the result of mathematical operations applied to data between the instants defined
by the StartTime and EndTime variables, at fixed intervals. The types of calculations are
Total, Minimum, Maximum, Standard Deviation, Amplitude, Mean, and Median.

19.4 Exercises
Let's create two Storages, which are going to be used in the following chapters. The Storage
with temperature data is going to be graphically viewed, and the Storage with pump data is
going to be used by PlayBack.

19.4.1 Temperature
1. Insert a Storage object in the project. Change its name to StorageTemp.

Insert Storage

2. In the StorageTemp object, insert two fields and configure them as in the next figure.

Storage 165
Field configuration

3. Click the Properties button and configure the following options.

· Database: Database

· Table: Temperature

4. Click Create Table. The following message should appear.

Structure successfully created

19.4.2 PumpData
1. In the XObject PumpData insert a Storage. Name it PumpStorage.

Insert Storage

166 Storage
2. Add to the PumpStorage the Automatic, Failure, and OnOff properties of the object
PumpData. Configure them as in the next figure.

Storage fields

3. Click Properties and configure the following options:

· Database: Database

· Table: Pumps

NOTE: When a Storage is inside an XObject, the table structure is generated when the
application runs.

19.5 Additional Exercises

19.5.1 KB
· KB-31955: Storage working only with a Studio hardkey.

Storage 167
19.6 Notes

168 Storage
CHAPTER

20E3Playback

E3Playback is an ActiveX that runs inside E3 Viewer or E3WebViewer and allows viewing
application Screens by using historical data stored on databases.

E3Playback retrieves Tags referenced on Screens from a database and displays values,
animations, states, and charts according to information on that database, in a defined
playback period.

NOTE: In Demo mode (or with a Studio license), the allowed playback period is restricted to
the last six hours of data stored on a database.

20.1 User Interface


The E3Playback user interface comprises five different parts, as displayed in the next sections.

20.1.1 Toolbar

E3Playback toolbar

20.1.2 Timeline
The Timeline allows visually following and controlling playback clock.

Timeline

E3Play bac k 169


20.1.3 Screen Area
This is the area where application Screens are displayed. The initial Screen to display is the
one configured in E3Playback's InitialScreen property. If this property is left blank, Viewer's
initial Screen is then used. Screens are always opened using a Fill zoom. You can freely
navigate through application Screens.

20.1.4 Event List


The Event List displays a chronological sequence of playback events (a change in a Tag value or
in an alarm state), allowing a state-by-state navigation.

Event List

170 E3Play bac k


20.1.5 Tag List
The Tag List displays Tags being used for playback.

Tag List

The Tag List can help determine which Tags need to be stored on a database to allow a full
playback of a Screen just by checking Tags with a forbidden icon next to them.

20.2 Restrictions and Comments


· Screens work as in a Read-Only Viewer. This ensures that operations performed in
E3Playback do not interfere with normal behavior of an application in real time

· You are not allowed to access server objects using Application's GetObject method. Script
errors occurred in E3Playback do not generate an error message, they are quietly aborted

· E3Playback emulates a real Viewer. You can test the IsPlaybackMode property

· E3Playback treats new Frames created by the application as tabs on top of the Screen Area.
The tab title is the name of the open Frame or Screen

· All Links referring to server objects are captured by E3Playback, and start receiving
historical data according to the current playback clock

· Links among Viewer objects (for example, a Display showing the value of a Viewer internal
Demo Tag) work normally, without playback interference

· E3Chart only works inside an E3Playback if it is configured with Historic Pens. Real-time
Pens are disabled

· E3Alarm displays the alarm summary according to what is stored in the alarm table on the
database

· E3Browser works normally

20.2.1 Storage
· The Source column must not contain expressions, because they cannot be used in playback

E3Play bac k 171


20.2.2 Alarms
· Enable or configure alarm storage on disk

· Select the following fields for recording (mandatory):

· EventTime (plus EventTimeMS) or EventTimeDbl

· FullAlarmSourceName

· ConditionActive

· Acked

· AckRequired

20.2.3 Historics
The Historic file format is not ideal for playback, because it generally has a great amount of
duplicated data stored in it. It is advisable using Storage whenever possible. Follow these
recommendations:

· Configure UserTable property to False

· Place each Tag in a separate field (do not use expressions)

· Create an index for E3TimeStamp field

· Use tables with a few fields and, if possible, add an individual index for each field (mainly for
the ones with little variation)

· Configure CompressedTable property to True and use DeadBand property in Historic

20.3 Licensing
Elipse provides two packages for E3Playback:

· Basic Playback

· Advanced Playback: Basic plus Video Recording and Screen Capture tools

Packages are sized according to the number of I/O points (Tags and Alarm Sources) stored on a
Database. If a Database has more points than the available licenses, Database assembling
fails and an error message is then displayed.

The E3 Studio's license includes an Advanced Playback license with unlimited I/O points,
although it is limited to the last six hours of data stored on a Database. In Demo mode (when

172 E3Play bac k


there is no protection device), playback also works in Advanced mode with unlimited I/O
points, but it is also limited to the last six hours of data stored on a Database.

20.4 Exercises

20.4.1 PlayBackScreen
1. Insert a new Screen on the project, called PlayBackScreen, to be opened on Splitter
_top.

2. On MenuScreen, insert a button to open PlayBackScreen. On item Frame, type the


name of a non-existing Frame (for example, "PlayBackFrame"), so that two Screens are
opened simultaneously.

20.4.2 Configuration
1. On PlayBackScreen, insert an E3PlayBack object filling the whole Screen.

2. Go to its properties and configure them according to the following figure.

E3Playback properties

3. Execute the application.

E3Play bac k 173


20.4.3 Execution
1. Click button to enter Online mode. The first playback data will be loaded, and playback
clock will be placed at center of available data.

2. A line with existing interval data will appear on Timeline, and Event List will be populated.

Timeline

3. Choose the event you want to start reproducing and click Play button.

20.5 Additional Exercises

20.5.1 Playback Data


1. Save all Tags you want to view in E3Playback in Historics or Storages.

174 E3Play bac k


20.6 Notes

E3Play bac k 175


CHAPTER

21Hot-Standby

The Hot-Standby implements a failover concept in a supervisory system, that is, two servers
(main and backup) acting in contingency mode; if main server fails, a backup server
immediately takes over, without having to stop running processes. This backup server is
known as Standby.

When starting to execute an E3 configured for a Hot-Standby system, there is an icon on


Windows Notification Area represented by a yellow spinning bar , indicating that Domains
are loading. After a few seconds, E3 recognizes the main server and indicates this action by an
icon represented by a green arrow . This icon means the server is executing. The Standby
server remains with an icon represented by two yellow bars , indicating that it is in
standby mode.

21.1 Hot-Standby Settings


This section contains configurations for E3 servers in Hot-Standby mode.

21.1.1 Files
Domain files must be at the same location of main and backup servers. For example, if main
server's Domain and other files (.lib, .prj, etc.) are at C:\Project1, in Standby server the project
must be copied to that same path, that is, C:\Project1.

21.1.2 Servers
Servers (main and backup) must be listed on Servers tab of Domain options.

1. To open Domain's configurations, click the E3 Admin icon on Windows Notification Area
and select Domain - Options menu.

176 Hot-Standby
Domain - Options menu

2. Servers may have any name in Server name field. In Network address field, type the
computer's name on the network. For example, Server name as Server1 and Network
address as \\server1.

Servers tab

Hot-Standby 177
21.1.3 Configuration Options
On Options tab, check Enable item, and in Main server and Backup server options, choose
previously registered servers on Servers tab.

Options tab

Items described in next sections must also be configured.

21.1.4 Integrity Ping


An Integrity Ping is a third network entity (the other two being the main and backup server)
used to determine if network is active. If neither the integrity address nor the backup server
can be reached, the main server assumes that its network interface has problems and
immediately terminates Domain execution. If Standby server can successfully reaches the
integrity address, but not the Hot server (main), it assumes that Hot server has problems and
takes over Domain execution.

178 Hot-Standby
21.1.5 Local Failure
Local failures are detected and reported by the application via Application.ReportFailure
method. You can enable automatic server switch when a local failure is reported on the main
server. Server switch is only performed if backup server has no failures.

21.1.6 Database
When working with databases and Hot-Standby, there are basically two structure options:

· Both applications access the same network database. The Hot server stores data on this
database

· There are two databases running locally, on both servers (main and backup). In this case,
enable Database's EnableSynchronization property, so that all data recorded on the main
database is also updated on the Standby database

If the main application cannot send data to the Standby server, this data remain stored locally
on disk, to be sent later (when communication between computers is reestablished), thus
ensuring that tables generated by the application are equal.

21.1.7 Retentive
Retentive property determines if a value must be stored in case the active server is switched.
So, when the Standby server executes, its value is the same as the Hot server's when it
stopped. If this property is False, the value is set to the initial value whenever the Domain is
executed or the active server switches.

21.2 Exercises

21.2.1 Retentive
To highlight the differences, let's turn Tank1's color Tags (red, green, and blue) to retentive,
and Tank2's color Tags to non-retentive.

1. Select all Internal Tags of folder Tank1 (red, green, and blue) and change their Retentive
property to True.

Hot-Standby 179
21.2.2 Local Failure
1. In Data folder, insert an Internal Tag named LocalFailure.

2. Configure its Value property to False (Boolean).

3. In Tag LocalFailure, create a user event called Failure, which only occurs when Tag
value is True.

Create user event

4. On Failure event, create the following script:


Application.ReportFailure "Failure", "Failure on the active server", 1
Value = False

5. Search for, using the AppBrowser, Server's ReportFailure method.


Application.ReportFailure(FailureName, FailureDescription, FailureWeight)

6. Change FailureName parameter to "Failure", FailureDescription to "Failure on the active


server", and FailureWeight to 1.
Application.ReportFailure "Failure", "Failure on the active server", 1

7. For this Tag to return to its normal state, type in the last line the expression "Value = False".
Value = False

8. On MenuScreen, insert a button labeled "Local Failure".

9. In this button, create a Load Value Pick.

180 Hot-Standby
Load Value Pick

10.Search for LocalFailure's Value property and choose a True value.

LocalFailure's Tag value

21.2.3 Database Syncing


1. In Database object, set EnableSynchronization property as True.

21.2.4 Standby Application


1. Copy application's folder to the computer where Standby server is.

2. On Standby server, open the application in E3 Studio and configure the Database for a local
SQL Server.

21.2.5 Hot-Standby Configuration

1. From either Hot or Standby computer, click E3 Admin icon on Windows Notification Area
and select Domain - Options menu.

2. On Servers tab, add two servers informing both computer's name on the network and any
other name.

3. On Options tab, enable Hot-Standby and choose one server as main and the other one as
backup.

4. Inform the IP of a third computer on the network as its integrity ping.

5. Check option Activate backup server on local failure.

6. Execute the application and test its functionalities.

Hot-Standby 181
21.3 Additional Exercises

21.3.1 KB
· HotStandBy: Frequently Asked Questions (FAQ).

· KB-26057: Viewer behavior during server switching.

182 Hot-Standby
21.4 Notes

Hot-Standby 183
CHAPTER

22Remote Domains

Remote Domains configuration establishes that different servers and Viewers can
communicate, where one application will send data and the other one receives data. The
Domain sending data is called the Server Domain. The Domain using this data is called the
Client Domain. A Domain configured as Client may also work as a Server at the same time, and
vice versa.

NOTE: Remote Domains are not available in Demo mode.

With these Remote Domain configurations, a Client Domain can access objects from a Server
Domain in two ways: by using scripts or via links. For the connection between Domains to
occur, all E3 Servers involved must be running the same E3's version.

NOTE: Associated REC connection port and possible firewall configurations also apply to
Remote Domains.

22.1 Studio Configuration


At E3 Studio, you can use the AppBrowser normally to retrieve existing objects in the Remote
Domain's application, as long as the Domain file's full path is correctly specified in the remote
server.

Another possibility is to keep a copy of the Remote Domain on client machine, and type this
copy's path in Domain File field. This way, E3 Studio uses this local copy to determine which
objects exist, allowing it to work offline.

22.2 Sharing the Server Domain Folder


Ever since version 3.0, when Remote Domains became available, E3 Server will always run as a
service in the SYSTEM account. Services using the SYSTEM account start at the system context
with no credentials, that is, with no user authentication or password required. If these
services, running without a Microsoft network domain, wish to access network resources, they
will have their access denied, because they lack credentials and use a null session.

184 Remote Domains


22.2.1 General Configurations
The following configurations must be performed in the machine running the Server Domain.

1. If the machine uses Windows 2000, 2003, or Vista, go to Administrative Tools - Local Security
Policy Control Panel.

2. On the next window, go to Local Policies - Security Options.

3. Disable option Network Access: Restrict anonymous Access to Named Pipes and Shares.

Security options

If Server Domain's machine uses Windows XP, configuration must be performed directly at
Windows Registry. In this case, follow these procedures:

1. Go to key HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Lanmanserver \


parameters.

2. Create a DWORD-type variable named RestrictNullSessAccess, and set its value as


0.

Remote Domains 185


Variable RestrictNullSessAccess

Configuration using Windows Registry can also be performed in Windows 2000, 2003, and
Vista. According to Microsoft, the key RestrictNullSessAccess specifies whether a
server limits access to system by users logged in with no username and no password
authentication. Possible values are:

· 0: Access without authentication is allowed and all users have access to shared resources

· 1: Does not allow access without authentication. Users without authentication can only
access directories listed on variable NullSessionShares

In either case, you must restart the machine to apply changes. In addition, you must configure
sharing and NTFS to accept access from anonymous users (ANONYMOUS LOGON) or network
users (NETWORK). To do so, follow these steps:

1. Select the folder containing the Server Domain, which must be shared.

2. Right-click it and select Properties option.

3. On Sharing tab, click Permissions.

186 Remote Domains


Folder properties

4. Add NETWORK user or ANONYMOUS LOGON user, allowing reading access to that folder, and
then click OK.

Remote Domains 187


Add user

5. Go to Security tab, and once again add NETWORK or ANONYMOUS LOGON user (the same one
added on Sharing tab), then click OK.

188 Remote Domains


Security tab

NOTE: For communication between machines to work correctly at run time, firewall must
either be correctly configured or disabled.

22.2.2 Security Tab


In some cases, Security tab may not be visible, along with Sharing tab, in folder properties. This
occurs because in some Windows versions, like XP, for example, whenever it is running
without belonging to a Microsoft network domain, a simplified sharing mode is enabled by
default. In this case, you must change the sharing mode by using variable ForceGuest in
registry key, at HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ LSA. This
variable must be set as 0.

22.3 Licenses
E3 Server running the Client Domain, as well as the one running the Server Domain, must have
specific Remote Domain licenses. When this license exists, E3 Server running the Server
Domain accepts an unlimited number of external connections from other Domains. Likewise,
in case of an E3 Server running a Client Domain, it is possible to establish an unlimited number
of connections.

Remote Domains 189


22.4 Links Syntax
Access to objects from another Domain is performed by using an alias (Domain Name), which
must precede each object's full path, separated by a colon. For example, DOMAIN:PATH,
where DOMAIN is the alias given to that connection with a Remote Domain, and PATH is an
object's or property's full path of that Domain. For example, Driver1.Tag1 + Remote:
Driver2.Tag1 * 2.

22.5 Local Alias


A Local Alias is an Elipse E3 tool which makes sure the application working as server of a
Remote Domain is correctly configured for an easy, fast, and reliable migration from a project
to a remote application.

This tool allows creating a Remote Domain in the local application pointing back to itself, that
is, pointing to the local Domain and machine.

Local alias

When configuring an application, you must link all Screen objects and scripts via recently
added Remote Domain.

Link via Remote Domain

190 Remote Domains


Thus, links from all Screen objects are directed to Tags and local application data objects, but
via Remote Domain.

22.6 Access Permissions


Access to Remote Domain's objects can be limited to Read-Only mode. When this happens, the
same types of access limitations for a Viewer Only are applied. To do so, you must use the user
configuration in Remote writing access to the Domain permission, on security item Domain.
With this, it may be necessary for a Remote Domain connection to specify a certain user to
have full access to Domain's objects.

22.7 Exercises

22.7.1 RemoteScreen
1. Insert a new Screen named RemoteScreen on the project, to be opened on Splitter
Central_Area. Check option Set as initial Splitter's screen.

2. On MenuScreen, insert a button to open RemoteScreen.

22.7.2 Sharing
1. Share project folder and configure its permissions according to section Sharing the Server
Domain Folder.

22.7.3 Local Alias


1. Go to Domain options using E3 Admin icon on Windows Notification Area.

2. On Remote Domains tab, insert a Domain and configure the following properties:

· Domain Name: Local_Domain

· Domain File: .dom file under development

· Main server: current computer name on the network

Remote Domains 191


Domain configuration

3. Click Apply and finish configuration by clicking OK.

4. Check Organizer if configured Domain's project appears.

Remote Domain projects

5. On RemoteScreen, create a Display to show values from any Tag. Search for, in the
AppBrowser, a Tag inside Remote Domain Local_Domain.

192 Remote Domains


Tag in Remote Domain

22.7.4 Remote Domain


1. Go to Domain options using E3 Admin icon on Windows Notification Area.

2. On Remote Domains tab, insert a Domain and configure the following properties:

· Domain Name: Remote1

· Domain File: Remote Domain's file path. This path must be a network sharing which
allows accessing this file or a local copy

· Main server: remote computer's name on the network

Remote Domains 193


Remote Domains tab

3. Click Apply and finish configuration by clicking OK.

4. Check Organizer for Remote Domain and its projects.

Remote Domain projects

5. On RemoteScreen, create a Display to show values from a Remote Domain. Search for, in
the AppBrowser, a Tag inside Remote Domain Remote1.

194 Remote Domains


Tag in Remote Domain

6. Create a Display or Setpoint for each Tag you want, and link them via Remote Domain path.

RemoteScreen

7. Add as many Remote Domains as you wish.

22.8 Additional Exercises

Remote Domains 195


22.8.1 KB
· KB-26842: Unifying users and permissions from several different Domains.

196 Remote Domains


22.9 Notes

Remote Domains 197


CHAPTER

23Revision Exercises

23.1 Exercise
A mining company wants to monitor the levels of a few tanks. The equipment to be used in it
has not been decided yet, but it must bring information about four levels.

The sector manager wants to view data in a user-friendly way, then they asked to develop a
supervisory with the following requirements:

· Simulate values of the four levels of the equipment on failure (values from 0 to 100)

· The main Screen must have an image of the mining site

Mining site image

· Above each tank, view its respective level with a bar

198 Revision Exerc ises


Tank level

· Display the level value on screen formatted with its engineering unit as "%", one decimal
place, and obeying the following color table

MINIMUM MAXIMUM COLOR


90 100 Red

70 90 Yellow

30 70 White

10 30 Blue

0 10 Green

· Sign on screen the alarms of all levels, according to the following table

ALARM LIMIT
HiHi 90

Hi 70

Lo 30

LoLo 10

· On the main Screen, you must be able to identify the logged in user

Revision Exerc ises 199


· A user belonging to the Maintenance group MUST NOT acknowledge alarms

· On a second Screen, you can view those four levels on a chart, where you can choose which
information to display simultaneously via buttons

Level chart

· Store level data each 2 seconds on a database

· View data stored on a database on a table in the same Screen of the chart

· A report with level data stored on the database must be exported as PDF

200 Revision Exerc ises


23.2 Resolution
· Simulate values of the four levels of the equipment on failure (values from 0 to 100):

1. To simulate values, create Demo Tags, setting their maximum and minimum limits as
specified.

· The main Screen must have an image of the mining site:

1. Insert the figure as a Resource.

2. Change the FillStyle property of the Screen to 12 - bkPicture.

3. Type the name of the figure in the PictureFile property of the Screen.

· Above each tank, view its level with a bar:

1. Insert a Rectangle on the Screen above the tank.

2. Access the Rectangle properties, Links tab.

3. Create a Link from the VerticalPercentFill property to the corresponding Tag Level.

· Display the level value on screen formatted with its engineering unit as "%", one decimal
place, and obeying a color table:

1. As there are several duplicated Displays, the best option is to create an XControl.

2. Create a library file and insert it in the Domain.

3. Insert an XControl and name it DisplayLevel.

Revision Exerc ises 201


4. Create a property called Level of type Double.

5. Draw a Display.

6. Format the Display with the expression '0.0 "%"'.

7. Create a Simple Connection to the Level property created in the Value property of the
Display.

8. Create a Table Connection in the ForegroundColor property informing limits and


colors. In the Source property, search for the Level property previously created.

9. Save and register it.

10.Insert an XControl on the Screen called DisplayLevel.

11.Create a Simple Connection from the Level property to the Tag.

· Sign on screen the alarms of all levels, according to a table:

1. If the Domain does not have one yet, insert an Alarm Server in the project.

2. If the Domain does not have one yet, insert an Alarm Configuration in the project.

202 Revision Exerc ises


3. In the Alarm Configuration, insert an Alarm Area.

4. In the Alarm Area, insert an Analog Alarm.

5. Access the properties of the Alarm Source, Analog tab. Inform limits and alarm
messages according to the table.

6. In the Source column, search for the Tag you want the alarm to monitor.

7. Insert as many alarms as needed and configure them according to the previous steps.

· On the main Screen you must be able to identify the logged in user:

1. Create a Display on Screen.

2. Create a Connection from the Value property of the Display to the User property of the
Viewer.

3. Insert a button near the Display.

Revision Exerc ises 203


4. In this button, create the following script.
Application.Login(True)

5. Access the File - Users menu and create at least one user.

· A user belonging to the Maintenance group MUST NOT acknowledge alarms:

1. Access the File - Users menu.

2. Create a Maintenance group.

3. Insert a user in the Maintenance group.

4. In the Permissions tab, block alarm acknowledgement for the Maintenance group.

204 Revision Exerc ises


· On a second Screen, you can view those four levels on a chart where you can choose which
information to display simultaneously using a button:

1. Create a new Screen.

2. Insert an E3Chart on the Screen.

3. Access the chart properties, Pens tab.

4. Insert a Pen.

5. Choose a name and a color.

6. In the Data tab, keep one Pen as Real Time and search for the Tag in the Vertical axis
link field.

7. Repeat previous steps to include the other Pens.

8. On the main Screen, create a button to open the chart Screen.

· Store level data every 2 seconds on a database:

1. If the Domain does not have one yet, insert a Database object and configure it.

2. Insert a Historic object in the project.

3. Create fields for each information and link them to the respective Tag in the Source
column.

Revision Exerc ises 205


4. Access the Historic properties and configure the Database name, table name
(LevelTable) and recording time (2000 ms).

· View data stored on a database as a table in the same Screen of the chart:

1. Insert an E3Browser object on the Screen.

2. Access its properties, Query tab and click Configure.

3. Configure the Query to fetch the table just created on the Database.

4. Choose the fields you want to fetch and in the Visualize tab, press the button to
check data.

· A report with level data stored on the database must be exported as PDF:

1. Insert a Report in the project, named ReportLevel.

2. Configure the Report Query to fetch the table on the Database.

3. Choose the Level and E3TimeStamp fields.

206 Revision Exerc ises


4. Insert in the Detail section a Setpoint object for each chosen column in the Query. Fill
in the DataField property with the column name.

5. Use a Label object to type column titles (the Caption property).

6. Insert on the Screen a button with the following script:


Set Report = Application.LoadReport("[BoilerReport]")
Report.Export "PDF", "LevelReport.pdf"

Revision Exerc ises 207


23.3 Notes

208 Revision Exerc ises


Headquarter Branch MG
Rua 24 de Outubro, 353 - 10º andar Rua Antônio de Albuquerque, 156
90510-002 Porto Alegre RS 7º andar Sala 705
Phone: +55 (51) 3346-4699 30112-010 Belo Horizonte - MG
Fax: +55 (51) 3222-6226 Phone: +55 (31) 2511-2121
E-mail: [email protected] E-mail: [email protected]

Branch SP Branch PR
Rua dos Pinheiros, 870 - Conj. 141/142 Av. Sete de Setembro, 4698/1705
05422-001 São Paulo - SP 80240-000 Curitiba - PR
Phone: +55 (11) 3061-2828 Phone: +55 (41) 3342-0120
Fax: +55 (11) 3061-2828 Fax: +55 (41) 3342-0120
E-mail: [email protected] E-mail: [email protected]

Branch RJ USA
Praia de Botafogo, 300/525 40190 Jarvis Gray Lane
22250-044 Rio de Janeiro - RJ Avon - NC - USA 27915
Phone: +55 (21) 2158-1015 Phone: +1 (252) 995-6885
Fax: +55 (21) 2158-1099 Fax: +1 (252) 995-5686
E-mail: [email protected] E-mail: [email protected]

Germany Taiwan
D-67714 Waldfischbach Deutschland 9F., N.12, Beiping 2nd St., Sanmin Dist.
Phone: +49 (0) 6333-4439 807 Kaohsiung City - Taiwan
Fax: +49 (0) 6333-2790045 Phone: +886 (7) 323-8468
E-mail: [email protected] Fax: +886 (7) 323-9656
E-mail: [email protected]

Check our website for information about a representative in your city or country.

w w w .elipse.c om.br
[email protected] om.br

You might also like