You are on page 1of 41

1. Start E3 Studio.

After you get to know the work area at E3 Studio, click the
icon New on Default Tool Bar, or the menu File—New Project.

2. On Application Wizard, select the option Standard Application, adjusting


the application path to “c:\e3training”.

3. Next, name the project “MainProject”. When questioned whether you want to
create the folder MainProject, reply “Yes”.

4. The next window on the wizard, click “Create a New Domain”, and use the
same name as the project. Reply “No” to the next three questions, and then
click “Finish”.

5. Click “New Project” again. This time, select “Blank Application”.

6. Direct the project to the same path as MainProject, that is, to “c:\e3training”.
Name the project “IndustrialProject”. It is advisable not to use accents nor
spaces between names, to avoid distortions and the generation of errors in the
domain (this will be seen later in this tutorial).

7. Click Next, and then Yes to the window that will open. Next, select “Add to
the Current Domain”. Finally, click Finish to conclude the project.

8. Repeat steps from 5 to 7, but now create a new project called


“ElectricalProject”.

9. By the end of these procedures, you will have in the Organizer the scheme
displayed in the picture below:

Picture 1: Organizer

Tutorial Exercises Book 2


To start your work with tags, you are going to create some internal tags as well as a
demo tag, which will be used later in our project. The tags you are going to create
are just a part of the cluster of tags that you will use. The others will be created at a
more opportune moment during the application’s development.

1. Inside the folder Data in MainProject, insert a Demo Tag, and define its type
to CurrentTime. This tag will be used on MenuScreen to display system’s
time. Rename it to CurrentTime.

2. In IndustrialProject, insert a new data server and rename it IndustrialData.

3. Inside IndustrialData server, insert the demo tags of the table below:

Demo Tags to be inserted


NAME TYPE MINIMUM MAXIMUM SCAN
Level Random 0 100 100
Outflow Random 0 50 100
Truck RampUp 0 100 100

4. The way the data will be used on screen will be described later. Just remember
not to use spaces nor accents.

5. In ElectricalProject, insert a new data server called ElectricalData. Inside this


folder, create three new demo tags, named Current1 to Current3, type
Random, values from 0 to 100, period 1500, and scan 100. Current tags will be
used in the study of libraries, graphics, and historics.

6. Still in ElectricalData folder, create three new demo tags, type Random,
values from 34000 to 42000. Rename them Tension1 to Tension3. Tension
tags will be used in the study of graphics.

7. In the same data server, insert an internal tag called KeySec. This tag will be
used in the study of alarms and libraries.

Tutorial Exercises Book 3


The exercises about communication drivers and communication tags will be
performed under the instructor’s supervision, since each installation can have
different types of equipment to illustrate this section. Still, it is possible to talk about
the procedures to configure communication tags using an Elipse driver. The steps
are:

1. Insert an I/O Driver in the project.

2. Modify the property DriverLocation to the folder where the driver is installed
(it is advisable to keep it in a specific folder for this purpose inside the project’s
folder, to make project maintenance easier).

3. Configure parameters P1 to P4 in the driver where it had been inserted. These


parameters are described in the document appended to the driver.

4. Configure the I/O tags or block tags that you need.

5. Configure the parameters N1 to N4 or B1 to B4 in each tag or block created.

6. Adjust scan time for each tag.

7. Adjust tag scale, when necessary.

8. Check, through the item Activate Communication, if the configurations


performed correspond to the expected behavior.

9. Follow your instructor’s steps, and write down any step you think is important
in the space available at the end of the exercises, so that your doubts can be
solved during the development of a real project in class.

1. Import some tags from their own definiton on an Excel spreadsheet. Save the
spreadsheet as a file with .CSV extension, and choose the option “Import
Tags” in the I/O Driver. The description of the fields in the spreadsheet can be
obtained at User’s Manual.

2. Create another I/O driver in your application and check how drivers are shared,
by checking the option SharedServer as True in both cases, besides from
specifying the same path for the I/O driver. The second driver being executed
“borrows” its connection from the first driver.

3. Perform some tests using tags’ Scale and DeadBand properties. Scales are used
to convert values, and DeadBand is used to make new tag values to be sent to
Tutorial Exercises Book 4
E3 Server only if they have a value x% higher or lower than the last reported
value, thus diminishing the traffic of unnecessary information.

Tutorial Exercises Book 5


Now, you are going to configure an OPC communication driver. E3 will work
simultaneously as both the OPC Server and the OPC Client. The idea here is, just
like in the previous exercise, to show how the OPC Server’s configuration works,
since the procedure is similar to any OPC Server being used. Follow these steps:

1. Right-click the project and choose Insert—OPC Client Driver.

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

3. Click Select button. A window with options for local servers or network servers
will be opened. Select your instructor’s Elipse OPC Server in the option
Network Servers.

4. Press the button Activate Driver. From this point on, it is possible to check
communication with the server by clicking Information.

5. The next step for configuration is importing tags. Close Properties window
and right-click the OPC driver. Select the option Import Tags. With this action,
E3’s tag importing wizard will be opened:

Picture 2: Importing OPC tags

Tutorial Exercises Book 6


6. The picture above shows the appearance of the importing window: on the right
side, there is the server tags list, and on the left side, the importing area for E3.
To import an item, select it and take it to the OPC group it is headed to.

7. After importing some tags or properties, check for the performance of the
imported tags.

8. Just like with the configuration of Elipse Drivers, the routine to work with OPC
Server is the same as with any other server in use. Write down any items you
considered important at the end of the exercises, to make subsequent
consultations easier.

Tutorial Exercises Book 7


!
Check Viewer’s configuration at MainProject. It should be pointing to
InitialScreen, with the zoom adjusted to Fill. The other characteristics of the
Viewer Screen configuration should not be altered.

Tutorial Exercises Book 8


" #$
1. In MainProject, create three new screens, and name them MenuScreen,
EventScreen, and AlarmScreen.

2. In ElectricalProject, create three new screens: ElectricalScreen,


GraphicScreen, and HistoricScreen.

3. In IndustrialProject, create two new screens: IndustrialScreen and


FormulaScreen.

4. Insert a new Frame in MainProject. Frame1 will be created, with the item
Splitter1. Right-click the frame and select the option Split Horizontal,
according to the picture below:

5. Place the bar at around 10% from the frame, from its lower limit. Next, left-
click it and establish bar position. Check if there are two new splitters on
Frame1.

6. Name those splitters Superior and Inferior.

7. For the Frame (and its splitters) to start displaying Screens, it is necessary to
configure SplitLink property of the splitters.

8. In Superior splitter, configure SplitLink property with the name


IndustrialScreen. In Inferior splitter, type MenuScreen. In case you want to
start the frame with the Screens in Fill with default zoom, type after Screen
name the string ?4?0. These arguments indicate the type of zoom (4—Fill) and
if there is any scrollbar (0—No Scroll). These will be the Screens used in our
projects.

Tutorial Exercises Book 9


% &'
(
The Screen that opens our application is shown in the picture below:

Picture 3: Project’s opening Screen

To configure it, you should follow these steps:

1. Insert a new resource in MainProject by right-clicking it and selecting Insert


Resource. This will be used to integrate to the project files that are external to
E3, such as pictures. Otherwise, these files should be copied together with the
application. In Open window, go to the folder My Documents, and select the
folder My Pictures. Inside it, there is a file called Sample.jpg. Select it and
press Open. This procedure should be made any time files external to E3 are
used, because it brings the possibility to integrate pictures to the project, with
no need to for moving several files or folders when the project is copied or
moved to another station.

2. In InitialScreen, modify BackgroundColor property to White. Insert the object


Picture on screen, and do not select a file in the window that is open (press
Cancel).

Tutorial Exercises Book 10


3. Go to bitmap’s Filename property and type file name between brackets:
[sample.jpg]. This bitmap will use the resource inserted previously. Notice the
brackets around file name: this is common whenever you have a name whose
caracters are not letters and numbers.

4. Next to this bitmap, place a text “E3 Studio Training” using Arial font, size 22,
in Blue. Below, place a second text, displaying the message “Elipse Software”,
also using Arial font and in Blue, but with size 16.

5. In the lower center of the screen, place two text objects. The first one displays
the message “Enter the System”; the second one displays “Close Viewer”. Both
should use Arial font, size 12, in Blue.

)
This Screen will be used as a browsing tool among screens throughout the domain. It
will only contain links to other screens in the system, and nothing else. Screen
layout will follow this pattern:

1. Change Screen’s background color to White, and adjust its height (through
Height property) to 2000.

2. Insert a ComboBox and resize this object.

3. Create a button . In button’s Caption property, insert the label “Alarms”.


This button will be used to call AlarmScreen.

4. Create a Display , and link it to CurrentTime tag, previously created in


MainProject’s Data folder. Access this object’s properties and select
Formatting tab. Define its format as Other, and on Type field, type the text
MM/dd/yyyy HH:mm:ss. This will show a complete date.

5. To distribute the spaces evenly between screen objects, select them all and
press the button Space Across .

In all Screens, labels will be created on their upper part (displaying Screen names),
to help identify them all when browsing, even when the screen had not yet been
edited. The example can be seen in the picture below. There is no restriction to
colors on each screen, except for ElectricalScreen, which will be described in more
details later.

Tutorial Exercises Book 11


Picture 4: Event Screen

1. In EventScreen, place a text and modify its value to “Initial Time:”. Place a
second text as “Final Time:”.

2. Next to those two texts, place two SetPoints, used to display initial and final
time to be selected from a calendar, which will be built later on. Format these
two SetPoints to display the time, in date/time format, and rename them
TxtIniTime and TxtFinTime.

3. Place a Command Button on Screen and change Caption property to “Display


Time” text.

1. In AlarmScreen, after you configure the text with screen title, place on its
lower parte a Command Button with Caption property set to “Alarms
Acknowledgment”.

Tutorial Exercises Book 12


(#
IndustrialScreen should be built according to the model of the picture below. In
this screen, you will work with Links, and your aim will be to present how
animations can be built in E3’s project Screens.

2. Insert the text “Industrial Screen” as the title for IndustrialScreen.

3. Open the Gallery at Organizer, go to the folder Tanks, and insert


VerySmoothTank1.

4. Next, insert a TankWithRivets2, also from the same folder.

5. Insert a CutAway4 from TankCutaway folder.

6. Insert a HairpinTurnDown from Pipes folder.

7. Insert a Reducer3, from the same folder.

8. Insert a LongHorizontalPipe, from the same folder.

9. Insert a FlangeWithPipeExtendingDown, from the same folder.

Tutorial Exercises Book 13


10. Insert ControlValve3, from Valves folder. Rotate the valve, by right-clicking it
and selecting the option Convert to Symbol. After that, apply rotation by using
the button Rotate .

11. Finally, insert TankerTruck2, from Vehicles folder. On this object, insert

linear movement with the button Linear Slider , to simulate the truck
movement leaving from the left.

12. Adjust Linear Slider’s cursor through sliding position markers..

13. Insert a Display, and configure its formatting to display values with two
decimal places, with the prefix Outflow:. To do so, configure display’s Value
property as Long, and Format’s property should contain the string “Outflow:”
0.00.

14. Insert StraightArrow2 from Arrows folder. Right-click the object and choose
the option Convert to Symbol.

15. Rotate the object through the option Rotate , directing it to the left. Signal
the sector Production.

16. Repeat the whole operation, now replacing the text to Dispatch. In case there is
any doubt, check it with the instructor.

Tutorial Exercises Book 14


+ ,
After the Screens are configured, animations will be performed on them. All links
and animations in this training will use either Demo or Internal tags. However, links
will work the same either with internal tags (just like here), or with I/O tags (via
driver or OPC).

(#

1. Configure the properties of Cutaway4 as follows:

• OverrideFillMode: 2- Solid

• OverrideFillColor: Brown (192,32,0)

• BackgroundColor: Black (0,0,0)

• BackgroundStyle: 1- Opaque

4. Next, link VerticalPercentFill property to Level.Value tag.

5. Associate display’s Value property to Outflow.Value tag.

6. In HarpinTurnDown, modify:

• OverrideFillColor: Red (255,0,0)

• OverrideLineColor: Red (255,0,0)

7. Next, link OverrideFillMode property (Table connection) with Outflow.Value


tag. Configure three groups of values:

• 0 a 10: 0- No Override

• 11 a 40: ByBrightness

• 41 a 50: Solid, with blink 3: ByBrightness

8. Modify ControlValve3’s OverrideFillColor property to blue. For


OverrideFillMode, create a digital link, with mode on adjusted to 3-
ByBrightness, and mode off adjusted to 0-NoOverride with the expression
IndustrialData.Level.Value>0.8*IndustrialData.Level.Maximum. This
procedure is similar to the one used to link tags, but after you select the tag
IndustrialData.Level.Value, click the area of the associated tag and press F2
to edit the expression.
Tutorial Exercises Book 15
9. As for the linear slider of TankerTruck2 object, link its Value property to
Truck.Value.

Tutorial Exercises Book 16


-.

1. On InitialScreen, click “Close Viewer”, and on scripts tab create a new script
on Click event. Locate Exit method, which can be found at Viewer, in scripts
editting area, through AppBrowser. Copy it to the script.

2. On the same screen, click “Enter the System” and create on Click event a new
Open Screen pick. In the item Open Screen, select Frame1. In Initial Zoom,
select Fit.

1. EventScreen enables you to view the alarms in the system, filtered in time
intervals. To do so, you will use E3’s method that displays a calendar. The
purpose of the next exercises is to create Screens and filter control buttons.
Also, we can visualize the selected time through a message on the Screen.

2. Now you will edit the scripts that allow you to modify both the initial and the
final time of the events query. Create on initial time’s SetPoint a new script on
Click event. In this new script, the code to be inserted is:
Dim Hora
'Calls Calendar function
Application.ShowDatePicker Hora, 0, 0
'Passes the chosen value to SetPoint
Value = Hora

3. On final time’s SetPoint, repeat the script.

4. To view the selected time, create a new script on Click event of the Command
Button already configured on Screen. Insert the following code in the script:
'Passes the values from SetPoints to script variables
Initime = Screen.Item("TxtIniTime").Value
Fintime = Screen.Item("TxtFinTime").Value
MsgBox "Hora Inicial: " & Initime & Chr(13) &
"HoraFinal:" & Fintime

5. Run EventScreen as the initial Screen, and check E3’s buttons and calendar to
see if they are working properly.

Tutorial Exercises Book 17


)

1. The next step is configuring the button that will call AlarmScreen modally on
MenuScreen. To do so, go to the properties on Alarm button, and create a
new script on Click event. Insert the following code on the script:
Application.DoModal "AlarmScreen","Alarms Screen",_
100,100,500,500,0

2. At the end of this exercise, go to Viewer object and adjust InitialScreen


property to MainProject’s InitialScreen.

Tutorial Exercises Book 18


-- * /
) $ &'
To ilustrate the configuration of a MSForms Object, you will use the ComboBox
already inserted on MenuScreen. The goal of this ComboBox is to implement
browsing among the project’s Screens. To do so, two steps are necessary: combo’s
configuration (with the inclusion of all the options), and its use (through the
monitoring of the selected item).

1. To include the options, you should create a new script in ComboBox for
OnStartRunning event. Para incluir as opções, deve-se criar na própria Lista
de seleção um novo script para o evento OnStartRunning. Insert the code
below:
'Delete existent lines to avoid duplication
Clear()
AddItem "Industrial Screen"
AddItem "Electrical Screen"
AddItem "Event Screen"
AddItem "Historic Screen"
AddItem "Formula Screen"
AddItem "Initial Screen"

3. After all the options are registered, it is necessary to compose a script that will
browse among Screens when some option is selected on the combo box. To do
so, click the ComboBox, go to Scripts tab, and create a new script for Click
event. The script below shows how browsing among Screens is performed.
'Choose which Screen will be opened and store the answer
in the variable Screen.
Select Case(ListIndex)
Case 0
Screen = "IndustrialScreen"
Case 1
Screen = "ElectricalScreen"
Case 2
Screen = "EventScreen"
Case 3
Screen = "HistoricScreen"
Case 4
Screen = "FormulaScreen"
Case 5
Screen = "InitialScreen"
End select

Tutorial Exercises Book 19


'If chosen Screen is InitialScreen, open in full Screen,
otherwise, open in superior frame.
If ListIndex <> 5 then
Application.GetFrame("Superior").OpenScreen
Tela&"?4?0",0
Else
Application.GetFrame("").OpenScreen Tela&"?4?0",0
End if

4. Go to Viewer, and configure the item InitialScreen for the InitialScreen in


MainProject. Run the application and check the browsing among Screens,
through the button that calls AlarmScreen modally.

5. Check if the entire application is working before you go to the chapter on


libraries.

Tutorial Exercises Book 20


-0 ,&
Four library objects will be created as examples: three XControls (Screen objects)
and one XObject (Data object). The use of objects from the electrical sector is just
for illustrative purposes only, for the concept of libraries used at E3 is highly
flexible, as you will see.
For these purposes, you will use ElectricalScreen, which should have the
appearance below before you begin to instance the objects:

1. After you have finished the first draft of ElectricalScreen, click again on New
Project , and on project wizard select the option E3 Object Library. Name
it TrainLib and save the application on the previously created MainProject
folder. Click next, add it to the current domain, and finish it.

2. Insert a new XControl in the library, and rename it to CurrentDisplay. Insert a


diplay in this new object, and configure its appearance according to the picture
below.

Tutorial Exercises Book 21


3. To create the variable that will appear on display, insert a new property in
CurrentDisplay and name it Source. Configure its type to DemoTag.

4. Double-click the display to associate Value property to the expression


CurrentDisplay.Source.Value.

5. Save the changes and register the library, accessing this option by right-clicking
it.

6. Insert three CurrentDisplay objects in ElectricalScreen, just below the three


vertical lines that symbolize the power bus output. Link each display’s source
property to the tags Current1 to Current3, the display on the left
corresponding to Current1.

7. Insert a new XControl in the library, and name it Sectional. On central bar,
add a rotation and change its point of reference to the lower part.
Configure it according to the appearance and data illustrated below.

Tutorial Exercises Book 22


8. The sectional key created here will ilustrate how a real key works, so it should
“open” and “close”. For that purpose, you can use a digital link on the bar’s
Angle property, linked to the expression Sectional.Status.Value. Attribute the
value 30 for On, and 0 for Off.

9. When you finish configuring the Sectional, save it in the library and register it.
To illustrate thow the object works, insert a Sectional object on Screen, right
below the box with the text Concessionaire.

10. Create a link for the property Status with the tag KeySec.

11. The object Sectional Text created on ElectricalScreen should toggle the value
of KeySec.Value variable between 0 and 1 at each click. For this, use the
button’s “Toggle Value” pick.

12. When you execute the application, you will notice that the sectional’s design
follows the value defined by KeySec tag, just as the updated current values are
shown on CurrentDisplay objects placed on Screen.

13. The next steps demonstrate how to create a data object, and how to create a
Screen object that uses data made available by this XObject. Over the library,
insert a new XObject, and name it BreakerData. Insert three properties and
configure them like the model below.

Tutorial Exercises Book 23


14. Save the object and register the library again.

15. Insert a new XControl in the library, named Breaker. Configure it according
to the model in the picture.

16. Link Value property of the text inserted right to the circuit breaker to the
expression Breaker.source.Name (“Name” is the name of the breaker to be
configured in the XObject instanced at ElectricalProject).

17. In the red rectangle, create a digital link for ForegroundColor property to the
expression Breaker.Source.Status. When on, the breaker should be Red, and
when off, Green.

18. Still in the rectangle, create a script for Click event, with the commands listed
below.
set DJ = Disjuntor.Fonte
'If Breaker has no faults
if DJ.Defeito = false then
'If it is on
if DJ.Estado = true then
'Ask user if they would like to turn off
if MsgBox("Turn Breaker off " & DJ.Nome & "?",_
vbOKCancel, "Confirme!") = vbOK then
'If yes, turn off
DJ.Estado = false
else
' If not, cancel command
MsgBox("Abort command – Turn Breaker off " _

Tutorial Exercises Book 24


& DJ.Nome)
end if
'If it is off
else
if MsgBox("Turn Breaker on " & DJ.Nome & "?",_
vbOKCancel, "Confirme!") = vbOK then
'If yes, tunr on
DJ.Estado = true
else
' If not, cancel command
MsgBox("Abort command – Turn Breaker on " & DJ.Nome)
end if
end if
'If Breaker has faults
else
MsgBox "Faulty Breaker – Call Maintainance!"
End If
End Sub

19. This enables both the breaker’s current state and and the condition of the fault
listed on XObject’s properties to be checked. Besides, any manouver to be
made will display a confirmation box to be answered before the operation.

20. Once again, save the updates and register the library.

21. Create the folder BreakerData inside the folder ElectricalData to ilustrate
how the objects BreakerData and Breaker work. In this folder, you will insert
three BreakerData objects, and one FaultDJ1 internal tag. Adjust each
BreakerData’s Name property to Dj23-01, Dj23-02, and Dj23-03.

22. Insert three Breaker objects in ElectricalScreen, one to each bus’s output. Link
each one to a BreakerData instanced at ElectricalProject.

23. Create a Toggle Value pick for the variable FaultDJ1.Value on Electrical
Screen’s Text DJ1 Faults. Follow to BreakerData1 and link Fault property to
the variable FaultDJ1.Value.

24. Save the updating and run the project. All breakers will have similar
functionality, although their data are different.

NOTE: The use of libraries is highly recommended because it enables reusing


functions. Creating data patterns allows better maintenance and higher agility when
creating projects. In case any doubts remain, you should consult the instructor at the
end of the exercises.

Tutorial Exercises Book 25


- &
1. Insert a new database in MainProject, and rename it DBServer.

2. Place the file in the folder e3training, where all project’s files are. Name the
file Data.mdb. This database will be used to store all data about alarms and
historics in our project.

Tutorial Exercises Book 26


- *
1. Insert an Alarm Configuration object in MainProject. Create a new alarm
area inside this object and change its name to ElectricalArea.

2. Inside the area you have created, insert three Analog alarms, whose sources
will be the Current tags from ElectricalProject. Before you link them to these
tags, rename them as CurrentAlarm1, CurrentAlarm2, and CurrentAlarm3.

3. Click the source editting area and, through AppBrowser, select each Current
tag’s Value property (ElectricalProject’s ElectricalData folder). When
configuring each alarm, check the items Lo (limit=30) and Hi (limit=80).
Adjust the messages to each alarm level.

4. Insert in ElectricalArea a new “Variation Rate” alarm. Rename it


TDVCurrent1. Next, link Current1 tag’s Value property to the alarm source.
Adjust the value “Variation per second” to 10, and adjust the message to alert
that the variation rate has been high. Change Severity property to Medium.

5. Create a new alarm source named SectionalAlarm and select as source


KeySec.Value tag. Set the alarm as False, and adjust the message to System of
Co-Generation with no Help from the Network. Change Severity property to
Medium.

6. Create a new alarm area and rename it IndustrialArea. Create two new analog
sources, OutflowAlarm and LevelAlarm, and link them to the tags Outflow
(Lo=10 and Hi=40) and Level (Lo=30 and Hi=70), from IndustrialData
folder. Change Severity property to Medium.

7. Insert an Alarm Server object, and set it to save data from the database
registered in MainProject. Next, check the server to “Mantain Data from
Last 3 Months”, cheking them every month. Click Fields button, and add
EventTime field. Last, click Generate Table button. A message of success is
displayed.

Tutorial Exercises Book 27


- *
1. Real-time data viewing can be done via E3Alarm object. For this purpose,
place an E3Alarm on AlarmScreen, and configure on Columns tab just
DateTime, Operator, Message, Area, Acked, and Value, in this order. On the
tab Ordering, adjust it via DateTime field, in Rising form.

2. On General tab, type the name Alarm Server.

3. To recognize all the alarms, insert a new script in Click event of


AlarmScreen’s Recognize Alarms. The code below should be inserted in this
script.
Sub CommandButton1_Click()
Application.GetObject("ServidorAlarmes1").AckAllAlarms_
(Application.User)
End Sub

Tutorial Exercises Book 28


- 1
1. Now you will create a a historic of the current data which you are using in the
application. Insert a new historic in ElectricalProject, and name it
CurrentsHist.

2. In the historic recently created, insert three new fields and adjust these fields’
sources for the tags Current1 to Current3, from ElectricalProject. Next,
change the stamps in each field so that their names are the same as the tags’.

3. Next, click the option Historic Properties. Select DBServer and name the table
to be used as CurrentsTable. The historic’s recording interval should be 2
seconds long.

4. To finish it, click Create DB Structure button. With this, the necessary tables
will be created in the database.

5. The current data will be saved every two seconds, as soon as the domain begins
to run.

Tutorial Exercises Book 29


-% !
1. Insert an E3Browser in ElectricalProject’s HistoricScreen, and center it on
the Screen.

2. Double-click E3Browser, go to Data Source tab, and click Get Fields button.
The query configurer will be opened. Then, select the DBServer available in
the domain.

3. Find CurrentsTable. Then, select the fields to be displayed at E3Browser:


E3TimeStamp, and Current1 to Current3.

4. Generate the query to check if it is working correctly. When you finish this
step, all the fields listed on the query will be available in the browser.

5. On Options tab, configure the refreshing to be done every 10s.

6. With the configurations made above, all the content of the currents historic
table will be refreshed on Screen every ten seconds. Many times, this is not
viable, either because of the amount of data stored in the historic, or because of
the high amount of fields, or even because of the great number of registers. So,
the application of filters for historic diplay is made necessary. Examples of
fields will be created in the next exercises.

7. Insert a new browser in MainProject’s EventScreen. Configure the query to


receive all the fields from the table “Alarms”.

8. At E3Browser, select the same fields configured at E3Alarm (AlarmScreen),


including EventTime field and excluding E3TimeStamp.

9. Highlight the column Severity to make filter checking easier. When you select
the field, drag it up, until it is right below EventTime.

10. For alarms filter, use EventTime field. It is necessary to create the filter for
field value input in the query. Click the query, and edit the filter on
EventTime’s Filter column as in the picture below:

Tutorial Exercises Book 30


11. Create a new Command Button and adjust its Caption property to Filter by
Date. In the button’s Click event create a new script to apply the filter by date.
The script should contain the following block of commands:
'Passes SetPoint’s value to the variables
HoraInicial = Screen.Item("TxtIniTime").Value
HoraFinal = Screen.Item("TxtFinTime").Value
'Sets query’s variables with SetPoint’s value
Set Consulta = Screen.Item("E3Browser1").Item("Query1")
Consulta.SetVariableValue "DataIni",HoraInicial
Consulta.SetVariableValue "DataFim",HoraFinal
'Updates Browser
Screen.Item("E3Browser1").Requery()

12. This script creates the query to be made to the DB, with values configured at
the time SetPoints created at EventScreen. To check the query, adjust the
period between which the alarms content will be displayed.

Tutorial Exercises Book 31


-+
2
To work with E3Chart (which is E3’s graphic), you will use both current and tension
tags previously saved in the folder ElectricalData. You will do this exercise in two
different ways. In the first, you will make an online graphic. In the second, you will
create a historic graphic, which will present only the values from the last two hours.

1. On GraphicScreen, place an E3Chart, a command button, and its title


(“Graphic Screen”).

2. Create a pick in the button that should call ElectricalScreen. Likewise, on


ElectricalScreen, add a pick to Graphic text to open GraphicScreen.

3. Access E3Chart’s properties.

4. On Axis tab, configure HorizontalAxis. In axis properties’ dialog box, go to


Scale tab and adjust the item Show Latest Data (Real-Time) to 5 minutes.
Click OK to finish the configuration.

Tutorial Exercises Book 32


5. Select now the available VerticalAxis. Click Configure, then Name, and
rename it to CurrentAxis. On the tab Scale, select Numeric Scale and adjust
Maximum and Minimum values to -5 and 105. Click OK and finish this
configuration.

6. Still on Axis tab, click Add button. A new scale will be created, called
TensionAxis, and its values should be adjusted to 34000 and 42000. Change
the item Scale Color, so that it distinguishes itself from CurrentScale.

7. Now you will start working with on-line pens. To do so, go to Pens tab. Create
a new pen and access its properties.

8. Configure the pen, begining with Vertical Axis Data, which should be linked
to Current1 tag. With Vertical Axis, use Axis. Create a new pen to each
CurrentTag.

9. Now configure tension pens. Add three more pens and relate them to the
corresponding tags. The axis should be TensionAxis.

10. When you have finished configuring the pens, proceed with legend
configuration. Go to Legend tab, enable the item Show Legend, and mantain
the option on bottom. Select the columns Pen Color, YScale, Y Tag Name,
and Y Tag Value. The Graphic’s configuration is now completed.

11. To enable or disable the pens that had been created, insert on Screen six
CheckBox objects. Each box should be named after one of the tags displayed
on the graphic (Current 1 to 3, and Tension 1 to 3).

12. Change each checkbox’s Value property to True. Thus, they will be in
accordance with the pens’ initial visibility when you open the Screen.

13. In each button, create a script on Change event with the following code:
Set Pena1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pena1.visible = Value

14. In this script, the number 1 should be replaced by the pen’s number (1 to 6). So,
each button will be responsible for showing or hiding one of the pens created in
the graphic.

1 2

1. Insert an E3Chart in HistoricScreen, right below E3Browser. The


configuration of the Query to be used by the graphic’s pens will be performed.
The configuration sequence will be the same for E3Browser.

Tutorial Exercises Book 33


2. Double-click E3Chart and go to Queries tab. Click Add, chose DBServer, and
select CurrentsTable. The query’s variables will be Currents1 to Currents3,
and E3TimeStamp.

3. After you have configured the query, proceed configuring Axis.


HorizontalAxis should have its Scale property adjusted for last 24 hours. To
do so, select the option Time Interval (Historical Data), press Select button,
and choose Yesterday.

4. Still on Axis tab, configure VerticalAxis for a scale from -5 to 100.

5. Next, configure the pens. Create a new one, configure it to be Historical Data
from Query, and use the query you have created at the beginning of this
exercise. Select Current1 for vertical axis, and E3TimeStamp for horizontal
axis. Picture 15.3 ilustrates how the configuration of historic Pen1 should look
like.

Tutorial Exercises Book 34


6. Repeat this procedure for the other two currents. At the end, run the project,
and check the results on HistoricScreen.

7. Since query periods are usually smaller than one day, you can make that each
time the Screen is open only the data from the last two hours are displayed.
Create a new script for HistoricScreen’s OnShow event. The following code
will make the necessary adjustments for the two-hour period to be displayed:
Sub TelaHistorico_OnShow()
Set Chart = Screen.Item("E3Chart1")
Chart.Axes.HorAxis.SetHistoricPeriod now - 2/24, now
End Sub

8. Create a button called Update Graphic with the following script to refresh it:
Screen.item("E3Chart1").Queries.UpdateData()

9. Run the project and check the results obtained. In case you have any doubts,
call your instructor.

Tutorial Exercises Book 35


0. 3
1. Now you are going to create a report that will extract the data from currents
historic, saved in ElectricalProject. To do so, insert a new Report in this
project.

2. Adjust report query to find current data stored in the DB. To do so, double-
click the query, through Organizer. The available tables will be displayed, so
select CurrentsTable. Then, queries wizard will be opened. Select, on
CurrentsTable, the variables E3TimeStamp and Current1 to Current3.
These data will be available to be displayed in the report.

3. The next steps define the report’s appearance, since the data to be displayed
have already been configured. Insert a bitmap in PageHeader area, and place
the picture file indicated by your instructor.

4. Configure SizeMode property to 1- ddsMStretch.

5. Add a text to the same field, and configure it to E3 Report.

6. Still in PageHeader area, insert four new Text objects and configure them to
Date/Time and Current1 to Current3. Adjust them to be level with the
lowermost limit in PageHeader area.

7. On Detail field, insert 4 SetPoints, aligning them with the fields created in
PageHeader, since these fields will be responsible for displaying historic data.
For each field, configure DataField property for the data it will display. For
example, the field below the label Date/Hour should have as value
E3TimeStamp in DataField; the labe Current1 should have as value
Current1, and so on

8. To split data lines in the report, at the end of Detail area, insert a horizontal
line.

9. The report is configured to display the current values selected from Database.
To view this report, press report’s Preview button .

10. E3’s report data fields use is very flexible, being configured on the same field
where the function this field should execute is. As an example, you will create
in PageFooter the text indicating “Page 1 of 12”. To do so, insert two texts.
Configure one of them to “Page”, and the other to “of”. Between them, insert a
SetPoint and configure SummaryType property to 4 – ddSMPageCount, and
SummaryRunning property to 2 – ddSRAll. This will display the current page
number.

Tutorial Exercises Book 36


11. To disply the total number of pages in the report, repeat the last procedure, but
do not modify SummaryRunning property. Default value is 0 – ddSRNone.

12. Execute report’s visualization one more time, and check the changes made.

13. To view the report in runtime, create a command button on ElectricalProject’s


HistoricScreen, and create a Print Report pick. In the option Print
Report, select Report1, and in the option Output, select the item Screen.

14. This will make the report visualization Screen be displayed. From this Screen,
it is possible to configure printer and paper characteristics, among others, and
also print the report. To print the report without viewing it, use the report’s
Print() method.

Tutorial Exercises Book 37


0- $
The exercises about formulas will be executed in IndustrialProject. The final
product of our industrial project will be different kinds of fuel, distinguished from
each other by three different characteristics (amount of additive, percentage of
alcohol, and coloring). You will simulate three different values to be “produced” in
the two tanks on IndustrialScreen.

1. Before you start working with formulas, in IndustrialData folder, insert a data
folder called Formula, and inside it, create a subfolder called Tank1. Inside
Tank1, insert three internal tags and rename them to Additive, Alcohol, and
Coloring.

2. Duplicate Tank1 folder (and rename the copy Tank2).

3. In IndustrialProject, insert a new Formula object. Double-click it, and


configure its properties according to the following items.

4. Type TrainFormula as the name of the table, and link the formula to
MainProject’s DBServer.

5. Next, define a format to the formula, with the data on the table below:
NAME TYPE RESTRICTIONS
Additive Integer A 1 20
Alcohol Integer A 15 25
Coloring Integer P 10 10

6. Go to the next Screen. Create two new units, receiving different values for their
tags. In Unit1, link Tank1’s tags to the respective template’s tags. Next, create
create the second unit, and link it to Tank2 folder’s tags.

7. On the next Screen, create four new cluster of values, obeying the previously
defined limitations by the format. The values can be the constant ones in the
next table.
ITEM’S NAME VALUE1 VALUE2 VALUE3 VALUE4
Additive 15 18 20 5
Alcohol 23 15 20 21
Coloring 10 8 15 20

8. Edit FormulaScreen at IndustrialProject, according to the pattern of the


picture below. The Screen should use SetPoints for the values indicated for
Additive, Coloring, and Alcohol, and also for the number of the unit to be
loaded. Rename the tow last SetPoints to TxtUnit1 and TxtUnit2.

Tutorial Exercises Book 38


9. Link each tank’s setpoints to the data to be displayed. These tags are in
IndustrialData.Formula.

10. For the command button with the label Load Quiet Formula, edit the
following script.
Unit1 = Screen.Item("TxtUnit1").Value
Unit2 = Screen.Item("TxtUnit2").Value
'Loads values cluster chosen form the two units
set formula = Application.GetObject("Formula1")
formula.LoadFormulaValuesQuiet "Unit", "Value"&Unit1
formula.LoadFormulaValuesQuiet "Unit2", "Value"&Unit2

11. This script will load the cluster of values especified at the setpoints for the
respective units. Notice that you will use only the values 1, 2, 3, or 4 at the
setpoints, because you will only have registered four cluster of values.

12. For the command button Load Dialog Formula, edit the script below. You will
find LoadFormulaDlg method among Viewer’s methods.
Application.LoadFormulaDlg "Formula1"

13. This script will make the loading of values to formula units be done through a
wizard.

Tutorial Exercises Book 39


14. To alter the values registered at Formula, create the script below at Save Unit1
button. The goal is to save the new values typed for Tank1 at the values cluster
specified at TxtUnit1 setpoint.
Unit = Screen.Item("TxtUnit2").Value
Set formula = Application.GetObject("Formula1")
Formula.SaveFormulaValues "Unidade1", "Valor"&Unit1

15. For the same purposes as the previous exercise, create the script below at Save
Unit2 button.
Unit2 = Screen.Item("TxtUnit2").Value
Set formula = Application.GetObject("Formula1")
Formula.SaveFormulaValues "Unidade2", "Valor"&Unit2

Tutorial Exercises Book 40


00 4 # ! #
1. Access E3’s user permission control (menu File—Users), create three groups:
Administrators, Supervisors, and Operators.

2. Next, create the four users listed on the table below:

Users Table
USERS Paul Henry Sally Peter
PASSWORD P H S P
ADMINISTRATOR Yes No No No
ADMINISTRATORS Yes Yes Yes Yes
SUPERVISORS No Yes Yes No
OPERATORS No Yes No Yes

3. Access the tab Permissions, and select the option Groups. For the group
Adminstrators, enable the opening of all Screens, except for InitialScreen,
which sould not check users. For alarms, block the option Alarm
Acknowledgment for Electrical and Industrial areas. Enable all Domain
options for this group.

4. For the group Supervisors, enable the opening of all screens, except for
InitialScreen. Enable the option Alarm Acknowledgment. Block all Domain
options.

5. For the group Operators, enable the opening of MenuScreen,


IndustrialScreen, AlarmScreen, and ElectricalScreen. Disable all others,
except for InitialScreen, which should not check users. Enable the option
Alarm Acknowldgment. Block all Domain options.

6. Now, select the option Permissions, and click Users. For user Paul, enable the
option Alarm Acknowledgment at Electrical area. Since he is part of
Administrators group, individual permission overrides group permission.

7. Go to InitialScreen and create Click event for the text Enter the System, and
run the command Application.Login().

8. Run the application, using all the registered users. Check each user restrictions
or permissions behavior. When you doubt, ask your instructor.

Tutorial Exercises Book 41

You might also like