Visual TD Developer Reference
Visual TD Developer Reference
Visual T&D
Diagram Editor
© 2011 Cooper Power Systems, LLC – All rights reserved.
The information in this document is subject to change without notice.
GUI-00115-00031 T, version 8
Contents
1 Introduction 1
3 Application Object 7
3.1 Methods .................................................................................................................7
3.1.1 ChangeLogin Method..............................................................................7
3.1.2 GetServerName Method..........................................................................7
3.1.3 GetUserName Method ............................................................................8
3.1.4 PrintDiagram Method..............................................................................8
3.1.5 PrintPreview Method ..............................................................................8
3.1.6 PrintSetup Method ..................................................................................9
3.1.7 ShowExplorer Method ............................................................................9
3.1.8 StopAnimation Method .........................................................................10
3.1.9 UpdateAllViews Method.......................................................................10
3.1.10 UserHasPrivilege Method .......................................................10
3.1.11 ZoomIn Method ......................................................................11
3.1.12 ZoomOut Method ...................................................................12
3.1.13 ZoomTo Method .....................................................................12
3.1.14 ZoomToFit Method.................................................................12
3.2 Properties .............................................................................................................13
3.2.1 Application Property .............................................................................13
3.2.2 CurrentZoom Property ..........................................................................13
3.2.3 Name Property ......................................................................................14
3.2.4 Parent Property ......................................................................................14
3.2.5 VBAVersion Property ...........................................................................14
3.2.6 VBE Property ........................................................................................15
4 Document Object 17
4.1 Methods ...............................................................................................................17
5 Pages Object 23
5.1 Methods ...............................................................................................................23
5.1.1 Item Method ..........................................................................................23
5.2 Properties .............................................................................................................23
5.2.1 Count Property ......................................................................................24
6 Page Object 25
6.1 Properties .............................................................................................................25
6.1.1 Name Property ......................................................................................25
6.1.2 Shapes Property .....................................................................................25
7 Shapes Object 27
7.1 Methods ...............................................................................................................27
7.1.1 Item Method ..........................................................................................27
7.2 Properties .............................................................................................................27
7.2.1 Count Property ......................................................................................28
8 Shape Object 29
8.1 Methods ...............................................................................................................29
8.1.1 ForceAliasResolution Method...............................................................29
8.1.2 ForceAliasResolutionByName Method ................................................30
8.1.3 GetAlias Method ...................................................................................30
8.1.4 GetChild Method...................................................................................30
9 Aliases Object 39
9.1 Methods ...............................................................................................................39
9.1.1 Item Method ..........................................................................................39
9.2 Properties .............................................................................................................39
9.2.1 Count Property ......................................................................................40
10 Alias Object 41
10.1 Properties .............................................................................................................41
10.1.1 IsResolved Property ................................................................41
10.1.2 Name Property ........................................................................41
10.1.3 ResolvedName Property .........................................................42
11 RTDB Object 43
11.1 Methods ...............................................................................................................43
11.1.1 CreateLogicalPoint Method ....................................................43
11.1.2 GetCmndStatusString Method ................................................44
11.1.3 GetDataPoint Method .............................................................45
11.1.4 GetDataPoints Method ............................................................45
11.1.5 GetIdFromName Method ........................................................46
12 DataPoints Object 57
12.1 Methods ...............................................................................................................57
12.1.1 Item Method............................................................................57
12.2 Properties .............................................................................................................57
12.2.1 Count Property ........................................................................58
13 DataPoint Object 59
13.1 Properties .............................................................................................................59
13.1.1 FormattedValue Property ........................................................59
13.1.2 Id Property ..............................................................................59
13.1.3 Name Property ........................................................................60
13.1.4 Quality Property ......................................................................60
13.1.5 RawValue Property .................................................................60
13.1.6 Time Property .........................................................................61
13.1.7 Type Property .........................................................................61
13.1.8 Value Property ........................................................................62
14 AlarmManager Object 63
14.1 Methods ...............................................................................................................63
14.1.1 Acknowledge Method .............................................................63
15 Alarms Object 79
15.1 Methods ...............................................................................................................79
15.1.1 Item Method............................................................................79
15.2 Properties .............................................................................................................79
15.2.1 Count Property ........................................................................80
17 AlarmChanges Object 91
17.1 Methods ...............................................................................................................91
17.1.1 Item Method............................................................................91
17.2 Properties .............................................................................................................91
17.2.1 Count Property ........................................................................92
18 AlarmChange Object 93
18.1 Properties .............................................................................................................93
18.1.1 Alarm Property .......................................................................93
18.1.2 Change Property .....................................................................93
19 EventManager Object 95
20 Events Object 97
20.1 Methods ...............................................................................................................97
20.1.1 Item Method............................................................................97
20.2 Properties .............................................................................................................97
20.2.1 Count Property ........................................................................98
21 EventObject Object 99
21.1 Methods ...............................................................................................................99
21.1.1 IsAlarm Method ......................................................................99
21.2 Properties .............................................................................................................99
21.2.1 AlarmState Property ............................................................. 100
21.2.2 Description Property ............................................................. 100
21.2.3 EventType Property .............................................................. 101
21.2.4 FormattedValue Property ...................................................... 101
21.2.5 Millisecond Property............................................................. 101
21.2.6 NumericValue Property ........................................................ 102
21.2.7 Source Property..................................................................... 102
21.2.8 Time Property ....................................................................... 103
24 EventChanges 109
24.1 Methods ............................................................................................................. 109
25 EventChange 111
25.1 Properties ........................................................................................................... 111
25.1.1 Change Property ................................................................... 111
25.1.2 EventObject Property ............................................................ 112
This document provides a complete reference manual for programming Visual T&D Diagram
Editor in Visual Basic.
The main purpose of the object model is to model the Visual T&D Server management
components in an object-oriented manner. Objects are real-time representations of the server
components. Operations performed on a Visual Basic object are automatically performed on the
server. The object model is shown below:
Application
Document
Pages
Page
Shapes
Shape
Aliases
Alias
RTDB
DataPoints
DataPoint
AlarmManager
Alarms AlarmChanges
Alarm AlarmChange
TagManager
Object Description
Application Represents the Visual T&D Diagram Editor application.
Shape Represents a Visual T&D Diagram Editor shape. This object is accessible only
through a Visual T&D Diagram Editor event.
RTDB Real-Time Database. Represents all the data points monitored by the
Visual T&D Server.
AlarmChanges Collection of alarm changes. This object is accessible only through the Change
event of the AlarmManager.
AlarmChange Represents a change that occurred on an alarm. Changes include: a new alarm,
acknowledging an alarm, clearing an alarm, a change of state for an alarm, etc.
TagManager Represents the tag manager, responsible for managing all tags.
TagChanges Collection of tag changes. This object is accessible only through the Change
event of the TagManager.
TagChange Represents a change that occurred on a tag. Changes include: a new tag,
modifying an existing tag, and deleting a tag.
The Application object represents the Visual T&D Diagram Editor application. This object is
accessible through the Application property of the Document object.
3.1 Methods
The Application object provides several methods to access application information and perform
various actions related to the application features.
Syntax
Application.ChangeLogin
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Reconnect… command of the application's File
menu.
Syntax
String = Application.GetServerName
Part Description
Application Required. A valid Application object.
Remarks
This method returns a String that contains the name of the server to which the application is
currently connected.
Syntax
String = Application.GetUserName
Part Description
Application Required. A valid Application object.
Remarks
This method returns a String that contains the name of the user that is currently logged in to the
server.
Syntax
Application.PrintDiagram
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Print command of the application's File menu.
Application.PrintPreview
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Print Preview command of the application's File
menu.
Syntax
Application.PrintSetup
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Print Setup command of the application's File
menu.
Syntax
Application.ShowExplorer
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Explorer command of the application's Tools menu.
Syntax
Boolean = Application.ShowExplorer
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Execute command of the application's Animation
menu. Returns True if it succeeds, and False if an error occurs.
Syntax
Application.UpdateAllViews
Part Description
Application Required. A valid Application object.
Remarks
This method tells the application to update the contents of all views that are displayed. It can be
used to refresh the display when shape properties are changed in animation mode by VBA
routines.
Syntax
Part Description
Application Required. A valid Application object.
Settings
Value Description
USER_PRIVILEGE_NONE Any privilege. This value will verify if the user
account has at least one privilege.
Remarks
This method raises an error flag if it fails. In order to succeed, an alarm of the specified type must
exist for the specified point. Returns True if the user account has the specified privilege, and False
otherwise.
Syntax
Application.ZoomIn
Part Description
Application Required. A valid Application object.
This method performs the same action as the Zoom In command of the application's View menu.
Syntax
Application.ZoomOut
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Zoom Out command of the application's View
menu.
Syntax
Application.ZoomTo zoomValue
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the predefined zoom value commands (50%, 75%,
100%, etc,) available from the application's View menu.
Application.ZoomToFit
Part Description
Application Required. A valid Application object.
Remarks
This method performs the same action as the Zoom To Fit command of the application's View
menu.
3.2 Properties
The Application object has some properties to manage the application.
Syntax
Application.Application
Part Description
Application Required. A valid Application object.
Remarks
Syntax
Application.CurrentZoom
Remarks
Syntax
Application.Name
Part Description
Application Required. A valid Application object.
Remarks
Syntax
Application.Parent
Part Description
Application Required. A valid Application object.
Remarks
Application.VBAVersion
Part Description
Application Required. A valid Application object.
Remarks
Syntax
Application.VBE
Part Description
Application Required. A valid Application object.
Remarks
The Document object represents the active Visual T&D Diagram Editor document. Only one
document can be active at any given time in Visual T&D Diagram Editor.
4.1 Methods
The Document object provides several methods for navigating through the pages of a document
while in animation mode.
Syntax
Boolean = Document.Close
Part Description
Document Required. A valid Document object.
Remarks
This method closes the active window only. There is no way to determine which page/window
will be closed if this method is not used in an event that also activates a page, such as a click or a
double click. The main page cannot be closed. This method returns True if it succeeds, and False
if an error occurs. Furthermore, it raises an error flag before returning False.
Part Description
Document Required. A valid Document object.
nZoomFactor Optional. The zoom factor to apply to the page once it is open. If omitted, it defaults to
100.
nTop Optional. Top position on the screen, where the page is to be opened. If omitted, defaults
to –1 (which means: use default value).
nLeft Optional. Left position on the screen, where the page is to be opened. If omitted, defaults
to –1 (tells the application to use its default value).
nBottom Optional. Bottom position on the screen, where the page is to be opened. If omitted,
defaults to –1 (tells the application to use its default value).
nRight Optional. Right position on the screen, where the page is to be opened. If omitted,
defaults to –1 (tells the application to use its default value).
ResolutionHint Optional. If the page is a renaming page, the renaming table to use. If omitted, defaults to
an empty string. This parameter is ignored if the page is not a renaming page.
Remarks
If any of nTop, nLeft, nBottom or nRight is specified, all values must be supplied to be taken into
account. This method returns True if it succeeds and False if an error occurs. Furthermore, it
raises an error flag before returning False.
Syntax
Boolean = Document.Previous
Part Description
Document Required. A valid Document object.
This method returns True if it succeeds and False if an error occurs. Furthermore, it raises an error
flag before returning False.
Syntax
Document.Save
Part Description
Document Required. A valid Document object.
Remarks
4.2 Properties
Syntax
Document.Application
Part Description
Document Required. A valid Document object.
Remarks
Syntax
Page = Document.CurrentPage
Part Description
Document Required. A valid Document object.
Remarks
Syntax
Document.Name
Part Description
Document Required. A valid Document object.
Remarks
Syntax
Pages = Document.Pages
Part Description
Document Required. A valid Document object.
Syntax
Document.Parent
Part Description
Document Required. A valid Document object.
Remarks
4.3 Events
The Document object generates events when a page is opened, and when the animation mode is
started and stopped.
Syntax
Part Description
Document Required. A valid Document object.
NewPage Required. The name of the page opened. This is the same as the PageName parameter of the
OpenPage method.
NewHint Required. The renaming table name used when the page was opened.
Syntax
Sub Document_Run()
Part Description
Document Required. A valid Document object.
Remarks
Syntax
Sub Document_Stop()
Part Description
Document Required. A valid Document object.
Remarks
The Pages object is the collection of Page objects that are available from the Document object.
As for every collection, it can be used in a For … Each construct.
5.1 Methods
The Pages object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid Pages object.
itemIndex Required. The index of the item to get. Only numeric values are allowed. The first
page is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid Page object if itemIndex is valid, otherwise it is Nothing.
5.2 Properties
The Pages object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid Pages object.
Remarks
A Page object represents a page of a Visual T&D Diagram Editor document. Page objects are
obtained from a Pages collection.
A Page object can be used directly in a For … Each construct to iterate through all the children.
6.1 Properties
Syntax
object.Name
Part Description
object Required. A valid Page object.
Remarks
Syntax
object.Shapes
Part Description
Object Required. A valid Page object.
Remarks
A Shapes object is a collection of Shape objects obtained either from a Shape object when an
event generated by Visual T&D Diagram Editor is raised, or from a Page object. As for every
collection, it can be used in a For … Each construct. It represents the collection of children of the
Shape from which it is obtained, or the collection of shapes available in a Page object.
7.1 Methods
The Shapes object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid Shapes object.
itemIndex Required. The index of the shape to get. Only numeric values are allowed. The first
shape is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid Shape object if itemIndex is valid, otherwise it is Nothing.
7.2 Properties
The Shapes object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid Shapes object.
Remarks
A Shape object represents a shape on a page of a Visual T&D Diagram Editor document. Shape
objects are obtained when an event is generated by Visual T&D Diagram Editor, such as a click, a
double-click, a mouse enter, etc.
A Shape object can be used directly in a For … Each construct to iterate through all the children.
8.1 Methods
Syntax
Part Description
object Required. A valid Shape object.
VariabledName Required. The data point name to which the alias is to be bound.
Remarks
This method returns True if it succeeds and False if an error occurred. Furthermore, it raises an
error flag before returning False.
Syntax
Part Description
object Required. A valid Shape object.
VariabledName Required. The data point name to which the alias is to be bound.
Remarks
This method returns True if it succeeds and False if an error occurred. Furthermore, it raises an
error flag before returning False.
Syntax
Part Description
object Required. A valid Shape object.
Alias Required. The index of the alias to get. The first alias is at index 1, the second, at
index 2, etc.
Remarks
This method returns True if it succeeds and False if an error occurred. Furthermore, it raises an
error flag before returning False.
Part Description
object Required. A valid Shape object.
nChild Required. The index of the child to get. The first child is at index 1, the second, at
index 2, etc.
Remarks
This method raises an error flag if it fails. This method is not recommended. The use of the
Shapes property is the recommended method.
Syntax
Part Description
object Required. A valid Shape object.
Left Required. Will be initialized to the left coordinate of the bounding rectangle.
Top Required. Will be initialized to the top coordinate of the bounding rectangle.
Right Required. Will be initialized to the right coordinate of the bounding rectangle.
Bottom Required. Will be initialized to the bottom coordinate of the bounding rectangle.
Syntax
Part Description
object Required. A valid Shape object.
AliasName Required. The alias for which to get the corresponding data point name.
ResolvedName Required. Will be initialized to the data point name corresponding to the alias.
Remarks
This method returns True if it succeeds and False if an error occurred. Furthermore, it raises an
error flag before returning False.
Syntax
Part Description
object Required. A valid Shape object.
VariabledName Required. The data point name to which the alias is to be bound.
Remarks
This method returns True if it succeeds and False if an error occurred. Furthermore, it raises an
error flag before returning False.
The method will also return a false if the alias it tries to resolve is not configured in automatic
resolution.
Syntax
Part Description
object Required. A valid Shape object.
VariabledName Required. The data point name to which the alias is to be bound.
Remarks
This method returns True if it succeeds and False if an error occurred. Furthermore, it raises an
error flag before returning False.
The method will also return a false if the alias it tries to resolve is not configured in automatic
resolution.
Syntax
Part Description
object Required. A valid Shape object.
TranslateX Required. The horizontal translation. Positive value moves right, negative, left.
TranslateY Required. The vertical translation. Positive value moves downward, negative,
upward.
8.2 Properties
Syntax
object.AliasCount
Part Description
object Required. A valid Shape object.
Remarks
Syntax
Aliases = object.Aliases
Part Description
object Required. A valid Shape object.
Remarks
The collection returned may be empty if no aliases are used within this shape.
Syntax
object.ChildCount
Part Description
object Required. A valid Shape object.
Remarks
The ChildCount property is a read-only property. This property is unrecommended. The use of
the Shapes property is recommended.
object.Color
Part Description
object Required. A valid Shape object.
Remarks
Syntax
object.Name
Part Description
object Required. A valid Shape object.
Remarks
Syntax
object.Parent
Part Description
object Required. A valid Shape object.
Remarks
The Parent property is a read-only property. The parent of a shape may be Nothing if the shape
has no parent.
Syntax
object.Shapes
Part Description
object Required. A valid Shape object.
Remarks
Syntax
object.Text
Part Description
Object Required. A valid Shape object.
Remarks
Syntax
object.Type
Part Description
object Required. A valid Shape object.
Value Description
SHAPE_CURVE Closed curve
SHAPE_CURVED_LINE Polycurve
SHAPE_ELLIPSE Ellipse
SHAPE_LINE Line
SHAPE_POLYGON Polygon
SHAPE_RECTANGLE Rectangle
SHAPE_TEXT Text
SHAPE_IMAGE Image
Remarks
Syntax
object.UserData [= Variant]
Part Description
object Required. A valid Shape object.
Remarks
Syntax
object.Visible [= Boolean]
Part Description
object Required. A valid Shape object.
Boolean Optional. True to make the shape visible, False to hide it.
Remarks
The Visible property is affected by animation of the shape. It does not consider whether the page
on which the shape is located, is displayed.
An Aliases object is a collection of Alias objects obtained from a Shape object. As for every
collection, it can be used in a For … Each construct. It represents the collection of aliases defined
in the Shape from which it is obtained.
9.1 Methods
The Aliases object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid Aliases object.
itemIndex Required. The index of the alias to get. Only numeric values are allowed. The first
alias is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid Alias object if itemIndex is valid, otherwise it is Nothing.
9.2 Properties
The Aliases object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid Aliases object.
Remarks
An Alias object represents an alias of a shape, in a page of a Visual T&D Diagram Editor
document. An Alias object can be used directly in a For … Each construct to iterate through all
the children.
10.1 Properties
Syntax
object.IsResolved
Part Description
Object Required. A valid Alias object.
Remarks
Syntax
object.Name
Part Description
object Required. A valid Alias object.
Remarks
Syntax
object.Name
Part Description
object Required. A valid Alias object.
Remarks
The RTDB object represents the Visual T&D Server real-time database. All monitored points are
grouped in this object. You can also create local points that are not managed by the Visual T&D
Server.
11.1 Methods
The RTDB object provides several methods for accessing and manipulating data points.
Syntax
Part Description
RTDB Required. A valid RTDB object.
ptName Required. A string representing the point name. This name must be unique among all points
and must not be empty.
Value Description
POINT_TYPE_ANALOG_INPUT An input analog point. This point can assume any value, but it is
not possible to command it.
POINT_TYPE_ANALOG_OUTPUT An output analog point. This point can assume any value and it is
possible to command it.
POINT_TYPE_DIGITAL_INPUT A binary point. This point can only have two values (True or False)
and it is not possible to command it.
POINT_TYPE_ANALOG_OUTPUT A binary point. This point can only have two values (True or False)
and it is possible to command it.
Remarks
A logical point exists only locally and must be created each time the Connect event of RTDB is
called.
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False.
Syntax
Part Description
RTDB Required. A valid RTDB object.
cmndStatusString Required. A string that will be initialized to the textual description of the status.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Remarks
This method raises an error flag if the specified data point does not exist.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Filter Required. A string used to filter the list of data points that are to be returned. If the
string is empty, all data points of the specified types are returned.
Settings
Value Description
MASK_ALL Retrieves data points of all types.
Remarks
This method raises an error flag if it fails. The returned collection may be empty if no data points
matches the search criteria specified.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the ID returned is not valid and you can assume the point does
not exist.
Syntax
Part Description
RTDB Required. A valid RTDB object.
PointName Required. A string that will be initialized to the name of the point.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the name returned is not valid and you can assume the ID is
invalid.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Quality Required. A Variant that will be initialized to the acquisition quality of the point.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the quality returned is not valid and you can assume the ID is
invalid.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Quality Required. A Variant that will be initialized to the acquisition quality of the point.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the quality returned is not valid and you can assume the point
does not exist.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Settings
The Tag parameter can assume any value from 1 to 16, each representing a specific bit.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the value returned is not valid and you can assume the internal
ID is invalid.
Part Description
RTDB Required. A valid RTDB object.
Settings
The Tag parameter can assume any value from 1 to 16, each representing a specific bit.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the value returned is not valid and you can assume the point
does not exist.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Value Required. A Variant that will be initialized to the current point value.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the value returned is not valid and you can assume the ID is
invalid.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Value Required. A Variant that will be initialized to the current point value.
Remarks
This method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False. If it returns False, the value returned is not valid and you can assume the point
does not exist.
Syntax
Part Description
RTDB Required. A valid RTDB object.
status Required. A Long that will be initialized to the execution status of the command. If this
number is different from 0 once the method is executed, use the GetCmndStatusString
method to get a textual description.
timeout Required. A Long value representing the timeout, in milliseconds, allowed before
command execution fails. This parameter is dependent on the device with which the data
point is associated and may be ignored.
The status value indicates whether or not the call was successful. Here are the possible ranges and
their meaning:
Value Description
Between 0 and 1000H Operation succeeded.
Value Description
CMND_TYPE_DIRECT_EXECUTE Direct execution of the command.
CMND_TYPE_RESERVE – not implemented Not yet implemented. Reserve the point for a
yet command.
Remarks
The method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False.
The allowed values for cmndType depend on the data source with which the point is associated.
Part Description
RTDB Required. A valid RTDB object.
status Required. A Long that will be initialized to the execution status of the command. If this
number is different from 0 once the method is executed, use the GetCmndStatusString
method to get a textual description.
param Required. A Long value. The interpretation of this parameter depends on the
combination of cmndType and execType and may be ignored.
timeout Required. A Long value representing the timeout, in milliseconds, allowed before
command execution fails. This parameter is dependent of the device to which the data
point is associated and may be ignored.
Settings
The status value indicates whether or not the call was successful. Here are the possible ranges and
their meaning:
Value Description
Between 0 and 1000H Operation succeeded.
Value Description
CMND_TYPE_DIRECT_EXECUTE Direct execution of the command.
CMND_TYPE_RESERVE – not implemented Not yet implemented. Reserve the point for a
yet command.
Value Description
EXEC_TYPE_NONE No execution. The cmndType is sufficient.
EXEC_TYPE_OPEN Executes an open command. The exact meaning depends on the device
to which the data point is associated.
EXEC_TYPE_CLOSE Executes a close command. The exact meaning depends on the device
to which the data point is associated.
Remarks
The method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False.
The values allowed for cmndType and execType depend on the data source with which the point is
associated.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Settings
The Tag parameter can assume any value from 1 to 16. Each value represents a specific bit.
However, only bits 1 (control inhibition) and 16 (information) are currently supported.
Remarks
The method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False.
Syntax
Part Description
RTDB Required. A valid RTDB object.
Settings
The Tag parameter can assume any value from 1 to 16. Each value represents a specific bit.
However, only bits 1 (control inhibition) and 16 (information) are currently supported.
Remarks
The method returns True if it succeeds, False otherwise. Furthermore, it raises an error flag before
returning False.
Syntax
DataPoints = RTDB.DataPoints
Part Description
RTDB Required. A valid RTDB object.
Remarks
The collection returned may be empty if no there are no data points in the site configuration.
11.3 Events
The RTDB object generates events on connection and disconnection.
Syntax
Part Description
RTDB Required. A valid RTDB object.
ServerName Required. A string representing the name of the server to which the RTDB is connected.
Part Description
RTDB Required. A valid RTDB object.
ServerName Required. A string representing the name of the server from which the RTDB is
disconnected.
A DataPoints object is a collection of DataPoint objects obtained from the RTDB object. As for
every collection, it can be used in a For … Each construct. It represents the collection of all data
points available in the site configuration.
12.1 Methods
The DataPoints object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid DataPoints object.
itemIndex Required. The index of the data points to get. Only digital values are allowed. The
first data point is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid DataPoint object if itemIndex is valid, otherwise it is Nothing.
12.2 Properties
The DataPoints object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid DataPoints object.
Remarks
A DataPoint object represents a data point in the site configuration of the Visual T&D Server to
which the Visual T&D Diagram Editor application is connected. A DataPoint object can be used
directly in a For … Each construct to iterate through all the children.
13.1 Properties
Syntax
object.FormattedValue
Part Description
Object Required. A valid DataPoint object.
Remarks
13.1.2 Id Property
Retrieves the ID of the data point.
Syntax
object.Id
Remarks
Syntax
object.Name
Part Description
object Required. A valid DataPoint object.
Remarks
Syntax
object.Quality
Part Description
object Required. A valid DataPoint object.
Remarks
object.RawValue
Part Description
Object Required. A valid DataPoint object.
Remarks
Syntax
object.Time
Part Description
Object Required. A valid DataPoint object.
Remarks
Syntax
object.Type
Part Description
object Required. A valid DataPoint object.
Settings
Remarks
Syntax
object.Value
Part Description
Object Required. A valid DataPoint object.
Remarks
The AlarmManager object represents the Visual T&D Server alarm manager. Every active alarm
is represented and accessible, and can be managed through this object.
An AlarmManager object can be used directly in a For … Each construct to iterate through all
active alarms.
14.1 Methods
The AlarmManager object provides methods for accessing and managing alarms. Any
manipulation on alarms in Visual T&D Diagram Editor is automatically mirrored on the
Visual T&D Server.
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
PointName Required. A string identifying the point for which to acknowledge the alarm.
Value Description
ALARM_TYPE_ALL Any kind of alarm. This value will acknowledge the alarm on the point,
regardless of its type.
ALARM_BINARY_STATE Alarm generated when the value of a binary data point becomes True.
ALARM_LEVEL_LOW Alarm generated when the value of an analog data point falls below the lower
threshold.
ALARM_LEVEL_HIGH Alarm generated when the value of an analog data point exceeds the upper
threshold.
ALARM_BAD_QUALITY Alarm generated when the quality of a data point turns bad.
Remarks
This method raises an error flag if it fails. In order to succeed, an alarm of the specified type must
exist for the specified point and must not have been acknowledged, and the logged on user must
be able to manage alarms.
Syntax
AlarmManager.AcknowledgeAll
Part Description
AlarmManager Required. A valid AlarmManager object.
Remarks
This method raises an error flag if it fails. In order to succeed, an alarm unacknowledged alarm
must exist and the logged on user must be able to manage alarms.
Syntax
AlarmManager.AcknowledgeOldest
Part Description
AlarmManager Required. A valid AlarmManager object.
Remarks
This method raises an error flag if it fails. In order to succeed, an unacknowledged alarm must
exist and the logged on user must be able to manage alarms.
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
PointName Required. A string identifying the point for which to clear the alarm.
type Optional. An ALARM_TYPE enumeration value identifying the alarm type to clear.
If omitted, defaults to ALARM_TYPE_ALL.
Settings
Value Description
ALARM_TYPE_ALL Any kind of alarm. This value will clear any alarm on the point, regardless of
its type.
ALARM_BINARY_STATE Alarm generated when the value of a binary data point becomes True.
ALARM_LEVEL_LOW Alarm generated when the value of an analog data point falls below the lower
threshold.
ALARM_LEVEL_HIGH Alarm generated when the value of an analog data point exceeds the upper
threshold.
ALARM_BAD_QUALITY Alarm generated when the quality of a data point turns bad.
Remarks
This method raises an error flag if it fails. In order to succeed, an alarm of the specified type must
exist for the specified point, must have been acknowledged, must be in the return to normal state,
and the logged on user must be able to manage alarms.
Syntax
AlarmManager.ClearAll
Part Description
AlarmManager Required. A valid AlarmManager object.
Remarks
This method raises an error flag if it fails. In order to succeed, acknowledged alarms in the return
to normal state must exist and the logged on user must be able to manage alarms.
Syntax
AlarmManager.ClearOldest
Part Description
AlarmManager Required. A valid AlarmManager object.
Remarks
This method raises an error flag if it fails. In order to succeed, an acknowledged alarm in the
return to normal state must exist and the logged on user must be able to manage alarms.
Syntax
AlarmManager.ClearSound
Remarks
This method raises an error flag if it fails. For the method to succeed, the logged-on user must be
able to manage alarms.
Syntax
Part Description
Priority Required. Specifies the alarm priority. Valid values are from 1 to 3.
Settings
Value Description
0 Active and unacknowledged alarms.
Remarks
Part Description
AlarmManager Required. A valid AlarmManager object.
PointName Required. A string identifying the point for which get the description of the alarm.
type Optional. An ALARM_TYPE enumeration value identifying the alarm type for
which to get the description. If omitted, defaults to ALARM_TYPE_ALL.
Settings
Value Description
ALARM_TYPE_ALL Any kind of alarm. This value will get the description of an
ALARM_BINARY_STATE if the data point is binary; otherwise it will get
the description of an ALARM_LEVEL_LOW for an analog data point.
ALARM_BINARY_STATE Alarm generated when the value of a binary data point becomes true.
ALARM_LEVEL_LOW Alarm generated when the value of an analog data point falls below the lower
threshold.
ALARM_LEVEL_HIGH Alarm generated when the value of an analog data point exceeds the upper
threshold.
ALARM_BAD_QUALITY Alarm generated when the quality of a data point turns bad.
Remarks
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
Priority Required. Specifies the alarm priority. Valid values are from 1 to 3.
Settings
Value Description
0 Active and unacknowledged alarms.
Remarks
This method returns a Boolean that indicates whether flashing is configured for the specified alarm
state and priority. The true Boolean state indicates that flashing is configured.
Syntax
AlarmManager.GetPriorityQty
Part Description
AlarmManager Required. A valid AlarmManager object.
Remarks
This method returns the number of alarm priority levels supported by the system.
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
PointName Required. A string identifying the point for which the active alarms are to be
verified.
Settings
Value Description
ALARM_TYPE_ALL Any type of alarm. This value will check for active alarms of any type for the
point.
ALARM_BINARY_STATE Alarm generated when the value of a binary data point becomes True.
ALARM_LEVEL_LOW Alarm generated when the value of an analog data point falls below the lower
threshold.
ALARM_LEVEL_HIGH Alarm generated when the value of an analog data point exceeds the upper
threshold.
ALARM_BAD_QUALITY Alarm generated when the quality of a data point turns bad.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm of the specified
type must exist for the specified point.
Syntax
AlarmManager.GetStateQty
Part Description
AlarmManager Required. A valid AlarmManager object.
Remarks
This method returns the number of alarm states supported by the system.
Syntax
Part Description
Priority Required. Specifies the alarm priority. Valid values are from 1 to 3.
Settings
Value Description
0 Active and unacknowledged alarms.
Remarks
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
PointName Required. A string identifying the point for which to verify the acknowledged
alarm.
Settings
Value Description
ALARM_TYPE_ALL Any kind of alarm. This value will verify for acknowledged alarm of any
type for the point.
ALARM_BINARY_STATE Alarm generated when the value of a binary data point becomes True.
ALARM_LEVEL_LOW Alarm generated when the value of an analog data point falls below the lower
threshold.
ALARM_LEVEL_HIGH Alarm generated when the value of an analog data point exceeds the upper
threshold.
ALARM_BAD_QUALITY Alarm generated when the quality of a data point turns bad.
Remarks
This method raises an error flag if it fails. In order to succeed, an alarm of the specified type must
exist for the specified point.
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
PointName Required. A string identifying the point for which to verify the active alarms.
Settings
ALARM_BINARY_STATE Alarm generated when the value of a binary data point becomes True.
ALARM_LEVEL_LOW Alarm generated when the value of an analog data point falls below the lower
threshold.
ALARM_LEVEL_HIGH Alarm generated when the value of an analog data point exceeds the upper
threshold.
ALARM_BAD_QUALITY Alarm generated when the quality of a data point turns bad.
Remarks
This method raises an error flag if it fails. In order to succeed, an alarm of the specified type must
exist for the specified point.
Syntax
Part Description
PointName Required. A string identifying the data point to be checked for a disabled alarm.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist for the
data point.
Syntax
PointName Required. A string identifying the data point to be checked for a permanent alarm.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist for the
data point.
Syntax
Part Description
PointName Required. A string identifying the data point to be checked for a silent alarm.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist for the
data point.
Syntax
Boolean = AlarmManager.IsSoundDisabled
Part Description
Remarks
Syntax
Boolean = AlarmManager.IsSoundTriggered
Part Description
Remarks
Syntax
Part Description
PointName Required. A string identifying the point for which the alarm is to be set to disabled
state.
BDisabled Required. A Boolean: True to disable the alarm, False to enable it.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist and the
logged-on user must be able to manage alarms.
Syntax
PointName Required. A string identifying the point for which the alarm is to be set to
permanent state.
bPermanent Required. A Boolean: True to make the alarm permanent, False to make the alarm
non-permanent.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist and the
logged-on user must be able to manage alarms.
Syntax
Part Description
PointName Required. A string identifying the point for which the alarm is to be set to silent
state.
bSilent Required. A Boolean: True to silence the alarm, False to make it audible.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist and the
logged-on user must be able to manage alarms.
Syntax
AlarmManager.SetSoundDisabled bDisable
Part Description
bDisable Required. A Boolean: True to disable the buzzer, False to enable it.
Remarks
14.2 Properties
For the moment, the AlarmManager object has only one property. This property gives access to
the collection of alarms.
Syntax
Alarms = AlarmManager.Alarms
Part Description
AlarmManager Required. A valid AlarmManager object.
Remarks
14.3 Events
The AlarmManager object generates events on connection, disconnection and changes.
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
ServerName Required. A string representing the name of the server to which the AlarmManager is
connected.
Syntax
Part Description
AlarmManager Required. A valid AlarmManager object.
ServerName Required. A string representing the name of the server from which the AlarmManager
is disconnected.
An Alarms object represents the collection of active alarms when the collection was obtained. As
for every collections, it can be used in a For … Each construct.
15.1 Methods
Alarms object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid Alarms object.
itemIndex Required. The index of the alarm to get. Only numeric values are allowed. The first
alarm is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid Alarm object if itemIndex is valid, otherwise it is Nothing.
15.2 Properties
Alarms object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid Alarms object.
Remarks
An Alarm object represents an active alarm on the Visual T&D Server. Objects of this type are
accessible through an Alarms collection. All information is accessible through this object and the
alarm can be managed directly.
16.1 Methods
Some methods are provided for managing alarms. They are equivalent to the method of the
AlarmManager object but apply only to the specific alarm.
Syntax
object.Acknowledge
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.Clear
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
Time = object.GetTimeString
Part Description
Remarks
This method returns a String object formatted as “DATE HH:MM:SS.XXX*”, where DATE is in
the Windows long date format, HH are the hours in 2-digit/24-hour format, MM are the minutes,
SS are the seconds, XXX are the milliseconds, and the asterisk is the invalid flag.
Syntax
object.SetDisabled bDisable
Part Description
bDisable Required. A Boolean: True to disable the alarm, False to enable it.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist and the
logged-on user must be able to manage alarms.
Syntax
object.SetPermanent bPermanent
Part Description
bPermanent Required. A Boolean: True to make the alarm permanent, False to make it non-
permanent.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist and the
logged-on user must be able to manage alarms.
Syntax
object.SetSilent bSilent
Part Description
bSilent Required. A Boolean: True to make the alarm silent, False to make it audible.
Remarks
This method raises an error flag if it fails. For the method to succeed, an alarm must exist and the
logged-on user must be able to manage alarms.
16.2 Properties
In order to access information about the alarm, several properties are defined. Those properties
reflect the state of the alarm when the collection was obtained.
Syntax
object.Acknowledged
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.Description
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.FormattedValue
Part Description
object Required. A valid Alarm object.
Syntax
object.IsAcknowledged
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.IsActive
Part Description
Object Required. A valid Alarm object.
Remarks
Syntax
object.IsDisabled
Remarks
Syntax
object.IsMultiple
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.IsPermanent
Part Description
Remarks
object.IsSilent
Part Description
Remarks
Syntax
object.Multiple
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.NumericValue
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.Priority
Part Description
Object Required. A valid Alarm object.
Remarks
Syntax
object.Source
Part Description
object Required. A valid Alarm object.
Remarks
Syntax
object.Time
Part Description
object Required. A valid Alarm object.
Syntax
object.Type
Part Description
object Required. A valid Alarm object.
Remarks
17.1 Methods
The AlarmChanges object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid AlarmChanges object.
itemIndex Required. The index of the change to get. Only numeric values are allowed. The
first change is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid AlarmChange object if itemIndex is valid, otherwise it is Nothing.
17.2 Properties
The AlarmChanges object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid AlarmChanges object.
Remarks
18.1 Properties
The AlarmChange object defines two properties.
Syntax
object.Alarm
Part Description
object Required. A valid AlarmChange object.
Remarks
The property gives access to an Alarm object on which the changes occurred. The Alarm
property is a read-only property.
Syntax
object.Change
Part Description
object Required. A valid AlarmChange object.
Settings
Possible values for this property are any combination of the following:
Value Description
ALARM_CHANGE_CLEARED The alarm was cleared.
Remarks
The EventManager object represents the Visual T&D Server event manager. The latest events are
represented and accessible, and can be managed through this object.
An EventManager object can be used directly in a For … Each construct to iterate through all
the latest events.
19.1 Properties
The following properties are available for the EventManager object.
Syntax
Events = EventManager.Events
Part Description
EventManager Required. A valid EventManager object.
Remarks
The collection returned may be empty if there are no events on the server.
EventTypes = EventManager.EventTypes
Part Description
EventManager Required. A valid EventManager object.
19.2 Events
The following EventManager events are generated when the list of events changes on the
Visual T&D Server.
Syntax
Part Description
EventManager Required. A valid EventManager object.
An Events object represents the collection of the latest event when the collection was obtained. As
for every collection, it can be used in a For … Each construct.
20.1 Methods
The following methods are available for an Events object.
Syntax
Part Description
object Required. A valid Events object.
itemIndex Required. The index of the event to get. Only numeric values are allowed. The first
event is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid Event object if itemIndex is valid, otherwise it is Nothing.
20.2 Properties
The following properties are available for an Events object.
Syntax
object.Count
Part Description
object Required. A valid Events object.
Remarks
An EventObject object represents an event on the Visual T&D Server. Objects of this type are
accessible through an Events collection. All information is accessible through this object and the
event can be managed directly.
Note: As “Event” is a reserved keyword in Visual Basic, the “Object” suffix was added
to differentiate the Visual T&D event object from the Visual Basic one.
21.1 Methods
The following methods are available for an EventObject object.
Syntax
object.IsAlarm
Part Description
object Required. A valid EventObject object.
21.2 Properties
The following properties are available for an EventObject object.
Syntax
object.AlarmState
Part Description
object Required. A valid EventObject object.
Returned Value
ALARM_RTN_REQUIRED 0x08 Indicates that the alarm must return to its normal
state before being cleared.
ALARM_REAPPEARANCE 0x10 The alarm has reentered its active state at least once
before being acknowledged.
ALARM_SILENT 0x40 The alarm as been set as silent: it does not activate
a sound warning when triggered.
Remarks
Syntax
object.Description
Part Description
object Required. A valid EventObject object.
Remarks
Syntax
object.EventType
Part Description
object Required. A valid EventObject object.
Remarks
Syntax
object.FormattedValue
Part Description
object Required. A valid EventObject object.
Remarks
object.Millisecond
Part Description
object Required. A valid EventObject object.
Remarks
Syntax
object.NumericValue
Part Description
object Required. A valid EventObject object.
Remarks
Syntax
object.Source
Part Description
object Required. A valid EventObject object.
Remarks
Syntax
object.Time
Part Description
object Required. A valid EventObject object.
Remarks
An EventTypes object represents the collection of event types when the collection was obtained.
As for every collection, it can be used in a For … Each construct.
22.1 Methods
The following methods are available for an EventTypes object.
Syntax
Part Description
object Required. A valid EventTypes object.
itemIndex Required. The index of the event type to get. Only numeric values are allowed. The
first event type is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid EventType object if itemIndex is valid, otherwise it is Nothing.
22.2 Properties
Retrieves the number of objects in the collection.
object.Count
Part Description
object Required. A valid EventTypes object.
Remarks
23.1 Properties
The following properties are available for the EventType object.
Syntax
object.Name
Part Description
object Required. A valid EventType object.
Remarks
Syntax
object.SubTypeId
Part Description
object Required. A valid EventType object.
Remarks
Syntax
object.TypeId
Part Description
object Required. A valid EventType object.
Remarks
24.1 Methods
The following methods are available for the EventChanges object.
Syntax
Part Description
object Required. A valid EventChanges object.
itemIndex Required. The index of the change to get. Only numeric values are allowed. The
first change is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid EventChange object if itemIndex is valid, otherwise it is Nothing.
24.2 Properties
The following properties are available for the EventChanges object.
Syntax
object.Count
Part Description
object Required. A valid EventChanges object.
Remarks
An EventChange object represents the changes that occurred on an event. It is accessible through
an EventChanges collection.
25.1 Properties
The following properties are available for the EventChange object.
Syntax
object.Change
Part Description
object Required. A valid EventChange object.
Returned Value
Possible values for this property are any combination of the following:
Value Description
EVENT_CHANGE_ADDED This is a new event.
Remarks
Syntax
object.EventObject
Part Description
object Required. A valid EventChange object.
Remarks
The property gives access to an EventObject object on which the changes occurred. The
EventObject property is a read-only property.
The TagManager object represents the tag manager of the Visual T&D Server. Every active tag is
represented, accessible and can be managed through this object.
A TagManager object can be used directly in a For … Each construct, to iterate through all
active tags.
26.1 Methods
Several methods are provided to manage tags on the Visual T&D Server.
Syntax
Part Description
TagManager Required. A valid TagManager object.
pointName Required. The point name associated to the tag. It must not be empty.
tagTypeId Required. An index value identifying the tag type. The type must exist in the
configuration.
Comment Optional. A string used as a comment for the tag. The content of the string can be
anything and is not limited. It can be empty. If omitted, an empty string is used.
Syntax
Part Description
TagManager Required. A valid TagManager object.
tagTypeId Optional. An index value identifying on which type of tag the clear operation should
be performed. Ignored if range is TAG_RANGE_BY_ID. If omitted, defaults to 0
(which represents all tag types).
Settings
Value Description
TAG_RANGE_BY_ID The label parameter identifies a specific tag by its identifier.
Remarks
This method raises an error flag if it fails. A user cannot clear tags belonging to another user
unless he has the right to edit the site configuration.
Syntax
Part Description
TagManager Required. A valid TagManager object.
pointName Required. The point name associated to the tag for which a comment is to be edited.
Comment Required. A string used as the new comment for the tag. The content of the string
can be anything and is not limited. It can be empty.
Remarks
Syntax
Part Description
TagManager Required. A valid TagManager object.
range Required. A TAG_RANGE enumeration value identifying which tag(s) to get. This
value will determine how the following parameters are interpreted.
tagTypeId Optional. An index value identifying which tag type to get. Ignored if range is
TAG_RANGE_BY_ID. If omitted, defaults to 0 (which represents all tag types).
Settings
Value Description
TAG_RANGE_ALL The label is ignored. Retrieves all the tags.
TAG_RANGE_BY_OBJECT The label parameter identifies a specific object (that is, a data
point). Retrieves all tags on this object.
Remarks
This method raises an error flag if it fails. The returned collection may be empty if no tags match
the search criteria specified.
Part Description
TagManager Required. A valid TagManager object.
pointName Required. The point name associated to the tag for which to count the active tags.
tagTypeId Optional. An index value identifying which tag type to count. The type must exist in
the configuration. If omitted, defaults to 0. (which represents all tag types)
Remarks
This method raises an error flag if it fails. If no tags are found, it returns 0.
Syntax
Part Description
TagManager Required. A valid TagManager object.
Remarks
The generatorId parameter can be use to maintain multiple sequences of numbers. Consider a
category X and a category Y. The first call of GetNextSerialNumber(X) on a system will return 1,
the second one will return 2, etc… You can then call GetNextSerialNumber(Y) to obtain a fresh
sequence starting at number one. There’s no need to initially create a generator.
Sequences are not reset when the application or the workstation restarts: to reset a sequence, you
must use the ResetSerialNumber method.
Part Description
TagManager Required. A valid TagManager object.
tagTypeId Required. An index value identifying which tag type to get information for. The
type must exist in the configuration. If omitted, defaults to 0. (which represents all
tag types)
Remarks
This method raises an error flag if it fails. The collection returned may be empty.
Syntax
TagManager.ResetSerialNumber generatorId
Part Description
TagManager Required. A valid TagManager object.
Remarks
Calling ResetSerialNumber(X) will make the next call to GetNextSerialNumber(X) return “1”.
26.2 Properties
The TagManager object defines some properties that give access to the collections of objects
managed by the Visual T&D Server.
TagManager.Tags
Part Description
TagManager Required. A valid TagManager object.
Remarks
The collection returned may be empty. The Tags property is a read-only property.
Syntax
TagTypes = TagManager.Types
Part Description
TagManager Required. A valid TagManager object.
Remarks
26.3 Events
The AlarmManager object generates events on connection, disconnection and changes.
Syntax
Part Description
TagManager Required. A valid TagManager object.
Syntax
Part Description
TagManager Required. A valid TagManager object.
ServerName Required. A string representing the name of the server to which the TagManager is
connected.
Syntax
Part Description
TagManager Required. A valid TagManager object.
ServerName Required. A string representing the name of the server from which the TagManager is
disconnected.
A Tags object represents the collection of active tags when the collection was obtained. As for
every collection, it can be used in a For … Each construct.
27.1 Methods
Tags object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid Alarms object.
itemIndex Required. The index of the tag to get. Only numeric values are allowed. The first tag
is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid Tag object if itemIndex is valid, otherwise it is Nothing.
27.2 Properties
Tags object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid Tags object.
Remarks
28.1 Methods
A Tag object defines one method in order to clear it from the Visual T&D Server.
Syntax
object.Clear
Part Description
object Required. A valid Tag object.
Remarks
This method raises an error flag if it fails. The rules for clearing a tag are the same as the Clear
method of the TagManager object.
28.2 Properties
Several properties exist on a Tag object. Those properties can be used to get more information
about a specific tag.
object.Comment [= String]
Part Description
object Required. A valid Tag object.
Remark
This property may raise en error flag if the comment cannot be set.
28.2.2 Id Property
Retrieves the identifier of the tag.
Syntax
object.Id
Part Description
object Required. A valid Tag object.
Remarks
Syntax
object.object
Part Description
object Required. A valid Tag object.
Remarks
Syntax
object.Owner
Part Description
object Required. A valid Tag object.
Remarks
Syntax
object.Time
Part Description
object Required. A valid Tag object.
Remarks
The Time property is a read-only property. See Obtaining Milliseconds from a Date Object, for a
code snippet of how to obtain the milliseconds.
Syntax
object.Type
Part Description
object Required. A valid Tag object.
A TagTypes object represents the collection of tag types when the collection was obtained. As for
every collection, it can be used in a For … Each construct.
29.1 Methods
TagTypes object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid Alarms object.
itemIndex Required. The index of the tag type to get. Only numeric values are allowed. The
first tag type is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid TagType object if itemIndex is valid, otherwise it is Nothing.
29.2 Properties
The TagTypes object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid TagTypes object.
Remarks
A TagType object is accessible through the Type member of a Tag object or a TagTypes
collection. This object contains information about a type of tag as in the Visual T&D Server
configuration.
30.1 Properties
The properties of a TagType object provide access to information about the tag type as configured
in the Visual T&D Server.
Syntax
object.Action
Part Description
object Required. A valid TagType object.
Settings
Value Description
TAG_TYPE_ALL_CONTROL_INHIBITED Represents a control inhibition tag.
Remarks
Syntax
object.Color
Part Description
object Required. A valid TagType object.
Remarks
Syntax
object.description
Part Description
object Required. A valid TagType object.
Remarks
Syntax
object.Group
Part Description
object Required. A valid TagType object.
Syntax
object.Maximum
Part Description
object Required. A valid TagType object.
Remarks
Syntax
object.Name
Part Description
object Required. A valid TagType object.
Remarks
Syntax
object.Priority
Remarks
Syntax
object.Symbol
Part Description
object Required. A valid TagType object.
Remarks
Syntax
object.TagTypeId
Part Description
object Required. A valid TagType object.
Remarks
object.Type
Part Description
object Required. A valid TagType object.
Settings
Value Description
TAG_TYPE_ALL_CONTROL_INHIBITED Represents a control inhibition tag.
Remarks
A TagChanges object is a collection of TagChange objects obtained by the Change event of the
TagManager object. It represents all the changes that occurred on the Visual T&D Server for the
tags since the last invocation of the Change event. As for every collection, it can be used in a For
… Each construct.
31.1 Methods
The TagChanges object defines the usual methods for a collection.
Syntax
Part Description
object Required. A valid TagChanges object.
itemIndex Required. The index of the change to get. Only numeric values are allowed. The
first change is at index 0, the second, at index 1, etc.
Remarks
The returned value is a valid TagChange object if itemIndex is valid, otherwise it is Nothing.
31.2 Properties
The TagChanges object defines the usual properties for a collection.
Syntax
object.Count
Part Description
object Required. A valid TagChanges object.
Remarks
A TagChange object represents the changes that occurred on a tag. It is accessible through a
TagChanges collection.
32.1 Properties
The TagChange object defines two properties.
Syntax
object.Tag
Part Description
object Required. A valid TagChange object.
Remarks
The property gives access to a Tag object for which the changes occurred. The Tag property is a
read-only property.
Syntax
object.Change
Part Description
object Required. A valid TagChange object.
Settings
Value Description
TAG_CHANGE_ADDED This is a new tag.
TAG_CHANGE_MODIFIED The tag was modified. As for now, it means the comment
associated with the tag was modified.
Remarks
A class module defines objects, their properties, and their methods. A class module acts as a
template from which an instance of an object is created at run time. Every diagram project
contains the Application, Document, Shape and RTDB class modules.
A user form contains user interface controls, such as command buttons and text boxes.
Once you have created the graphic aspects of your diagram, you will design your VBA project.
Typically, you will create a new module for each major component of your diagram. In each
module, you will create the procedures necessary to process the events that occur in the diagram.
If you plan your modules carefully, you will be able to export diagram pages and shapes to library
files.
Select the Module command in the Insert menu of the Visual Basic Editor.
Select the Name property in the Properties window and enter a meaningful name for your
module.
Tip: You should always begin your modules with the Option Explicit statement. This
statement ensures that all Visual Basic variables are declared before they are
used.
Select the Procedure command in the Insert menu of the Visual Basic Editor.
Enter a name for the procedure, select the type and scope.
Tip: Because of the specific parameters required, it is easier to use the Visual Basic
Wizard to create event handlers.
Select the UserForm command in the Insert menu of the Visual Basic Editor.
Select the Name property in the Properties window and enter a meaningful name for the form.
This name will be used as a prefix for all the form event handlers.
Select the Caption property in the Properties window and enter a meaningful caption for the
form.
When you add a user form to your project, VBA automatically opens the Controls Toolbox. This
toolbox contains controls that you can place on the form. Each control has its own properties and
generates events for which you can provide event handlers.
In this section, we will explain basic programming techniques that you can use to add
sophisticated capabilities to your diagrams.
Diagram Editor generates a Resolve Alias event before it displays a new diagram page. To
automatically assign tag names to aliases, you must provide a Visual Basic procedure that is
associated with the Resolve Alias event of each shape.
In order to automatically assign aliases to variables, you will need to use a naming convention.
The following table illustrates a simple convention you can use, where the name of each shape
corresponds to a device and the name of each alias corresponds to a type of data. The variable
names are composed of the device name and the data point name, separated by an underscore.
The following sample procedure illustrates how you can implement a procedure that assigns
aliases to variables according to the above naming convention.
shapename = DiagramShape.Name
aliasCount = DiagramShape.aliasCount
For index = 1 To aliasCount Step 1
DiagramShape.GetAlias index, alias
variable = shapename + "_" + alias
DiagramShape.ResolveAlias index, variable
Next index
End Function
Note: You can use a single procedure to resolve the aliases for all the shapes in your
diagram. However, you will have to assign the procedure individually to each
shape.
In the following sample code, a click on a shape displays a message box where the operator
confirms an operation. If the operator confirms, the procedure invokes another procedure to handle
the operation.
In the following sample code, we use the Click event handler to display a diagram page:
The OpenPage method uses the name of the selected shape to select a shape renaming table.
In the following sample code, we use the Click event handler to toggle the tag associated with a
device:
' Build tagname from shape name and data point name
PointName = DiagramShape.Name + "_CB_Open"
The following code processes the Click event and displays a user form called "BreakerForm":