E3scripts Us
E3scripts Us
E3scripts Us
4. EVENTS ..................................................................................................................................................................... 59
5. METHODS ................................................................................................................................................................. 81
EXAMPLE DESCRIPTION
Filenames and other terms in operational system level are
typed in font Tahoma, upper case.
Field names and options shown in the Screen, menus or
object tabs are typed in font Tahoma.
“Chart” Characters between quotation marks should be typed where
mentioned, with no quotation marks.
Screen1.Show() Excerpts of programs (scripts) are indicated by Courier font.
They must be typed in the appropriated places and then
compiled, for error verification.
DriverLocation Italic font characters indicate either E3’s methods or
properties. Methods are followed by parenthesis.
Expressions between the symbols < > must be replaced by
the name of the object being mentioned.
Optional parameters are indicated between brackets in
method calls.
! Expressions between brackets and typed in Tahoma font
indicate key name. When followed by the + symbol, it
indicates you must press the second key while you press the
first key.
Scripts are programming language modules that allow you to create procedures
associated to specific events, providing you with higher flexibility in the
development of applications. Each object (item of an application) from E3 has a list
of previously defined events, but it is also possible to define new events created by
the user.
Objects are reusable software components that allow you to maximize use, and
increase quality and productivity of applications.
Each object from E3 encapsulates three different parts (properties, methods, and
events) that you can manipulate to obtain the advantages of its functionality in your
application.
Properties define the object’s attributes, such as the appearance of a Screen control,
or an object’s initial value when you start the application.
Methods are functions that perform a specific action with or within an object.
Events are notifications generated by an object as a response to some particular
occurrence, such as a mouse click or a change in tag value, among others.
One of the main characteristics of objects and object-oriented languages is their
ability of inheritance among each other, i.e., they can inherit characteristics of one or
more objects, having the same specific functionalities. So, you can have different
objects working together to provide characteristics of another derived object.
For example, take the object E3Chart. It consists internally of many objects, such as
titles, subtitles, scales, divisions, queries, and pens. Notice how each object
contributes for the functionality of E3Chart as a whole: scales help locate point
values, subtitles help identify pens and their values, and pens draw values in the
E3Chart.
By handling objects within the E3Chart, you can create two instances of this object
that are very different from one another. To handle a specific object, you have to
access it through a hierarchy. If both E3Charts are on the same Screen, you should
first access the Screen, then the preferred E3Chart, and then one of its properties or
child-objects. When there are many objects of the same type, usually they can be
accessed through a collection. A collection is a special object that manages a set of
similar objects. An example in the E3Chart is the collection Pens, which allows
access to all E3Chart pens.
Introduction 7
E3 - Scripts - Reference Manual
The language used for E3 Studio scripts is VBScript, a subset of the Visual Basic®
language developed by Microsoft. VBScript has a quick, light, and portable
interpreter, developed for the use in Internet browsers and other applications using
ActiveX Controls, Automation Servers, and Java Applets.
As seen before, scripts are associated to object’s events. However, to facilitate and
increase the development speed, E3 has already incorporated some of the most
common actions that can be made with scripts through wizards called Picks. You
can therefore define that a given event will either run a script, a pick, or a
combination of both, in a sequence that is also pre-defined.
Each view at E3 Studio displays at least two tabs on its lower side: Design and
Scripts, with the exception of the objects Database and Alarm Server, which do not
present the tab Design. The objects and its child-objects can be manipulated in the
tab Design; to manipulate their scripts, use the script Scripts. The buttons available
in the latter are:
8 Introduction
E3 - Scripts - Reference Manual
$
() ' $ * Adds the pick “Open Screen”.
$
()- .. & , * Adds the pick “Toggle Value”.
$
() ' * Adds the pick “Print Report”.
Introduction 9
E3 - Scripts - Reference Manual
The execution order is top-down. To alter the order, just use the buttons and .
Use the button to check for errors in the specified script. The error messages of
the compiler are presented in the panel Messages, in the lower part of the tab Scripts.
Double-click the error in case you want to it to be selected in the script.
!
To add a script to an object, follow these steps:
Select the object for which you want to create the script and click on the
Scripts tab.
10 Introduction
E3 - Scripts - Reference Manual
Click on the icon Script. The scripts editor is then opened, according to
the picture below.
NOTE: use the character _ (underline) whenever you wish to add a line break to
make the code more legible. The underline character indicates that the line continues
on the next line.
For example:
If intBoilerTemperature3 > 120 and _
intBoilerTemperature4 > 120
Then
bSendAlarm = True
bAlarmOn = True
End If
Each event can have several scripts and several picks associated to it. These are
called actions. The list of actions can be seen on the upper side of the Scripts. Each
object can have any number of events with scripts or picks associated.
NOTE: By right-clicking any of these actions described above, a menu will open to
allow you cut, copy and paste scripts and picks among events.
Introduction 11
E3 - Scripts - Reference Manual
" #
Picks implement a friendlier way of achieving the most common procedures, saving
configuration time. Among them there are actions such as switching Screens or
values assignment, which are very common in the creation of a project.
Next, there is a description of the picks available through the tab Scripts.
Open Screen
Opens a Screen or a specific Frame.
12 Introduction
E3 - Scripts - Reference Manual
Introduction 13
E3 - Scripts - Reference Manual
14 Introduction
E3 - Scripts - Reference Manual
Run Application
Runs a specific application program.
Introduction 15
E3 - Scripts - Reference Manual
Load Value
Loads a value into a tag.
16 Introduction
E3 - Scripts - Reference Manual
Toggle Value
Allows toggling the value of a tag. If tag value is equal to 8 , 9, then the tag gets
8 , :. If tag value is equal to 8 , :, then the tag gets 8 , 9. If tag value is
different from either 8 , 9 or 8 , :, the tag gets 8 , 9.
It is possible to put as many Toggle Value picks as necessary. It allows checking
multiple values for the same tag or even for several tags in the same event.
Introduction 17
E3 - Scripts - Reference Manual
Print Report
Allows printing a report on Screen or in the printer.
18 Introduction
E3 - Scripts - Reference Manual
$ % & ' ( )
Although E3 comes with a wide range of events, there are many times when the user
may wish to create a specific event for their own application.
An example of use of user-customized events would be a calculation, or a more
complex task in an object, when the generating event comes from another tag or
property.
Although you can create and execute this type of work from the tag or property
generating the event, there are several advantages in keeping the script next to the
object that will suffer the action of the script. Among these is the additional work
needed to make an object point to another, not to mention the small amount of work
needed in maintenance, because if by any reason it is necessary to modify or delete a
tag or property generating the event, it will not be necessary to modify a second
object.
Another advantage comes from the fact that if you erase the tag generating the event,
the object does not lose its script, so long as you indicate another event generating
source.
Internal events generation also makes the creation of libraries easier, for each time a
library component is inserted in an application it also brings scripts and calculations
that may be necessary, reducing configuration work.
To generate a new internal event in an object, follow these procedures:
.
Picture 11: Window for adding user-customized events
Introduction 19
E3 - Scripts - Reference Manual
Click on < to finish the process and insert the event. It will now be a
part of the Events Combo.
To alter this event, select it and click on Edit user event. The previous
window is then opened again to edit the information on the event.
To erase this event, select it and click on Remove user event.
IMPORTANT: when you click on this option, the event’s scripts are lost.
20 Introduction
! *+
VBScript is a language based on Visual Basic® that brings the capacity of scripting
to applications that run on Windows.
VBScript exchanges information with applications using the ActiveX Scripting
technology. With ActiveX Scripting, browsers and other client-applications like E3
Viewers are able to compile scripts and call functions, among other procedures. This
enables scripts developed for an application or library (that should be executed in the
graphical interface) to run either in the E3 Viewer or an Internet browser, with no
need of adaptation on the application.
Further information about VBScript can be obtained on the online manual
"VBScript Reference Guide”, in the E3 Program Group.
! '' !) '
The script-programming environment in the E3 Studio can be accessed by right
clicking any object, and selecting the option Properties. On Scripts tab you can see a
combo box where you can define which event will be the script generator. As seen
in the previous chapter, there are two types of events in an E3 object: predefined
events, and user-customized events.
Predefined events vary from object to object, depending on its use and functionality.
A Screen object, for example, has graphical interface related events, like OnClick
(called whenever clicking the object) or OnDbClick (called whenever double
clicking it); an object like an IODriver, on the other hand, has communication
related events, like OnCommError (called whenever there is a communication
error). You can also define other events for the object, as seen before.
When you associate a script to an event in an object, the typing field presents a
procedure declaration whose definition is automatic and formed by the following
text:
Sub ObjectName_EventName()
End Sub
where "#$; is the name of the associated object, and !& ; is the
name of the aforementioned event. Script commands should come between these
two lines.
To help typing the script, you can use AppBrowser. When choosing the preferred
method or property, you can activate the Copy button. The chosen tag, property, or
Introducing VBScript 21
E3 - Scripts - Reference Manual
method will be inserted in the cursor position on the editing board of the script. The
cursor position is shown by an animated blinking arrow.
, -
VBScript has only one datatype called Variant. A Variant is a special datatype that
can contain different types of information, depending on how it is being used.
Because the variant is the only datatype in VBScript, it is also the type of return data
of all functions in VBScript.
In practice, a variant may contain either numbers or text. A Variant behaves as a
number when used in numerical expressions, and as a string in text expressions. It
means that if you are working with data that resemble numbers, VBScript assumes
that these are really numbers, and performs appropriately to this type of data.
Likewise, if you are working with data that look like text, VBScript treats them as if
they were text. You can also force numbers to behave like text by putting them
between quotation marks (" ").
Variant Subtypes
Beyond simple classifications of number or text, a variant can make distinctions on
the specific nature of the numerical information. For example, you can have
numerical information representing date/time. When used with other date/time data,
the result is always expressed in a date/time format. You can also have a variety of
numerical type information of different sizes, from logical types (Boolean) to big
floating-point numbers. These different categories of information that can be
contained in a variant are called subtypes. In most cases, you simply attribute the
preferred type of data to a variant and it behaves in the most appropriated way.
Variant Subtypes
SUBTYPES DESCRIPTION
! '4 Empty (non initialized variant). The value is 0 for numerical variables, or a
string of zero length ("") for text variables.
;, Null. The variant does not contain valid data intentionally.
Logical. Contains true (True or 1) or false (False or 0).
4 Contains integers ranging from 0 to 255 (8 bits).
. Contains integers ranging from -32768 to 32767 (16 bits).
, $ 4 Monetary values, ranging from -922.337.203.685.477,5808 to
922.337.203.685.477,5807.
. Contains integers varying from -2,147,483,648 to 2,147,483,647 (22 bits).
. Contains a floating-point number of single precision ranging from
3,402823E38 to -1,401298E-45 (for negative values), and from 1,401298E-
45 to 3,402823E38 (for positive values).
= ," Contains a floating-point number of double precision ranging from
1,79769313486232E38 to -4,94065645841247E-324 (for negative values),
and from 4,94065645841247E-324 to 1,79769313486232E38 (for positive
values).
22 Introducing VBScript
E3 - Scripts - Reference Manual
" *
A variable is a memory location in the computer where you can store information
that may change during script execution. For example, you can create a variable
called ClickCount to save the number of times the user clicked an object. The place
where the variable is stored in the computer memory is not important. Actually, it is
only necessary to know the name of the variable to see or modify its value. On
VBScript, the variables are always of base-type Variant.
Declaring variables
You can declare variables in two different manners: implicitly, or explicitly.
To declare a variable implicitly, simply use its name on the script. The variable will
automatically be created and initialized with the attribution value, or it will remain
Empty, in case it does not receive any value before being used.
This a quick practice, but if the script is very extensive this can cause confusion and
the creation of more than one variable with the same name, generating bugs in the
script.
To declare variables explicitly, use the command Dim, as in the example below:
Dim Temperature
You can declare multiple variables separating each variable name by a comma. For
example:
Dim Left, Right, Top, Bottom
Because all scripts in E3 are associated to a specific object, variables are always
local, valid only for the script scope. To have public or global variables, you must
create an internal tag and use it to store the preferred value.
Introducing VBScript 23
E3 - Scripts - Reference Manual
24 Introducing VBScript
E3 - Scripts - Reference Manual
$
A constant is a special type of variable that never changes its value. VBScript
already has a set of predefined constants. See the language reference at Microsoft®
website for further details.
Creating constants
You can create user-customized constants by using Const command. Using Const
command you can create text or numerical constants as names with meaning and
attribute literal values. For example:
Introducing VBScript 25
E3 - Scripts - Reference Manual
.
VBScript has a vast range of operators as we can next see.
Arithmetical operators
(addition)
> (subtraction or unary negation)
? (multiplication)
/ (decimal division, returns a fixed-point number)
@ (integer division, returns an integer number)
+ (remainder of the division)
A (exponent)
Comparison operators
(lesser than)
(greater than)
B (lesser or equal to )
B (greater or equal to)
B (equal to )
(different from)
Strings operators
C (concatenation)
26 Introducing VBScript
E3 - Scripts - Reference Manual
Logical operators
0+ (AND)
(OR)
; (Negation, unary operator)
D (exclusive OR)
Precedence of operators
When many operations occur in an expression each part is evaluated and solved in a
predetermined order called precedence of operators.
You can use parentheses to redefine the precedence order and force some parts of an
expression to be always executed before those, which are out of the parentheses.
Meanwhile, within the parentheses are kept the standard precedence of operators .
When expressions contain operators of more than one category, the arithmetical
operators are evaluated first, followed by the comparison operators and the logical
operators are the last ones.
Arithmetical operators are evaluated in the following order:
1. - (unary negation)
2. ^
3. *, /
4. \
5. Mod
6. +, -
7. & (Concatenation of strings)
When multiplication and division are together in the same expression, each
operation is evaluated as they appear, from the left to the right. In the same way,
when addition and subtraction are together in the same expression, each operation is
evaluated in the order they appear, from the left to the right. The operator of strings
concatenation (&) is not an arithmetical operator, but in precedence it occurs after
all arithmetical operators and before all comparison operators.
All comparison operators have the same precedence, i.e., they are evaluated from the
left to the right, in the order they appear.
Logical operators are evaluated in the following order: Not, And, Or and Xor.
Introducing VBScript 27
E3 - Scripts - Reference Manual
/ ''
Comments lines and notes in the code can be added using the character '
(apostrophe) in the beginning of the line.
Example:
Sub Example()
Dim X
' This is an example of comment
X = 1 ' commenting that the variable X received 1
End Sub
0 1 2
You can control the script execution flow with condition and loop commands. With
conditional commands you can write a VBScript code that take decisions and repeat
actions.
0 )
The If...Then...Else command is used to evaluate if a condition is true or false and
depending on the result, to specify one or more commands to be executed. Usually
condition is an expression that uses a comparison operator to compare one value or
variable with another.
The If...Then...Else commands can be nested in as many levels as you need.
However, you should respect the block syntax : if the Then has only one command
you can put it in the same line. If it has more than one command you should put the
Then marking the beginning of the block followed by the desired commands in
separated lines, and finalize it with one of these commands: Else, ElseIf or End If
(see next examples).
28 Introducing VBScript
E3 - Scripts - Reference Manual
Sub FixDate()
' Declare the variable myDate
Dim myDate
' Attribute February, 13rd, 1995 to myDate variable
myData = #1995/02/13#
' If myDate is prior
' to today (Now system variable)
' then make myDate be equal to today
If myDate < Now Then myDate = Now
End Sub
In order to execute more than one code line you should use block syntax or multiple
lines. This syntax includes the End If command as showed below:
If value = 0 Then
AlertLabel.ForeColor = vbRed
AlertLabel.Font.Bold = True
AlertLabel.Font.Italic = True
End If
ElseIf clause
A variation in the If...Then...Else command allows you to choose among many
alternatives. Adding ElseIf clauses we expand the command functionality making
possible the control of the execution flow based on distinct possibilities. For
example:
Introducing VBScript 29
E3 - Scripts - Reference Manual
Sub InformValue(value)
If value = 0 Then
MsgBox value
ElseIf value = 1 Then
MsgBox value
ElseIf value = 2 then
Msgbox value
Else
Msgbox "Invalid value!"
End If
It is possible to add as many ElseIf clauses as necessary, but the extensive use of
ElseIf clauses can be replaced by the Select Case command making the script
clearer and more optimized.
0
The Select Case structure is a more effective alternative to the If...Then...ElseIf to
select one among multiple blocks of instructions conditioned to a variable.
The Select Case command works with a simple expression of test that is evaluated
one time, in the beginning of the structure. The result of the expression is then
compared to the values for each desired Case. If there is a true comparison the block
of instructions associated to that case is executed. For example:
Select Case WarningType
Case 1
Msgbox "Warning: tag with critical low value!!!"
Case 2
Msgbox "Warning: tag with low value!"
Case 3
Msgbox "Warning: tag with high value!"
Case 4
Msgbox "Warning: tag with critical high value!!!"
Case Else ' if any case is selected
Msgbox "Normal situation."
End Select
Notice that the Select Case command evaluates the expression only one time in the
beginning of the structure. In opposition, the If...Then...ElseIf structure will
evaluate a different expression for each ElseIf instruction, making the code less
optimized. In these cases, always prefer the Select Case structure.
30 Introducing VBScript
E3 - Scripts - Reference Manual
0" 3 3
The While... Wend command allows repeating one block of commands while a
condition is true. This command is provided in VBScript for those who are familiar
to its use. Meantime, the lack of flexibility recommends the use of the Do... Loop
instruction.
0$ , 4
You can use Do... Loop commands in order to execute a block of code indefinite
number of times. The commands are repeated while the condition is true or until the
condition become true.
While keyword
The While key word should be used in a Do... Loop instruction in order to indicate
the loop will be executed while its condition is true. It is possible to evaluate the
condition before entering in the loop or after the loop have been executed at least
one time.
In the following example, in the !& , 52 procedure, if we attribute 9
to myNum instead of 20, the code within the loop will never be executed.
In the !& , 0 52 procedure, the code within the loop will be execute only
one time within the loop due to the condition already be false.
Examples:
Introducing VBScript 31
E3 - Scripts - Reference Manual
Sub EvaluateBeforeWhile()
Dim counter, myNum
counter = 0
myNum = 20
Do While myNum > 10
myNum = myNum – 1
counter = counter + 1
Loop
MsgBox "The loop had " & counter & " repetitions."
End Sub
Sub EvaluateAfterWhile()
Dim counter, myNum
counter = 0
myNum = 9
Do
myNum = myNum – 1
counter = counter + 1
Loop While myNum > 10
MsgBox "The loop had " & counter & " repetitions."
End Sub
Until keyword
The Until key word indicates the loop will be executed until its condition be true.
There are two methods of using the Until key word in order to evaluate a condition
in a Do... Loop loop. You can evaluate a condition before entering in the loop (as
showed in the example !& , 6 ) or after the loop have been ran at least
one time (as showed in the example !& , 0 6 ). While the condition is
false, the loop occurs.
32 Introducing VBScript
E3 - Scripts - Reference Manual
Examples:
Sub EvaluateBeforeUntil()
Dim counter, myNum
Counter = 0
myNum = 20
Do Until myNum = 10
myNum = myNum – 1
counter = counter + 1
Loop
MsgBox "The loop had " & counter & " repetitions."
End Sub
Sub EvaluateAfterUntil()
Dim counter, myNum
Counter = 0
myNum = 1
Do
myNum = myNum + 1
counter = counter + 1
Loop Until myNum = 10
MsgBox "The loop had " & counter & " repetitions."
End Sub
Exit Do command
It is possible to force the exit of a Do... Loop loop by the Exit Do command. This
command ignores the condition specified in the loop and closes it unconditionally.
Due to the fact of desiring to exit only in special situations (like avoiding an infinite
loop) you should use the Exit Do command in the true condition of an
If... Then... Else command. If the condition is false the loop runs normally.
In the following example, myNum receives a value that creates an infinite loop. The
If... Then... Else command verifies this condition, preventing an infinite execution.
Introducing VBScript 33
E3 - Scripts - Reference Manual
Example:
Sub ExampleExitDo()
Dim counter, myNum
counter= 0
myNum = 9
Do Until myNum = 10
myNum = myNum - 1
counter = counter + 1
If myNum < 10 Then Exit Do
Loop
MsgBox "The loop had " & counter & " repetitions."
End Sub
0. 1 5
You can use the For... Next command in order to execute a block of instructions a
specific number of times. For loops, use a variable as counter which value is
increased or decreased in each repetition of the loop.
The following example makes the tag example receives the value of the expression
for 50 times. The For command specifies the counter X variable and its initial and
final values. The Next command increases the counter and verifies if it reached the
limit. If not it executes the loop one more time. If yes, the script continues.
Sub Execute50Times()
Dim X, example
For X = 1 To 50
example = X * 2 ' receives 2, 4, 6, 8, 10 etc.
Next
End Sub
Using Step key word you can increase or decrease the counter variable for the value
you specify. In the following example the counter is increased by 2 each time the
loop repeats. When the loop is over the total is the sum of 2, 4, 6, 8 and 10.
Sub TotalOfTwo()
Dim j, total
For j = 2 To 10 Step 2 ' count by 2
total = total + j
Next
MsgBox "The total is " & total
End Sub
In order to decrease the counter, use a negative value for Step. You should specify a
final value lesser than the initial value. In the following example myNum is
34 Introducing VBScript
E3 - Scripts - Reference Manual
decreased by 2 each time the loop repeats. When the loop is over the total is the sum
of 16, 14, 12, 10, 8, 6, 4 and 2.
Sub OtherTotal()
Dim myNum, total
For myNum = 16 To 2 Step –2
total = total + myNum
Next
MsgBox "The total is " & total
End Sub
You can exit from any For... Next command before the counter reaches its final
value using the Exit For command. This command behaves similarly to the Exit Do
command finalizing the loop unconditionally.
0/ 1 ) 5
A For Each... Next loop is similar to a For... Next loop. Instead of repeating the
instructions of a block a specific number of times, a For Each... Next loop repeats a
group of command for each item in a collection of objects or for each element in an
array. This is very useful when you do not know how many elements a collection
contains.
Example:
Sub cmdChange_OnClick
Dim d 'Declare a variable
' d will be an object of type Scripting.Dictionary
Set d = CreateObject("Scripting.Dictionary")
' Add items to collection d
d.Add "0", "Athens"
d.Add "1", "Belgrade"
d.Add "2", "Cairo"
For Each I in d ' I é implicitly declared
Document.frmForm.Elements(I).Value = D.Item(I)
Next
End Sub
Introducing VBScript 35
E3 - Scripts - Reference Manual
6
The main reason for using a consistent set of codification conventions is to
standardize the codification structure and style of a script or a set of scripts so that
you and other people can read and understand the code.
The use of good codification conventions results in a precise, legible and non-
doubtful font-code that is consistent with the convention of other languages and
makes it as intuitive as possible.
Procedures
A good technique is using the pair verb-noun for the nomination. Meanwhile, do not
use vague, doubtful or generic words, like “do”, “thing” or “this”. If you find
difficulties nominating a procedure using these suggestions, maybe it has no reason
of existing or its purpose is wrong.
Examples: ClassifyMatrixNames, CalculateInterestRate.
Constants
Use the prefix “con” followed by the constant name. Start the constant name with
upper case. For constants names with two or more words separate them by using
only upper cases to define the beginning of the new word.
Example: conMyConstant.
Variables
Although a reasonable extensive name be recommended, names using more than 32
characters are difficult to read and to type. In this case it is good to use abbreviated
names, mainly for variables, which are largely used like counters in loops.
Meanwhile you should use the same standard of abbreviation in all of the code (do
not define, for example, a counter variable using "cnt" in a procedure and using
"cont" in another one).
In addition it is recommended to use prefixes of the variable nomination, which
indicate its subtype. This is very useful when using variables in functions or loops,
which work with a specific subtype.
Examples:
Dim strMyName ' string
Dim dblNumberCalls ' double
Dim intCodScreen ' integer
36 Introducing VBScript
E3 - Scripts - Reference Manual
Objects
It is recommended to use the following prefixes:
OBJECT PREFIX
E 3 $ ." hsb
8 $ $ ." vsb
0 + ", ani
+ ", cmd
' .", spn
" " % " % cbo
= . % dlg
" % lst
-%" % txt
2$ (" % chk
. img
+ . +$ sld
lin
1 fra
F= pnl
" lbl
Introducing VBScript 37
E3 - Scripts - Reference Manual
Comments
All of procedures should begin with a short comment about what it does.
Nevertheless, this comment should not describe the implementation in details
because oftentimes it spends a lot of time and results in a maintenance work of
unnecessary comments. The code itself or the comments at the end of the lines will
describe how the procedure executes the task it is proposed to.
By the way, a very important recommendation that may cause the opposition of
great majority of programmers is: comment each code line of your program.
Although it is excessively difficult this will save you from having a hard time
mainly when you try to read what yourself have written some time after you had
done the code.
A good tip for those who do not like commenting their code is to use the following
technique: first, write down all of the code; then, comment all of the lines. This will
be very useful when reviewing the code and finding syntactic or semantic errors. In
addition, sometimes it can be useful to include in the beginning of a code a small
pseudo-code describing the algorithm.
For each procedure you should include the following information before its
definition:
• purpose (what the procedure does and not how it does);
• suppositions (which other parts of the program affect such procedure);
• effects (which other parts of the program such procedure affects);
• parameters (explanation of the purpose of each parameter).
7 *+ )"
In this section, you will see a brief description of the VBScript methods most
commonly used in E3. For further information on VBScripts methods, see
documentation available at E3 program group, under the item “Documents”.
38 Introducing VBScript
E3 - Scripts - Reference Manual
Abs(number)
Returns the absolute value of a number. , " parameter can be any valid
numeric expression. The absolute value of a number is its unsigned magnitude. Ex:
Both Abs(-1) and Abs(1) return 1.
Array(arglist)
Returns a Variant containing an array. . parameter is a comma-delimited list of
values that are assigned to the elements of an array contained with the Variant. If no
arguments are specified, an array of zero length is created.
Example:
Sub CommandButton1_Click()
Dim A
A = Array(10,20,30)
B = A(2)
MsgBox "value is "& b
End Sub
LoadPicture(picturename)
Returns a picture object. Available only on 32-bit platforms. '$,
parameter is a string expression that indicates the name of the picture file to be
loaded. Graphics formats recognized by LoadPicture include bitmap (.bmp) files,
icon (.ico) files, run-length encoded (.rle) files, metafile (.wmf) files, enhanced
metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files.
Examples: See MouseIcon and Picture properties.
Introducing VBScript 39
E3 - Scripts - Reference Manual
40 Introducing VBScript
E3 - Scripts - Reference Manual
The first group of values (0–5) describes the number and type of buttons displayed
in the dialog box; the second group (16, 32, 48, 64) describes the icon style; the third
group (0, 256, 512, 768) determines which button is the default; and the fourth group
(0, 4096) determines the modality of the message box. When adding numbers to
create a final value for the argument buttons, use only one number from each group.
MsgBox method has the following return values:
Introducing VBScript 41
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
Dim MyVariable
MyVariable = MsgBox ("Hello!", 65, "Example of Msgbox")
' MyVariable can contain 1 or 2, depending on the clicked
'button.
End Sub
Now
Returns the current date and time according to the setting of your computer'
s system
date and time.
42 Introducing VBScript
" " ! '' !2 )"
Although the majority of VBScript aspects apply to scripts programming with E3,
some particularities should be emphasized regarding the implementation of object
orientation concept in the system.
" !
One of the most important things to consider when you work with scripts inside E3
is the separation between processes executed in the server and those executed in the
client's interface (E3 Viewer). In order to work with scripts, you can manipulate:
• Server objects via server
• Server objects via E3 Viewer(s)
• E3 Viewer objects via the same E3 Viewer
However, you cannot manipulate directly:
• E3 Viewer objects via server (it is only possible by creating events at
E3 Viewer, which are connected to variables in the server)
• E3 Viewer objects via another E3 Viewer (it is only possible by
creating events connected to variables that are in the server)
Such limitations come from the fact that, by definition, there is independence
between what the E3 Viewer station is doing or visualizing and the server, and vice-
versa. So, all activities, both in the server and in E3 Viewer, need to be coordinated
either in an asynchronous way or through events in order to operate harmoniously.
Thus, due to this independence, when creating a script, first you should obtain a
correct reference to the objects you want to manipulate, i.e., it is necessary that the
object be found in several E3 modules first.
Remember that when you edit a script, you can use AppBrowser, which allows the
path of a method or property to be copied to the script completely, then helping you
create scripts.
Therefore, to access external objects being manipulated in a script, some basic
guidelines are used. For example, if you want to manipulate the value of an I/O Tag,
the path is: Server – Driver – Folder (if existing) – Tag. But if your goal is to
manipulate a button in the Screen, the path is:Viewer – Frame (if existing) – Screen
– Button.
Programming in E3 43
E3 - Scripts - Reference Manual
There are basically three scripts source locations according to the methodology for
accessing objects:
• Server (E3 Server)
• Screens and Frames (E3 Viewer)
• ElipseX (libraries): they can be XObjects (running in the server) and
XControls (running in E3 Viewer).
" !
To access an object running in the server from a Screen Object or an ElipseX, use
the directive Application.GetObject.
The word Application stands for the application as whole, and the method
GetObject()searches for an object with the given name within Application, in the
server. Example:
Sub Button1_Click()
Application.GetObject("Driver1")._
Item("tag001").AllowRead = False
End Sub
or
Sub Button1_Click()
Application.GetObject("Driver1.tag001").AllowRead = False
End Sub
Item() method has been used to locate “tag001” from the reference of “Driver1”,
because the Driver is a Tag collection. After the object has been located, its
properties and functions can be freely accessed.
In case you need to accomplish another operation with “Driver1” or “tag001”,
another alternative for this script is:
Sub Rectangle1_Click()
Set obj = Application.GetObject("Driver1")
obj.Item("tag001").AllowRead = False
obj.Item("tag002").AllowRead = False
End Sub
In this case, the variable “obj” is pointing to the object “Driver1”, and the next time
you want to access some object descending from “Driver1” inside the script, you can
use the variable “obj” directly. This brings performance enhancement, since each
call from GetObject() method accesses the server once. With this technique, you
avoid unnecessary calls to the server. This example uses the command Set,
explained later. Notice that the use of variables also makes the code clearer and
more easily modifiable. In case it is necessary to change the object where you want
to execute commands, just change the attribution line of this variable.
The word Application in scripts can indicate either functions executed at E3 Viewer
or in the Server. In this case, the Application object senses beforehand which
44 Programming in E3
E3 - Scripts - Reference Manual
" ! '
Take the example of accessing the tag properties from another one. In this case,
origin and destination are in the server, even though connected via a Driver1
“parent” module.
In this case, the Parent declaration should be used. This allows the “parent” of the
object where the script is, to be firstly accessed; and then, we descend in the
hierarchy to look for another element. For example:
Sub Tag1_OnRead()
Parent.Item("tag002").AllowRead = False
End Sub
Picture 12: The picture above shows it is necessary to use Parent declaration
If we are inside a group and we want to access the same tag002, we can nest various
Parent commands.
For example:
Sub Tag1_OnRead()
Parent.Parent.Item("tag002").AllowRead = False
End Sub
Programming with E3 45
E3 - Scripts - Reference Manual
Picture 13: The picture above shows it is necessary to use Parent declaration
In this case, we should only use the Item() method, as the objects are “children” of
the Screen.
For example:
Sub Tela1_OnPreShow(vArg)
Item("Retangulo1").Enabled = True
End Sub
Picture 14: The picture above shows it is necessary to use Parent declaration
46 Programming in E3
E3 - Scripts - Reference Manual
" $ ! '
Picture 15: The picture above shows it is necessary to use Parent declaration
" . - ! '
This is not possible via scripts, for each data client is a different Screen copy. The
modification of any behavior in the Screen can be done only due to a concept
question, from associations (the server automatically reports all changes in variables
chosen for E3 Viewers), or via explicit information search in the server. The whole
graphic interface association operation is accomplished from client to server and not
from server to client.
Let's see a practical example: either to change the color of a text in the Screen into
green when a tag is “turned on” (value 1) or into red when it is “turned off”
(value 0).
How to do it: simply create a digital association between Text1’s TextColor property
and Tag1. This way, you do not need to create a script, which is preferable, due to
the execution speed and maintenance and construction simplicity.
Programming with E3 47
E3 - Scripts - Reference Manual
People experienced in other supervisors might want to create scripts in order to solve
this problem. For example: create an event through a script when the Value property
changes the value, during tag change, and then obtain a reference for the Screen
object, finally changing the TextColor property. Nevertheless, there is no means of
calling the Screen from the server. Therefore, it is not adequate. Another way would
be to create a script in the E3 Viewer, which is constantly verifying if the value of
Tag1 has changed or not, then change the text color. This type of script is possible to
be accomplished, but it would be extremely perverse, because it would strongly
affect the application performance. Thus, this practice is not recommended.
" / ! ) 8 ' ) 8
When creating an ElipseX, we can assign properties (XProperties) and insert objects,
which can be Screen objects (XControl) as well as server objects (XObject). In order
to access XProperties via scripts, just access directly the property name.
48 Programming in E3
E3 - Scripts - Reference Manual
For example, in the picture above there is an XControl1 with Property1 property,
and the objects Text1 and Rectangle1. This property is Boolean, and can be accessed
like this:
Sub XControl1_OnStartRunning()
XControl1.Property1 = True
End Sub
or even:
Sub XControl1_OnStartRunning()
Property1 = True
End Sub
If ElipseX has any internal objects, it is possible to use Item() method to get
references from these objects. For example:
Sub XControl1_OnStartRunning()
Item("Text1").Value = "motor"
Item("Rectangle1").BackgroundColor = RGB (212,208,20)
End Sub
" 0 ! ' ) 8 -
An ElipseX object can only be accessed externally via its properties, by using the
created instances. It is not possible to access internal objects directly.
Programming with E3 49
E3 - Scripts - Reference Manual
If the ElipseX is an XControl, it will behave as a Screen object. For example, in this
application:
To alter XControl’s Property1 property, you can write the following script in the
button:
Sub CommandButton1_Click()
Screen.Item("XControl11").Property1 = True
End Sub
Or, alternatively
Sub CommandButton1_Click()
Parent.Item("XControl11").Property1 = True
End Sub
In case of an XObject, insert it into a Data Server.
Or, alternatively:
Sub CommandButton1_Click()
Application.GetObject("Data").Item("XObject11").Value=123
End Sub
You can also have an XControl accessing an XObject through an XProperty. For
example, the picture below shows an XControl called “XControl1” with an XValue
property. This property’s type is XObject1, which is also the name of the XObject
created.
For example, you can link the value of the object “Text1” with Value property of
“XObject1”. This is done via XValue property, created at “XControl1”. Thus, the
value of Value property of “XObject1” will be shown in the object “Text1” of
“XControl1”.
Programming with E3 51
E3 - Scripts - Reference Manual
52 Programming in E3
E3 - Scripts - Reference Manual
Notice that:
• The links within the library are internal, and its format is
Control_Name.Property_Name.
• The object, after being inserted into Screen, must have these properties
liked to real tags, for each engine.
• Each EngineA will have a tag linked to State property.
Another broader possibility is to use an XObject for the engine. Thus, all
information regarding engines remains in objects in the server. Hence, it is possible
to create several types of interface for the engine (XControls), which bring only
relevant information from the server, via XObject.
Then, the object EngineA would have to be modified to “point” to an XObject,
instead of declaring all properties on itself.
Programming with E3 53
E3 - Scripts - Reference Manual
" !
Following the object oriented programming encapsulation concept, the methods and
properties become associated to their original objects. This means that we always
have to indicate the object, method or property we are accessing.
54 Programming in E3
E3 - Scripts - Reference Manual
Properties
In order to refer the object properties, we should use the GetObject() method of E3.
The syntax is the following:
Application.GetObject("<object>").<property>
where <object> is the name of the object, and <property> is the property desired.
Example:
Application.GetObject("Dados.TempTanque2").Type
In order to ease typing, it is always advisable to use AppBrowser, which already
brings the correct syntax, avoiding mistakes.
Value Property
In E3, many objects have a standard property called Value. In this specific case, you
can access this property by using the very name of the object:
Button1 = False
That is equivalent to:
Button1.Value = False
Some objects are formed by other objects, and one can access the other through a
property, as follows:
Application.GetObject("Dados.Temeperatures.Tanque2").Type
In this example, Tanque2 is part of another object called Temperatures.
Methods
The syntax below exemplifies the call of a method that doesn'
t need parameters:
Application.GetObject("<object>").<method>
where <object> is the specific object, and <method> is the method desired.
If the method accepts parameters, use the syntax below:
Application.GetObject("<object>").<method>(<parameter>)
where <parameter> is the parameter needed to be passed to the method. When there
is more than a parameter, use commas to separate them.
If the method returns to a result that you want to keep, then the parameters should be
placed between parentheses:
<V> =Application.GetObject("<object>").<method>(<parameter>)
where <V> is the variable that will receive the method'
s result.
"" 3 # !2
As previously seen, a collection is an object that manages a set of similar objects.
The objects contained in a collection are referred to by indexes, similarly to arrays
reference.
Programming with E3 55
E3 - Scripts - Reference Manual
You can add or remove individual objects from a collection, as we see in the
example below:
'Add a pen to an E3Chart object
E3Chart.Pens.Add "Pen"
'Removes the second pen
E3Chart.Pens.Remove 2
Note: the first object in a collection has index 1.
All collections have a standard property called Count, which is the number of
existing objects (or children). Example:
'Shows a dialog box with the number of pens
MsgBox E3Chart.Pens.Count
"$ ''
VBScript implements the concept of object oriented language polymorphism,
allowing a Variant type variable to assume the form of any object through the Set
command. In this way, the variable will work as a “pointer” of the object wanted,
allowing the access to its methods and properties.
Example:
Set E3Chart = Screen.Item("E3Chart1")
E3Chart.Pens.Item(2).Color = RGB (212,208,20)
In the above example, the same task of the previous example has been
accomplished, but the part related to getting the specific object has been forgotten.
Without the Set command, the same call should be:
Screen.Item("E3Chart1").Pens.Item(2).Color = RGB(212,208,20)
Apparently, there is no advantage in this case, for we are able to do everything with
a single code line. But, if we want to do other operations in the same script right
below, it would be simpler and faster if we avoided placing the call for the Item
method in all lines.
56 Programming in E3
E3 - Scripts - Reference Manual
'
Bad example:
Screen.Item("E3Chart1").Pens.Item(1).Color = RGB(212,208,20)
Screen.Item("E3Chart1").Pens.Item(2).Color = RGB(200,208,20)
Screen.Item("E3Chart1").Pens.Item(3).Color = RGB(100,208,20)
Better example:
Set Pens = Screen.Item("E3Chart1").Pens
Pens.Item(1).Color = RGB (212,208,20)
Pens.Item(2).Color = RGB (200,208,20)
Pens.Item(3).Color = RGB (100,208,20)
Programming with E3 57
$ $ )
The Events are occurrences related to an object, which allow triggering scheduled
actions. Basically, there are two types of events: physical (or external) and internal.
Physical events are, e.g., user actions. In case the user types something on the
keyboard, the relevant information can be the pressed key or, if the user points and
clicks the mouse, the relevant information can be the arrow position and buttons
status. Internal events are, e.g., changes of value on a variable (tag) in the system.
Since the tag can be associated to an external device, it is possible to say that
internal events can have physical associations, such as temperature changes in a
chamber, for example.
In this chapter we have a list of E3’s available events classified by object, beginning
with the standard events, present in all objects. Each entry describes the name of the
event and its occurrence, and exemplifies its use through scripts, including the event
variables.
$ ) *
Event Variables are created when the event is started. To be used, they should be
associated to parameters in the script call of the event.
The following example is the call from a procedure associated to the event Key
Down from "#$.
Sub SomeObject_KeyDown(KeyCode, Shift)
Notice that in the call we have two variables: < 4 + and 2 . E3 will
automatically assign values to these variables at the moment of the occurrence of the
event. In this case, < 4 + will receive the code of the pressed key and [Shift] will
be true or false, according to the key [ 2 ] being pressed or not.
Eventos 59
E3 - Scripts - Reference Manual
$ '' )
OnStartRunning( )
Occurs as soon as an object is started.
Example:
Sub Months_OnStartRunning()
' Months is a tag of InternalTag type
' Here it uses the event OnStartRunning in order to
' start the vector up
Value = Array ("January", "February", "March", "April",_
"May", "June", "July", "August", "September", "October",_
"November", "December")
End Sub
NOTE: To access this array, it is necessary to copy the property Value to a local
variable.
OnStopRunning( )
Occurs when the execution of an instance of this object finishes. Use the event
OnStopRunning to make termination operations for the object.
Example:
Sub Tag_OnStopRunning()
' When the tag object finishes
' it assigns False to tag2
set tag2 = Application.GetObject("DataServer1.tag2")
tag2.Value = False
End Sub
60 Events
E3 - Scripts - Reference Manual
$" 9 , )
AfterStart( )
Occurs after the communication driver has started the communication. It is common
to make a script for this event using Write() method to perform equipment set up.
Example:
Sub Driver1_AfterStart()
' After started, communication sends/write values
' to the equipment/device
Write 0, 2, 55, 2, 33.4
Write 0, 3, 55, 20, "Metal"
End Sub
AfterStop( )
Occurs after the driver has finished communication. Use the event AfterStop to
perform any necessary actions after driver communication has finished.
BeforeStart( )
Occurs when the driver is about to start communication. Use the event BeforeStart
to perform any necessary actions before starting communication, such as the setup of
driver parameters.
Example:
Sub Driver1_BeforeStart()
' It performs the startup of driver parameters before
' starting the communication
P1 = 0
P2 = 20
P3 = 80
P4 = 0
End Sub
BeforeStop( )
Occurs when the driver is about to finish communication. Use the event BeforeStop
to perform any necessary actions before finishing communication, such as writing or
reading values of the equipment/device, before communication is no longer
available.
the driver. Event variables receive information about this error. With these values, it
is possible to track back which tags have communication problems.
62 Events
E3 - Scripts - Reference Manual
Example:
Sub Driver1_OnCommError(Type,Size,Element,N1,N2,N3,N4)
Application.GetObject("Dados.TagInterno1").Value=_
Application.GetObject("Dados.TagInterno1").Value+1
Application.GetObject("Data.EvtType").Value=EvtType
Application.GetObject("Data.Size").Value=Size
Application.GetObject("Data.Element").Value=Element
Application.GetObject("Data.N1").Value=N1
Application.GetObject("Data.N2").Value=N2
Application.GetObject("Data.N3").Value=N3
Application.GetObject("Data.N4").Value=N4
End Sub
OnCommErrorEx(ErrorInfo)
Occurs soon after the execution of OnCommError() method.
OnTagRead(Tag)
This event only occurs when a tag is read and at least, one of these conditions is
True: the tag value or the tag quantity change, or the property EnableDeadBand of
the tag is True. The parameter - .contains the event generator tag. This event can
be generated by the I/O tag, the Block tag or the I/O Block Element. It will be
generated every time a new value or a reading error comes from I/O Driver (on the
I/O Server).
Example:
Sub Tags_OnTagRead(Tag)
Set Obj = Application.GetObject("Data1.TagName")
Obj.Value = Tag.Name
Events 63
E3 - Scripts - Reference Manual
$" 9 !)
OnRead( )
Occurs when a tag reading is performed by the driver. Use the event OnRead when
it is necessary to perform some operation soon after some data has been modified in
the tag, such as the properties Value, Quality or TimeStamp. This event is generated
by a background reading.
Example:
Sub CommTag1_OnRead()
' When reading the tag, assign its value
' to the InternalTag1 tag.
Set obj=Application.GetObject("DataServer1.InternalTag1")
obj = Value 'CommTag1 Value
End Sub
$" 9 + #)
OnRead( )
Occurs when the driver performs a communication block reading. Use the event
OnRead when it is necessary to perform some operation soon after some data has
been modified in the communication block object, such as the properties Quality,
TimeStamp or even Value of some of the block’s element.
Example:
64 Events
E3 - Scripts - Reference Manual
Sub IOBlock1_OnRead()
' When reading a block, assign to the InternalTag1 tag
' the value of the block element elm1.
Set obj=Application.GetObject("DataServer1.InternalTag1")
Set elm = Application.GetObject("Driver1.IOBlock1.elm1")
obj.Value = elm.Value
End Sub
$$ )
KeyDown(KeyCode, Shift)
Occurs whenever a key is pressed, regardless of Screen focus.
Example:
Sub Screen1_KeyDown(KeyCode, Shift)
' It shows a message box whenever
' the user presses a key
MsgBox "Key code: " & KeyCode
End Sub
KeyUp(KeyCode, Shift)
Occurs whenever a key is released, regardless of Screen focus.
Example:
Sub Screen1_KeyUp(KeyCode, Shift)
Events 65
E3 - Scripts - Reference Manual
Example:
Sub InitialScreen_MouseDown(Button, ShiftState, MouseX,
MouseY)
' Closes the application when the mouse is clicked
' on the object InitialScreen.
Application.Exit()
End Sub
66 Events
E3 - Scripts - Reference Manual
clicked.
, G Shows the position Y on the Screen where the mouse was
clicked.
Example:
Sub InitialScreen_MouseUp(Button, ShiftState, MouseX, MouseY)
' Closes the application only when the user
' releases the button.
Application.Exit()
End Sub
OnHide( )
Occurs when a Screen is about to be closed. Use the event OnHide when it is
necessary to carry out some operation before the object Screen is closed. This event
can happen in different ways:
• When the Screen can be replaced by another through the method
OpenScreen();
• When the user clicked on the closing window icon where the Screen is;
• When the method Close() was called from Screen;
• When the viewer was closed/finished.
Example:
Sub InitialScreen_OnHide()
Application.exit
End Sub
OnPreShow(Arg)
Occurs before the Screen is shown. The variable from the event 0.receives the
content of the parameter 0.of the method OpenScreen(), which generates this
event. Soon after, the event OnShow is generated. Example:
Sub Screen1_OnPreShow(Arg)
' Screen1 window title to be shown
' was passed as a parameter at the OpenScreen method call
' that generated the event.
Caption = vArg
End Sub
OnShow( )
Occurs at the exact moment a Screen is shown. Use the event OnPreShow to carry
out any operation before it is displayed. Example:
Sub MainScreen_OnShow()
MsgBox "Welcome to the system!"
Events 67
E3 - Scripts - Reference Manual
End Sub
$. )
Click( )
Occurs when the left button clicks the object. This event will not occur if the object
is not visible or the property Enabled is set to False. The object’s visibility depends
on three factors: property Visible set to True; parent object visible; and object’s
Layer property on the Screen layer.
Example:
Sub Button_Click()
' It shows a message box when
' the user clicks the object
MsgBox "You have clicked the object."
End Sub
DbClick( )
Occurs when the left button double-clicks the object. This event will not occur if the
object is not visible or the property Enabled is set to False. The object’s visibility
depends on three factors: property Visible set to True; parent object visible; and
object’s Layer property on the Screen layer.
Example:
Sub Button_DbClick()
' It shows a message box when
'the user double click the object
MsgBox "You have double clicked the object."
End Sub
KeyDown(KeyCode, Shift)
Occurs when a key is pressed and the object has the keyboard focus. Notice that this
event will not be generated if the object is not enabled (Enabled = False) or if this
object does not have the keyboard focus.
68 Events
E3 - Scripts - Reference Manual
Example:
Sub Button_KeyDown(KeyCode, Shift)
' It shows a message box when
' the user press a key
MsgBox "Screen code: " & KeyCode
End Sub
KeyUp(KeyCode, Shift)
Occurs when a key is released and the object has the keyboard focus. Notice that this
event will not be generated if the object is not enabled (Enabled = False) or if this
object does not have the keyboard focus.
Example:
Sub Button_KeyUp(KeyCode, Shift)
' It shows message box when the user
' releases a key
MsgBox "Screen code: " & KeyCode
End Sub
Events 69
E3 - Scripts - Reference Manual
Example:
Sub InitialScreen_MouseDown(Button, ShiftState, MouseX,
MouseY)
' Closes the application when the mouse is clicked
' in the object InitialScreen.
Application.Exit
End Sub
Example:
Sub Rectangle1_MouseUp(Button, ShiftState, MouseX, MouseY)
' Closes the application only when the user releases the
' button after clicking the Rectangle1 object.
Application.Exit
End Sub
$. :, - )
Example:
Sub Text1_Validate(Cancel, NewValue)
' Ask user if the new value is acceptable
message = "Current value: " & value & vbnewline & _
"New value: " & NewValue & vbnewline & vbnewline &_
"Accept the new value?"
If MsgBox (message , vbQuestion + vbYesNo,_
"Validate event") = vbNo Then
Cancel = True
End If
End Sub
$/ 8
Events 71
E3 - Scripts - Reference Manual
72 Events
E3 - Scripts - Reference Manual
Change( )
It occurs when the value of the property Value of the object is modified. Here are
some examples of actions, which trigger Change event:
• Clicking a check box, an option button or an increase-decrease button.
• Clicking or selecting words in a selection list or text editor.
• Selecting different tabs in a dialog.
• Moving the scrolling bar in a scrolling bar object.
• Clicking the arrows of an increase-decrease button.
• Selecting different pages in a multi-pages object.
Events 73
E3 - Scripts - Reference Manual
KeyPress(KeyAscii)
This event occurs when the object has the keyboard focus and user presses a key
corresponding to a character that can be showed on Screen (an ANSI key, of a code
indicated in the < 4 0 $ variable). That is, the event occurs when some of the
following keys are pressed:
• any keyboard character that can be printed;
• [ ] key combined with any standard alphabet character;
• [ ] key combined with any special character;
• [ $ ('$];
• [!$ ].
This event does not occur in the following conditions:
• by pressing [- "];
• by pressing [! ];
• by pressing [= ] (this is not an ANSI key);
• by pressing keyboard arrow keys
• when a key change the focus from an object to another.
While a user presses a key that produces an ANSI code, the object repeatedly
receives the KeyDown and the KeyPress events. When the user releases the key, the
KeyUp event occurs.
In order to monitor keyboard physical status or handle keys which are not recognizes
by the KeyPress event (such as function keys, browsing keys, etc.), use the
KeyDown and KeyUp events.
74 Events
E3 - Scripts - Reference Manual
$/ ' + + )
DropButtonClick()
Occurs whenever the drop-down list appears or disappears.
$/ '' + !! + )
MouseMove()
Occurs when the mouse pointer is moved over the control.
$/" + )
Scroll( )
Scroll event is generated when scrolling bar pointer is moved to any direction.
$/$ + )
SpinUp( )
It occurs whenever the user presses up arrow key. This event increases the object
Value property.
SpinDown( )
It occurs whenever the user presses down arrow key. This event decreases the object
Value property .
Events 75
E3 - Scripts - Reference Manual
$0 * 2 )
OnInactive( )
This event occurs when the Viewer is inactive, and the property EnableInactivity is
True. It starts when it is verified the user has not been using Viewer for a period of
time equal or superior to the InactivityTime property value.
In a script for this event, the user can schedule what he wants to do when the Viewer
is inactive for a specific period. For example, it is possible to specify that after 20
minutes without using the Viewer, the logout will be performed.
Example:
Sub Viewer_OnInactive()
Application.GetObject("Data.TagDemo1").Enabled = FALSE
MsgBox "Testing the OnInactive script call"
Application.GetObject("Data.TagInterno1").Value = 334
End Sub
$0 % )
IMPORTANT: The following events are accessed through the object Viewer.
OnLogin( )
Occurs when the user successfully performs a system login (user authentication).
The system login can be performed through the execution of the method Login(), or
when an object that can only be accessed by users with a specific authorization level
requires authentication.
Example:
Sub Viewer_OnLogin()
MsgBox "Authorized user. Welcome to the system!"
End Sub
OnLogout( )
It occurs when a “logout” is performed, that is, the user exits from the system.
Logout is performed by calling the Logout() method.
Example:
Sub Viewer_OnLogout()
MsgBox "User came out the system."
End Sub
76 Events
E3 - Scripts - Reference Manual
$ 6 )"; -)
OnAsyncQueryFinish(Recordset, Error)
Occurs when GetAsyncADORecordset() method return. $ + parameter is the
ADO recordset generated by the query, and ! parameter is a Boolean that, when
True, says the object could not be generated.
Example:
Sub query1_OnAsyncQueryFinish(Recordset, Error)
MsgBox "Returned " + CStr(Recordset.RecordCount) +
"registry"
End Sub
$ 7 )"+ 2 )
OnDrawRow (bSelected, nLine, cTextColor, cBackColor)
This method passes four parameters. " $ + indicates whether the row is
selected; indicates the number of the row being drawn; $ -% indicates
the row’s text color; and $ $ ( indicates the text’s background color. If the
color is modified within this event, this change will be used by E3Browser when
drawing the row. Another important new feature is that if GetColumnValue()
method is called within the event, returned values are the drawn row’s ones, and not
the selected row’s.
Events 77
E3 - Scripts - Reference Manual
$ < )" )
OnChangeCursor( )
This event occurs whenever E3Chart cursor changes position. For example, you can
create a script for this event when you need to show cursor position values on
Screen:
Sub E3Chart1_OnCursorChange()
Set Chart = _
Application.GetFrame("").Screen.Item("E3Chart1")
Set Pen = Chart.Pens.Item(0)
' Text1 object shall show current cursor position
Set Text = Application.GetFrame("").Screen.Item("Text1")
If Pen.GetCursorPos(aa,bb) Then
Text.Value= "Position X=" & aa & "; position Y=" & bb
End If
End Sub
$ 8 8 )
Constructor( )
This event is triggered when an ElipseX object is initialized. It is possible to use this
event in order to run a script that set up the internal values of an ElipseX, for
example.
OnPropertyChanged( )
It occurs when a property of an ElipseX is modified. Use this event in order to
trigger scripts that perform actions according to an ElipseX specific status.
78 Events
E3 - Scripts - Reference Manual
$ )
OnAfterPrint( )
It starts after a section is set in the report. You can use this event to update any
counter that needs to be used after report is completed..
OnBeforePrint( )
It starts before a section is set in the report. You can use this event to change the
value of an object in the report before it is printed. It is recommended that report
query fields are not accessed when this event is being used.
OnDataInitialize( )
It occurs before the OnReportStart event. This event allows adding and setting up
fields to the Fields collection of a report before its generation.
Example:
Sub OnDataInitialize()
Fields.Add "Name"
Fields.Add "Sector"
Fields.Add "Code"
End Sub
OnFetchData(eof)
OnFetchData event is triggered every time a new register is processed. Use this
event to run a script in order to change the value of the fields added in the
Events 79
E3 - Scripts - Reference Manual
OnDataInitialize event. variable has the standard value True and indicates that
after the script, the current register processing of the report.
OnFormat( )
It starts after the data are read and loaded in the report, but before section is set for
printing. This event can be used to change report’s (or any other object’s) section
layout.
OnHyperlink(Button, Link)
Hyperlink event occurs when a link in the report is clicked. You can use this event
either to run a script that redirect a hyperlink or to configure a hyperlink in the
report. Button variable indicates which button was clicked (usually 1) and the Link
variable specifies to which address it will be directed.
OnNoData( )
This event occurs when there are no data to be printed in the report. You can use this
event in order to run a script that shows an error message on Screen informing lack
of data to print and cancel the report.
OnPageEnd( )
It occurs at the end of printing of each report page.
OnPageStart( )
It occurs at the beginning of printing of each report page.
OnPrintProgress(PageNumber)
It occurs while a report page is being printed. . ;, " variable indicates the
current page number.
OnReportEnd( )
This event is triggered at the end of the report generation, after finishing its printing.
OnReportStart( )
This event is triggered at the beginning of the report generation, before printing.
80 Events
. .
Methods are procedures that can be executed by objects. For example, the object
Screen opens via a method, and closes via another one.
Because they are encapsulated (i.e., “stored” inside the objects), you must always
state the object to which you are referring in a method call. Many E3’s methods are
encapsulated in the object Application, which represents the application itself.
.
Many predefined methods have parameters, which can (or should) be passed at
method call. For this, VBScript has a rule that must be followed: If the method is
used in an assignment, their parameters should be put in brackets. For example, look
at this GetObject() method's call:
obj = Application.GetObject("data.tag001")
If the method is called the brackets should be taken out. For example, look at this
SetVariableValue() method call:
Screen.Item("Query").SetVariableValue Value,12
Brackets used in the methods'citations in this manual work only as an indicator to
differentiate them from the properties. In the scripts, the rule should be followed.
. ,
In this chapter we listed many methods predefined in the E3, grouping them by
object types, and beginning with the default methods of all application objects.
Each entry presents the method name, with its respective parameters and correct
syntax, and an example of method use.
Methods 81
E3 - Scripts - Reference Manual
Activate()
Activates a currently inactive object.
Example:
Dim obj, new
Set obj = Application.GetObject("Data")
' Create a new object and let it disabled (False).
Set new = obj.AddObject("DemoTag", False)
' Setup the new object parameters.
new.Name = "tag001"
new.Type = 3
' Enable the object (startup).
new.Enable()
AddObject(strClassName, bActivate)
AddObject() method add a new object in the application via script. This method has
the ; parameter, which is mandatory, and indicates the type of object
that will be created.
For example, in order to create a rectangle on the Screen the ;
parameter should be the “DrawRect”. Created object is located in the object that
called the AddObject() method and can be accessed by the Item() method.
The "0$& parameter is optional and indicates whether the object will be enabled
after its creation or not. When the object is enabled the links and scripts remain
enabled. If the object is created with "0$& in False condition, it can be lately
enabled by the enable method.
The object will be created only if it is of a type compatible to the object that contains
it. In order to be sure that the object was created, IsObject() method can be used.
In order to use this method along with other objects on Screen, just type
“addObject("ObjectName", True)”. In order to use it with an XControl, just type on
the script “addObject("Libname.XControlName",True)”.
Example:
...
Set rc = Screen.AddObject("DrawRect", True)
rc.X = 1000
rc.Y = 1000
rc.width = 10000
rc.height= 10000
rc.Visible = True
...
82 Methods
E3 - Scripts - Reference Manual
NOTE: Only objects having the option “Insert” in the menu, can access this method.
Such objects are the following: Viewer, Screen, Data Server, Folders,
Communication Driver and Blocks, Alarms Area, OPC Communication Driver and
Blocks, Alarms Settings, Reports, E3Chart and E3Browser.
Deactivate()
Deactivates a created object, or an object previously activated by Activate() method.
You can deactivate an object when it is necessary to perform a previous
configuration (property initialization, for example), or when you want to perform
tests in which it is necessary that the object is neither present nor activated.
Example:
Dim obj, new
Set obj = Application.GetObject("Data")
obj.AddObject("DemoTag", True)
' Disable the object.
new.Disable()
DeleteObject(strChildName)
Erases from the project the specified object. 2+; parameter is a string
(ignores capital and lower cases) and indicates the child-object one desire to delete.
Method returns True in the event it has accomplished deleting the object, or False, if
child-object does not exist.
In order to delete an object from a reference to an element, parent-object' s
DeleteObject() method is used.
Example:
Dim obj
obj = Application.GetObject("data.tag001")
If obj.Parent.DeleteObject(obj.Name) Then
MsgBox("Tag successfully deleted!")
Else
MsgBox("Deleting failed: tag does not exist.")
Endif
NOTE: Only objects having the option “Insert” in the menu, can access this method.
Such objects are the following: Viewer, Screen, Data Server, Folders,
Communication Driver and Blocks, Alarms Area, OPC Communication Driver and
Blocks, Alarms Settings, Reports, E3Chart and E3Browser.
Methods 83
E3 - Scripts - Reference Manual
GetObject(Link)
GetObject() method searches for an object from the specified project path in (,
and recovers its reference. This allows accessing all object properties and/or
methods.
This is a common practice in scripts programming in E3. It facilitates handling
objects and makes the code more intelligible.
Example:
Sub Button1_Click()
' Assign the value 20 to the object Value property
' InternalTag1 that is in DataServer1.
Set tag = Application.GetObject("DataServer1.InternalTag1")
tag.Value = 20
End Sub
Item(itemid)
Returns the reference to the + child-object of the method calling the object.
Item() method can search for an object either by its name or index (integer, from 1
up to that specified in the Count property). If specified index or name is valid, Item()
method returns the object reference, otherwise it will return an invalid parameter
error.
Example:
Sub Screen1_Click()
' Assign to obj the reference to the Screen1 Button1
' child-object.
Set obj = Item("Button1")
' Set the obj BackgroundColor property, that is,
' of Button1.
obj.BackgroundColor = RGB(255,0,0)
End Sub
Save()
This method saves the specified object that was modified in runtime. Children-
objects will also be saved, as parent-object specifications. This method is not valid
for Screen and viewer objects.
Example:
Sub CommandButton1_Click()
Set area = Application.GetObject("ConfigAlarms")._
AddObject("Area", true)
Application.GetObject("ConfigAlarms").Save()
End Sub
84 Methods
E3 - Scripts - Reference Manual
." 9 ,
Write(N1, N2, N3, N4, Value)
Writes data in the equipment synchronously. This method returns a Boolean
indicating whether the operation has been successful or not.
;9 to ;I parameters correspond to driver’s [;] parameters. 8 , parameter defines
the value to be written in the driver. For further information on these parameters, see
driver’s documentation.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, write into the driver
Set driver = Application.GetObject("Driver1")
'Takes the driver
driver.Write 4, 5, 1, 0, 55.5
'Write value 55.5
End Sub
Methods 85
E3 - Scripts - Reference Manual
." 9 !: 9 + # + #) '
Write()
Writes I/O Tag’s, I/O Block’s or Block Element’s current value in the equipment.
Usually, this script command is used only when the object’s AllowWrite property is
False. For further information, see driver’s documentation. This method returns a
Boolean indicating whether the operation has been successful or not.
86 Methods
E3 - Scripts - Reference Manual
.$
Refresh(Source)
Forces the server to re-send values from all tags in the group whose write is enabled,
whether they have changed their values or not.
,$ parameter determines driver’s data source argument. If the input value is 1
( 21 $2 ), sent values are server’s cache value; otherwise, if the input
value is 2 ( 21 = &$), values are updated in server’s cache before they
are sent.
To make sure this method works, group’s Enabled property must be True, as well as
at least one tag read. For further information on Advise mechanism, see AllowRead
and AdviseType properties.
Example:
Sub CommandButton1_Click()
Application.GetObject("DriverOPC1.Group1").Refresh(2)
End Sub
Write()
Writes OPC Tag’s, OPC Block’s or OPC Block Element’s current value in the
equipment. For further information, see driver’s documentation. This method returns
a Boolean indicating whether the operation has been successful or not.
WriteEx([vValue], [vSyncWrite])
Writes values in the equipment. All its parameters are optional; if omitted, method’s
behavior is the same as Write()’s. This method returns a Boolean indicating whether
the operation has been successful or not.
&8 , parameter defines the value to be written in the driver. Datatype depends on
the driver; if omitted, tag’s current value is assumed. & 4 $ 5 parameter is a
Boolean that specifies whether the operation is synchronous (True) or asynchronous
(False). If omitted, the value specified in SyncWrite property is used.
NOTE: just as for Write() method, the write is performed whether the value is
different or not from tag’s current value, as well as whether tag’s AllowWrite
property is True or False. Also, if the write works but the tag is not in scan (either
because AllowRead property is False, or because it uses the option
0+& 52 (+ when not linked), the written value is immediately assumed as
having good quality, and with the timestamp of the write moment.
Methods 87
E3 - Scripts - Reference Manual
..
ClearFailure(strName)
Called to indicate that a failure reported by ReportFailure() becomes inactive. The
parameter ; specifies the failure name (defined by user) and must be passed
to ReportFailure() when the method is called.
Example:
Sub TagSerialStatus_OnValueChanged()
If Value then
'The tag value is True, application is on error
Application.ReportFailure "FAULT_COM1",_
"Communication fault at COM1", 100
Else
'The tag value is False, clear the failure
Application.ClearFailure "FAULT_COM1"
End If
End Sub
88 Methods
E3 - Scripts - Reference Manual
./ , ' !
Reset()
Resets the phase (movement in time) of the tag’s wave format. This phase must not
be reset unless the tag is enabled. This method, when the tag is enabled, has no
effect on CurrentTime and Random tags, which are not periodic. When the tag is
disabled, its value is simply reset, regardless of tag type.
Example:
Sub CommandButton1_Click()
Application.GetObject("Data.Sine").Reset()
End Sub
.0 !
WriteEx(NewValue, NewTimestamp, NewQuality)
Allows you to modify an Internal Tag’s value, timestamp, and quality in just one
operation. This method returns a Boolean indicating whether the operation has been
successful or not.
; 8 , parameter specifies tag’s new value; if omitted, tag value does not
change. ; - 'parameter specifies tag’s new timestamp; if omitted, the
timestamp from the moment of method call is used. ; H, 4parameter specifies
Methods 89
E3 - Scripts - Reference Manual
tag’s new quality; if omitted, Good quality (192) is assumed. All these parameters
can be omitted.
Example:
Sub CommandButton12_Click()
dim Ret
Ret = Application.GetObject("Dados.TagInterno1")._
WriteEx(123.456,"1/1/2001", 193)
if Ret Then
MsgBox "It works!"
Else
MsgBox "It failed!"
End if
End Sub
.6
Close(Code)
Use Close() method to close the Screen. This method generates the OnHide event
before being effectively performed. The parameter + indicates the returned value
for DoModal() method, if the Screen was called by this method.
Example:
Sub CloseButton_Click()
' When click CloseButton, closes the window
Screen.Close(0)
End Sub
SetFocus()
Use SetFocus() method to move the mouse or keyboard focus to a specific object.
Example:
Sub Screen1_OnShow()
'When opening the window, move focus to Button1
Item("Button1").SetFocus()
End Sub
90 Methods
E3 - Scripts - Reference Manual
.7 1 '
BringToFront()
Bring to front a frame object that is hidden or under another one.
Example:
Sub Button1_Click()
Application.GetFrame("Test").BringToFront()
End Sub
CaptureScreen(Filename)
Capture the content of a chart frame, saving it into a file of a 1 name and
path, in BMP format.
Example:
Sub CommandButton1_Click()
' When clicking the button, save frame
'content to FRAME.BMP file.
Screen.Frame.CaptureScreen ("c:\temp\frame.bmp")
End Sub
Close(Code)
Use Close() method to close the frame’s window. The parameter + indicates the
returned value for DoModal() method, if the window was called by this method.
Example:
Sub CloseButton_Click()
' When click CloseButton, closes the window
Screen.Close(0)
End Sub
FlashWindow(Number, Time)
This method makes viewer icon begins to blink on Windows taskbar. ;, "
parameter determines the number of times the task must blink and - determines
the time (in milliseconds) between the blinks.
Example:
Sub Text1_Click()
set frame = Application.GetFrame("_top")
frame.FlashWindow 50, 500
End Sub
Methods 91
E3 - Scripts - Reference Manual
MaximizeFrame()
Use this method in order to maximize a frame or modal Screen.
Example:
Sub CommandButton4_Click()
Application.GetFrame("Other").MaximizeFrame()
End Sub
MinimizeFrame()
Use MinimizeFrame() method in order to minimize a frame or modal Screen.
Example:
Sub CommandButton4_Click()
Application.GetFrame("Other").MinimizeFrame()
End Sub
OpenScreen(ScreenName, Arg)
OpenScreen() method opens a Screen inside a frame. The parameter $ ;
determines the name of the Screen to be opened. It is also possible to specify
Screen’s zoom percentage and to enable scrollbar through the key “?”, as seen the
model below:
<Screen-name>?<zoom>?<enable-scroll>
where <Screen-name> is the name of the Screen to be opened; <zoom> stands for
Screen’s zoom percentage, and <enable scroll> enables or disables scroll.
Screen’s zoom percentage can assume the following values: 1= the whole page; 2 =
Screen width occupies 100% of frame’s width, with proportional height; 3 = Screen
height occupies 100% of frame’s height, with proportional width; 4 = Screen fills
the frame completely; 5 to 100 = is equivalent to actual Screen’s zoom percentage.
Scroll enabling can assume the following values: 1 = enables scroll; 0 = disables
scroll.
92 Methods
E3 - Scripts - Reference Manual
The parameter 0.enables you to pass the specified value to the Screen through the
event OnPreShow.
Example:
Sub Button1_Click()
'When clicking the button, Screen2 opens in Test Frame
'and passes the value 1 that will be used in the PreShow
event
Application.GetFrame("Test")._
OpenScreen "Screen2?100?0","This is a test."
End Sub
Sub Screen2_OnPreShow(vArg)
'The message will show the
'sentence "This is a Test."
MsgBox vArg
End Sub
Refresh(Force)
Refresh() method allows forcing a frame content redraw within a script. It must be
used in Viewer massive processing scripts (i.e. loops), or in method calls that
demands long time and needs to show the user the task progress.
Due to redrawing to be a heavy operation, the Refresh() default method call (with no
parameters) is optimized, and ignore successive redraw requests that are too close,
including the E3 normal redraw. This default behavior is indicated to show loop
progress. The parameter 1 $ disables this optimization, and forces the redraw on
every Refresh() method’s call. Using this option, Refresh() must not be called
successively (i.e. inside a loop).
Methods 93
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
' Draw a progress bar of an operation
While i < 31
Screen.Item("Rectangle2")
.HorizontalPercentFill = (i/30)*100
Frame.Refresh()
<-- some time-consuming operation -->
i=i+1
Wend
End Sub
RestoreFrame()
RestoreFrame() method allows restoring the chart windows to its original size.
Example:
Sub CommandButton1_Click()
Application.GetFrame("Other").RestoreFrame()
End Sub
SetForegroundWnd()
SetForegroundWnd() method enable and focus the Viewer window. This method is
useful when one desires to call operator'
s attention to some event occurred and
Viewer window is found hidden or minimized. Example:
Sub CommandButton1_Click()
Application.GetFrame("Other").SetForegroundWnd()
End Sub
SetFrameOptions(Title, Flags)
Used to setup frame title on the window and window style. - parameter contains
the window title. This text will be shown in case Screen'
s Caption property is empty.
1 . parameter specifies the window style. A special value (-1) can be used in
order to keep the same settings, while only Caption is changed. If this parameter is
omitted, default will be -1. When the value specified is not -1, it is possible to
obtain modifications in window style with the sum of the following combinations:
94 Methods
E3 - Scripts - Reference Manual
Examples:
Sub Screen_OnPreShow()
Frame.SetFrameOptions("Alarm Screen", 114)
End Sub
In the example, the value 114 (2+16+32+64) indicates that the window will have the
following style: button enabled (2), border on (16), can be resized (32) and
can be moved (64). The window title will be “Alarm Screen”.
In Open Screen and Open modal Screen picks are possible to set up the window
style through the 5 + 4 dialog. For more information, see the topic
“Picks”, in chapter “Introduction”.
. <
BringToFront()
Makes object be positioned in front of all other objects on Screen.
Example:
Sub Button1_Click()
' When clicking Button1, the system
' brings Rectangle1 object to front
Screen.Item("Rectangle1").BringToFront()
End Sub
Methods 95
E3 - Scripts - Reference Manual
SendToBack()
Makes object be positioned behind of all other objects on Screen.
Example:
Sub Button2_Click()
' When clicking Button2, the system
' takes Rectangle1 object to back
Screen.Item("Rectangle1").SendToBack()
End Sub
. 8
. ''
BringToFront()
Brings object to the uppermost layer on Screen, in front of all others.
Example:
Sub Button1_Click()
' When clicking Button1, the system
' brings Rectangle1 object to front
Screen.Item("Rectangle1").BringToFront()
End Sub
SendToBack()
Sends object to the lowermost layer on Screen, at the back of all others.
Example:
Sub Button2_Click()
' When clicking Button2, the system
' takes Rectangle1 object to back
Screen.Item("Rectangle1").SendToBack()
End Sub
SetFocus()
Use SetFocus() method to move mouse or keyboard focus to a specific object.
Example:
Sub Screen1_OnShow()
'When opening the window, move focus to Button1
Item("Button1").SetFocus()
End Sub
96 Methods
E3 - Scripts - Reference Manual
. ' +
AddItem([pvargItem], [pvargIndex])
Adds items to a ComboBox or to a ListBox. '& . is a string containing the text
to be added to the box; if omitted, a blank string will be added. '& . + %is the
combo’s text index; if omitted, '& . is added as the last item on the box.
Example:
Sub CommandButton1_Click()
EntryCount = EntryCount + 1
ComboBox1.AddItem (EntryCount & " - Selection")
End Sub
Clear()
Clears the text from the object.
Example:
Sub ClearTextButton_Click()
ComboBox1.Clear()
End Sub
Copy()
Copies the previously selected content to the clipboard. Use Paste() method to paste
the content into the place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("ComboBox1").Copy()
End Sub
Cut()
Cuts the previously selected content to the clipboard. Use Paste() method to paste
the content into the place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("ComboBox1").Cut()
End Sub
Methods 97
E3 - Scripts - Reference Manual
DropDown()
The method opens the ComboBox object item list. This method does the same as the
button clicking in the button on the right side of the object.
Example:
Sub CommandButton1_Click()
Dim ComboBox1
ComboBox1.AddItem "Pineapple"
ComboBox1.AddItem "Strawberry"
ComboBox1.AddItem "Grape"
ComboBox1.AddItem "Orange"
ComboBox1.DropDown()
End Sub
Paste()
Inserts the content of the clipboard into the object.
Example:
Sub CommandButton1_Click()
Screen.Item("ComboBox1").Paste()
End Sub
RemoveItem(pvargIndex)
Removes a line from a List Box or a Combo Box. This method has the '& . + %
parameter specifying the line to be excluded. The first line number is 0, the second
line number is 1, and so on. Example:
Example:
Sub CommandButton2_Click()
ComboBox1.SetFocus
'Check if the list contains the selected data
If ComboBox1.ListCount >= 1 Then
'If there is no selection, choose the last item.
If ComboBox1.ListIndex = -1 Then
ComboBox1.ListIndex = ComboBox1.ListCount – 1
End If
ComboBox1.RemoveItem (ComboBox1.ListIndex)
End If
End Sub
98 Methods
E3 - Scripts - Reference Manual
. " 4 +
AddItem([pvargItem], [pvargIndex])
Adds items to a ComboBox or to a ListBox. '& . is a string containing the text
to be added to the box; if omitted, a blank string will be added. '& . + %is the
combo’s text index; if omitted, '& . is added as the last item on the box.
Example:
Sub CommandButton1_Click()
EntryCount = EntryCount + 1
ListBox1.AddItem (EntryCount & " - Selection")
End Sub
Clear()
Removes the text from the list box. Example:
Sub ClearTextButton_Click()
ListBox1.Clear()
End Sub
RemoveItem(pvargIndex)
Removes a line from the List Box. This method has the parameter '& . + %that
specifies the line to be excluded. The first line number is 0, the second line number
is 1, and so on. Example:
Sub CommandButton2_Click()
ListBox1.SetFocus
'Check if the list contains the selected data
If ListBox1.ListCount >= 1 Then
'If there is no selection, choose the last item.
If ListBox1.ListIndex = -1 Then
ListBox1.ListIndex = ListBox1.ListCount – 1
End If
ListBox1.RemoveItem (ListBox1.ListIndex)
End If
End Sub
Methods 99
E3 - Scripts - Reference Manual
. $ +
Copy()
Copies to clipboard the content selected. Use Paste() method to paste the content
into another place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("TextBox1").Copy()
End Sub
Cut()
Cuts to clipboard the content selected. Use Paste() method to paste the content into
another place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("TextBox1").Cut()
End Sub
Paste()
Inserts the object content from the clipboard into the designated place.
Example:
Sub CommandButton1_Click()
Screen.Item("TextBox1").Paste()
End Sub
. 4 #
Links, Connections or Associations are links among objects applications and their
modules. Links property is a collection of object links. For further information, see
User Manual, chapter “Links”.
CreateLink(Property,Source[,Type])
This method allows creating a connection of a type specified with an object
property. In case of success, the method returns the created object. Otherwise, a
script error shall occur and the method will return “nothing”.
100 Methods
E3 - Scripts - Reference Manual
Methods 101
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Text1").Links.Item("Value")
If Bind Is Nothing Then
MsgBox "Text1 is not associated to any object."
Dim Source
Source = "Data.InternalTag1.Value"
MsgBox "Creating a connection in '" & Source & "'..."
Set Bind = Screen.Item("Text1").Links._
CreateLink("Value", Source, 0)
Bind.BiDirectional = Screen.Item("BiDirectional").Value
Bind.Reverse = Screen.Item("Reverse").Value
MsgBox "Type: " & TypeName(Bind)
Else
MsgBox "Text1 is already linked to '" &Bind.Source& "'."
End if
End Sub
Item(Property, Index)
This method returns a connection-object from a specific property of an object. If it is
a text, ' 4specifies the property name whose connection one desires to access.
The connection can also be numerically accessed by + %index. This index should
be from 1 up to Count(). In the case the connection to the property or the index is
invalid, a script error shall occur. Like other collections, Links allow using
VBScript' s “For Each” command.
Example:
Sub Text1_Click()
For Each Link In Links
MsgBox "Link origin:” “ & Link.Source
Next
End Sub
102 Methods
E3 - Scripts - Reference Manual
RemoveLink(Property)
This method removes a connection to the property specified by ' 4 , in the case
it exists. In the case a connection to the specified property does not exist, the
function does nothing.
Example:
Sub CommandButton2_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
If Bind Is Nothing Then
'If the connection does not exist
MsgBox "ScrollBar1 is not connected."
Else
MsgBox "ScrollBar1 is linked to '" & Bind.Source & "'"
MsgBox "Removing link..."
Screen.Item("ScrollBar1").Links.RemoveLink("Value")
End if
End Sub
Methods 103
E3 - Scripts - Reference Manual
. 4 #
InsertRow([Row])
Inserts a new line on the table. parameter is optional and specifies in which
table position the line should be inserted. When omitted, it assumes the standard
behavior of inserting a line at the end of the table, which is the same as using
equal to -1. When it is informed and is not equal to -1, it must be a value between 1
and RowCount, and the new line created displace lines of greater or equal index
towards index ascendant direction. A new line always assumes the following
standard values to the properties:
Min:0.0 Max:1.0 Blink:False BlinkValue:0.0 Value:0.0
Example:
Sub InsertRow_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Rectangle1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
MsgBox "Rectangle1 have no association."
Else
Dim row
row = Screen.Item("Row").Value
If (row < 1 Or row > Bind.RowCount) And row <> - 1 Then
MsgBox "Invalid line number " & row
Else
MsgBox "Adding a line in " & row
Bind.InsertRow(row)
If -1 = row Then
row = Bind.RowCount
Bind.Value(row) = _
Screen.Item("Value2").ForegroundColor
Bind.BlinkValue(row) =_
Screen.Item("BlinkValue").ForegroundColor
Bind.Max(row) = Screen.Item("Max").Value
Bind.Min(row) = Screen.Item("Min").Value
Bind.Blink(row) = Screen.Item("Blink").Value
End If
End If
End Sub
104 Methods
E3 - Scripts - Reference Manual
RemoveRow(Row)
Removes the line in a specified index. parameter determines table line to be
removed (it must be from 1 to RowCount).
Example:
Sub RemoveRow_Click()
On Error Resume Next
Dim Bind
Set Bind =_
Screen.Item("Rectangle1").Links.Item("ForegroundColor")
If Bind Is Nothing Then
MsgBox "Rectangle1 have no association!"
Else
MsgBox "Rectangle1 is linked to '" & Bind.Source & "'"
Dim row
row = Screen.Item("Row").Value
MsgBox "Removing line " & row
Bind.RemoveRow row
End if
End Sub
. " * 2
CaptureScreen(Filename)
This method captures the current Screen and saves to a file. The effect is similar to
Windows $ key. The parameter 1 specifies the name of the file
that will receive the captured Screen.
NOTE: The final file format will be always Windows Bitmap (.bmp); any extension
specified in parameter 1 will be ignored.
Example:
Sub CommandButton1_Click()
' When clicking the button, save Screen
' content to SCREEN.BMP file.
Screen.Frame.CaptureScreen ("c:\temp\Screen.bmp")
End Sub
Methods 105
E3 - Scripts - Reference Manual
ChangePassword()
This method opens a dialog box in order to allow changing the current user
password. The method returns True if current user has a permission to change
password. Otherwise, it returns False, indicating there was an operation failure or
that it is not possible to change the password because the user is not authorized.
Example:
Sub Text1_Click()
If Application.ChangePassword(True) Then
MsgBox "The password can be changed."
Else
MsgBox "It was not possible to change password."
End If
End Sub
106 Methods
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
'Parameter 3 (Enable title bar and Close button)
Application.DoModalOp "InitialScreen", 1, "ModalScreen", 3
End Sub
Methods 107
E3 - Scripts - Reference Manual
108 Methods
E3 - Scripts - Reference Manual
This method returns True if the user presses <, and if the fields 6 and
+ are valid. Otherwise, if the dialog box is cancelled, or if login or
password fails after three attempts, the method returns False. In case of failure, 6
and are configured for “ ”.
Pre-defined comments are kept in Windows registry. Only the last 26 comments are
saved. Each time the window is created, last comments are searched in the registry
and used to fill the combo box. If a new comment is informed by the user, it will be
saved, and the oldest will be discarded, in case there is no free position. If a pre-
defined comment is used, this will be the first on the list of the most recent
comments.
Example:
Sub Button1_Click()
Dim Tag, User, Comment
Set Tag = Application.GetObject("IO.Inputs.I001")
If Application.ESign(Tag.PathName,, "Change in Value",_
Tag.Value, 1, User, Comment) Then
If Tag.WriteEx 1 Then
Application.TrackEvent
"Tag IO.Inputs.I001 changed to 1 " &_
"by the user" & User, Comment
End If
End If
End Sub
Methods 109
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
dim ret
Application.ExecuteExternalApp "calc.exe", "", "", 1, ret
Application.GetObject("Data.InternalTag1").Value = ret
End Sub
Exit()
This method closes Viewer window.
Example:
Sub_Button1.Click()
Application.Exit()
EndSub
110 Methods
E3 - Scripts - Reference Manual
GetFrame([FrameName])
GetFrame() method has as objective searching for a frame object which is already
opened in current Viewer. This method has the 1 ; parameter, which is
optional and determines the name of the chart to be searched for. In case the value
specified in 1 ; is empty, it will return a chart containing all frames or the
window currently active. With the return of this method, use frame methods, such
as, for example, OpenScreen() method in order to open another Screen.
Example:
Sub Button1_Click()
'When clicking the Button, it takes Menu chart
and replace this chart's current Screen to the Options
Screen
Set frame = Application.GetFrame("Menu")
'Chart has an object of frame type
.OpenScreen "Options", 0
End Sub
GetValue(TagName)
GetValue() method search for the value of an object from the path specified in
- .; parameter, that is mandatory, and specifies the object path in the server to
be searched. If the path specified in - .; parameter points to a property, this
method will return the property value. On the other hand, if - .; parameter
specifies only one single object, the method will return the value of object property
Value.
Example:
Sub Button1_Click()
When clicking the Button, it takes the value of a tag
running in a DataServer
X = Application.GetValue("DataServer1.InternalTag1")
End Sub
GetFormulaUnitDataObj(FormulaName)
This method, used in any script in the graphical interface (Viewer), obtains the
setting of existing units in a given formula. Units are the destination of data saved in
the formula (values). This method has the 1 , ; parameter, which informs
formula name.
Use GetFormulaUnitDataObj() method to obtain a collection of units of a formula.
This method returns True if achieved performing the operation, otherwise returns
False.
Methods 111
E3 - Scripts - Reference Manual
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the number or Units and the name of the
'First Unit
set obj= Application.GetFormulaUnitDataObj("Formula1")
MsgBox CStr(obj.Count)
MsgBox CStr(obj.Name(1))
End Sub
GetFormulaValueDataObj(FormulaName)
This method used in some script in graphical interface (Viewer), obtains the setting
of values existing in a specific formula. Values are a set of data saved into the
formula. This method has the 1 , ; parameter that informs formula name.
Use GetFormulaValueDataObj() method to obtain a collection of values of formula.
This method returns True if achieved performing the operation, otherwise returns
False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the number of Sets
'and the name of the First Set
set obj= Application.GetFormulaValueDataObj("Formula1")
MsgBox CStr(obj.Count)
MsgBox CStr(obj.Name(1))
End Sub
IsAppRunning(ProcessId)
Indicates if an application started by ExecuteExternalApp() method is running.
Returns True if the application identified in the operational system by $ =is
running. Otherwise, it returns False.
112 Methods
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
Application.ExecuteExternalApp _
"www.elipse.com.br", "", "", 1, processID
while Application.IsAppRunning(processID)
' espera pelo final da aplicação
wend
MsgBox "The application was closed!"
End Sub
IsUserMemberOfGroup(GroupName)
This method checks whether user logged in the current Viewer belongs to a specific
group. This method has the ,'; parameter that specifies the group name
one wants to check. The method returns True if user belongs to the ,';
group, otherwise it returns False.
Example:
Sub CommandButton1_Click()
If Application.IsUserMemberOfGroup("Support") then
Msgbox ("The user" & Aplication.User & _
"is a Support group member")
Else
Msgbox ("The user" & Aplication.User & _
"is not a Support group member")
End If
End Sub
IsWebViewer()
Check if the application is viewed by E3WebControl. Checking is done by the
ActiveX control. The method returns True if the application is running under
E3WebControl; otherwise, it returns False.
can freely assign one to another. When user clicks [ <, the set of values will be
loaded in the specified unit.
Example:
Sub Button1_Click()
'Calls the dialog box to operate
Dim val
Application.LoadFormulaDlg("Formula1”)
End Sub
NOTE: The method returns a logic value, that is, it returns True when it is
successfully executed, and False when it fails, which does not mean there is a script
error.
Example:
Sub Button1_Click()
Application.LoadFormulaValues "Formula1", "Unit1", "Value1"
End Sub
NOTE: This method can be accessed through the Formula object also.
114 Methods
E3 - Scripts - Reference Manual
LoadReport(ReportName)
Load a report model. ' ; parameter is the name of the report to be loaded.
Example:
Sub Rect_Click()
' Loading predefined report
Set strRep = Application.LoadReport("[Report3]")
strRep.PrintPreview ' Viewing printing
End Sub
Login([Mode])
It opens a dialog box for “login” (user authentication) in the application. Logged
user remains in memory until another login or logout (user exit from the application)
be done. This method has the optional + parameter, which is a Boolean
specifying whether a confirmation or operation failure message shall be showed (by
default it is False). When a window will be opened (through OpenScreen() method),
it is checked whether any security setting exist. In case it exists, the window only
will be opened if the logged user has permission to do it. In case he does not have
permission, it is opened a dialog for the login.
Examples:
Sub InitialScreen_OnPreShow(vArg)
Application.Login ' Use False as default
Application.Login(True)
Application.Login(False)
End Sub
Logout([Mode])
It performs the logout (current user exit from the application) from Viewer. In case
there is no logged user, this method has no effect. From this moment on, it will be
considered that an “anonymous” user is using the application. One can use
OnLogout event in order to run a script to go to the initial Screen or to finish the
application). This method has the optional + parameter, which is a Boolean
specifying whether a confirmation or operation failure message shall be showed (by
default it is False).
Example:
Sub InitialScreen_OnPreShow(vArg)
Application.Logout(True)
End Sub
Methods 115
E3 - Scripts - Reference Manual
PasswordConfirm(Mode)
This method opens a dialog asking for another confirmation of the currently logged
user password. The method returns True if the password was confirmed, otherwise
False. + Boolean parameter specifies whether a logout has to be performed in
case of confirmation failure (True) or not (False).
If the dialog is closed through [ $ ] button, the function returns False. In case
there is no logged user, the function returns a False, but without opening a dialog
box. In the case the typed password is not correct, the request is repeated up to three
times and then it closes, returning a False.
Example:
Sub Text1_Click()
If Application.PasswordConfirm(True) Then
MsgBox "ConfirmPassword returned a True"
Else
MsgBox "ConfirmPassword returned a False"
End If
End Sub
Playsound(Filename)
Plays a specific sound file whose path and name are indicated in Filename
parameter.. This method has the 1 parameter that determines the sound file
to be played. The file must meet the following specifications:
• it only accepts files with .wav extension;
• if the file is in the project (added through the option “Insert resource”),
the file must be between brackets [ ] (e.g.: [sons.wav]).
If it is created a folder in the project and "Insert resource" feature is used, the file
path must be between double quotes "" (e.g.: "c:\sound\ding.wav"). If the file is in
local directory, the name does not need quotes and it is enough to type the path (e.g.:
c:\sound\ding.wav).
Example:
Sub InitialScreen_OnAlarm()
'If exists an active alarm, play alert sound.
'When the alarm is acked, the sound stops.
Set Alarm = Application._
GetObject("AlarmConfig1.Area1.AlarmSource1")
If Alarm.ActiveNACKAlarms = True Then
Application.PlaySound("[ringin.wav]")
End If
End Sub
116 Methods
E3 - Scripts - Reference Manual
SelectMenu(Menu)
This method shows a “pop-up “ menu as specified by ,parameter. This text
consists of many options delimited by the character |, where each of these strings
will be a menu option. In case there is a set of two delimiters (||), it inserts a
separator. Use the characters { and } in order to create a submenu. A * character in
front of a string means that options will have a checkmark. While a ! character will
make the option disabled.
This method returns 0 if no option is selected, or the option number, considering that
1 would be for the first option contained in the text, 2 for the second and so on.
Example:
Sub Button1_Click()
op = Application.SelectMenu("Option 1|Option 2|Option 3")
If op = 1 Then
MsgBox "Option 1 was chosen"
ElseIf op = 2 Then
MsgBox "Option 2 was chosen"
ElseIf op = 3 Then
MsgBox "Option 3 was chosen"
ElseIf op = 0 Then
MsgBox "No option was chosen"
End If
End Sub
SetValue(TagName, NewVal)
This method setup the value of an object within the server. SetValue() method
searches for an object/property running in the server and assigns the value specified
in the parameter defined in - .; . ; 8 parameter type and value shall be
supported by the object specified in - .; .
Example:
Sub Button1_Click()
'When clicking the Button1, it sets up the value of a tag
'the DataServer and sets up the value 20 to the tag
Application.SetValue "DataServer1.InternalTag1", 20
End Sub
118 Methods
E3 - Scripts - Reference Manual
Example of filter:
"Arquivos de Chart (*.xlc)|*.xlc|Planilhas Excel
(*.xls)|*.xls|Arquivos de Dados (*.xlc;*.xls)|*.xlc;
*.xls|Todos os arquivos (*.*)|*.*||"
Methods 119
E3 - Scripts - Reference Manual
Example:
Sub CommandButton_Click()
Dim newColor
Dim defaultColor
defaultColor = 65280 'light green
If Application.ShowPickColor(newColor,defaultColor,90,90) Then
Screen.Item("Rectangle1").ForegroundColor = newColor
Screen.Item("Text1").Value = newColor
End If
End Sub
Stopsound()
Stop a sound playing.
Example:
Sub CommandButton2_Click()
Application.Stopsound()
End Sub
120 Methods
E3 - Scripts - Reference Manual
TrackEvent method will only record events in case the option “Events Recording” at
Domain Options is enabled. The events are recorded in a database’s table which is
also defined in the configurations of Events Recording. For further information on
Domain Events Recording, see User’s Manual.
Example:
Sub Button1_Click()
Dim Tag, User, Comment
Set Tag = Application.GetObject("IO.Inputs.I001")
If Application.ESign(Tag.PathName,, "Value Change",_
Tag.Value, 1, User, Comment) Then
If Tag.WriteEx 1 Then
Application.TrackEvent
"Tag IO.Inputs.I001 changed to 1 " &_
"by user" & User, Comment
End If
End If
End Sub
UserAdministration()
This method opens a box that allows editing E3 Server user list. Functions available
are:
• showing the list of all users;
• deleting users (it is not possible to delete the current user);
• adding and editing users;
• editing user settings;
• changing user password;
• changing other user data (login, name etc.).
IMPORTANT: Only the Administrator can have access to the UserAdministration
method. User settings box is only accessible to the user enabled as "Administrator".
Administrator user can not exclude himself and can not set his type to " non-
administrator".
Methods 121
E3 - Scripts - Reference Manual
Example:
Sub Text1_Click()
Application.UserAdministration()
End Sub
. $ ,
SetDBParameters(ServerName, UserName, Password, DBName)
String for connection to DB in the properties of the object Database. The parameter
&; determines the name of the server. The parameter 6 ;
determines the name of the user. The parameter + determines the password
of the login to connect to the database. The parameter = ; is used only for
SQL; it is the name of the database used in the SQL server.
. . '
. . '
Ack(bstrActorID)
Acknowledges an alarm configured in the object Alarm Source. This method returns
a Boolean indicating whether the operation has been successful or not.
" 0$ = parameter informs the name of the user responsible for alarm
acknowledgement.
GetAlarm()
Returns an object that grants you access to each type of alarm’s specific settings.
This allows you to check or modify any alarm’s properties in runtime. Depending on
the type of alarm, the method will return the following properties:
122 Methods
E3 - Scripts - Reference Manual
Analog Alarm: Responsible for the definition of levels alarm. Object’s properties (4
alarm levels):
ITEM DESCRIPTION
Enable/Disable LoLo alarm checking.
LoLo alarm limit
.- % LoLo alarm message text
& 4 LoLo alarm severity. Set of values: 0 - High, 1 -
Medium, 2 - Low
0$
( Q, + Acknowledgement requirement by this alarm
level (LoLo).
ITEM DESCRIPTION
Enable/Disable the Lo alarm checking.
Lo alarm limit.
.- % Lo alarm message text
& 4 Lo alarm severity. Set of values: 0 - High, 1 -
Medium, 2 – Low
0$
( Q, + Acknowledgement requirement by this alarm
level (Lo).
Methods 123
E3 - Scripts - Reference Manual
ITEM DESCRIPTION
E Enable/Disable the High alarm checking.
E Hi alarm limit.
E .- % Hi alarm message text
E & 4 Hi alarm severity. Set of values: 0 - High, 1 -
Medium, 2 – Low
E0$
( Q, + Acknowledgement requirement by this alarm
level (Hi).
HIHI ALARM
ITEM DESCRIPTION
EE Enable/Disable the HiHi alarm checking.
124 Methods
E3 - Scripts - Reference Manual
Example:
Sub Button1_Click()
Dim val
'When clicking the button, AlarmSource BatteryLevel
'Lo alarm level is changed
Application.GetObject("ConfigAlarms1.Area1.BatteryLevel")_
.GetAlarm().LoLimit = 10.2
End Sub
NOTE: the specific properties from each alarm source type can be accessed directly
via scripts or links, as well as visualized in the object’s Property List, making their
edition via GetAlarm() method not mandatory anymore.
. . '
AckAllAlarms(bstrActorID)
Acknowledges all alarms in the server, regardless of their area. This method returns
a Boolean indicating whether the operation has been successful or not.
" 0$ = parameter informs the name of the user responsible for alarm
acknowledgement.
Methods 125
E3 - Scripts - Reference Manual
Example:
Sub Button1_Click()
'When clicking the button, it acknowledges all alarms
Application.GetObject("AlarmServer1")._
AckAllAlarms (Application.User)
End Sub
AckArea(bstrArea, bstrActorID)
Acknowledges the alarms in a given area. This method returns a Boolean indicating
whether the operation has been successful or not.
" 0 parameters specifies the name of the area(s) whose alarms will be
acknowledged, by matching the beginning of their names. For example,
AckArea("ANA") acknowledges alarms in areas named "ANALOG",
"ANA.AREA2", etc. If this parameter is empty, the method will behave like
AckAllAlarms(). " 0$ =parameter informs the name of the user responsible for
alarm acknowledgement.
Example:
Sub Button1_Click()
'When clicking the button, it acknowledges Area1 alarms
Application.GetObject("AlarmServer1")._
AckArea "Area1", Application.User
End Sub
126 Methods
E3 - Scripts - Reference Manual
The other event fields cannot be specified and always assume the following values:
• CurrentValue = 0.0
• Quality = ""
• ConditionActive = 0 (False)
• ConditionName = ""
• SubConditionName = ""
• Acked = 1 (True)
• AckRequired = 0 (False)
• Enabled = 1 (True)
• EventTimeUTC = *Always equal to EventTime (just like in alarm
events)
• ChangeMask = 0
• Cookie = 0
Methods 127
E3 - Scripts - Reference Manual
. / =
StartAcquisition()
Enables the Historic to record values from its fields periodically, from the rate
specified in ScanTime property. This method can be called at any time after
StopAcquisition() method has been called. This method’s default value is “enabled”
every time the application starts; that is, this method always runs internally when
Historic starts.
Example:
Sub Button1_Click()
'When the button is clicked, Historic is enabled
Application.GetObject("Hist1").StartAcquisition()
End Sub
StopAcquisition()
Disables registers record per period at Historic, regardless of the value specified in
ScanTime property. Record per period is disabled until StartAcquisition() method is
called. Historic’s default behavior is to start the application with this record enabled.
Example:
Sub Hist1_OnStopAcquisition()
'Disable Historic as soon as it starts.
StopAcquisition()
End Sub
128 Methods
E3 - Scripts - Reference Manual
WriteRecord()
Inserts a new information line into the database. The values are obtained from the
current values of each variable specified as a data source of history fields. This
method is commonly used in two cases:
• To record a new data line before the time scheduled for the next
recording when the Historic is enabled per time.
• To record a new data set when the Historic is disabled.
Example:
Sub Tag1_OnValueChange()
'Records a new line in a Historic
'when a tag changes its value
Application.GetObject("Hist1").WriteRecord()
End Sub
. 0 !
CreateNewSession([DefaultType], [DefaultMinRecTime],
[DefaultMaxRecTime], [DefaultDeadBand], [DefaultUnit])
Creates a new session that can include data from an E3Storage regardless of the
ordinary acquisition. The optional parameters are used to configure tags in the
session, in case they are not informed when created. They are, respectively:
datatype, minimum interval between records, maximum interval with no records,
deadband, and tag’s deadband unit.
How to use it:
Creating a session:
set Session =
Application.GetObject("Storage1").CreateNewSession(0, 0, 3600,
10, 1)
Adding a tag to the session (AddField(FieldName, [Type], [MinRecTime],
[MaxRecTime], [DeadBand], [Unit]) method):
result = session.AddField("TempTag", 0, 0, 100000, 15, 1)
Adding values (AddValue(FieldName, TimeStamp, Quality, Value) method):
result = session.AddValue("TempTag", Now, 192, 10)
StartAcquisition()
Starts or resumes the generation of data going to the database. Storage is notified on
which registered tags are modified, and when it happens it checks whether the
registers will be recorded. When this method is called, both change notification and
recording generation either start or resume.
Example:
Sub Botao1_Click()
Methods 129
E3 - Scripts - Reference Manual
StopAcquisition()
Stops the generation of data going to the database. Storage is notified on which
registered tags are modified, and when it happens it checks whether the registers will
be recorded. When this method is called, both change notification and recording
generation stop.
Example:
Sub Storage1_OnStopAcquisition()
'Disables Storage as soon as it starts.
StopAcquisition()
End Sub
. 6 )"+ 2
ClearFields()
Clears column and row formatting at E3Browser. Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser1").ClearFields()
End Sub
GetColumnValue(iIndex)
Returns the value of a cell, in the informed column and selected line. This method
has the + %parameter, determining the index of the column desired.
Example:
Sub E3Browser1_DblClick()
Screen.Item("Text1").Value = GetColumnValue(0)
Screen.Item("Text2").Value = GetColumnValue(1)
Screen.Item("Text3").Value = GetColumnValue(2)
Screen.Item("Text4").Value = GetColumnValue(3)
End Sub
130 Methods
E3 - Scripts - Reference Manual
Requery()
Requery() method update the query by using the current query settings, returning the
data to E3Browser.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser1").Requery()
End Sub
RetrieveE3QueryFields()
RetrieveE3QueryFields() method reads query data structure and updated E3Browser
formatting with the fields defined in the query. If it is successful, it returns True.
Otherwise, it returns False. This method is especially useful when one must use one
single E3Browser to show data from different tables or queries.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser1").RetrieveE3QueryFields()
End Sub
Methods 131
E3 - Scripts - Reference Manual
. 7 )"; -
AddField(Name, [Table])
AddFields() method add a new field into the query table. ; parameter
determines new field name to be added to the query. This field will be setup with the
first table recorded into the query. This method was developed only to keep
compatibility to E3Chart old query object. - " parameter represents the name of
the table where the field belongs. This parameter searches in the table, and returns a
Boolean indicating whether the operation has been successful or not. Example:
Sub Button1_Click()
Screen.Item("E3Browser").Item("Query").AddField "Field1"
End Sub
AddStorageTag(Name, fieldType)
Adds a tag from the Storage to be queried to the query. ; parameter gets the
name of the tag to be added. +-4 ' parameter indicates the tag type (M - double,
9 - bit, : - string). Returns a Boolean indicating whether the operation has been
successful or not.
AddTable(Name)
Receives the name of the table to be included in the query list. ; parameter
determines new table name to be added to the query.
Execute(ImediateExecute)
Execute() method executes an SQL command that does not have a return (such as
DELETE, UPDATE or INSERT), setup in SQLQuery. + !%$ , parameter
indicates whether the operation will pass through DB operation rows (e3i and e3o
files) before it reaches the database (if False), or it will be sent directly to the
database (if True). The advantage of using a query to execute commands is the use
of variables, such as in a simple query. Example of SQL commands:
DELETE FORM test WHERE cod > 10
UPDATE test SET cod = 10 WHERE cod > 10
INSERT INTO test (cod) VALUES(10)
Example:
Sub CommandButton1_Click()
Screen.Item("Query1").Execute
End Sub
GetAsyncADORecordSet()
132 Methods
E3 - Scripts - Reference Manual
GetADORecordSet()
GetADORecordSet() method returns a recordset of ADO (ActiveX Data Object) type
resulting from the execution of the query setup.
Example:
Sub Button1_Click()
Set rec = Screen.Item("Query1").GetADORecordset()
strDates = " "
i = 0
while (not rec.EOF and i < 10)
strDates = strData & CStr(rec("E3TimeStamp")) & _
Chr(10) & Chr(13)
i=i+1
Wend
MsgBox strDates
End Sub
GetE3QueryFields()
GetE3QueryFields() method returns a collection of the query fields. The fields have
properties that can be modified, as follows:
Example:
Sub CommandButton1_Click()
Set Fields = Screen.Item("E3Browser")._
Item("Query").GetE3QueryFields()
Fields.Item(0)
End Sub
NOTE: To use this method, the query must be previously created in the
development time.
RemoveField(FieldName, [Table])
RemoveField() method removes a field previously included in a query into Query
object. 1 +; parameter determines the field name to be removed from query.
This method, just like AddField() method, was included in order to keep the
compatibility to E3Chart query old versionsThis parameter searches in the table, and
returns a Boolean indicating whether the operation has been successful or not. - "
parameter represents the name of the table where the field belongs.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser").Item("Query")._
RemoveField "Field1"
End Sub
RemoveStorageTag(Name)
Removes a tag previously configured in the query. ; parameter indicates tag’s
name. Returns a Boolean indicating whether the operation has been successful or
not.
RemoveTable(TableName)
Receives table name, and removes all its fields configured in this query. - " ;
parameter determines the name of the table to be removed from the query.
SetVariableValue(bstrVarName, vValue)
SetVariableValue() method adjust the value of a variable setup in the query, so that
this value can be informed as a filter or parameter before being performed. It must
be defined the variable name (" 8 ; ) and the value (&8 , ), which can be
a number, a text or a date/time.
134 Methods
E3 - Scripts - Reference Manual
Example:
Sub CommandButton_Click()
Set cons = Screen.Item("E3Browser1").Item("Query1")
InitialDate = now -1
FinalDate = now
cons.SetVariableValue "IniData",InitialDate
cons.SetVariableValue "EndDate",FinalDate
End Sub
. < )"
CopyConfig(SourceChart)
CopyConfig() method copies the settings from an E3Chart to another. ,$ 2
parameter indicates the origin E3Chart whose properties will be copied to the
E3Chart calling CopyConfig() method.
Example: Considering copy settings from an E3Chart on a Screen (in this example,
ScreenChart) to another one within a report (ReportChart). In this case, the script
must be added in the E3Report object associated to the report:
Sub OnBeforePrint
Set Chart =_
Report.Sections("PageHeader").Controls("ReportChart")
Chart.CopyConfig_
(Application.GetFrame().Screen.Item("ScreenChart"),0)
Chart.LoadData()
Chart.FitAll()
End Sub
Note: this method also has the optional parameter 1 ., which is not used, and
was only kept for purposes of compatibility with earlier versions.
Methods 135
E3 - Scripts - Reference Manual
FitAll([FitStyle])
Fit all pens into E3Chart. Optional parameter 1 4 indicates how pens will fit in
runtime: M fits both axes at the same time; 9 fits just the vertical axis; and : fits just
the horizontal axis.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").FitAll()
End Sub
FitPen(Pen, [FitStyle])
Fit a pen into the E3Chart specified by the index or name. parameter defines the
pen to be fit in the E3Chart (pen index or name). Optional parameter 1 4
indicates how pens will fit in runtime: M fits both axes at the same time; 9 fits just
the vertical axis; and : fits just the horizontal axis.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.FitPen(1)
Chart.FitPen("Pen1",1)
'Fits Pen1 just vertically
End Sub
Legend()
Return an E3Chart legend object.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.Showbackground = False
End Sub
LoadData()
Load data into the E3Chart. This method is specially used to load data before
printing, when used in E3Reports.
Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("E3Chart1").LoadData()
End Sub
136 Methods
E3 - Scripts - Reference Manual
ResetConfig()
Remove all settings setup in an E3Chart, turning it back to its original status.
Example:
Sub E3Chart1_OnStartRunning()
' When starting E3Chart1, remove all settings
ResetConfig()
End Sub
Note: this method also has the optional parameter 1 ., which is not used, and
was only kept for purposes of compatibility with earlier versions.
ZoomIn()
ZoomIn() method increases zoom in the E3Chart, i.e., it closes pens viewing. In
runtime, this feature can be accessed by right clicking the mouse on the object and
selecting the options Zoom In from the context menu.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").ZoomIn()
End Sub
ZoomOut()
ZoomOut() method decreases zoom in the E3Chart, i.e., it separates pens viewing in
E3Chart. In runtime, this feature can be accessed by right clicking the mouse on the
E3Chart and selecting the option Zoom Out.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").ZoomOut()
End Sub
. <
Note: HorAxis and VerAxis are axes properties that access default horizontal
and vertical axis, respectively. For example, instead of typing
Chart.Axes.Item("HorizontalAxis"), you can type Chart.Item.HorAxis.
Further user-generated axes will have their own names, depending on the case.
Methods 137
E3 - Scripts - Reference Manual
GetHistoricPeriod(Begin,End)
Return the time interval shown in the historic scale. . parameter indicates the
historic scale initial date, and ! + indicates the final date.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart")
Chart.Axes.Item("AxisName").GetHistoricPeriod min, max
Value = cstr(dmin) & " "& cstr(dmax)
MsgBox "initial date = " & cstr(min) & _
vbNewLine & " final_ date =" & cstr(max)
End Sub
GetMinMax(Min,Max)
Return the numeric scale minimum and maximum values in the and %
parameters.
Example:
Sub CommandButton1_DBClick()
Set Chart = Screen.Item("E3Chart")
Chart.Axes.Item("AxisName").GetMinMax dmin, dmax
Msgbox cstr(dmin) & " " & cstr(max)
End Sub
GetRealTimePeriod(Times, TimeUnit)
Return the value and time unit setup in the real-time scale. The value is determined
by - parameter and the time unit by - 6 . Time units available in
- 6 parameter are the following:
138 Methods
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Unitvalue = _
Chart.Axes.Item("AxisName").GetRealTimePeriod(dmin)
Msgbox "value" & cstr(dmin) & "unit" & cstr(unitvalue)
End Sub
GetTickSpacing(TickSpacing, TimeUnit)
Return the spacing between ticks and the unit setup. -$ ( ' $ . parameter
determines the spacing between the ticks (scale subdivisions) and TimeUnit
determines the unit. When this parameter is in zero, it means it is automatic. The
unit is not used when scale is numeric.
Options available in - 6 parameter are the same showed in
GetRealTimePeriod() method table.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Unitvalue = _
Chart.Axes.Item("AxisName").GetTickSpacing(TickSpacing)
Msgbox "value" = " & cstr(TickSpacing) & _
"unit" & cstr(unitvalue)
End Sub
SetHistoricPeriod(Begin, End)
Setup the period for the history scale. . parameter determines the scale initial
period and ! + determines the scale final period.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart2")
Chart.Axes.Item("AxisName").ScaleType = 2
' shows the last period
Chart.Axes.Item("AxisName").SetHistoricPeriod now -1, now
End Sub
Methods 139
E3 - Scripts - Reference Manual
SetMinMax(Min, Max)
Setup the minimum and the maximum value of the numeric scale. The minimum
value is determined by parameter and the maximum value by %. Example:
Sub Circle1_Click()
Set Chart = Screen.Item("E3Chart2")
Chart.Axes.Item("AxisName").SetMinMax -10, 500
End Sub
SetRealTimePeriod(Times, TimeUnit)
Set the time period in the unit defined by TimeUnit parameter. Options available in
this - 6 parameter are the same showed in the table of the
GetRealTimePeriod() method. - parameter determines the time period and the
scale unit is specified by - 6 . In this mode (real-time) the Axis is updated all
the time.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart5")
'tuSecond = 0, tuMinutes =1, tuHours = 2, tuDays = 3,
'tuWeeks = 4, tuMonths = 5,tuYears = 6
'2 minutes
Chart.Axes.Item("AxisName").SetRealTimePeriod 2,1
Chart.Axes.Item("AxisName").SetTickSpacing 30,0
End Sub
SetTickSpacing(TickSpacing, TimeUnit)
Setup the spacing between ticks (scale subdivisions) by using the unit. Spacing
between ticks is determined by -$ ( ' $ . parameter. - 6 parameter
determines the unit. In case the scale is numeric, the unit is not considered. Options
available in - 6 parameter are the same showed in GetRealTimePeriod()
method table.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
'10 (in case the scale is numeric,
'unit value is not considered)
Chart.Axes.Item("AxisName").SetTickSpacing 10,0
Chart.Axes.Item("AxisName").SetTickSpacing 20,0
End Sub
140 Methods
E3 - Scripts - Reference Manual
. <
AddAxis(AxisName)
Adds a new axis with the name specified in parameter 0% ; and returns the
created axis. In the case of trying to create an axis with an existing name, an error
message will be shown. To generate a name automatically, simply put a blank name
in the parameter 0% ; .
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Set newAxis = Chart.Axes.AddAxis("")
newAxis.Color = RGB(255,0,0)
End Sub
Remove(Index)
Removes the axis by its name or index, as specified in + %parameter. Main axes
0 and 1 can not be removed. In case one try to remove them, an error message will
be shown.
Examples:
Sub CommandButton1_Click()
'This example removes all additional axes
Set Chart = Screen.Item("E3Chart")
While (Chart.Axes.Count>2)
Chart.Axes.Remove(2)
Wend
End Sub
Sub CommandButton1_Click()
'Remove an additional axis, in case it exists
set Chart=Screen.Item("E3Chart1")
Chart.Axes.Remove(2)
End Sub
Methods 141
E3 - Scripts - Reference Manual
. <"
AddPoint()
Adds a point at the end of the real-time buffer. So, the number of points that can be
added depends on this buffer’s size (pen’s BufferSize property). Buffer size is only
valid after pen’s Connect() method. This method must be used with a real-time pen,
and with UseTimeStamp property set to False.
Clear()
Erases data from real-time buffer, with no decrease in its size. This method does not
disconnect links, nor does it remove historical data.
Connect()
Connect() method connects the pen to the server in order to receive data in real-time,
associating the XField and YField properties. If the pen is already connected, the
method is not used.
Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.Disconnect()
Pen1.Connect()
End Sub
Disconnect()
Disconnect() method clean up the current data and prevent pen of receiving more
real-time data from its associated tag. If the pen is already disconnected, the function
does nothing. It can be used to change a tag in execution mode. When Disconnect()
is used with a mixed pen (DataSourceType=2), the method removes the real-time
part, and keeps the historic part. In runtime, the method Connect() must be called to
show the real-time data again.
Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.Disconnect()
Pen1.Connect()
End Sub
GetCursorPos(X,Y)
Return to the position the cursor intercepted the pen in the E3Chart. This method has
the D and G parameters, corresponding to x and y cursor positions. If the method is
successful, it returns True, otherwise it returns False.
142 Methods
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
For each pen in Chart.Pens
If pen.GetCursorPos(aa,bb) Then
strResult = strResult&pen.name&”:=”&CSTr(CDate(aa))+_
"y" + cstr(bb) + vbnewline
End If
Next
MsgBox strResult
End Sub
. <$
AddPen(pen)
AddPen() method add a new pen to the E3Chart, returning the pen created.
Examples:
Sub CommandButton1_Click()
'Create a name to the pen added.
Set Pen = Screen.Item("E3Chart1").Pens.AddPen("")
MsgBox Pen.Name
End Sub
SubCommandButton1_DbClick()
'Give a pen the name "Pen1".
'If the name exists, the pen is added.
Set Pen = Screen.Item("E3Chart1").Pens.AddPen("Pen1")
MsgBox Pen.Name
End Sub
Methods 143
E3 - Scripts - Reference Manual
Sub CommandButton2_Click()
'Create a pen and associate it to TagDemo1.
Set Chart = Screen.Item("E3Chart1")
Set Pen = Chart.Pens.AddPen("")
MsgBox Pen.Name
Pen.UsetimeStamp = true
Pen.YLink = "Data.TagDemo1"
Pen.Connect()
End Sub
ChangePenPos(Source, Dest)
Modify the drawing position of pens in E3Chart. This function is especially useful
when the pen has the shape of lines and another one has areas shape, for example. In
this case, depending on the drawing order, it can be impossible viewing all pens if
the area pen is in from of the line pen. This method has the following parameters:
,$ determines the index of the pen to be moved (starting from 1) and = ,
determines the pen destination (starting from 1).
Example:
Sub CommandButton1_Click()
'Move Pen 1 to the second position
Screen.Item("E3Chart1").Pens.ChangePenPos(1,2)
End Sub
Item(index)
Item() method turns pen object back to pens collection, specified by the index. This
method has the + %parameter that can be of numeric type if corresponding to the
pen index, or text if corresponding to the pen name.
Example:
Sub CommandButton1_Click()
'Obtains the first pen
Set Pen1 = Screen.Item("E3Chart1").Pens.Item(0)
End Sub
Remove(Name)
Remove() method removes a pen through the specified name. This method has a
Name parameter determining the name of the pen to be removed.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Pens.Remove(1)
End Sub
144 Methods
E3 - Scripts - Reference Manual
. <. 4 !
In the legend, many columns can be selected. Each column show a type of
information and has a corresponding name and a value. Following we have a
description table of the possible columns in the legend.
ChangeColumnPos(Source, Dest)
Change the position of a column. This method has the following parameters: ,$
is the index of the column to be moved to = , and = is the index of the column
to be moved to ,$.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.ChangeColumnPos 1,2
End Sub
Count()
Return the number of columns of the legend.
Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("E3Chart1").Legend.Count()
End Sub
InsertColumn(Col, Index)
Insert a new column in the legend. This method has the following parameters:
identifies the column to be inserted (see the columns identification table) and + %
determines the position in which the column will be inserted.
Methods 145
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.InsertColumn 1,2
End Sub
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.InsertColumn "Color",2
End Sub
Item(Col)
Return a legend column by name or index. parameter determines the column
index or name. In order to see the column name, see the column identification table.
Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("E3Chart1").Legend.Item(1)
End Sub
RemoveColumn(Col)
Remove the columns. This method has a parameter determining the column to
be removed. See the columns identification table.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.RemoveColumn (1)
End Sub
. </ ;
The following methods are used to handle Queries collection.
AddQuery(QueryName)
Add a query to E3Chart queries collection. This method has H, 4
; parameter
determining the query name that is being added.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Queries.AddQuery("Query1")
End Sub
Item(index)
Setup or return a query collection by name or index. This method has an + %
parameter that is mandatory and assumes the following behavior: if it is numeric, it
146 Methods
E3 - Scripts - Reference Manual
Remove(Index)
Return the query object specified by name or index. This method has an + %
parameter corresponding to the query name to be removed.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Queries.RemoveQuery(0)
End Sub
UpdateData()
Update the data of all queries.
Example:
Sub Text1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
E3Chart1.Queries.UpdateData
End Sub
. 1 '
CreateUnit(bstrUnitName)
Create a unit in formulas database and returns if the operation performance was
achieved. This method has a " 6 ; parameter determining the name of the
formula to be created. This method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it creates a new Unit
Application.GetObject("Formula1").CreateUnit("Unit2")
End Sub
Methods 147
E3 - Scripts - Reference Manual
CreateValue(bstrValueName)
Create a values set in formulas database and returns if the operation performance
was achieved. This method has a " 8 , ; parameter determining the name
of the set to be created. This method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it creates a new Value
Application.GetObject("Formula1").CreateValue("Template5")
End Sub
DeleteUnit(bstrUnitName)
Delete a unit in formulas database and returns if the operation performance was
achieved. This method has a " 6 ; parameter informing the name of the
unit to be deleted. The method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it deletes the unit
Application.GetObject("Formula1").DeleteUnit("Unit2")
End Sub
DeleteValue(bstrValueName)
Delete a values set in formulas database and returns if the operation performance
was achieved. This method has a " 8 , ; parameter informing the values
set to be deleted. The method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it deletes a values set
Application.GetObject("Formula1").DeleteValue("Template5")
End Sub
FindUnit(bstrUnitName)
Check whether given unit exists in formulas database. This method has a
" 6 ; parameter determining the name of the unit to be found. The method
returns True if the operation performance was achieved; otherwise, it returns False.
148 Methods
E3 - Scripts - Reference Manual
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the result
MsgBox (Application.GetObject("Formula1")._
FindUnit("Unit2"))
End Sub
FindValue(bstrValueName)
Check whether given values set exist in formulas database. This method has a
" 8 ,; parameter informing the name of the set to be checked. The
method returns True if the operation performance was achieved; otherwise, it returns
False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the result
MsgBox CStr(Application.GetObject("Formula1")._
FindValue("Template5"))
End Sub
LoadFormulaValuesQuiet(bstrUnitName, bstrValueName)
This method loads a values set to a destination unit, without showing any message.
This method has the following parameters: " 6 ; , determines the unit name
and " 8 , ; , determining the name of the values set. The method returns
True when it is successfully executed, and False when it fails (which does not mean
there is a script error).
Example:
Sub Button1_Click()
Application.LoadFormulaValuesQuiet_
"Formula1", "Unit3", "Values1"
End Sub
NOTA: This method can be accessed through the Viewer object also.
RenameUnit(bstrUnitName, bstrNewUnitName)
Rename given unit existing in formulas database. It returns True if achieved
performing the operation, or otherwise it returns False. This method has the
following parameters: " 6 ; determines the name of the unit to be found
and " ; 6 ; informs the unit name.
150 Methods
E3 - Scripts - Reference Manual
RenameValue(bstrValueName, bstrNewValueName)
Rename given values set existing in formulas database. It returns True if achieved
performing the operation, or otherwise it returns False. This method has the
following parameters: " 8 , ; informs the values set name and
" ; 8 ,; informs the new values set name.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it renames a values set
Application. GetObject("Formula1")._
RenameValue "Template5","TemplateABC"
End Sub
SaveFormulaValues(bstrUnitName, bstrValueName,
[IgnoreErrors])
This method saves origin unit tags’s current values in a cluster of values on the
formula table. This method does not check for limits, in case the template’s
restriction is of the absolute type. " 6 ; parameter is the name of the origin
unit, and " 8 , ; parameter is the cluster of values to be saved. It returns
True if the operation is accomplished; otherwise, it returns False. . !
parameter, when True, causes all values to be recorded, regardless of link errors in
the Formula. Its default value is False, though.
Example:
Sub CommandButton1_Click()
Application. GetObject("Formula1")._
SaveFormulaValues "Unit1", "Value1"
End Sub
Methods 151
E3 - Scripts - Reference Manual
.
Export([ExportFilter], [ExportFileName])
Print a report according to the format specified in the file. This method has the
following parameters: !%' 1 determines the filter for the report, by indicating
the format type for exporting. It can assume the following options:
• PDF: Export data to Acrobat Reader format.
• Excel: Export data to Excel spreadsheet format.
• HTML: Export data to HTML page format.
• TEXT: Export data to text format.
• RTF: Export data to Rich Text Format.
• TIFF: Export data to Tag Image File Format.
By simply informing the filter name as showed above, the data can be exported
using the standard properties of each filter. It must also be informed the file name
into the !%' 1 ; parameter. One can also modify the standard properties of
an exporting filter through GetExportFilter() method, before exporting the data.
152 Methods
E3 - Scripts - Reference Manual
Example:
Sub Button1_Click()
Set report = Application.LoadReport("[Report3]")
Select case Application._
SelectMenu("PDF|Excel|HTML|RTF|Text|TIFF|Text(CSV)")
Case 1
Report.Export "PDF", "C:\correio\reports\report.pdf"
MsgBox "Exported to PDF!"
Case 2
Report.Export "EXCEL", "C:\correio\reports\report.XLS"
MsgBox "Exported to XLS!"
Case 3
Report.Export "HTML", "C:\correio\reports\report.html"
MsgBox "Exported to HTML!"
Case 4
Report.Export "RTF", "C:\correio\reports\report.rtf"
MsgBox "Exported to RTF!"
Case 5
Report.Export "TEXT", "C:\correio\reports\report.txt"
MsgBox "Exported to TXT!"
Case 6
Report.Export "TIFF", "C:\correio\reports\report.tiff"
MsgBox "Exported to TIFF!"
Case 7
Set reportFilter = report.GetExportFilter("TEXT")
reportFilter.FileName="C:\correio\reports\report2.txt"
reportFilter.TextDelimiter=","
report.Export reportFilter
MsgBox "Exported to TXT by using the filter!"
End Select
End Sub
Methods 153
E3 - Scripts - Reference Manual
GetExportFilter(FilterName)
Return an object specifying the exporting parameters customization. This method
has 1 ; parameter determining the filter for reporting, by indicating the
format type for exporting. It can assume the following options:
• PDF: Export data to Acrobat Reader format.
• Excel: Export data to Excel spreadsheet format.
• HTML: Export data to HTML page format.
• TEXT: Export data to text format.
• RTF: Export data to Rich Text Format.
• TIFF: Export data to Tag Image File Format.
After the filter is obtained, the following parameters can be modified:
154 Methods
E3 - Scripts - Reference Manual
1%
!%' TIFF Object that allows exporting data into RFC 1314
TIFF format.
Print()
Print a report.
Example:
Sub Rect_Click()
Application.LoadReport("[Report3]").Print()
End Sub
PrintPreview()
It gives a preview on Screen of the report to be printed. If the report is correctly
showed on Screen, it returns True. In case the user press the $ button or
some error happens, it returns False.
Example:
Sub CommandButton1_Click()
set report = Application.LoadReport("[Report1]")
Beginning =
Application.GetObject("Data.Graphic.idate").Value
Final = Application.GetObject("Data.Graphic.fdate").Value
report.Item("Query1").SetVariableValue "Ini",Initiate
report.Item("Query1").SetVariableValue "End",Final
report.PrintPreview()
End Sub
Query()
Return current Query object selected in the report, by informing through
SourceQuery property. (There might be more than one query in the report).
Example:
Sub Rect_Click()
Set Query = Application.LoadReport("[Report3]").Query()
Query.SetVariableValue("Key1","XYZ")
End Sub
Methods 155
/ /
Each object has Properties, which are used to save information about its
characteristics. For example, take and object like a Rectangle. One of its properties
is Name, where its name is stored. Two other properties are Width and Height, which
save its width and height, respectively.
In this chapter, E3 object’s properties will be summarized. Each entry has the name
of the property, its description, and, when possible, a practical example of its use.
The first topic (“Common Properties”) introduces the properties that are present in
all E3’s objects. The following topics bring the properties that are specific to the
object or group of objects mentioned in their titles. In some of these topics, the first
item is also about common properties; in this case, properties that are common to all
the objects whose group is being depicted in the topic (for example, in the topic
“Screen Objects Properties”, the first item is “Screen Objects Common
Properties”, where all properties common to these objects are grouped).
Properties are identified by an icon indicating the datatype supported on their
content. They are:
Available Datatypes
ICON DATA DESCRIPTION
Returns True or False.
Properties 157
E3 - Scripts - Reference Manual
Some properties can propagate their values to the same property in their child-
objects; in this case, they are called propagator properties. You can, however,
force the property in the child-object to behave distinctively.
/ ''
Application: Returns the application related to this object. With this application
it is possible, for example, to search for other objects that are in the application.
Example:
Sub Tela1_Click()
'When Screen is clicked, a tag is searched
Dim obj
Set obj = Application.GetObject("DataServer1.InternalTag1")
obj.Value = 100
End Sub
Count: Returns the number of child-objects the object has. This property works
conjoined with Item() method. If the object does not have any child-objects, this
property’s value is 0.
Example:
Sub Tela1_Click()
'Searches all Screen objects and sets
'ForegroundColor property to red
Dim obj
For i=1 TO Count
Set obj = Item(i) 'Takes child-object
obj.ForegroundColor = RGB(255,0,0)
Next
End Sub
DocString: Free text that enables the documentation of the object’s functionalities
and/or characteristics by the project’s programmers. Example:
158 Properties
E3 - Scripts - Reference Manual
Sub CommandButton1_Click()
Docstring = "This button activates system condenser."
MsgBox Docstring
End Sub
Links: Returns an object that is a collection of links of any given object at E3.
This property is available in runtime only.
Name: Identifies each object present in the system. Modifying this property
implies in modifying all other properties and/or scripts that use this object. Hence, it
is not advisable to change this property in runtime.
Example:
Sub CommandButton9_Click()
MsgBox "Screen name is "&(Screen.Name)
End Sub
/ ,
/ 9 ,
Properties 159
E3 - Scripts - Reference Manual
This property cannot be modified once communication has started. Default value is
empty. Example:
Sub Driver1_BeforeStart()
'Sets DriverLocation as "c:\drivers\Driver1.dll"
DriverLocation = "c:\drivers\" & Name & ".dll"
End Sub
P1: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
End Sub
160 Properties
E3 - Scripts - Reference Manual
P2: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
End Sub
P3: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
End Sub
P4: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
P4 = 500
End Sub
ParamDevice: Defines the address of the device accessed by the driver. This
property is inherited by the driver’s blocks and tags, which can override this value, if
necessary.
ReadRetries: Indicates the number of read retries by the driver in case of error. If
it is set to 2, for example, it means the driver will retry failed communication twice,
apart from the original try.
Properties 161
E3 - Scripts - Reference Manual
Example:
'This driver will not be shared
ShareServer = False
ShareMaximum = <qualquer valor>
'all drivers are grouped in the same ‘IOServer
'does not define limit
ShareServer = True
ShareMaximum = 0
'groups every 5 drivers in an IOServer
ShareServer = True
ShareMaximum = 5
ShareServer: If True, this driver will share its execution among all other I/O
drivers that have the same string in DriverLocation. It means that only the first I/O
driver that is set will execute communication initialization. All other shared
communication drivers will ignore all setting parameters from P1 to P4, as well as
other settings. Otherwise, if ShareServer property is False, the driver will not share
any kind of communication with other I/O drivers. This property cannot be modified
once communication has started. Default value is False.
Example:
Sub CommandButton1_Click()
Dim mode
mode = Application.GetObject("Driver1").WriteFeedbackMode
MsgBox mode
Select case mode
Case 0
MsgBox "Tag reading is done in the next scan"
Case 1
MsgBox "After each writing, a confirmation _
reading will be done as soon as possible”
Case 2
MsgBox "If the driver indicates writing success, _
the written value is assumed directly by the tag, _
without reading it from the PLC."
End Select
End Sub
NOTA: When value 2 is used, timestamp and quality may be damaged, since in a
successful writing the value is assumed by the tag without searching for timestamp
and quality in the PLC. Besides, the assumed value itself may present a little
deviation due to any kind of simplification in numbers that may occur in the driver
and/or PLC. Also note that some drivers or protocols may indicate success, even
when the writing has failed. So, the other values (0 or 1) should be preferred as often
as possible.
WriteRetries: Indicates the number of write retries by the driver in case of error.
If it is set to 2, for example, it means the driver will retry failed communication
twice, apart from the original try.
WriteSyncMode: Determines how writes will be sent to the IOServer
(synchronous or asynchronous mode). This property has the following configuration
options:
Properties 163
E3 - Scripts - Reference Manual
/ 9 !
Example:
Sub CommandButton3_Click()
MsgBox Application._
Application.GetObject("Driver1.Tag1").AdviseType
End Sub
AllowRead: Defines whether the tag will be read by the I/O driver. If True, the
driver automatically updates Value and Bits (00 to 31) properties, in time spans
164 Properties
E3 - Scripts - Reference Manual
defined by Scan property. Otherwise, the I/O tag will neither be read nor updated.
This property can be modified in execution. Default value is True.
Example:
Sub Botao1_Click()
'Stops tag reading
Set obj = Application.GetObject("Driver1.tag")
obj.AllowRead = False
End Sub
AllowWrite: Defines whether the tag will be written automatically when Value or
Bits (00 to 31) properties are modified. If True, the modifications will be sent to the
device associated to the I/O driver. Otherwise, the modifications will be ignored.
Default value is True. Example:
Sub Botao1_Click()
'disables tag writing
Set obj = Application.GetObject("Driver1.tag")
obj.AllowWrite = False
End Sub
Bit00-Bit031: These properties represent the 32 bits in I/O Tag Value property’s
value, ranging from Bit00 (the least significant bit) to Bit31 (the most significant
bit). By modifying each one of these bits you will modify tag’s Value property, and
vice-versa, but this only happens when UseBitFields property is True. Default value
is False.
DeviceHigh: Defines the highest value achieved by this tag in the device. Adjusts
the value scale from the device before being attributed to Value property. Likewise,
the inverse operation is done before sending the value to the driver, when writing.
This conversion happens only when EnableScaling property is True. Default value is
1,000.
Properties 165
E3 - Scripts - Reference Manual
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
DeviceLow: Defines the lowest value achieved by this tag in the device. Adjusts
the value scale from the device before being attributed to Value property. Likewise,
the inverse operation is done before sending the value to the driver, when writing.
This conversion happens only when EnableScaling property is True. Default value is
0.
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
166 Properties
E3 - Scripts - Reference Manual
EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
are attributed to Value property. Otherwise, no adjustment in scale will be made.
Default value is False.
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
Properties 167
E3 - Scripts - Reference Manual
EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc.
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
EULow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
168 Properties
E3 - Scripts - Reference Manual
is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EULow = 100
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
N1: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.
Example:
Sub Tag_OnStartRunning()
N1 = 10
End Sub
N2: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.
Example:
Sub Tag_OnStartRunning()
N2 = 3
End Sub
N3: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.
Properties 169
E3 - Scripts - Reference Manual
Example:
Sub Tag_OnStartRunning()
N1 = 10
N3 = 5
N4 = 20
End Sub
N4: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.
Example:
Sub Tag_OnStartRunning()
N1 = 10
N4 = 20
End Sub
ParamDevice: Defines the address of the device accessed by the tag. This
property is inherited from the driver, but its value can be overridden, if necessary.
ParamItem: Identifies the data the tag accesses from inside the device.
Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Tag it also sets data quality. This property is
read-only. Default value is 0 (Bad Quality).
NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.
170 Properties
E3 - Scripts - Reference Manual
Scan: Specifies the duration of the scan used by the server to update Value
property. This property is represented in milliseconds, and can be modified after
communication has started. It is used only when AllowRead property is set to True.
When you set this property in the several tags in the application, you should increase
the value of the property to those tags that do not vary very much in the device,
enabling other tags with higher priority to be read more frequently, and enhancing
general performance in the system. Default value is 1,000 (1 second). Scan value
should be above zero. Example:
Sub Tag_OnStartRunning()
Scan = 1500
End Sub
UseBitFields: If True, every time the value from Value property is modified, the
bits referring to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
Properties 171
E3 - Scripts - Reference Manual
Value: Updated whenever a new device value valid reading is done, using N1-
N4 parameters. Datatype (integer, floating point, string) depends on the driver to
which the element is associated and its parameters.
This property is updated like this if AllowRead property is True, and when there are
no communication errors (in this case, Quality and TimeStamp properties are
updated), according to scan time defined in Scan property. Another way to use this
property is to write values in the device; for this, just attribute a new value to Value
property or to some of the bits from Bit00-Bit031. In this case, AllowWrite property
must be True.
This is also I/O Tag’s default property. So, it is not mandatory for a value reference
to a I/O Tag to make Value property explicit in order to access value. Default value
is empty (no value). Example:
Sub Botao1_Click()
'Accesses a tag and shows current value
'tag1 is an I/O tag
Set obj = Application.GetObject("I/O
Driver1.tag1")
MsgBox "Tag1's current value: " & obj.Value
'This can also be done in a different way,
'with no need to show Value property, which is default
MsgBox " Tag1's current value: " & obj
End Sub
NOTE: Bits value (Bit00...Bit31 properties) are not affected by scale adjustment.
That is to say, they represent bits of the value read from the device, before
conversion.
172 Properties
E3 - Scripts - Reference Manual
/ " 9 + #
AllowRead: Defines whether the block will be read by the I/O driver. If True, the
driver automatically updates the I/O elements inserted in the block, in time spans
defined by Scan property. Otherwise, the communication block will neither be read
nor updated. This property can be modified in execution. Default value is True.
Example:
Sub Botao1_Click()
'Stops block reading
Set obj = Application.GetObject("Driver1.bloco1")
obj.AllowRead = False
End Sub
Properties 173
E3 - Scripts - Reference Manual
B1: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.
Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
End Sub
B2: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.
Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
End Sub
B3: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.
Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
End Sub
174 Properties
E3 - Scripts - Reference Manual
B4: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.
Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
B4 = 524
End Sub
ParamDevice: Defines the address of the device accessed by the block. This
property is inherited from the driver, but its value can be overridden, if necessary.
ParamItem: Identifies the data the block accesses from inside the device.
Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Block it also sets data quality. This property
is read-only. Default value is 0 (Bad Quality).
NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.
Scan: Specifies the duration of the scan used by the server to update the block.
This property is represented in milliseconds, and can be modified after
communication has started. It is used only when AllowRead property is set to True.
When you set this property in several blocks in the application, you should increase
Properties 175
E3 - Scripts - Reference Manual
the value of the property to those blocks that do not vary very much in the device,
enabling other blocks with higher priority to be read more frequently, and enhancing
general performance in the system. Default value is 1,000 (1 second). Scan value
should be above zero. Example:
Sub IOBlock1_BeforeStart()
Scan = 152
End Sub
Size: Defines the size of the values cluster in this block. See driver documentation
for this property’s limits, according to parameters B1 to B4. By creating elements for
the block, you can access read values and write values for the device. This property
cannot be modified once communication has already started. Default value is 0.
Example:
Sub IOBlock1_BeforeStart()
Size = 10
End Sub
/ $ + #) '
DeviceHigh: Defines the highest value achieved by this element in the device. It
adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 1,000.
176 Properties
E3 - Scripts - Reference Manual
Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
DeviceLow: Defines the lowest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 0. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
are attributed to Value property. Otherwise, no adjustment in scale will be made.
Default value is False.
Properties 177
E3 - Scripts - Reference Manual
Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc.
Example:
Sub ElementodeBloco1_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
178 Properties
E3 - Scripts - Reference Manual
Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
EULow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Default value is 0. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EULow = 100
EULow = 0
End Sub
Index: Specifies this element’s position among the other elements configured by
Size property of the I/O block where it is inserted. This property’s values range from
0 to the value defined by Size, -1. (For example: If Size is 20, Index ranges from 0 to
19). This property can be modified once communication has started. Default value is
0, but when mapping the elements from a block Studio automatically adjusts Index
parameter to a specified value.
Properties 179
E3 - Scripts - Reference Manual
Example:
Sub Element_OnStartRunning()
Index = 15
End Sub
Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Element it also sets data quality. This
property is read-only. Default value is 0 (Bad Quality).
NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.
UseBitFields: If True, every time the value from Value property is modified, the
bits referring to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.
Value: Updated whenever a new device value valid reading is done, using B1-B4
parameters of the I/O Block where this element is inserted, and considering its
position on the table read via Index property. Datatype (integer, floating point,
string) depends on the driver to which the element is associated and its parameters.
This property is updated like this if I/O Block’s AllowRead property is True, and
when there are no communication errors (in this case, Quality and TimeStamp
properties are updated), according to scan time defined in Scan property. Another
way to use this property is to write values in the device; for this, just attribute a new
value to Value property or to some of the bits from Bit00-Bit031. In this case, I/O
Block’s AllowWrite property must be True.
180 Properties
E3 - Scripts - Reference Manual
This is also Block Element’s default property. So, it is not mandatory for a value
reference to a Block Element to make Value property explicit in order to access
value. In case the property is not updated, check if Index property is correctly set.
Default value is empty (no value).
Example:
Sub Button1_Click()
'Accesses and object and shows current value
'elm1 is a I/O BlockElement
Set obj = Application.GetObject("I/O
Driver1.Block1.elm1")
MsgBox "elm1's current value:" & obj.Value
'This can also be done in a different way,
'with no need to show Value property, which is default
MsgBox " elm1's current value: " & obj
End Sub
/"
/" ,
Compatibility: Controls the use of OPC default interfaces by E3’s OPC client.
The available options are: M>0 48 : normal operation (recommended): OPC
driver communicates with both DA 2.0x and 1.0a servers (preference is given to
2.0x interfaces); 9>8 9M0: forces communication with DA 1.0a pattern for
servers that support both DA 2.0x and 1.0a; and :>8 :M: forces
communication only with OPC DA 2.0x pattern.
This property cannot be modified when OPC client communication is enabled (both
in Studio and runtime).
NOTE: only as last resource should the diver be configured in a value different from
M>0 4 8 (default). This property is for advanced use only, and applies strictly
to overcoming a possible incompatibility situation with some specific OPC server.
Properties 181
E3 - Scripts - Reference Manual
Example:
Sub Driver OPC1_AfterStart()
Application.GetObject("DriverOPC1.GrupoOPC1")._
ReconnectPeriod = 0
End Sub
ServerID: Determines the server that OPC Driver connects to. This property can be
modified only when OPC Driver is not connected. If the property’s field is blank, OPC
object will not connect. Default value is empty. Example:
Sub Driver OPC1_AfterStart()
MsgBox _
Application.GetObject("DriverOPC1.GrupoOPC1").ServerID
End Sub
ServerMachine: Determines the address of the station where the OPC server is
running. For applications running locally, this property can remain blank. Otherwise,
it is necessary to specify the path. This property can only be modified when OPC
driver is disconnected. Default value is empty.
Example:
Sub Driver OPC1_AfterStart()
MsgBox Application._
GetObject("DriverOPC1.GrupoOPC1").ServerMachine
End Sub
Example:
Sub Driver OPC1_AfterStart()
MsgBox _
Application.GetObject("DriverOPC1.GrupoOPC1").ServerName
End Sub
182 Properties
E3 - Scripts - Reference Manual
The values below are only informed when ReconnectPeriod property is different
from 0. At each non-specified period passage, the status is searched in the server. In
case it is not correctly informed, the property can maintain value -1, or then
disconnection can be detected, what turns the status to 0. Values are based on the
five default types of status defined for OPC servers.
Status is searched in the server at each passage from the specified period. In case
status is not informed correctly, the property can maintain value -1; or then
disconnection can be detected, what turns the status to 0. The values are based on the
five default types of status for OPC Server.
Properties 183
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
Dim status
status = Application.GetObject("DriverOPC1").ServerStatus
MsgBox "Driver status is " & status
Select Case status
Case -1
MsgBox "OPC Driver is connected to OPC Server_
but its status was not informed"
Case 0
MsgBox "OPC Driver is not connected to OPC Server"
Case 1
MsgBox "Server runs normally"
Case 2
MsgBox "Server is not running"
Case 3
MsgBox "Server is running with no configuration_
information"
Case 4
MsgBox "Server has been temporarily suspended"
Case 5
MsgBox "Server is on Test Mode"
End Select
End Sub
NOTA: If you want this property to behave as if it were Boolean, use ServerStatus
different from 0. This causes the property to differentiate only between the existence
or not of connection, not considering more specific status from the server. Besides,
the expression will not depend on ReconnectPeriod different from 0.
/" >
184 Properties
E3 - Scripts - Reference Manual
be useful when you need to perform some operation in the tag’s OnStartRunning()
event.
DeadBand: Adjusts OPC tag’s deadband, for its updating. This parameter only
applies to group tags that are considered analog by the OPC Server the OPC Driver
is connected to. The valid interval for this property is from 0 to 100 percent. When
DeadBand is 0, it means that any variation in the value of a group tag implies in
updating this tag (considering also the group’s updating time). This percentage is
applied to each tag according to their Engineering limits (defined in OPC Server).
To update a tag, the following expression must be True (according to OPC Server):
Abs(Previously_saved_value – Current_value) > _
(DeadBand / 100) * Abs (Upper_limit – Lower_limit)
Default value is 0.
Enabled: Enables tags updating inside a OPC Group. If True, tags with
AllowRead property set to True, and AdviseType property set to 1, are kept updated
according to the group’s updating time (Scan property) and deadband (DeadBand
property). Otherwise, no tag inside OPC Group will be updated. Also, it will not be
possible to use Refresh() method.
Scan: Specifies the duration of the scan used by the server to update group tags
used by the server. This property is represented in milliseconds, and can be modified
after communication has started. It is used only when Enable property is set to True.
When you set this property in the several tags in the application, you should increase
the value of the property to those tags that do not vary very much in the device,
enabling other tags with higher priority to be read more frequently, and enhancing
general performance in the system. Default value is 1000 (1 second).
Properties 185
E3 - Scripts - Reference Manual
/"" !
Example:
Sub CommandButton3_Click()
MsgBox Application._
GetObject("Driver OPC.GrupoOPC.Tag_ OPC1").AdviseType
End Sub
AllowRead: Defines whether the tag will be read by the OPC driver. If True, the
driver automatically updates Value and Bits (00 to 31) properties from this object, in
time spans. Otherwise, the this tag will neither be read nor updated. This property
can be modified in execution. Default value is True. Example:
Sub CommandButton1_Click()
'Stops tag reading
Set obj = Application.GetObject("Driver1.tag")
obj.AllowRead = False
End Sub
AllowWrite: Defines whether the tag will be written automatically when Value or
Bits (00 to 31) properties are modified. If True, the modifications will be sent to the
device associated to the OPC driver. Otherwise, the modifications will be ignored.
Default value is True.
186 Properties
E3 - Scripts - Reference Manual
Example:
Sub Botao1_Click()
'Disables tag writing
Set obj = Application.GetObject("Driver1.tag")
obj.AllowWrite = False
End Sub
Bit00-Bit031: These properties represent the 32 bits in OPC Tag Value property’s
value, ranging from Bit00 (the least significant bit) to Bit31 (the most significant
bit). By modifying each one of these bits you will modify tag’s Value property, and
vice-versa, but this only happens when UseBitFields property is True. Default value
is False.
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
DataType: Read-only property. Determines datatype associated to this OPC tag (see
table below).
OPTION DESCRIPTION
:: R T . T Integer value
:F R T6 . Unsigned integer value.
K9PI > T0 . Integer value array.
K9PL R T0 . 32-bit signed integer value one-dimensional array.
K9P R T0 . 32-bit floating-point value one-dimensional array.
K9PO > T0 = ," 64-bit floating-point value one-dimensional array.
K9PK R T0 , $ 4 Currency value one-dimensional array.
K9PP R T0 = Date/hour value one-dimensional array.
K:MM R T0 . Text (string) value one-dimensional array.
K:M9 R T0 "#$ Generic object value one-dimensional array.
K:M: R T0 ! Error code value unidimensional array.
K:MF R T0 Boolean value (True/False) one-dimensional array.
K:MI R T0 8 Variant value one-dimensional array.
K:ML R T0 6 ( "#$ Unknown object value one-dimensional array.
K:M R T0 = $ 96-bit floating-point value one-dimensional array.
K::K R T0 $ + Record value one-dimensional array.
K:MK R T0 2 8-bit signed integer value one-dimensional array.
K:MP R T0 4 8-bit unsigned integer value one-dimensional array.
K:9M R T0 5 + 32-bit integer value one-dimensional array.
K:99 R T0 =5 + 32-bit integer value one-dimensional array.
K:9: R T0 . . 16-bit integer value one-dimensional array.
K:9F R T0 ==5 + 32-bit signed integer value one-dimensional array.
K:9I R T0 . T 16-bit signed integer value one-dimensional array.
K:9L R T0 6 . Unsigned integer value one-dimensional array.
DeviceHigh: Defines the highest value achieved by this tag in the device. Adjusts
the value scale from the device before being attributed to Value property. Likewise,
the inverse operation is done before sending the value to the driver, when writing.
This conversion happens only when EnableScaling property is True. Default value is
1,000.
188 Properties
E3 - Scripts - Reference Manual
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
DeviceLow: Defines the lowest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 0.
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
Properties 189
E3 - Scripts - Reference Manual
EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc. Default value is empty. Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
190 Properties
E3 - Scripts - Reference Manual
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
EuLow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Default value is 0.
Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EULow = 100
EULow = 0
End Sub
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in scale.
That is, they represent the bits from the value read by the equipment before the
conversion.
ItemID: Determines the path identifying OPC tag on the server, which OPC
Driver connects to. Path definition is flexible, and depends on the specific server.
Usually, servers specify an ID space with hierarchical items, such as
Properties 191
E3 - Scripts - Reference Manual
Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Tag it also sets data quality. This property is
read-only. Default value is 0 (Bad Quality).
NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.
SyncWrite: Determines the type of writing used by an OPC tag. If True, writing
is synchronous, that is, OPC Driver waits for the writing result from the server.
Otherwise, writing is asynchronous, that is, OPCTag value is sent and OPC Driver
processing will continue immediately. Default value is False.
UseBitFields: If True, every time the value from Value property is modified, the
bits referent to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.
NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.
192 Properties
E3 - Scripts - Reference Manual
Value: Contains current tag value. This property’s updating control (reading) is
made by AllowRead and AdviseType properties in the tag, as well as by Enabled,
Scan, and DeadBand properties in the tag’s OPC group. This property is a Variant,
and its subtype (informed by DataType property) varies according to its definition in
the OPC Server. In the event of communication reading errors, this property will
assume either null or the last known value. Since it is OPC tag’s default property, it
does not need explicit specification to be referred to. Default value is empty.
Example:
Sub Botao1_Click()
'Accesses a tag and shows its current value
'tag1 is an OPCTag
Set obj = Application._
GetObject("Driver de_ Comunicação1.tag1")
MsgBox "Tag1’s current value: " & obj.Value
'does not show Value property, since it is default
MsgBox " Tag1’s current value: " & obj
End Sub
Properties 193
E3 - Scripts - Reference Manual
/"$ + #
Example:
Sub CommandButton3_Click()
MsgBox Application._
GetObject("DriverOPC.GrupoOPC.SCRIPT1").AdviseType
End Sub
AllowRead: Defines whether the block will be read by the OPC driver. If True,
the driver automatically updates Value and Bits (00 to 31) properties from OPC
block, in time spans. Otherwise, the OPC block will neither be read nor updated.
This property can be modified in execution. Default value is True. Example:
Sub Botao1_Click()
'Stops tag reading
Set obj = Application.GetObject("Driver1.tag")
obj.AllowRead = False
End Sub
AllowWrite: Defines whether the tag will be written automatically when Value or
Bits (00 to 31) properties are modified. If True, the modifications will be sent to the
device associated to the OPC driver. Otherwise, the modifications will be ignored.
Default value is True.
194 Properties
E3 - Scripts - Reference Manual
Example:
Sub Botao1_Click()
Set obj = Application.GetObject("Driver1.tag")
obj.AllowWrite = False
End Sub
Properties 195
E3 - Scripts - Reference Manual
OPTION DESCRIPTION
K:MF R T0 Boolean value (True/False) one-dimensional array.
K:MI R T0 8 Variant value one-dimensional array.
K:ML R T0 6 ( "#$ Unknown object value one-dimensional array.
K:M R T0 = $ 96-bit floating-point value one-dimensional array.
K::K R T0 $ + Record value one-dimensional array.
K:MK R T0 2 8-bit signed integer value one-dimensional array.
K:MP R T0 4 8-bit unsigned integer value one-dimensional array.
K:9M R T0 5 + 32-bit integer value one-dimensional array.
K:99 R T0 =5 + 32-bit integer value one-dimensional array.
K:9: R T0 . . 16-bit integer value one-dimensional array.
K:9F R T0 ==5 + 32-bit signed integer value one-dimensional array.
K:9I R T0 . T 16-bit signed integer value one-dimensional array.
K:9L R T0 6 . Unsigned integer value one-dimensional array.
ItemID: Determines the path identifying OPC block on the server to which OPC
Driver is connected. Path definition is flexible, and depends on the specific server.
Usually, servers specify an ID space with hierarchical items, such as
“ParentItem.ChildItem.Tag1”. ItemID works as a unique “key” for data, and it is
considered “where”, or “what” allows OPC server to connect to data source.
Although default value is empty, it is necessary to specify some value for OPC block
to be valid. Example:
Sub Bloco OPC1_OnStartRunning()
MsgBox ItemID
End Sub
Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Block it also sets data quality. This property
is read-only. Default value is 0 (Bad Quality).
NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.
196 Properties
E3 - Scripts - Reference Manual
Size: Defines the size of value cluster in this block. See driver documentation for
this property’s limits according to B1 to B4 properties. By creating elements for the
block, it allows both accessing read values and writing values for the device. This
property cannot be modified once communication has started. Default value is 0.
Example:
Sub Bloco OPC1_OnStartRunning()
Size = 12
End Sub
/". + #) '
Bit00-Bit031: These properties represent the 32 bits in OPC block element Value
property’s value, ranging from Bit00 (the least significant bit) to Bit31 (the most
significant bit). By modifying each one of these bits you will modify element’s
Value property, and vice-versa, but this only happens when UseBitFields property is
True. Default value is False.
DeviceHigh: Defines the highest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 1,000. Example:
Properties 197
E3 - Scripts - Reference Manual
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
DeviceLow: Defines the lowest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 0. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
198 Properties
E3 - Scripts - Reference Manual
EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
are attributed to Value property. Otherwise, no adjustment in scale will be made.
Default value is False. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
Properties 199
E3 - Scripts - Reference Manual
EULow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub
200 Properties
E3 - Scripts - Reference Manual
Index: Specifies this element’s position among the other elements set by Size
property from the OPC block where it is inserted. This property’s values range from
0 to the value defined by Size, minus 1. (For example: If Size is 20, Index ranges
from 0 to 19). This property can be modified once communication has started.
Default value is 0, but when mapping the elements from a block Studio
automatically adjusts Index parameter to a specified value. Example:
Sub Elemento1_OnRead()
MsgBox Index
End Sub
Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Element it also sets data quality. This
property is read-only. Default value is 0 (Bad Quality).
NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.
UseBitFields: If True, every time the value from Value property is modified, the
bits referent to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.
Value: Updated whenever a new value is read at OPC Server, according to the
specifications of ItemID property of the OPC block where this element is inserted,
and taking into consideration Index property (which specifies element position in
OPC Server). Property’s datatype (integer, floating point, string, etc) depends on the
driver to which the element is associated and its parameters.
This property is updated like this if OPC Block’s AllowRead property is True, and
according to scan time defined in Scan property of the OPC Block that contains the
element. If OPC Block’s AllowWrite property is True, you can write values in the
device simply by attributing a new value to Value property.
This is also OPC Block Element’s default property. So, it is not mandatory for a
value reference to an OPC Block Element to make Value property explicit in order
to access value. In case the property is not updated, check if Index property is
correctly set (its value must be zero up to OPC block’s size minus one).
Example:
Properties 201
E3 - Scripts - Reference Manual
Sub Botao1_Click()
'Accesses an element and shows current value
'elm1 é is an OPC block Element
Setobj = Application.GetObject_
("OPCDriver1.Group1.OPCBlock1.elm1")
MsgBox " elm1’s current value: " & obj.Value
'This can also be done in a different way,
'with no need to show Value property, which is default
MsgBox " elm1’s current value: " & obj
End Sub
Property Quality
Quality: Represents value quality status. E3 uses OPC pattern to inform this
property. The field is formed by a 16-bit word, and the 8 first bits are defined in
three bit fields: Quality, Substatus, and Limit, arranged like this: QQSSSSLL.
Quality can be: bad, uncertain, or good (see following table). Substatus contains
additional information about Quality. Limit indicates diagnosis information. Servers
that cannot support these types of information return 0 in the corresponding bits.
The other 8 bits (of a higher order) are available for use from each manufacturer. If
those bits are used, default quality bits are still used to indicate which deductions can
be made over the returned data. So, it is the client’s responsibility to interpret the
specific quality information field to make sure the server providing this information
uses the same “rules” as the client.
OPC drivers or servers that do not support quality information always return 192
value (good quality). It is also acceptable for a server to simply return bad (0) or
good (192) quality, and not to pass out any substatus or limit information in bits.
A list with possible values for Quality, as well as their meaning, can be seen in the
following tables.
Quality Field
BAND QUALITY DESCRIPTION
MR F BAD Value cannot be used for the reasons indicated
in substatus.
I R 9:O UNCERTAIN Value’s quality is uncertain for the reasons
indicated in substatus.
9:K R 9P9 (Reserved) Not used in OPC pattern.
9P: > :LL GOOD Value’s quality is good
202 Properties
E3 - Scripts - Reference Manual
Limit Field
SPECIFICATIONS DESCRIPTION
; + The value is free to move up or down
+ The value has “pegged” at some lower limit
E.2 + The value has “pegged” at some high limit
The value is a constant and cannot move
Constant
Limited
Limited
Limited
High
Low
Not
; > '$ $ The value is bad, but no specific 000 001 002 003
reason is known.
., There is some server specific 004 005 006 007
! problem with the configuration. For
example, the item is question has
been deleted from the
configuration.
; $+ The input is required to be logically 008 009 010 011
connected to something but it is
not. This quality may reflect that no
value is available at this time, for
reasons like the value may have not
been provided by the data source.
= &$ 1 , A device failure has been detected. 012 013 014 015
1 , A sensor failure has been detected 016 017 018 019
(Limit field may provide additional
information).
Properties 203
E3 - Scripts - Reference Manual
Constant
Limited
Limited
Limited
High
Low
Not
; > '$ $ There is no specific reason why the 064 065 066 067
value is uncertain.
6 " Whatever was writing this value has 068 069 070 071
8, stopped doing so. The returned value
should be regarded as “stale”. Note that
this differs from a BAD value with
Substatus 5 (Last Known Value). That
status is associated specifically with a
detectable communications error on a
“fetched” value. This error is associated
with the failure of some external source
to “put” something into the value
within an acceptable period of time.
Note that the “age” of the value can be
determined from the TIMESTAMP in
OPCITEMSTATE.
;/0 Not used by OPC 072 - 079
; Either the value has “pegged” at one of 080 081 082 083
0$
$, the sensor limits (in which case the
limit field should be set to 1 or 2) or the
sensor is otherwise known to be out of
calibration via some form of internal
diagnostics (in which case the limit
field should be 0).
!. . The returned value is outside the limits 084 085 086 087
6 defined for this parameter. Note that in
!%$ + + this case the “Limits” field indicates
which limit has been exceeded but does
NOT necessarily imply that the value
cannot move farther out of range.
,">; The value is derived from multiple 088 089 090 091
sources and has less than the required
number of Good sources.
;/0 Not used by OPC 092 – 127
204 Properties
E3 - Scripts - Reference Manual
Low Limited
Not Limited
Constant
Limited
High
; > ' $ $ The value is good. There are no 192 193 194 195
special conditions
;/0 Not used by OPC 196 – 215
$ & + The value has been Overridden. 216 217 218 219
Typically this is means the input
has been disconnected and a
manually entered value has been
“forced”
;/0 Not used by OPC 220 - 255
/$ , ' !
Enabled: Defines whether demo tag variation is activated. If True, demo tag will
update Value property according to the settings in Period and Scan properties.
Otherwise, variation is disabled. Default value is True. Example:
Sub CommandButton1_Click()
Application.GetObject("Dados.TagDemo1").Enabled = True
End Sub
Properties 205
E3 - Scripts - Reference Manual
Example:
Sub CommandButton2_Click()
'When clicking the button, a message box is open,
'indicating TagDemo6's Minimum property value
MsgBox Application.GetObject("Dados.TagDemo6").Minimum
End Sub
Period: Defines wave shape length, in milliseconds. Does not apply when Type
property is set to either M> + or F> , - . Default value is 10,000 ms.
Example:
Sub Tag Demo1_OnStartRunning()
Period = 1000
End Sub
Scan: Defines time interval between two variations from Value property, in
milliseconds. Use this property to have a greater or smaller amount of data generated
by tag demo. Default value is 1,000. Scan value should be over 0.
Example:
Sub Linha1_Click()
Application.GetObject("Dados.TagDemo2").Scan = 200
End Sub
206 Properties
E3 - Scripts - Reference Manual
Type: Defines tag’s wave type. Modify this property according to the table below.
When Type is set to 3 (CurrentTime), Value property will contain current timestamp from
the server.
M Random
9 Sine
: Square
F N/A CurrentTime
I RampUp
L RampDown
RampUpDown
Example:
Sub Line1_Click()
Application.GetObject("Dados.TagDemo2").Type = 2
End Sub
Value: Varies according to the type of wave shape in Type property. This is a
read-only property. Default value is 0. Example:
Sub CommandButton1_Click()
MsgBox Application.GetObject("Dados.TagDemo2").Value=10
End Sub
/. !
Quality: Informs about the quality of the value in Value property. This property is
write/read, but whenever Internal Tag’s value is modified (be it by a script or an
association), it will be updated accordingly. Example:
Sub CommandButton1_Click()
MsgBox Application.GetObject("Dados.TagInterno1").Quality
End Sub
For further information on quality, see the topic “Quality” in the User’s Manual.
Properties 207
E3 - Scripts - Reference Manual
NOTE: This property is valid only for internal tags within the Server. Internal tags
within the Viewer cannot be retentive.
Value: Value property is a Variant type, which allows storing values of every and
any type, from an integer to objects’ references. Use it to store values inside the
Viewer or the Server, and to exchange data among the several points of its
application. Default value is empty. This property is read/write. Example:
Sub Months_OnStartRunning()
'Months is an InternalTag.
'Uses the event to initialize the vector.
Value = Array("January","February", "March", _
"April", "May", "June", "July", "August", _
"September", "October", "November", "December")
End Sub
208 Properties
E3 - Scripts - Reference Manual
//
NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,
each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adopted for properties in this manual,
when necessary.
Caption: Defines the title to be used on the title bar when this Screen is shown in
Viewer.
FillStyle: Defines Screen fill style. The following table shows the valid values
for this property:
Properties 209
E3 - Scripts - Reference Manual
Example:
Sub Tela1_Click()
'Switches background color to blue
ForegroundColor = RGB(0, 0, 255)
End Sub
Frame: Returns the object’s parent frame. This property is available in runtime
only.
GradientStyle: Specifies the Screen’s gradient fill style. Used only when
FillStyle is set to 8 (gradient). Gradient ranges from ForegroundColor to
BackgroundColor.
210 Properties
E3 - Scripts - Reference Manual
HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.
Layer: Shows objects on the Screen, according to the layers they are in. For
Screen objects, you can define up to 32 layers, so that they can be clustered logically
(e.g.: hydraulic layer objects, electric layer objects etc.), and shown/hidden just by
modifying the mask of the Screen’s Layer property. For the object to appear on the
Screen, Layer property should contain at least 1 bit set at the same position where
the Screen layer is.
NOTE: Object’s visibility depends on three factors: Visible property set to True;
parent-object visible; and object’s Layer property present in Screen Layer.
MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.
Properties 211
E3 - Scripts - Reference Manual
Screen: Returns the object’s parent Screen. This property is available in runtime
only.
TabStop: Determines whether TAB key can be used in the system. If True,
-0 key use is enabled. Otherwise, the key cannot be used.
212 Properties
E3 - Scripts - Reference Manual
/0 1 '
/0 1 ' -
Caption: Defines the title to be used on the title bar when this frame is shown in
Viewer.
/0
Border: If True, enables splitter border. Otherwise, the splitter will have no
border. Default value is True.
IsHTML: Returns True if the splitter has HTMLs inserted in it. Otherwise, it
returns False.
Resizable: Determines how the frame/splitter will be split. If True, the options
for horizontal and vertical split are enabled. Otherwise, they are disabled.
SplitPosition: Indicates splitter position on Screen. The value in the field is used
to identify the splitter. Example:
Sub CommandButton1_Click()
Application.GetFrame("Divisor1").SplitPosition
End Sub
SplitType: Determines splitter orientation on frame. You can orient them as the
following:
Properties 213
E3 - Scripts - Reference Manual
Example:
Sub Divisor1_Click()
SplitType = 1
End Sub
SplitUnit: Determines which split unit is used to set frame split. You can specify this
unit either in pixels or in percentage.
/6
In this topic, the properties of the following Screen Objects are listed: Line,
Rectangle, Round Rectangle, Ellipse, Arc, Freehand, Polygon, Curved Polygon,
Picture, Text, Display, SetPoint, and Scale. Also listed here are the properties of
the object Group, and of Linear and Rotation Sliders. The properties listed below
do not apply to the following objects: ActiveX (MS Forms), E3Chart, E3Browser,
and E3Alarm. These will be explained later, in specific chapters for these objects.
214 Properties
E3 - Scripts - Reference Manual
/6 ''
NOTE: The following properties are common to all objects listed above, including
object Group and sliders.
Frame: Returns the object’s parent frame. This property is available in runtime
only.
HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.
Layer: Shows objects on the Screen, according to the layers they are in. For
Screen objects, you can define up to 32 layers, so that they can be clustered logically
(e.g.: hydraulic layer objects, electric layer objects etc.), and shown/hidden just by
modifying the mask of the Screen’s Layer property. For the object to appear on the
Screen, Layer property should contain at least 1 bit set at the same position where
the Screen layer is.
MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.
Screen: Returns the object’s parent Screen. This property is available in runtime
only.
Tip: Shows a popup text when the mouse is over the execution object for a brief
moment. Example:
Properties 215
E3 - Scripts - Reference Manual
Visible: Defines the object’s visibility. If True, the object is visible, as long as the
following factors are also present: visible object’s parent-object, and object’s Layer
property present on Screen layer.
/6 , 2 ''
NOTE: The following properties are common to all Draw Screen Objects (Line,
Rectangle, Round Rectangle, Ellipse, Arc, Freehand, Polygon, and Curved Polygon)
and Text Screen Objects (Text, Display, and SetPoint).
Angle: Defines the rotation angle (in degrees and counterclockwise) the object
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The object will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).
BorderColor: Specifies the object’s border color. Used only in case BorderStyle
property is not set to 5 (null value), because in this case the object has no border.
216 Properties
E3 - Scripts - Reference Manual
Effect3D: Determines 3D effect on the selected object. The options available for
this property are:
Properties 217
E3 - Scripts - Reference Manual
FillStyle: Defines object fill style. The following table shows the valid values for
this property:
to compose the color to be associated to this property. Default value is blue (RGB
(0, 0, 255)), except for the objects Display and SetPoint, whose default value for this
property is white (RGB (255, 255, 255)). Example:
Sub Botao1_Click()
'Foreground color is green
'when object is clicked
ForegroundColor = RGB(0, 255, 0)
End Sub
GradientStyle: Specifies the object’s gradient fill style. Used only when FillStyle
is set to 8 (gradient). Gradient ranges from ForegroundColor to BackgroundColor.
IMPORTANT: Too many objects using gradient on Screen imply in damaging both
performance and Screen updating. The use of figures instead can solve the problem.
Properties 219
E3 - Scripts - Reference Manual
Example:
Sub Botao1_Click()
'Object gets gradient
FillStyle = 8 'GradientFill
GradientStyle = 0 'leftToRight
End Sub
HorizontalFillStyle: Defines the style of the object’s horizontal fill. Works jointly
with HorizontalPercentFill property, which tells the percentage of the object to be
filled. These two properties then can simulate level filling like, for example, in a
tank The table below shows the available options for this property.
Example:
Sub Circulo1_OnStartRunning()
HorizontalFillStyle=2
End Sub
Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.
ShadowColor: Specifies the object’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)).
220 Properties
E3 - Scripts - Reference Manual
Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub
ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.
Example:
Sub Botao1_Click()
ShadowY = 250
End Sub
VerticalFillStyle: Defines the style of the object’s vertical fill. Works jointly with
VerticalPercentFill property, which tells about the object’s percentage to be filled.
The table below shows the available options for this property.
Example:
Sub Circulo1_OnStartRunning()
VerticalFillStyle= 2
End Sub
Properties 221
E3 - Scripts - Reference Manual
Example:
Sub Circulo1_OnStartRunning()
VerticalPercentFill= 254
End Sub
/ 6" !
/ 6$
ArcBeginAngle: Sets the object arc’s initial angle, in degrees. This property
ranges from 0 to 359. Both arc style and arc shape depend also on ArcEndAngle and
ArcStyle properties. Default value is 0. Example:
Sub CommandButton9_Click()
Screen.Item("Arco1").ArcBeginAngle = 12
End Sub
ArcEndAngle: Sets the object arc’s end angle, in degrees. This property ranges
from 0 to 359. Both arc style and arc shape depend also on ArcBeginAngle and
ArcStyle properties. Default value is 270.
222 Properties
E3 - Scripts - Reference Manual
Example:
Sub CommandButton9_Click()
Screen.Item("Arco1").ArcEndAngle = 12
End Sub
ArcStyle: Specifies the object’s border style. The border is drawn according to
the defined style, using the color specified by BorderColor property, and the width
specified by BorderWidth property. The table below shows the valid values for this
property.
Example:
Sub CommandButton9_Click()
Screen.Item("Arco1").ArcStyle = 1
End Sub
/ 6. :, -:
EnableLimits: Checks for limits in the text. If True, and the user inserts a non-
number value, or a value outside the limits defined by MinValue and MaxValue
properties, an Error message is displayed (IsSetPoint property must be True).
Example:
Sub CommandButton1_Click()
Screen.Item("Texto1").EnableLimits = _
Not(Screen.Item("Texto1").EnableLimits)
End Sub
Format: Specifies the type of format to be attributed to the object. It allows changing
the way data is presented without changing their value. You can edit this property
manually, or set it through the formatting window. Its use is similar to format codes on
spreadsheets, following the same basic syntax. The following datatype are supported:
Properties 223
E3 - Scripts - Reference Manual
IsSetPoint: Determines whether the object allows editing Value property. Value
property is a variant (it can assume any and every type of value) exhibited by Text
object. If True, editing is allowed; otherwise, it is not. It can be viewed when Viewer
object is running. Default value is False.
MaxLimits: Contains the maximum value allowed for the object (EnableLimits
property must be True). Example:
Sub CommandButton3_Click()
Screen.Item("Texto1").MaxLimit=Screen.Item("Texto6").Value
End Sub
MinLimits: Contains the minimum value allowed for the object (EnableLimits
property must be True). Example:
Sub CommandButton2_Click()
Screen.Item("Texto1").MinLimit= Screen.Item("Texto5").Value
End Sub
Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False. Example:
Sub Tela1_OnStartRunning()
Screen.Item("TextBox1").Multiline=True
End Sub
224 Properties
E3 - Scripts - Reference Manual
When the typed text is sent by the SetPoint, it will first try to convert the value to the
set type (Word, String, Double etc.). If conversion is not possible—that is, the typed
value is not valid for the chosen type—no value is sent (e.g., if the user types “-1”,
and the type is Byte). But when property value is 0-stCurrentType, the datatype sent
by the SetPoint comes from the previous value present in the object. In case it is
empty, or null, no conversion will be made, and typed value will be sent as text.
Example:
Sub Combobox1_Change()
Screen.Item("Texto1").SetPointDataType=CInt(Left(Value,2))
End Sub
StretchText: Resizes object type. When enabled, the object automatically resizes
text font size so that the area the object occupies always remains the same.
Otherwise, if the property is set to False, no resizing will take place.
Properties 225
E3 - Scripts - Reference Manual
TextColor: Specifies font color in the text. Use VBScript’s RGB() function to
compose the color to be associated to this property. Default value is black (RGB(0,
0, 0)).
TextFont: Defines the type of font to be used in the object. This property cannot be
used in scripts and/or associations, and it is configured only via Studio.
Value: Value property is a variant (it can assume any and every type of value)
exhibited by the object. Usually this property contains text, because it is
automatically filled when the creation of a new Text object occurs. IsSetPoint
property determines whether the object allows the edition of Value property.
Example:
Sub DrawString1_OnStartRunning()
'Reads tag value and displays a Text
Dim obj
Set obj = Application.GetObject("DataServer1.DemoTag1")
Value = "Valor de DemoTag1 = " & obj.Value
End Sub
WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.
/ 6/
Filename: Defines the filename of the picture associated to this object. Filepath
could be either the complete filepath on disk or the path related to the application
(when picture file is inserted as an application resource). Default value is null. The
following types of figure file are supported:
PROPERTY FILTER DESCRIPTION FILTER
Bitmap file BMP No Yes
Graphics Interchange GIF No Yes
Format
Joint Picture Expert JPG No Yes
Group
Icon File ICO No Yes
HorizontalFillStyle: Defines the style of the object’s horizontal fill. Works jointly
with HorizontalPercentFill property, which tells the percentage of the object to be
filled. These two properties then can simulate level filling like, for example, in a
tank The table below shows the available options for this property.
Properties 227
E3 - Scripts - Reference Manual
Example:
Sub Circulo1_OnStartRunning()
HorizontalFillStyle=2
End Sub
Example:
Sub Circulo1_OnStartRunning()
HorizontalPercentFill=200
End Sub
Example:
Sub DrawPicture1_Click()
'When clicking the object sets
'Override mode to solid and changes
'picture fill color to blue
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
228 Properties
E3 - Scripts - Reference Manual
Example:
Sub DrawPicture1_Click()
'Ao clicar no objeto seta o modo
'Override para sólido e troca a cor de
'preenchimento da imagem para azul
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.
ShadowColor: Specifies the object’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
Properties 229
E3 - Scripts - Reference Manual
color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)). Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
230 Properties
E3 - Scripts - Reference Manual
Example:
Sub DrawPicture1_Click()
'Turns image blue color transparent
'when Picture is clicked
TransparentMode = 1 'ByColor
TransparentColor = RGB(0, 0, 255)
End Sub
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).
Properties 231
E3 - Scripts - Reference Manual
VerticalFillStyle: Defines the style of the object’s vertical fill. Works jointly with
VerticalPercentFill property, which tells about the object’s percentage to be filled.
The table below shows the available options for this property.
Example:
Sub Circulo1_OnStartRunning()
VerticalFillStyle= 2
End Sub
/ 60
Angle: Defines the rotation angle (in degrees and counterclockwise) the object
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The object will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).
232 Properties
E3 - Scripts - Reference Manual
Example:
Sub Escala1_Click()
BorderStyle = 1
End Sub
Properties 233
E3 - Scripts - Reference Manual
FillStyle: Defines object fill style. The following table shows the valid values for
this property:
Format: Specifies the type of format to be attributed to the object. It allows changing
the way data is presented without changing their value. You can edit this property
manually, or set it through the formatting window. Its use is similar to format codes on
spreadsheets, following the same basic syntax. The following datatype are supported:
234 Properties
E3 - Scripts - Reference Manual
GradientStyle: Specifies the object’s gradient fill style. Used only when FillStyle
is set to 8 (gradient). Gradient ranges from ForegroundColor to BackgroundColor.
IMPORTANT: Too many objects using gradient on Screen imply in damaging both
performance and Screen updating. The use of figures instead can solve the problem.
Example:
Sub Botao1_Click()
'Object gets gradient
FillStyle = 8 'GradientFill
GradientStyle = 0 'leftToRight
End Sub
LineColor: Determines the color of the line with the scale’s ticks and minor
ticks. To determine the color of the subtitle with the numbers, use TextColor
property. Default value is black (RGB (0, 0, 0)).
Properties 235
E3 - Scripts - Reference Manual
MinorTicks: Determines the number of minor ticks on the scale. Default value is 3.
Example:
Sub CommandButton1_Click()
'shows the total amount of minor ticks on the scale
MsgBox CStr(Screen.Item("Escala1").MinorTicks)
End Sub
Example:
Sub CommandButton1_Click()
Screen.Item("Escala1").ScaleAlignment=1
End Sub
236 Properties
E3 - Scripts - Reference Manual
StretchText: Applies stretch to the text in the object (whenever height or width vary,
the text box follows the alteration). If True, the text stretches to accommodate to the
object’s new dimensions. Otherwise, text maintains its original settings. Default value is
False.
TextColor: Determines the color of the font applied to the numbers subtitle on
the Scale. To determine the color of the line with the ticks and minor ticks, use
LineColor property. Default value is black (RGB (0, 0, 0)).
TextFont: Determines font to be applied in the Scale. This property cannot be used
in scripts and/or associations, and it is configured only via Studio.
/ 66 >
Angle: Defines the rotation angle (in degrees and counterclockwise) the group
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The group will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).
Otherwise, each object in the group will present its original line color. Default value
is False.
OverrideFillMode: Specifies fill mode of the objects inside the group. Alters original
fill mode without altering the original settings for filling objects. The table shows the valid
values for OverrideFillMode:
Example:
Sub DrawGroup1_Click()
'when clicking the object sets
'Override Mode to solid and changes fill color
'to blue
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub
instead of their original color. Use VBScript’s RGB() function to compose the color
to be associated to this property. Default value is red (RGB(255, 0, 0)). Example:
Sub Grupo1_Click()
OverrideLineColor = RGB (255,0,0)
End Sub
Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.
ShadowColor: Specifies the group’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)). Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub
ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.
/ 67 ?4 @
Angle: Defines the rotation angle (in degrees and counterclockwise) the object
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The object will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).
Properties 239
E3 - Scripts - Reference Manual
OverrideFillMode: Specifies fill mode on the object being slided. Alters original fill
mode without altering the original settings for filling objects. The table shows the valid
values for OverrideFillMode:
240 Properties
E3 - Scripts - Reference Manual
Example:
Sub DrawGroup1_Click()
'when clicking the object sets
'Override Mode to solid and changes fill color
'to blue
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub
Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.
ShadowColor: Specifies the object’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)).
Properties 241
E3 - Scripts - Reference Manual
Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub
ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.
Value: Slide’s initial value. It must be a value between the values set in
RangeMax and RangeMin properties.
242 Properties
E3 - Scripts - Reference Manual
/6 <
Example:
Sub CommandButton1_Click()
Screen.Item("DynamicMove1").RotationDirection = 1
End Sub
/7 8
NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,
each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adopted for properties in this manual,
when necessary.
/7 ''
Enabled: Enables/disables the object, that is, the focus and the answer to events
generated by the user. If True, the object has focus, responds to events generated by
the user, and will be available via scripts (default). Otherwise, the user cannot
interact with the object by using the mouse, pressing keys, or shortcuts, and the
object is then faded. Besides, if the object displays a bitmap, this bitmap is faded
every time whenever the object is disabled.
Properties 243
E3 - Scripts - Reference Manual
Frame: Returns the object’s parent frame. This property is available in runtime
only.
HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.
Layer: Defines on which layers the object should appear. The value represents a
32-bit mask (a bit per layer), being possible to define up to 32 individual layers. So,
objects can be logically grouped and displayed/hidden just by modifying Layer’s
property mask. At least one of the object’s layers has to be visible for it to be
displayed on Screen; that is, at least 1 bit set at the mask has to be also set at
Screen’s Layer property.
244 Properties
E3 - Scripts - Reference Manual
An image file can be selected to be used at mouse pointer in two different ways: via
Property Window (.cur or .ico extensions); or via scripts, by using LoadPicture()
method to specify name and path of the file with the personalized icon (.cur
extension only). Example:
Sub CommandButton1_Click()
' Atribuindo o item 99-fmMousePointerCustom à propriedade
' para que ela aceite a customização do ícone do mouse
Screen.Item("CheckBox1").MousePointer=99
Screen.Item("CheckBox1").MouseIcon=LoadPicture("C:\a.cur")
End Sub
MousePointer: Specifies the type of mouse pointer displayed when the user
places it over an object. The available options are:
Properties 245
E3 - Scripts - Reference Manual
Use this property to indicate functionality alterations as the mouse pointer slides
over the objects on the Screen. For example, an hourglass shaped pointer (option 11)
is useful to indicate that the user should wait for the process or operation to be
finished. Some icons may vary, depending on the system’s configuration, like the
icons associated to the work area themes.
TabStop: Sets the use of -0 key in the system. If True, it is possible to use
the key; otherwise, it cannot be used.
246 Properties
E3 - Scripts - Reference Manual
Tip: Shows a popup text whenever the mouse is briefly over an object that is
running. Example:
Sub RetanguloArr1_MouseUp(nButton, nShiftState, x, y)
Tip= "This is a test!"
End Sub
Visible: Defines the object’s visibility. If True, the object is visible, as long as the
following factors are also present: visible object’s parent-object, and object’s Layer
property present on Screen layer.
/7 #+ +
Alignment: Specifies the object's alignment on the Screen relating to its legend. The
available options are: M> 0 . = aligns the legend to the object’s left;
9> 0 . .2 = aligns the legend to the object’s right.
AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the objects CheckBox and OptionButton, if the property is True, the text
will be resized to fit the object’s current size.
BackStyle: Defines the object’s background style. The available options are:
M> $( 4- ' : the object’s background is transparent, with no
drawing; and e 9> $( 4 ' Q, (default): the object’s background is
opaque, with some kind of drawing.
NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.
Properties 247
E3 - Scripts - Reference Manual
Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.
NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.
Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture. Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub
248 Properties
E3 - Scripts - Reference Manual
TextAlign: Specifies how the text is aligned in the object. The options available
are:
Properties 249
E3 - Scripts - Reference Manual
TripleState: Determines up to three value status for the object. If True, the user
can choose from three status option: False, True, or Null. Null state is displayed with
a shaded button. Otherwise, the user can only choose from the Values True or False.
Default value is False.
Value: Indicates the object’s initial value. Its behavior is Boolean; if True, its
initial status is checked, otherwise it will start unmarked. Default value is False.
WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.
/ 7" ' +
AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object ComboBox, if the property is True, the text will be resized to fit
the object’s current size.
BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 9 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing.
NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.
250 Properties
E3 - Scripts - Reference Manual
BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 1 - fmBorderStyleSingle. Default
value is black (RGB (0,0,0)).
BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.
BoundColumn: Establishes the column where data are stored on the list. For
example, if each line has 8 items, and BoundColumn property is 3, the system stores
information on the third column of the line currently selected. If value is 0, it is
passed to the object’s ListIndex property. If value is 1 or higher, the indicated data is
attributed to the column referring to the value specified in the property. Columns are
numbered from 1.
NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.
CanPaste: Specifies whether transference area contains the data the object
supports. If True, the object can receive information pasted from transference area.
However, if the data in this area are in a format the object does not support, the
property is False. This property is available in runtime only.
Column: Specifies object’s line and column. If only column value is specified,
Column property reads or writes the column specified on the object’s current line.
For example, MyComboBox.Column(3) reads or writes the object’s third column.
This property is available in runtime only.
Properties 251
E3 - Scripts - Reference Manual
CurTargetX: Returns the text insertion horizontal position in the object. This
position is measured in HIMETRIC units. You can use either CurTargetX or CurX
properties to move the insertion point in a text as the user passes over the object’s
content. When the user moves the insertion point to another line in the text,
CurTargetX property specifies the most appropriate position for the text’s insertion
point. CurX property is defined in this value, if the text line is bigger than the value
of CurTargetX. Otherwise, CurX property is defined as the text line end. This
property is available in runtime only.
NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.
CurX: Specifies current text insertion horizontal position in the object. This
property is applied in an object with many lines, that is, whenever Multiline property
is enabled. The return value is valid when the object has focus. You can use either
Multiline or CurX properties to place the text insertion point as the user passes over
the object’s content. When the user moves the insertion point to another line in the
text, CurTargetX property specifies the most appropriate position for the text’s
insertion point. CurX property is defined in this value, if the text line is bigger than
the value of CurTargetX. Otherwise, CurX property is defined as the text line end.
This property is available in runtime only.
252 Properties
E3 - Scripts - Reference Manual
Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.
HideSelection: Specifies whether the selected text is still highlighted when the
object does not have focus anymore. If True, the selected text only remains
highlighted in case the object has focus. Otherwise, the object will always appear
highlighted, regardless of the presence of focus in the object. Default value is True.
NOTE: This property applies only to applications written in Asian languages, and is
ignored in other applications. It was maintained in the program for compatibility
reasons with the default specifications for Microsoft Forms objects.
Properties 253
E3 - Scripts - Reference Manual
List: Returns or defines column and row entries on the object’s list. Column and
row numbering starts at zero; it means that the number of the first column and of the
first row on the list are zero, the second column and row are 1, and so forth. This
property is available in runtime only.
ListCount: Returns the number of items in the object’s list. This property is
available in runtime only.
ListIndex: Identifies the item currently selected on the list (index). The values of
this property go from -1 to the total amount of rows in a list minus one (that is,
ListCount - 1). When no row is selected, ListIndex returns -1. When the user selects
a row in a Combo Box, the system defines the value of ListIndex property. The list’s
first row value of this property is 0, the second row value is 1, and so forth. This
property is available in runtime only.
ListRows: Determines the maximum amount of rows on the object’s list. Default
value is 8.
ListStyle: Determines the object’s list style. The options available for this
property are: M> 4 : lists the items in a plain style; and 9>
4 ' : displays option buttons or check boxes for a list with several
options—when the user selects an item in the group, the option button linked to the
item is selected, and the buttons linked to the other items in the group are
unchecked. Default value is 0- fmListStylePlain.
254 Properties
E3 - Scripts - Reference Manual
MatchEntry: Searches for a text entry that matches the data in the object. When
a text instance is found, the line with the text is highlighted, and column content is
displayed.
The options available are: M> $2! 4 1 : searches for the a text entry
whose first letter matches the character typed in the object. If the same letter is typed
repeatedly, it goes to the next text entry beginning with this letter and so forth; 9>
$2! 4 ' : as each character is being typed, the object searches for a
text entry whose characters match the ones being typed; and :>
$2! 4 ; : does not search in the object. Default value is 1-
fmMatchEntryComplete.
MatchFound: Indicates whether the text the user has typed in the object matches
any entry in the box. If True, Value property’s content matches one of the registers
in the box. Otherwise, Value property’s content does not match any of the registers
in the box (default). This property is available only in runtime, and does not apply if
MatchEntry property is set as 2. Default value is False.
MatchRequired: Specifies whether the text typed should match or not the items
in Combo Box. If True, the user cannot leave the box until the text inserted matches
an item in the object. Otherwise, the text inserted in the Combo Box can be different
from all other data in there.
NOTE: If SelectionMargin property is set to True when the object is being printed,
the selection margin will also be printed.
SelLength: Returns the number of characters selected in the object. This property
is available in runtime only.
SelStart: Indicates the starting point of the selected text, or the insertion point if
no text is selected. This property is available in runtime only.
Properties 255
E3 - Scripts - Reference Manual
SelText: Returns the text selected in the object. This property is available in
runtime only.
Style: Determines the object’s style. The available options are: M>
4 = '= " : the object behaves as a combo (default); and :>
4 = '= : the object behaves as a list.
Text: returns the selected option’s text. This property is available only in
runtime. TextAlign: Specifies how the text is aligned in the object. The options
available are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.
TextColumn: Identifies the column in the object. The values for this property go
from -1 to the actual number of columns in the box. TextColumn property’s value for
the first column is 1, for the second column is 2, and so forth. When TextColumn
property is set to 0, the values of ListIndex property will be displayed. When
TextColumn property is set to -1, the first column with ColumnWidths property
value superior to 0 will be displayed.
TextLength: Returns the number of characters typed in the object. This property
is available in runtime only.
TopIndex: Defines or returns the item in the combo which is on the top of the
list. This property returns -1 if the list is empty or hidden.
256 Properties
E3 - Scripts - Reference Manual
/ 7$ '' +
AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object Command Button, if the property is True, the text will be resized
to fit the object’s current size.
BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 1 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing.
NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.
Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.
Properties 257
E3 - Scripts - Reference Manual
Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture. Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub
258 Properties
E3 - Scripts - Reference Manual
WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.
/ 7. 4
AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object Label, if the property is True, the text will be resized to fit the
object’s current size.
BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 9 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing. Default value is 1 – fmBackStyleOpaque.
NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.
BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 9 > + 4 . . Default
value is black (RGB (0,0,0)).
BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.
Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.
Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture.
Properties 259
E3 - Scripts - Reference Manual
Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub
260 Properties
E3 - Scripts - Reference Manual
TextAlign: Specifies how the text is aligned in the object. The options available
are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.
WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True. If False, the configuration “white-space:nowrap”
will appear on Style property. Default value is True.
/ 7/ 4 +
BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 1 > + 4 . . Default
value is black (RGB (0,0,0)).
BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.
BoundColumn: Establishes the column where data are stored on the list. For
example, if each line has 8 items, and BoundColumn property is 3, the system stores
information on the third column of the line currently selected. If value is 0, it is
passed to the object’s ListIndex property. If value is 1 or higher, the indicated data is
attributed to the column referring to the value specified in the property. Columns are
numbered from 1.
NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.
Column: Specifies object’s line and column. If only column value is specified,
Column property reads or writes the column specified on the object’s current line.
Properties 261
E3 - Scripts - Reference Manual
Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.
262 Properties
E3 - Scripts - Reference Manual
NOTE: This property applies only to applications written in Asian languages, and is
ignored in other applications. It has no effect at E3, and it was maintained in the
program for compatibility reasons with the default specifications for Microsoft
Forms objects.
IntegralHeight: Adjusts height in text edition area, in case its available area
exceeds object size. If True, its height is adjusted to fit the object’s current size, thus
displaying the whole text. Otherwise, the size of text edition area remains the same.
If a text is bigger than the available space, it will not be displayed in the object.
List: Returns or defines column and row entries on the object’s list. Column and
row numbering starts at zero; it means that the number of the first column and of the
first row on the list are zero, the second column and row are 1, and so forth. This
property is available in runtime only.
ListCount: Returns the number of items in the object’s list. This property is
available in runtime only.
ListIndex: Identifies the item currently selected on the list (index). The values of
this property go from -1 to the total amount of rows in a list minus one (that is,
ListCount - 1). When no row is selected, ListIndex returns -1. When the user selects
a row in a Combo Box, the system defines the value of ListIndex property. The list’s
first row value of this property is 0, the second row value is 1, and so forth. This
property is available in runtime only.
Properties 263
E3 - Scripts - Reference Manual
ListStyle: Determines the object’s list style. The options available for this
property are: M> 4 : lists the items in a plain style; and 9>
4 ' : displays option buttons or check boxes for a list with several
options—when the user selects an item in the group, the option button linked to the
item is selected, and the buttons linked to the other items in the group are
unchecked. Default value is M> 4 .
MatchEntry: Searches for a text entry that matches the data in the object. When
a text instance is found, the line with the text is highlighted, and column content is
displayed.
The options available are: M> $2! 4 1 : searches for the a text entry
whose first letter matches the character typed in the object. If the same letter is typed
repeatedly, it goes to the next text entry beginning with this letter and so forth; 9>
$2! 4 ' : as each character is being typed, the object searches for a
text entry whose characters match the ones being typed; and :>
$2! 4 ; : does not search in the object.
When multiple selections are not being used, it is recommended the use of Value or
ListIndex properties.
264 Properties
E3 - Scripts - Reference Manual
Text: returns the selected option’s text. This property is available only in
runtime. TextAlign: Specifies how the text is aligned in the object. The options
available are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.
TextColumn: Identifies the column in the object. The values for this property go
from -1 to the actual number of columns in the box. TextColumn property’s value for
the first column is 1, for the second column is 2, and so forth. When TextColumn
property is set to 0, the values of ListIndex property will be displayed. When
TextColumn property is set to -1, the first column with ColumnWidths property
value superior to 0 will be displayed.
TopIndex: Defines or returns the item in the combo which is on the top of the
list. This property returns -1 if the list is empty or hidden.
/ 70 +
Delay: Specifies the object’s delay. Delay property affects the duration of time
between consecutive SpinUp, SpinDown and Change events, generated when the
user clicks the scroll bar and keeps it pressed. The first event occurs immediately.
Delay until the second occurrence of the event is five times the value specified for
this property. After this initial occurrence, the interval between events is the one
specified at Delay property.
Default value is 50 ms. This means that the object starts the first event after 250 ms
(five times the specified value), and start the following events after every 50 ms.
Properties 265
E3 - Scripts - Reference Manual
property, but the recommended interval is from -32.767 to +32.767. Also, this value
should be between the values of Max and Min properties.
ProportionalThumb: Specifies whether the size of the scroll box is the same as
the object’s dimensions. If True, ScrollBar’s box is as long as the object. Otherwise,
the scroll box remains the same, regardless of the size of the object. Default value is
True.
SmallChange: Specifies the amount of movement that happens when the user
clicks one of the object’s scroll arrows. Default value is 1.
Value: Integer between the values defined for Min and Max properties. It
indicates scroll bar’s initial position. It does not accept values lower than Min or
higher than Max.
/ 76 +
Delay: Specifies the object’s delay. Delay property affects the duration of time
between consecutive SpinUp, SpinDown and Change events, generated when the
user clicks the spin button and keeps it pressed. The first event occurs immediately.
Delay until the second occurrence of the event is five times the value specified for
this property. After this initial occurrence, the interval between events is the one
specified at Delay property.
Default value is 50 ms. This means that the object starts the first event after 250 ms
(five times the specified value), and start the following events after every 50 ms.
266 Properties
E3 - Scripts - Reference Manual
SmallChange: Specifies the amount of movement that happens when the user
clicks one of the object’s scroll arrows. Default value is 1.
Value: Integer between the values defined for Min and Max properties. It
indicates spin’s initial value. It does not accept values lower than Min or higher than
Max.
/ 77 +
AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object Text Box, if the property is True, the text will be resized to fit
the object’s current size.
BackStyle: Defines the object’s background style. The available options are:
M> $( 4- ' : the object’s background is transparent, with no
drawing; and e 9> $( 4 ' Q, : the object’s background is opaque, with
some kind of drawing. Default value is 1 – fmBackStyleOpaque.
NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.
Properties 267
E3 - Scripts - Reference Manual
BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 1 - fmBorderStyleSingle. Default
value is black (RGB (0,0,0)).
BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.
CanPaste: Specifies whether transference area contains the data the object
supports. If True, the object can receive information pasted from transference area.
However, if the data in this area are in a format the object does not support, the
property is False. This property is available in runtime only.
CurLine: Specifies the object’s current line, that is, the line that contains the text
insertion point. First line’s number is 0. Default value is 0. CurTargetX: Returns
the text insertion horizontal position in the object. This position is measured in
HIMETRIC units. You can use either CurTargetX or CurX properties to move the
insertion point in a text as the user passes over the object’s content. When the user
moves the insertion point to another line in the text, CurTargetX property specifies
the most appropriate position for the text’s insertion point. CurX property is defined
in this value, if the text line is bigger than the value of CurTargetX. Otherwise, CurX
property is defined as the text line end. This property is available in runtime only.
NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.
CurX: Specifies current text insertion horizontal position in the object. This
property is applied in an object with many lines, that is, whenever Multiline property
is enabled. The return value is valid when the object has focus. You can use either
Multiline or CurX properties to place the text insertion point as the user passes over
the object’s content. When the user moves the insertion point to another line in the
text, CurTargetX property specifies the most appropriate position for the text’s
insertion point. CurX property is defined in this value, if the text line is bigger than
the value of CurTargetX. Otherwise, CurX property is defined as the text line end.
This property is available in runtime only.
268 Properties
E3 - Scripts - Reference Manual
Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.
HideSelection: Specifies whether the selected text is still highlighted when the
object does not have focus anymore. If True, the selected text only remains
highlighted in case the object has focus. Otherwise, the object will always appear
highlighted, regardless of the presence of focus in the object. Default value is True.
NOTE: This property applies only to applications written in Asian languages, and is
ignored in other applications. It was maintained in the program for compatibility
reasons with the default specifications for Microsoft Forms objects.
Properties 269
E3 - Scripts - Reference Manual
IntegralHeight: Adjusts height in text edition area, in case its available area
exceeds object size. If True, its height is adjusted to fit the object’s current size, thus
displaying the whole text. Otherwise, the size of text edition area remains the same.
If a text is bigger than the available space, it will not be displayed in the object.
Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False.
270 Properties
E3 - Scripts - Reference Manual
ScrollBars: Specifies whether the object has vertical or horizontal scroll bars, or
even both. The available options are: M> $ ; : no scroll bars are
displayed; 9> $ E 3 : a horizontal scroll bar is displayed; and :>
$ 8 $ : a vertical scroll bar is displayed. Default value is 0-
fmScrollBarNone.
SelLength: Returns the number of characters selected in the object. This property
is available in runtime only.
SelStart: Indicates the starting point of the selected text, or the insertion point if
no text is selected. This property is available in runtime only.
SelText: Returns the text selected in the object. This property is available in
runtime only.
Text: returns the text being typed. This property is available only in
runtime. TextAlign: Specifies how the text is aligned in the object. The options
available are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.
Properties 271
E3 - Scripts - Reference Manual
TextLength: Returns the number of characters typed in the object. This property
is available in runtime only.
WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.
/7 < !! +
AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object ToggleButton, if the property is True, the text will be resized to
fit the object’s current size.
BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 9 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing.
NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.
Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.
NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.
Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture. Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub
Properties 273
E3 - Scripts - Reference Manual
TextAlign: Specifies how the text is aligned in the object. The options available
are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.
274 Properties
E3 - Scripts - Reference Manual
TripleState: Determines up to three value status for the object. If True, the user
can choose from three status option: False, True, or Null. Null state is displayed with
a shaded button. Otherwise, the user can only choose from the Values True or False.
Default value is False.
Value: Indicates the object’s initial value. Its behavior is Boolean; if True, its
initial status is selected, otherwise it will start cleared. Default value is False.
WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.
/ < 4 #
Links make the association between any two variables much easier, since it is
execution is done neither logical or via scripts. The object Links returns a collection
of any E3 object’s associations. Links collection’s default property is Count.
Count: Informs the number of connections an object has. Equals 0 (zero) if the
object has no links. Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("ScrollBar1").Links.Count
End Sub
/ < 4 # ''
To access or modify a connection, you can use either Link properties or Link
methods. Each type of connection has its own properties, except for three default
properties, shared by all types: Property, Source, and Type.
Property: Specifies the name of the property it is linked to. When modified,
moves the link to another property of the same object. Example:
Sub CommandButton1_Click()
dim bind
set bind = Screen.Item("TableBind").Links.Item(1)
bind.Property = "Caption"
End Sub
Properties 275
E3 - Scripts - Reference Manual
Source: Specifies link’s source, which could be the name of another object in the
application, or even a more complex expression accessing several objects. Example:
Sub CommandButton25_Click()
dim bind
set bind = Screen.Item("TableBind").Links.Item(1)
bind.Source = "Data.TagDemo1.Value"
End Sub
Type: This is a read-only property, and informs the type of link. The available
values are:
Example:
Sub CommandButton1_Click()
dim bind
set bind = Screen.Item("TableBind").Links.Item(1)
MsgBox bind.Type & " – Table link"
End Sub
/ < ' :+ : 4 #
Simple, bidirectional, and reverse links are all implemented by the same object.
According to the value of these properties, you can determine which type of
connection you are dealing with.
Example:
276 Properties
E3 - Scripts - Reference Manual
Sub CommandButton29_Click()
dim bind
set bind = Screen.Item("SimpleBind").Links.Item(1)
bind.BiDirectional = True
End Sub
Reverse: True when the connection is reverse, False when the connection is
simple or bidirectional. Example:
Sub CommandButton29_Click()
dim bind
set bind = Screen.Item("SimpleBind").Links.Item(1)
bind.Reverse = True
End Sub
/ <" !4 #
Through four specified values, a linear scale is made between property values and
source values.
Example:
Sub DstHiValue_ValueChange()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
Screen.Item("ScrollBar1").Max = Value
If Bind Is Nothing Then
MsgBox "ScrollBar1 is not linked"
Else
MsgBox "ScrollBar1 is linked to " & Bind.Source & "‘"
MsgBox "Changing DstHiValue from " &_
Bind.DstHiValue & " to " & Value
Bind.DstHiValue = Value
End If
End Sub
Properties 277
E3 - Scripts - Reference Manual
278 Properties
E3 - Scripts - Reference Manual
Example:
Sub SrcLoValue_ValueChange()
On error resume next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
Screen.Item("ScrollBar2").Min = Value
If Bind Is Nothing Then
MsgBox "ScrollBar1 is not linked"
Else
MsgBox "ScrollBar1 is linked to " & Bind.Source & " "
MsgBox "Changing SrcLoValue from " &_
Bind.SrcLoValue & " to " & Value
Bind.SrcLoValue = Value
End if
End Sub
NOTE: In case the values specified for SrcHiValue and SrcLoValue properties are
the same, there will be no linear scale, so the connection will work as a simple
connection.
Properties 279
E3 - Scripts - Reference Manual
/ <$ ,! 4 #
Example:
Sub BlinkOff_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1")._
Links.Item("ForegroundColor")
If Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to " & Bind.Source & " "
MsgBox "Changing BlinkOff from " &_
Bind.BlinkOff & " to " & Value
Bind.BlinkOff = Value
End If
End Sub
280 Properties
E3 - Scripts - Reference Manual
Example:
Sub BlinkOffValue_Click()
On Error Resume Next
Dim Value
If Application.ShowPickColor_
(Value, ForegroundColor, 400, 300) Then
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
if Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to "& Bind.Source & " "
MsgBox "Changing BlinkOffValue from " &_
Bind.BlinkOffValue & " to " & Value
Bind.BlinkOffValue = Value
End If
ForegroundColor = Value
End If
End Sub
Properties 281
E3 - Scripts - Reference Manual
282 Properties
E3 - Scripts - Reference Manual
End Sub
OffValue: Specifies the value the property will take when the source returns
False. Example:
Sub OffValue_Click()
On Error Resume Next
Dim Value
If Application.ShowPickColor_
(Value, ForegroundColor, 400, 300) Then
Dim Bind
Set Bind =_ Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
if Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to "& Bind.Source & " "
MsgBox "Changing OffValue from " &_
Bind.OffValue & " to " & Value
Bind.OffValue = Value
End If
ForegroundColor = Value
End If
End Sub
Properties 283
E3 - Scripts - Reference Manual
OnValue: Specifies the value the property will take when the source returns True.
Example:
Sub OnValue_Click()
On error resume next
Dim Value
If Application.ShowPickColor_
(Value, ForegroundColor, 400, 300) Then
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
if Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to "& Bind.Source & " "
MsgBox "Changing OnValue from " &_
Bind.OnValue & " to " & Value
Bind.OnValue = Value
End If
ForegroundColor = Value
End If
End Sub
284 Properties
E3 - Scripts - Reference Manual
/ <. 4 #
Blink(Line): Determines that when the source is within this line’s interval, the
property will alternate periodically between the values established in the properties
Value(Line) and BlinkValue(Line). Line index determines table line (from 1 to
RowCount property’s value). Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor = _
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub
Properties 285
E3 - Scripts - Reference Manual
BlinkValue(Line): Specifies the alternative (blinking) value the property will take
when the source is within the interval specified on the line, and Blink(Line) property
is True. Line index determines table line (from 1 to RowCount property’s value).
Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub
286 Properties
E3 - Scripts - Reference Manual
Max(Line): Specifies the highest source value for a table line. Line index
determines table line (from 1 to RowCount property’s value). Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub
Properties 287
E3 - Scripts - Reference Manual
Min(Line): Specifies the lowest source value for a table line. Line index
determines table line (from 1 to RowCount property’s value). Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub
288 Properties
E3 - Scripts - Reference Manual
Properties 289
E3 - Scripts - Reference Manual
Value(Line): Specifies the value the property will take when the source is within
the interval specified on the line. Line index determines table line (from 1 to
RowCount property’s value). Example:
Sub CommandButton1_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
if Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub
/ * 2
BlinkTime: Defines the time, in milliseconds, between status change when the
objects needs blinking (that is, whenever a screen object has a link and the option
Blink is checked). Default value is 200 ms.
NOTE: Minimum screen update time is 55ms; so, if this property is configured with
a value lower than 55ms, the configuration will have no effect at all.
290 Properties
E3 - Scripts - Reference Manual
Caption: Determines the name of the application using the Viewer. Default value
is empty.
Properties 291
E3 - Scripts - Reference Manual
LoginRetries: Specifies the number of Viewer login retries, that is, the number
of times the login dialog will be displayed apart from the first time. Default value is
2.
NOTE: When the reconnection occurs in quiet mode (the dialog is not shown), all
windows of current Viewer will be disabled and the hourglass cursor appears,
indicating that the application is busy. During this time, the user won’t be able to
cancel the action.
User: Displays the name of the user using Viewer. This property is read only.
292 Properties
E3 - Scripts - Reference Manual
WindowStyle: Defines Viewer window’s initial style. The available options are:
M- % 3+: Viewer starts maximized; 9-5 + +: Viewer starts windowed;
and :- 3+: Viewer starts minimized.
/ ,
ConnectTimeOut: Displays the waiting time for any database operation, before
the system generates a timeout error. Default value is 180 (3 minutes).
nRetries: Indicates how many times E3 will try to execute a database operation.
If the operation fails all times, it will be discarded.
SourceDatabase: In case the Database’s format is Access, this is the name of the
.mdb file. In case the Database’s format is SQL, this is the name of the SQL server
concatenated to the chosen DB in the format Server/Database. In case the Database’s
format is Oracle, this is the name of the connection generated. This is a read-only
property.
Properties 293
E3 - Scripts - Reference Manual
SourceType: Indicates the DMS that will be used by the Database object. The
available options are: M> $ : Oracle; 9> 0$ $ : Microsoft Access; and
:> H & : Microsoft SQL Server. Example:
Sub Grupo1_Click()
op = Application.SelectMenu("Oracle|Access|SQLServer")
If op = 1 Then
Application.GetObject("DBServer").SourceType = 0
MsgBox "Oracle server in use."
ElseIf op = 2 Then
Application.GetObject("DBServer").SourceType = 1
MsgBox "Access server in use."
ElseIf op = 3 Then
Application.GetObject("DBServer").SourceType = 2
MsgBox "SQL server in use."
End If
End Sub
NOTE: This property is used only with Oracle, and has no effect with Microsoft
Access or Microsoft SQL Server.
/ " '
/ " '
294 Properties
E3 - Scripts - Reference Manual
Alarm: Establishes the existence of at least one active alarm in the area. If True,
the system has at least one active alarm in the area, and ActiveAlarms property will
read for the number of active alarms. Otherwise, ActiveNACKAlarms property will
read for the number of non- acknowledged alarms. This property is read-only.
/ " '
NOTE: the specific properties from each alarm source type can be accessed directly
via scripts or links, as well as visualized in the object’s Property List, making their
edition via GetAlarm() method not mandatory anymore.
AlarmVerify: If True, enables alarm source checking (that is, alarm generation).
Properties 295
E3 - Scripts - Reference Manual
Event: When True, it indicates the alarm is event type. An event-type alarm,
when activated, is acknowledged by “System” user. Thus, when it is acknowledged,
nothing happens (there is no effect); it also does not increment the number of active
or unacknowledged alarms. It cannot be altered in runtime.
Format: Specifies the type of format to be attributed to the object. It allows changing
the way data is presented without changing their value. You can edit this property
manually, or set it through the formatting window. Its use is similar to format codes on
spreadsheets, following the same basic syntax. The following datatype are supported:
296 Properties
E3 - Scripts - Reference Manual
Value: Contains the value that has been evaluated to determine whether alarm
occurs.
/ "" '
ActiveAlarms: Determines the total amount of active alarms in the system. This
is a read-only property.
BackupDiscardInterval: Indicates the time interval during which the backup data
will be kept until they are discarded. This property works along with
BackupDiscardTimeUnit property. Default value is 12 (twelve time units indicated
by BackupDiscardTimeUnit).
Properties 297
E3 - Scripts - Reference Manual
NOTE: The total amount of time indicated by the combination of the properties
BackupDiscardInterval and BackupDiscardTimeUnit must be longer than the time
indicated by the properties DiscardInterval e DiscardIntervalTimeUnit.
DataSource: Defines the Database to be used to record alarms data. Default value
is empty, i.e., there is no Database to store data.
EnableDiscard: Indicates alarm data discard after a certain time. If False, data
are stored indefinitely on the table; otherwise, they are not. Default value is False.
298 Properties
E3 - Scripts - Reference Manual
/ $ )" '
NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,
each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adopted for properties in this manual,
when necessary.
Domain: Specifies the domain to which E3Alarm will connect. Default value is
empty, i.e., E3Alarm connects to the same domain of the Viewer where it is. For
example: “\\NameOfOther Server”.
Enabled: Enables the object ActiveX in the project. Default value is True.
Font: Determines E3Alarm’s header and lines font. This property is read-only,
and cannot be modified in runtime.
Filter: Controls visible alarm areas at E3Alarm. If its value is not empty, the
events whose area name start with the text typed in this field will be presented. For
example: if Filter is “Ana”, only the alarms of areas such as “Analog.Production" or
Properties 299
E3 - Scripts - Reference Manual
"[!m-p]": takes any character as long as it is not between “m” and “p”.
Default value is empty, i.e., there will be no filter per area (see also
ShowHighPriority, ShowMediumPriority and ShowLowPriority properties).
Frame: Returns the object’s parent frame. This property is available in runtime
only.
HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.
Layer: Shows objects on the Screen, according to the layers they are in. For
Screen objects, you can define up to 32 layers, so that they can be clustered logically
(e.g.: hydraulic layer objects, electric layer objects etc.), and shown/hidden just by
modifying the mask of the Screen’s Layer property. For the object to appear on the
300 Properties
E3 - Scripts - Reference Manual
Screen, Layer property should contain at least 1 bit set at the same position where
the Screen layer is.
MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.
SimpleAreaFilter: When True, filter behavior per alarm area name is based only
in total coincidence of the initial part of the name. When False, you can also use
wild-cards. See Filter property, which specifies filters per area name.
Properties 301
E3 - Scripts - Reference Manual
Tip: Shows a popup text when the mouse is over the execution object for a brief
moment. Example:
Sub RetanguloArr1_MouseUp(nButton, nShiftState, x, y)
Tip = "This is a test!"
End Sub
Visible: Defines the object’s visibility. If True, the object is visible, as long as the
following factors are also present: visible object’s parent-object, and object’s Layer
property present on Screen layer.
/ . =
BackupDiscardInterval: Indicates the time interval during which the backup data
will be kept until they are discarded. This property works alongside
BackupDiscardTimeUnit property. Default value is 12 (twelve time units indicated
by BackupDiscardTimeUnit).
NOTE: The total amount of time indicated by the combination of the properties
BackupDiscardInterval and BackupDiscardTimeUnit must be longer than the time
indicated by the properties DiscardInterval e DiscardIntervalTimeUnit.
CacheSize: Defines the number of registers that should be read by the Historic
before being sent to the DataBase. For example, if a Historic’s CacheSize = 4, it will
send every 4 registers to the associated DBServer. Valid values for this property
range from 1 to 4. Default value is 1.
CompressedTable: Enables the use of dead band for data recording. Default
value is False.
302 Properties
E3 - Scripts - Reference Manual
DBServer: Indicates the Database used in the Historic to create tables and data
registers. Default value is empty.
EnableDiscard: Indicates Historic data discard after a certain time. If False, data
are stored indefinitely on the table; otherwise, they are not. Default value is False.
ScanTime: Defines time interval variation for the Historic to acquire and save a
new register on the table, in milliseconds. Use this property if you wish a larger or
smaller amount of data generated per second. Default value is 1000.
UserTable: If True, identifies the historic as the user’s (data on the table were
imported from the database). Otherwise, it is a common E3’s Historic. This is a
read-only property.
UseTagQuality If True, the Historic will use the tag source’s quality value;
otherwise, the early method will be used (0 = uncertain value; 1 = good value).
Properties 303
E3 - Scripts - Reference Manual
/ / !
NOTE: The total amount of time indicated by the combination of the properties
BackupDiscardInterval and BackupDiscardTimeUnit must be longer than the time
indicated by the properties DiscardInterval e DiscardIntervalTimeUnit.
CacheSize: Defines the number of registers that should be read by the Storage
before being sent to the DataBase. For example, if a Storage’s CacheSize = 4, it will
send every 4 registers to the associated DBServer. Default value is 10.
CompressedTable: Enables the use of dead band for data recording. Default
value is False.
DBServer: Indicates the Database used in the Storage to create tables and data
registers. Default value is empty.
EnableDiscard: Indicates the data discard after a certain time. If False, data are
stored indefinitely on the table; otherwise, they are not. Default value is False.
/ 0 )"; -
NOTE: It is not advisable accessing these properties directly via scripts. You should
access E3Query object, passing parameters through SetVariableValue() method and
modifying filters or fields through the collection returned with GetE3QueryFields()
method.
CursorLocation: Defines the place where the query will be generated and
handled, from the DMS (Database Management System) point of view. The
available options are: M>$ & : the query will be generated in the DMS (server);
and 9>$ : the query will be generated in the E3 Server (client). The default
value of this property is M>$ & . See also CursorType property.
Properties 305
E3 - Scripts - Reference Manual
CursorType: Defines the type of query according to data view. The available
options are:
DataSource: Indicates the Database or Storage object that will be used in the
query. This is a read-only property, but it can be modified in runtime.
Fields: Text with the fields to be viewed in the query, separated by commas. It
corresponds to the argument of SELECT clause in query’s SQL code. When blank, it
determines that the query should display all the fields of the table. This is a read-
only property, but it can be modified in runtime.
Frame: Returns the object’s parent frame. This property is available in runtime
only.
FunctionType: Specifies the function that defines the E3Query data. Some
functions have subfunctions that may be indicated in FunctionSubType property.
FunctionType is valid in the case of a Storage object is the source of E3Query (it is
indicated in DataSource property). The property can assume the following values:
OPTION DESCRIPTION
L> ' += Returns, for one or more tags, the interpolated
values (i.e. estimated) at the interval between
the variables StartTime and EndTime, in fixed
intervals defined by the variable TimeInterval.
> $
, += Returns, for one or more tags, the result of the
math operation (specified in FunctionSubType)
applied to data at the interval between the
variables StartTime and EndTime, in fixed
intervals defined by the variable TimeInterval.
P> - .0 ", % $
- Maximum recording time (the absence of
values at this interval forces a recording).
HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.
MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.
Screen: Returns the object’s parent Screen. This property is available in runtime
only.
SQL: Finishes the SQL code specified for query. This is a read-only property, but
it can be modified in runtime.
308 Properties
E3 - Scripts - Reference Manual
Where: Determines the query condition that filters the table records to be viewed,
that is, only the records that meet the conditions are viewed. It corresponds to WHERE
argument in the query’s SQL code. This is a read-only property, but it can be
modified in runtime.
/ 6 )"+ 2
CurSel: Indicates E3Browser cursor’s current position, that is, the line index
where it is placed.
Properties 309
E3 - Scripts - Reference Manual
End Sub
OPTION DESCRIPTION
; Retrieves field’s name.
Retrieves criteria changing current query.
Retrieves field’s sorting: ASC (ascendent) o
DESC (descendent).
8 " Retrieves field’s visibility status.
1 Retrieves field’s value format.
5 + 2 Retrieves field’s width.
Retrieves field’s text color.
( Retrieves field’s background color..
Frame: Returns the object’s parent frame. This property is available in runtime
only.
GridFont: Determines the font to be used at E3Browser’s data area texts. Default
value is Arial. This property cannot be used in scripts and/or links, being configured
only via Studio.
310 Properties
E3 - Scripts - Reference Manual
MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. It is a read-only property, available in runtime.
Properties 311
E3 - Scripts - Reference Manual
NOTE: To change E3Browser’s query via scripts (in case the new query modifies
the fields of the original query), in addition to changing SourceQuery property, you
must use RetrieveE3QueryFields() and Requery() methods.
TabStop: Indicates whether E3Browser will have keyboard focus when the user
uses [Tab] key to browse fields on a Screen.
Tip: Contains a help text presented as a “tip” when the user places the mouse
pointer on the object.
/ 7 )"
Axes: Returns E3Chart’s axes collection. From this point, collection’s properties
can be modified.
Frame: Returns the object’s parent frame. This property is available in runtime
only.
HorGrid: Determines the type of line that will be applied to E3Chart’s horizontal
grid.
Properties 313
E3 - Scripts - Reference Manual
314 Properties
E3 - Scripts - Reference Manual
Number: Presents both whole and decimal numbers. The user can opt for up to 15
decimal places, for separating thousands or not, and for how to signal negative
numbers. For either too small or too large numbers, use Scientific format.
Date: Presents numerical values for date and time (when it applies). To display
time only, use the equivalent format.
Time: Presents numerical values for time and date (when it applies). To display
date only, use the equivalent format.
Percent: Multiplies the number by 100 and adds the percentile symbol (%) to it. It
may have up to 15 decimal places.
Scientific: Presents a number with exponent and mantissa notation. Ideal for
number with varied magnitude. It may have up to 15 decimal places.
Other: Allows editing any formatting code directly in this field, or then select a
format created previously.
These formats’s masks, as instanced in the field Type, will be displayed in the
Properties List (Ex: M/d/yy H:mm, 0E-00, etc.).
HorTickUnit: Determines the number of tick units on the grid. When value is 0, the
spacing is automatic.
Legend: Returns E3Chart’s legend. From this point, legend’s properties can be
modified.
Properties 315
E3 - Scripts - Reference Manual
MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.
Pens: Returns the E3Chart’s Pen Collection. The object Pens Collection is used
to insert/remove and stop the pens available at E3Chart. This property is read-only.
316 Properties
E3 - Scripts - Reference Manual
ShowLeftScale: If True, the main vertical scale is shown on the left of the grid.
Otherwise, it is invisible. Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.ShowLeftScale = not Chart.ShowLeftScale
End Sub
ShowRightScale: If True, the main vertical scale is shown on the right of the grid.
Otherwise, it is invisible. Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.ShowRightScale= not Chart.ShowRightScale
End Sub
Properties 317
E3 - Scripts - Reference Manual
ShowTopScale: If True, the main horizontal scale is shown in the top of the grid.
Otherwise, it is not shown. Default value is False. Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.ShowToptScale= not Chart.ShowTopScale
End Sub
Tip: Contains a help text presented as a “tip” when the user places the mouse
pointer on the object.
Title: Determines E3Chart’s main title. For this title to be visible on the chart,
ShowTitle property must be set to True.
VerGrid: Determines the type of line that will be applied to E3Chart’s vertical
grid.
318 Properties
E3 - Scripts - Reference Manual
VerScaleBegin: Determines the value at the top of E3Chart grid’s main vertical
axis. Default value is 100.
Number: Presents both whole and decimal numbers. The user can opt for up to 15
decimal places, for separating thousands or not, and for how to signal negative
numbers. For either too small or too large numbers, use Scientific format.
Date: Presents numerical values for date and time (when it applies). To display
time only, use the equivalent format.
Time: Presents numerical values for time and date (when it applies). To display
date only, use the equivalent format.
Percent: Multiplies the number by 100 and adds the percentile symbol (%) to it. It
may have up to 15 decimal places.
Properties 319
E3 - Scripts - Reference Manual
Scientific: Presents a number with exponent and mantissa notation. Ideal for
number with varied magnitude. It may have up to 15 decimal places.
Other: Allows editing any formatting code directly in this field, or then select a
format created previously.
These formats’s masks, as instanced in the field Type, will be displayed in the
Properties List (Ex: M/d/yy H:mm, 0E-00, etc.).
VerTickUnit: Determines the number of tick units on the grid. When value is 0, the
spacing is automatic.
/ 7
AutoQuery: Determines pen’s auto query. If True, the pen will use auto query.
Otherwise, it will not be used. Auto query cannot be used in the following situations:
when SQL is customized by the user; when Storage is being used; or when several
tables are being used.
BkColor: Determines the background color used in an area type pen. Default
value is empty.
BufferSize: Determines the number of points kept at the real-time pen. After this
value, the oldest data are discharged. This property has no effect with historic pens.
This property is considered only after pen connection. For further information, see
Connect() method. Default value is 10,000, and it must always be higher than 0.
320 Properties
E3 - Scripts - Reference Manual
NOTE: In runtime, if the property is updated and the real-time data is not shown,
the method Connect() must be called to show the real-time data again.
Example:
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
MsgBox "Click OK to create the pen"
Set Pen = E3Chart1.Pens.AddPen("Pen1")
Pen.DataSourceType = 0 'real-time
Pen.YLink = "Data.TagDemo1"
Pen.UseTimeStamp = True 'uses timestamp in X
Pen.Color = RGB(255,0,0)
Pen.Docstring = "test"
MsgBox "Click OK to connect"
Pen.Connect() 'starts getting data
MsgBox "Click OK to frame"
E3Chart1.FitPen(0)
MsgBox "Click OK to remove pen"
E3Chart1.Pens.Remove(Pen.Name)
End Sub
DigitalData: Determines digital plotting style. If True, the digital plotting system
will assume that data variation is digital, that is, its value varied instantly in relation
Properties 321
E3 - Scripts - Reference Manual
to the last one. Otherwise, the variation is considered linear and a straight-line
segment unites the points. Default value is True.
PenType: Specifies the pen drawing type (0= line; 1= dot; 2= dot-line; 3= area).
Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.PenType = 1
End Sub
QueryName: Determines the name of the query being used by the pen. Use this
property if DataSourceType property is set for 1 (Historic).
ScaleX, ScaleY: These properties indicate to which E3Chart’s X and Y scales the
pen is associated, respectively. The scale configured for ScaleX is horizontally
322 Properties
E3 - Scripts - Reference Manual
oriented, that is, it is placed either at E3Chart’s top or base. The scale configured for
ScaleY is vertically oriented; it is placed either on the object’s left or right side.
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Set Pen = Chart.Pens.AddPen("DemoTagPen2")
Pen.YLink = "Data.TagDemo2"
Pen.UseTimeStamp = True
' Scale must be pre-existent.
Pen.ScaleY = "ScaleForDemoTag2"
Pen.Connect
End Sub
ScanValue: Defines the expected reading time of the real-time pen' s tag. This
value is considered in the analogical design mode. When the value exceeds the value
determined by ScanValue, it is considered that tag value is was not altered in the
interval. Otherwise, when ScanValue value is zero, pen data are always connected to
a straight line uniting these two points as if value varied linearly. Property’ value are
represented in milliseconds.
UseTimeStamp: Determines the use, for the horizontal axis, of the timestamp
value associated to the vertical axis. See example at DataSourceType property.
Visible: Determines whether the pen is visible at E3Chart. If True, the pen is
visible in runtime. Otherwise, the pen is invisible. Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.Visible = Not Pen1.Visible
End Sub
XField: Query field used to plot data on a horizontal scale. Used for historic
pens.
XLink: Link used to plot data on a horizontal scale. When this property’s value is
altered, the pen is automatically disconnected. After the configuration, you need to
call Connect() method for the pen to start receiving data relating to this link. Used
for real-time pens.
Properties 323
E3 - Scripts - Reference Manual
YField: Query field used to plot data on a vertical scale. Used for historic pens.
YLink: Link used to plot data on a vertical scale. When this property’s value is
altered, the pen is automatically disconnected. After the configuration, you need to
call Connect() method for the pen to start receiving data relating to this link. Used
for real-time pens.
/ 7 -
Count: Contains the total number of pens inserted in E3Chart. This is a red-only
property.
/ 7" ; - -
/ 7$ '
TextAlign: Returns column text alignment. The options available for this
property:
324 Properties
E3 - Scripts - Reference Manual
/ 7. 4 !
ShowAllPens: When the property is True, all E3Chart pens are shown in legend.
The property Visible of the pen is ignored. When ShowAllPens is False, only the
pens with Visible = True are shown.
Example:
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
E3Chart1.Legend.ShowAllPens = not E3Chart1.Legend.ShowAllPens
End Sub
Size: Determines legend size. This size can stand for either height or width,
depending on the legend'
s orientation.
/ 7/
Note: HorAxis and VerAxis are axes properties that access default horizontal
and vertical axis, respectively. For example, instead of typing
Chart.Axes.Item("HorizontalAxis"), you can type Chart.Item.HorAxis.
Further user-generated axes will have their own names, depending on the case.
Properties 325
E3 - Scripts - Reference Manual
Count: Returns the total number of axes at E3Chart, including the two main axes
(horizontal and vertical).
GridStyle: Determines grid’s line style. The available options are the following:
Inverse: Inverts the order of minimum and maximum values in a numerical scale.
Usually, in vertical scales, the minimum value is placed at the bottom, whereas the
maximum value is at the top of the scale. In horizontal scales, the minimum value is
at the left side of the scale, while the maximum value is placed at its right side.
When Inverse property is True, however, this order is inverted: maximum values at
the bottom or the left, minimum values at the top or the right.
Mirror: Indicates axis’ mirror effect. If True, the axis is mirrored at the opposite
side of the original axis. Otherwise, the axis remains in the same position.
326 Properties
E3 - Scripts - Reference Manual
ScaleType: Determines the type of scale shown by the axis. The options available
for this item are:
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Set newAxis = Chart.Axes.AddAxis("")
For i = 0 to 2
MsgBox "clique ok para mudar o tipo de escala"
newAxis.ScaleType = i
Next
MsgBox "Remove axis"
Chart.Axes.Remove(newAxis.Name)
End Sub
ShowGrid: Determines grid lines visualization. If True, grid lines are shown.
Otherwise, grid lines are hidden.
Visible: Determines axis visibility on the grid. If True, axis is visible in the grid.
Otherwise, it is hidden.
/ 70
Count: Returns E3Chart’s total number of axes, including the two main axes
(horizontal and vertical).
HorAxis: Returns main horizontal axis. This axis is also a part of the axes lines.
Item: Returns the axis via its name or index. Index = 0 always stands for the main
horizontal axis, and index = 1 always stands for the main vertical axis.
VerAxis: Returns main vertical axis. This axis is also a part of the axes lines.
Properties 327
E3 - Scripts - Reference Manual
/ < 1 '
DBServer: Indicates the name of the Database where the information of the
formula (its units and sets of values) will be recorded. Default value is empty.
TableName: Indicates the name of the tables where the information of the
formulas will be recorded. Default value is empty.
/ 8 8
Public: When an ElipseX property is public (True), it will be visible outside the
library. Otherwise, the property will be internal, and only visible for the object.
Default value is True. Public properties are represented by the icon.
Type: Determines the type of value the property accepts (e.g.: Boolean, Double,
Integer, Variant, etc). When the type of object is specified (e.g.: DemoTag, IOTag,
XObject, etc), the property behaves as follows:
a) In case ElipseX is disabled: this property works as a string, which specifies the
configured object’s instance path.
b) In case ElipseX is enabled: in writing, the property works the same way as when
the object is deactivated. However, in reading, the property returns the specified
object, in case it exists. If the path does not point to an existing object, the property
returns Nothing.
/
NOTE: The object Report encapsulates the object ActiveReports (or "AR"), which
is the report itself.
To create scripts in Reports, we use the Scripts Editor of the report itself. To
manipulate the report object, we use the following syntax:
Report.Sections("<SectionName>").Controls("<ObjectName>")._
<PropertyName> = <Value>
where <SectionName> is the name of the section in the report; <ObjectName> is the
name of the object that is inside the specified section; <PropertyName> is the name
of the object'
s property; <Value> are values that the property is going to receive.
For example:
328 Properties
E3 - Scripts - Reference Manual
Report.Sections("PageHeader").Controls("E3Chart1")._
GridBkColor= RGB (255, 0, 255).
Caption: Contains the report title in the preview window title bar. Default value
is empty.
/ 4 -
NOTE: The properties described here are part of the ActiveReport (or “AR”) object
encapsulated in the Report object. These properties are valid within the scope of the
AR, and cannot be accessed outside this object.
documentName: Determines document’s name for the report. This name appears
in the printing manager and can be used to easily identify the report. Default value is
"ActiveReports Document".
MaxPages: Establishes the maximum number of pages for the report. When this
number is reached, E3 stops processing the document. Default value is 10.
ParentReport: This property is a variable for internal use in the system, and
contains a reference to the Report. This is a red-only property, and it is valid only for
DataInitialize and ReportEnd events.
PrintWidth: Determines report print area width, in twips. If you change report
size in runtime, print width should also be adjusted to make sure the report occupies
Properties 329
E3 - Scripts - Reference Manual
the whole print area. Print area size should also include margins width, so that the
report is not larger then the size of the paper. If this happens, the error will be
signaled by a red dotted line printed in each page of the report.
Status: Returns report status. The options available for this property are:
WaterMarkSizeMode: Sets or returns how the watermark will be sized when the
image is rendered on canvas. The available options are:
Properties 331
E3 - Scripts - Reference Manual
BackColor: Specifies the section’s background color. This color is only visible
when BackStyle property is set to 1-ddBKNormal. Default value is white (RGB
(255, 255, 255)).
BackStyle: Specifies the section’s background style. The options available for
this property are: 0- ddBKTransparent: transparent background; and
1- ddBKNormal: normal background.
CanGrow: Determines the text’s ability to stretch to page’s size. If True, the text
follows any height or width variation in the object when it grows in size. Otherwise,
text default configurations are maintained. Default value is True.
CanShrink: Determines the text’s ability to shrink to page’s size. If True, the text
follows any height or width variation in the object when it reduces its size.
Otherwise, text default configurations are maintained. Default value is False.
332 Properties
E3 - Scripts - Reference Manual
/ " > =
ColumnLayout: Determines whether Group Header uses the same layout as the
columns defined at “Detail” section. If True, the number The ColumnLayout property
specifies report column layout. If the property is configured for True, the number of
columns in the “Detail” section will be reflected in the group of page headers and footers.
Otherwise, it is not used.
DataField: The DataField property returns the report fields data. Defines an
obligatory field for a group inside the Detail object content. This value is adjusted in the
name of all fields at the report data source or at a name of a customized field that is
inserted in the field collection. When this property is adjusted, the report will create a new
group every time the field value change in the detail data registrations.
Properties 333
E3 - Scripts - Reference Manual
NewPage: The NewPage property inserts a page break in the report. The default
value of this property is M- ddNPNone. The options available for this property are
the following:
Repeat: The Repeat property determines if the group header will be printed again
after being associated to the “Detail” section whenever there are multiple pages,
columns or page breaks in the report. The default value of this property is 0-
ddRepeatNone. The available options are the following:
/ $ ! ,
ColumnSpacing: This property specifies the column spacing in the page details.
The default value of this property is 0.
/ . > 1
the report background, will make the following “Footer” sections be printed in
separate pages.
/ / ,
BackColor: This property specifies object background color in the report. The
effect of this property will only be visible if BackStyle property is enabled to option
9> ++ <; . You can use any whole number representing a valid color. It is
also possible to set the color through red, green and blue components of the RGB
function. The value of each component is a whole number whose interval varies
from 0 to 255. For example, a greenish blue can be specified with the whole value
4966415 or 15, 200,75, as red, green and blue components, as shown in the example.
The default value of this property is white (RGB 255, 255, 255).
BackStyle: This property specifies the style of background of the report section,
as follows: M> ++ <- ' = transparent background; 9> ++ <; =
normal background (default).
Height: This property specifies the height of the report object. The default value of
this property is 360.
Left: The left property returns the left positioning value of the report object. The
default value of this property is empty.
Name: The Name property specifies the object name. the default value of this
property is empty.
Tag: The Tag returns the type of tag associated to the object, i.e., whether it is Boolean,
string, integer, etc.
top: The top property returns the value of the top of the object. The default value of
this property is 0.
Visible: The Visible property specifies object visibility in the report. If the option
is setup to True, the object is visible in the report. Otherwise, the object is not
visible. The default value of this property is True.
336 Properties
E3 - Scripts - Reference Manual
/ 0 +
BarWidth: The BarWidth property is the bar width of bar codes. Setting the width to
1, the object's bar is expanded up to 15 points, and so on. The higher the number the
property is set, the wider the bar code'
s bar. the default value of this property is 1.
Direction: The Direction property returns the report' s data field. The default
value of this property is 0- ddbcLefttoRight. The options available in this property
are the following:
338 Properties
E3 - Scripts - Reference Manual
OPTION DESCRIPTION
9 > ++"$ + " Bar code' s style. Use A, B, C, D, +, -, :, /, or
numbers.
9O> ++"$!0;TK Bar code' s EAN-8 style. Use only numbers (7
numbers and a verification digit).
9K> ++"$!0;T9F Bar code' s EAN-13 style. Use only numbers (12
numbers and a verification digit).
9P> ++"$6 T0 Bar code' s UPC-A style. Use only numbers (11
numbers and a verification digit).
:M> ++"$6 T! Bar code' s UPC-E1 style. Use only numbers.
Used for UPC zero-compression symbols. In
Caption property, it is possible to input either a 6-
digit or 11-digit UPC-E code. If a 11-digit code is
input, bar code converts it to a 6-digit UPC-E, as
far as possible. Otherwise, 11-digit UPC-E is
converted to 6-digit UPC-E and nothing is
shown.
:9> ++"$6 T!9 Bar code' s UPC-E1 style. Use only numbers.
U.P.C E1' s data input width is 6 numerical
characters.
::> ++"$ I Bar code' s style Royal Mail RM4SCC. Use only
letters and numbers (with a verification digit).
This bar code is used in the United Kingdom.
:F> ++"$ 6 !0;9:K Bar code' s UCC/EAN_128 style. Use complete
characters ASCII. Code 128 special version is
used in the HIBC application.
/ 6 ) : ! !
Properties 339
E3 - Scripts - Reference Manual
LineWeight: The LineWeight property specifies object' s line width. Setting the
width to 1, the object'
s line is expanded up to 15 points, and so on. The higher the
number set in the property, the wider the object. The default value of this property is
1.
/ 7 1! -
DataField: The DataField property sets/returns the data field associated to the object.
Datum associated may be:
• A table field in the database supplied by E3Query.
• A mathematical expression with Query fields and VBScript functions.
In this case the field shall be preceded by the equal symbol ‘=‘.
• An E3 tag/property. In this case current variable value will be showed
when printing.
NOTE: Server must be executed in order for the variable value to be captured. The
default value of this property is empty.
ForeColor: The ForeColor property specifies the object' s fore color. In the
scripts, use VBScript RGB function to create the color to be associated to this
property. The default value of this property is black (RGB (0, 0, 0)).
hyperlink: The hyperlink property specifies the link to be assigned to the text. In
order to use this feature use Hyperlink event. The default value of this property is
empty.
340 Properties
E3 - Scripts - Reference Manual
LineWeight: The LineWeight property specifies object' s line width. Setting the width
to 1, the object'
s line is expanded up to 15 points, and so on. The higher the number set in
the property, the wider the object. The default value of this property is 1.
Picture: The Picture property specifies the picture file for the object. The file
extensions allowed are: bmp, gif, jpg cur, ico, emf and Wmf. the default value of this
property is empty.
SizeMode: The SizeMode property specifies the object size. The available options are
the following:
Properties 341
E3 - Scripts - Reference Manual
/ <
Alignment: Specify the text alignment in the object, as follows: M> = left
alignment (default); 9> .2 = right alignment and :> = centered alignment.
Font: This property specifies the object' s text font. The default value of this
property is empty. This property cannot be used in scripts and/or associations.
ForeColor: The ForeColor property specifies the object' s fore color. In the
scripts, use VBScript RGB function to create the color to be associated to this
property. the default value of this property is black (RGB (0, 0, 0)).
Hyperlink: The Hyperlink property specifies the link to be assigned to the text. In
order to use this feature use Hyperlink event.
Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False.
342 Properties
E3 - Scripts - Reference Manual
NOTE: When this property is used, CanShrink and CanGrow properties are
disabled.
Properties 343
E3 - Scripts - Reference Manual
WordWrap: Enables/disables line breaks in the text, in case the area available for
the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.
Angle: The Angle property indicates the angle of the text. Property value shall be
specified in tenth degrees, i.e. in order for the text to be shown in a 45 degree angle
the value shall be equal to 450. The default value of this property is 0 (horizontal
positioning).
344 Properties
E3 - Scripts - Reference Manual
Font: This property indicates the font name (type of the letters) of the text. the
default value of this property is empty (E3 will use system default).
NOTE: This property can not be used in scripts and/or associations. it only can be
changed at the setting time.
Fore color: The ForeColor property specifies the object' s fore color. In the
scripts, use VBScript RGB () function to create the color to be associated to this
property. the default value of this property is black (RGB (0,0,0)).
Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False.
Style: The Style property allows specifying a CSS style for the text substituting
global style. Property value must be a valid CSS string, otherwise the property is
ignored. The default value of this property is empty (E3 will use system default).
WordWrap: Enables/disables line breaks in the text, in case the area available for
the text overrides the limits determined in the object. For this property to work,
Multiline property must be True. If it is False, “white-space:nowrap” setting will
appear in the Style property.
/ 4
Properties 345
E3 - Scripts - Reference Manual
LineWeight: The LineWeight property specifies object' s line width. Setting the
width to 1, the object'
s line is expanded up to 15 points, and so on. The higher the
number set in the property, the wider the object. The default value of this property is
1.
X1: The X1 property enables/disables the position of line initial point of the line in the
axis X.
X2: The X2 property specifies the position of line final point of axis X. The
default value of this property is empty.
Y1: The Y1 property specifies the position of line initial point of axis Y. The
default value of this property is empty.
Y2: The Y2 property specifies the position of line final point of axis Y. The
default value of this property is empty.
/ " ! + #
Enabled: The Visible property specifies object enabling in the report. If the
option is setup to True, the object is enabled in the report. Otherwise the object
remains disabled. The default value of this property is True.
Tag: The Tag property specifies the type of tag to be aggregated to the object.
The default value of this property is empty.
Top: The top property returns the value of the top of the object. The default value
of this property is 0.
346 Properties
E3 - Scripts - Reference Manual
/ $
CloseButton: The CloseButton property specifies the addition of Close button in the
Viewer. If the option is setup to True, Close button will be disabled in the Viewer and will
be possible to close project viewing. Otherwise the Viewer will start without this option.
The default value of this property is True.
Left: The left property returns the left positioning value of the report object. the default
value of this property is empty.
Properties 347