0% found this document useful (0 votes)
226 views91 pages

Visual TD Diagram Editor User Guide

This document is a user guide for the Visual T&D Diagram Editor software. It provides information on how to use the software, including details on creating diagrams, organizing and modifying shapes, adding properties, and working with data.

Uploaded by

Bairon Alvira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views91 pages

Visual TD Diagram Editor User Guide

This document is a user guide for the Visual T&D Diagram Editor software. It provides information on how to use the software, including details on creating diagrams, organizing and modifying shapes, adding properties, and working with data.

Uploaded by

Bairon Alvira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 91

User Guide

Visual T&D
Diagram Editor
© 2011 Cooper Power Systems, LLC – All rights reserved.
The information in this document is subject to change without notice.

Cooper Power Systems


Energy Automation Solutions
730 Commerciale Street
Suite 200
Saint-Jean-Chrysostome, Quebec
Canada G6Z 2C5
Phone: +1.418.834.0009
Fax: +1.514.227.5256
Email: [email protected]
Web: http://www.cooperpower.com

Technical Support: [email protected]

GUI-00115-00021 T, version 12
Contents
Introduction 1
Welcome to Visual T&D Diagram Editor ...........................................................................1
Contacting Cooper Power Systems .......................................................................1
Getting Support .....................................................................................................2

The Basics 3
Overview .............................................................................................................................3
Modes of Operation .............................................................................................................3
Switching Between the Design Mode and the Animation Mode ...........................4
Creating a Diagram ..............................................................................................................4
Setting up the Current Page’s Properties ...............................................................4
Setting up the Current Page’s Grid Properties .......................................................5
The Drawing Toolbar ............................................................................................6
Adding Basic Shapes to Your Diagram .................................................................7
Adding a Line to Your Drawing ............................................................. 7
Adding a Polygon to Your Drawing........................................................ 7
Adding a Rectangle to Your Drawing ..................................................... 8
Adding a Polycurve to Your Drawing ..................................................... 8
Adding a Closed Curve to Your Drawing ............................................... 8
Adding an Ellipse or a Circle to Your Drawing ...................................... 8
Adding a Text Label to Your Drawing ................................................... 9
Adding an Image to Your Drawing ......................................................... 9
Working with Overlapping Shapes........................................................................9
Moving a Shape up in the Stacking Order............................................. 10
Moving a Shape Down in the Stacking Order ....................................... 10
Selecting Shapes ..................................................................................................10
Using the Pointer Tool to Select Shapes ............................................... 10
Using the Selection Tool to Select Shapes ............................................ 10
Selecting Multiple Shapes ..................................................................... 11
Moving Shapes ....................................................................................................11

Visual T&D Diagram Editor •i


Using the Mouse to Move Shapes ......................................................... 11
Using the Keyboard to Move Shapes .................................................... 11
Modifying Shapes................................................................................................12
Using the Mouse to Change the Size of a Shape ................................... 12
Adjusting the Size of a Shape ............................................................... 12
Moving the Vertices of a Complex Shape............................................. 13
Rotating Shapes ...................................................................................................13
Rotating a Shape at any Angle .............................................................. 13
Rotating a Shape in 90° Increments ...................................................... 14
Flipping a Shape.................................................................................... 14
Organizing Shapes in the Drawing ....................................................................................14
Selecting the Shapes to be Organized ..................................................................14
Aligning Shapes ..................................................................................................15
Making Shapes the Same Size .............................................................................15
Distributing Shapes Evenly .................................................................................15
Grouping Shapes ................................................................................................................16
Grouping Shapes .................................................................................................16
Ungrouping Shapes .............................................................................................17
Connecting Shapes.............................................................................................................17
Adding Connection Points ...................................................................................17
Linking the Shapes ..............................................................................................18
Adjusting the Link ...............................................................................................18
Shape Properties ................................................................................................................19
General Properties ...............................................................................................19
Image Properties ..................................................................................................20
Line Drawing Properties......................................................................................21
Color Fill Properties ............................................................................................21
Text Properties ....................................................................................................22
Font Properties ....................................................................................................23
Changing the Properties of Grouped Shapes .......................................................24
Changing the Properties of Individual Shapes in a Group ...................................24
Saving and Loading Diagrams ...........................................................................................25
Saving a Diagram ................................................................................................25
Saving a Diagram on the Server ..........................................................................25
Opening a Diagram Stored on Your Workstation ...............................................26
Opening the Diagram Stored on the Server .........................................................26

ii • Visual T&D Diagram Editor


Working with Data 27
Overview ...........................................................................................................................27
Variables and Data Points ..................................................................................................27
Animation Effects ..............................................................................................................28
Animation Basics ................................................................................................28
Drawing the Shape for the Open Switch ............................................... 28
Drawing the Shape for the Closed Switch............................................. 29
Grouping the Components .................................................................... 29
Defining the Animation Effects ............................................................ 30
Running the Animation ......................................................................... 31
The Animation Properties of Shapes ...................................................................31
Working with Animation Expressions.................................................................32
The Expression Editor ........................................................................... 32
Arithmetic Operators ............................................................................. 33
Relational Operators.............................................................................. 34
Logical and Binary Operators ............................................................... 34
Functions ............................................................................................... 35
Constants ............................................................................................... 36
Special-Purpose Logical Points ............................................................. 37
The Show Value Effect .......................................................................................37
The Change Color Effect .....................................................................................38
The Show Text Effect..........................................................................................39
The Hide Effect ...................................................................................................40
The Flash Effect ..................................................................................................41
The Scale Effect ..................................................................................................42
The Move effect ..................................................................................................43
Combining Effects ...............................................................................................44
Using the Full Screen Display Setting .................................................................44
Using Diagram Editor in the Standalone HMI Mode ........................................................45
The Kiosk Mode ..................................................................................................46

Sharing Diagram Components 47


Overview ...........................................................................................................................47
Creating and Managing Shape Libraries............................................................................47
The Library Manager Dialog Box .......................................................................47
Creating a New Shape Library ............................................................................48
Adding Shapes to Libraries .................................................................................48

Visual T&D Diagram Editor • iii


Creating Library Folders .....................................................................................49
Moving Shapes to Another Folder or Library .....................................................50
Renaming Libraries and Folders..........................................................................50
Renaming Shapes ................................................................................................50
Deleting Libraries and Folders ............................................................................50
Deleting Shapes ...................................................................................................51
Adding Library Shapes to a Diagram ................................................................................51
Adding Linked Shapes ........................................................................................51
Adding Unlinked Shapes .....................................................................................51
Working with Shape Versions ...........................................................................................52
Updating Shapes in a Library ..............................................................................52
Updating the Shapes in a Drawing ......................................................................53
Updating a Single Shape ....................................................................... 53
Updating all the Shapes in the Drawing ................................................ 53
Importing and Exporting Parts of a Diagram .....................................................................53
Exporting Parts of a Diagram ..............................................................................53
Importing Parts of a Diagram ..............................................................................55
Working with Aliases ........................................................................................................55
Using Aliases in Animation Expressions ............................................................55
Manually Assigning Aliases to Variables............................................................55
Automatically Assigning Aliases to Variables ....................................................57
Using the ResolveByName Procedure .................................................. 57
Using the ResolveFromFile Procedure.................................................. 60
The Basic Shapes Library ..................................................................................................61
Working with Pages ...........................................................................................................63
The Types of Pages in a Diagram ........................................................................64
Managing the Pages in Your Diagram.................................................................64
Adding a New Page or Modifying an Existing Page ...........................................65
Displaying the Pages of a Multiple-Page Diagram ..............................................66
Using a Single Diagram Page to Monitor Multiple Devices ...............................69

Working with Scripts 75


Overview ...........................................................................................................................75
Diagram Editor Events ......................................................................................................75
Events and Operation Modes...............................................................................76
The Click Event ...................................................................................................76
The Double-Click Event ......................................................................................77

iv • Visual T&D Diagram Editor


The Mouse Enter event ........................................................................................78
The Mouse Leave Event ......................................................................................78
The Add Shape to Diagram Event .......................................................................79
The Resolve Aliases Event ..................................................................................79
The Diagram Editor Object Model ....................................................................................79
The Visual Basic Wizard ...................................................................................................79
Creating a New Module.......................................................................................80
Creating a New Procedure ...................................................................................80
Assigning Procedures to Events and Shapes .......................................................81
The Visual Basic Integrated Development Environment...................................................83
Launching the Visual Basic Editor ......................................................................83

Visual T&D Diagram Editor •v


Introduction

Welcome to Visual T&D Diagram Editor


The Visual T&D family of products is specially designed to integrate a large variety of data
sources and provide you with a unified view of all the devices in a power substation.

With Visual T&D Diagram Editor, you can easily:

‰ Create basic shapes that represent various devices.

‰ Use shapes to create diagrams that represent the devices in the substation and how they are
interconnected.

‰ Associate data points with shape display properties and create animated diagrams that
represent the current state of a process.

‰ Create libraries of standard shapes and diagram pages that speed up the substation
configuration process.

‰ Associate shapes with Microsoft ® Visual Basic ® for Applications (VBA) scripts and
implement sophisticated control functions.

Visual T&D Diagram Editor is the companion product to Visual T&D Explorer and is part of
Cooper Power Systems’ Yukon family of products.

Contacting Cooper Power Systems


Cooper Power Systems is committed to providing the best possible support to Visual T&D users.
Feel free to contact us with any questions about Visual T&D or our substation automation line of
products.

Our sales department can assist you with general questions regarding the use of Visual T&D and
with any pricing and licensing issues.

Email: [email protected]
Phone: +1.418.834.0009
Fax: +1.514.227.5256

Visual T&D Diagram Editor •1


Getting Support
If you have any question regarding the performance, application or testing of any component of
this Cooper Power Systems product, do not hesitate to contact us. Our staff will be pleased to
assist you.
Technical Support
Cooper Power Systems
Energy Automation Solutions
730 Commerciale Street, Suite 200
Saint-Jean-Chrysostome, Quebec
Canada G6Z 2C5

Email: [email protected]
Phone: +1.418.834.0009
Fax: +1.514.227.5256

Business hours are from 8 a.m. and 5 p.m. EST, Monday to Friday.

2• Visual T&D Diagram Editor


The Basics

Overview
Visual T&D Diagram Editor is a complete drawing program that provides all the tools and
functions required to create high-quality interactive diagrams. If you already have a Windows-
based drawing program, you will immediately feel at ease with Diagram Editor.

In this chapter, you will learn how to use the drawing tools to create shapes that represent the
various components or devices in your diagram.

In the subsequent chapters, you will get acquainted with the more advanced aspects of the program
and learn how to animate the shapes in the drawing according to the values of the data points
provided by the Visual T&D server.

Modes of Operation
Diagram Editor provides two modes of operation.

‰ Design mode.
While you design your diagram, you use the drawing tools and command menus to create
your diagrams.

Unless it is specified otherwise, the instructions and procedures described in this document
apply to the Design mode.

‰ Animation mode.
When the diagram is animated, the program connects to the Visual T&D server and animates
the diagrams according to the values of the data points and the effects you have programmed.

When Diagram Editor is started via Visual T&D Explorer, it automatically enters the Animation
mode.

When Diagram Editor is started via Windows’ Start menu, the user is prompted to enter its Visual
T&D account’s credentials to connect to the server. If the user provides this information and
connects to a server, Diagram Editor enters the Animation mode; otherwise, it enters the Design

Visual T&D Diagram Editor •3


mode.

Switching Between the Design Mode and the Animation Mode


To switch between the Design mode and the Animation mode:

‰ Click the Animation menu.

‰ If there is a checkmark beside the Run command, Diagram Editor is in the animation mode.
To enter the design mode, click Run.

‰ If there is no checkmark beside the Run command, Diagram Editor is in the design mode.
To enter the animation mode, click Run.

Creating a Diagram
To create a diagram, you use drawing tools to place various shapes and text labels on a drawing
surface. Diagram Editor provides you with an empty drawing surface. You can select the size of
the drawing surface and specify a background color. You can also overlay the drawing surface
with a grid to help you align shapes.

Your diagram can contain one or more pages. Each page itself is a diagram that will either be
displayed in a separate window or occupy the full screen. To learn how to work with multiple
pages, see “Working with Pages”, page 63.

Setting up the Current Page’s Properties


To modify the current page’s background color and other properties:

‰ From the View menu, choose Page Properties.

The Page Properties dialog box will appear.

4• Visual T&D Diagram Editor


The Display tab contains the following properties:

Object Description
Name Specifies the name of the page

Width Sets the width of the page.

Height Sets the height of the page.

Zoom when run Changes the default zoom setting for the page when the diagram is run. You
choose a setting or enter a percent in the box.

Background color Selects the background color.

The Action tab is explained more in details in section “Adding a New Page or Modifying an
Existing Page”, page 65.

Setting up the Current Page’s Grid Properties


To modify the current page’s grid properties:

‰ From the View menu, choose Grid. The Grid Properties dialog will appear:

Object Description
Show grid Activates the display of the grid.

Snap to grid Activates snapping so that shape vertices are automatically pulled towards the
diagram grid points.

Angle snap Activates rotation snapping so that shapes can be rotated in fixed increments
only.

Grid color Selects the color used to display the grid.

Grid spacing Sets the horizontal and vertical grid spacing using pixels.

Visual T&D Diagram Editor •5


The Drawing Toolbar
The Drawing toolbar provides a set of tools that you can use to add new shapes to the drawing or
modify existing shapes. The shape of the mouse pointer changes according to the tool you select.

Tool Description
Pointer The Pointer tool moves or selects shapes and shape vertices.

Selection The Selection tool selects shapes enclosed within a rectangular area.

Edit Vertices The Edit Vertices tool moves individual points in a polygon or polycurve.

Properties The Properties button displays the Shape Properties dialog for the selected
shape.

Line The Line tool draws a line between two mouse positions.

Polygon The Polygon tool draws a closed polygon defined by the points clicked with the
mouse.

Rectangle The Rectangle tool draws a closed rectangle between two mouse positions.

Polycurve The Polycurve tool draws a curved line passing through the points clicked with
the mouse.

Closed Curve The Closed Curve tool draws a closed shape passing through the points clicked
with the mouse.

Ellipse The Ellipse tool draws a circle or ellipse between two mouse positions.

Text The Text tool inserts a text label in the drawing.

Image The Image tool inserts an image file in the drawing. Supported formats are:
bitmaps (.BMP), icons, (.ICO), Graphics Interchange Format (.GIF) and JPEG.

Connection Point The Connection Point tool inserts a connection point object that is used to
anchor a link between two shapes in the drawing. The connection point must be
grouped with an object.

Link The Link tool draws a line between two connection points. The line is anchored
to the objects and is redrawn if the objects are moved.

Orthogonal Link The Orthogonal Link tool draws a line between two connection points. The line
is composed of horizontal and vertical segments only; it is anchored to the objects
and is redrawn if the objects are moved.

6• Visual T&D Diagram Editor


Adding Basic Shapes to Your Diagram
To add a shape to your diagram, you simply use the mouse to select a tool from the Drawing
toolbar and then draw the required shape.

Basic shapes in Visual T&D Diagram Editor

Note: You can set the default shape properties by choosing the Default Properties…
command in the Shape menu.

Some details specific to each shape type are presented below.

Adding a Line to Your Drawing


To add a line:

‰ Select the Line tool from the Drawing toolbar.

‰ Press the left mouse button at the starting position of the line.

‰ Drag the mouse to the end position of the line.

Tip: Press the SHIFT key before pressing the mouse button to limit the mouse
movement to either the horizontal or vertical direction.

Adding a Polygon to Your Drawing


To add a polygon:

‰ Select the Polygon tool from the Drawing toolbar.

Visual T&D Diagram Editor •7


‰ Click the left mouse button at the successive vertex positions of the polygon.

‰ Double-click the left mouse button to stop entering vertex points.

Adding a Rectangle to Your Drawing


To add a rectangle:

‰ Select the Rectangle tool from the Drawing toolbar.

‰ Press the left mouse button at one of the corner positions.

‰ Drag the mouse to the intended position of the diagonally opposite corner.

Tip: Press the SHIFT key before pressing the mouse button to draw a square.

Adding a Polycurve to Your Drawing


To add a polycurve:

‰ Select the Polycurve tool from the Drawing toolbar.

‰ Click the left mouse button at the positions of the successive points of the polycurve.

‰ Double-click the mouse to enter the last point.

Note: You must enter at least four points to define a polycurve.

Adding a Closed Curve to Your Drawing


To add a closed curved:

‰ Select the Closed Curve tool from the Drawing toolbar.

‰ Click the left mouse button at the position of the successive points of the curve shape.

‰ Double-click the mouse to enter the last point.

Note: You must enter at least four points to define a closed curve.

Adding an Ellipse or a Circle to Your Drawing


To add an ellipse or a circle:

‰ Select the Ellipse tool from the Drawing toolbar.

‰ Press the left mouse button.

8• Visual T&D Diagram Editor


‰ Drag the mouse.

‰ The program draws an ellipse within the boundaries of the mouse movement.

Note: Press the SHIFT key before pressing the mouse button to define a circle.

Adding a Text Label to Your Drawing


To add a text label:

‰ Select the Text tool from the Drawing toolbar.

‰ Press the left mouse button at one of the corner positions.

‰ Drag the mouse to the intended position of the diagonally opposite corner.

Tip: Press the SHIFT key before pressing the mouse button, to draw a square text
label.

Note: Use the Text tab of the Properties command of the Shape menu, to set the text
display properties.

Adding an Image to Your Drawing


To add an image:

‰ Click on the Image tool on the Drawing toolbar. The program displays a dialog box from
which you can select the image file.

‰ Click the left mouse button to add the image to the drawing.

Note: Use the General tab of the Properties command of the Shape menu to set the
background transparency color.

Working with Overlapping Shapes


Diagram Editor remembers the order in which you add shapes to the drawing. You can consider
that the shapes are stacked and that the most recent shape added is at the top of the stack. The
shapes at the bottom of the stack are drawn first and may be hidden by shapes at the top.

You manage the order of shapes in the stack by using commands in the Shape menu or buttons on
the Structure toolbar.

Visual T&D Diagram Editor •9


Moving a Shape up in the Stacking Order
‰ Use the Pointer or Selection tool to select the shape.

‰ Select Bring To Front from the Order command in the Shape menu or on the Structure
toolbar. The object will be brought up to the top of the stack, in front of all others.

‰ Select Bring Forward from the Order command in the Shape menu or on the Structure
toolbar. The object will be brought up one level in the stack.

Moving a Shape Down in the Stacking Order


‰ Use the Pointer or Selection tool to select the shape.

‰ Select Send To Back from the Order command in the Shape menu or on the Structure
toolbar. The object will be sent to the bottom of the stack, behind all others.

‰ Select Send Backward from the Order command in the Shape menu or on the Structure
toolbar. The object will be brought down one level in the stack.

Selecting Shapes
The Drawing toolbar provides you with two different tools that you can use to select shapes in the
drawing.

Most of the commands in Diagram Editor apply to the shapes selected in the drawing. Selected
shapes are displayed differently, so that you can easily locate and modify them.

Using the Pointer Tool to Select Shapes


To select a shape using the pointer tool:

‰ Select the Pointer tool on the toolbar.

‰ Click the tool in the drawing to select the topmost shape at the mouse position.

OR

‰ Click the Pointer tool in an empty area of the drawing and drag the mouse to select all the
shapes within the area.

Using the Selection Tool to Select Shapes


The Selection tool provides you with a means to select shapes that are difficult to select using the
Pointer tool. With the Selection tool, you can click on a shape without selecting it. Only the
shapes that are within the area where you drag the mouse will be selected.

10 • Visual T&D Diagram Editor


‰ Select the Selection tool on the toolbar.

‰ Click the tool in the drawing, and drag the mouse to select all shapes within the area.

Selecting Multiple Shapes


Normally, whenever you click in the drawing with either the Pointer or the Selection tool, all
previously selected shapes are unselected.

To select new shapes while keeping those that are already selected:

‰ Press the SHIFT key or the CTRL key, and click on a shape to add it to those already
selected.

‰ Press the CTRL key, and drag the mouse in the drawing to add all the shapes in the area to
those already selected.

The SHIFT key can also be used to unselect a shape:

‰ Press the SHIFT key and click on a selected shape to unselect it.

Moving Shapes
You can use either the mouse or the keyboard to move shapes in the drawing.

Using the Mouse to Move Shapes


‰ Use the Pointer or Selection tool to select the shapes you want to move.

‰ Click on the selected shapes and drag them to the desired location.

Using the Keyboard to Move Shapes


‰ Use the Pointer or Selection tool to select the shape you want to move.

‰ Use the keyboard arrow keys to "nudge" the selected shape in any direction.

When you use the nudging commands, movement is not confined to the grid.

Note: The nudging commands are also available through the Position command in the
Shape menu and via the Nudge toolbar.

Visual T&D Diagram Editor • 11


Modifying Shapes
You can easily modify any shape by moving the end points, the vertices or the bounding rectangle.

A simple shape, such as a line, is composed of two end points and a single segment. More
complex shapes, such as polygons, are composed of vertices and segments. Rectangles and
ellipses are defined by a bounding rectangle.

Using the Mouse to Change the Size of a Shape


When you select a shape, the program displays the shape's selection handles. To modify the size of
the shape, simply move these handles.

‰ Use the Pointer or Selection tool to select the shape you want to resize.

‰ Click on a selection handle and use the mouse to drag the shape to the new size.

Tip: The shape of the mouse pointer changes to indicate the direction in which you
can move the selection handle.

Adjusting the Size of a Shape


If you find it difficult to adjust the size of a shape using the mouse, you can use the following
commands to increase or decrease the size of a shape one pixel at a time.

‰ Use the Pointer or Selection tool to select the shape you want to modify.

‰ Select Increase Width or Decrease Width from the Sizing toolbar to enlarge or reduce the
width of the shape by one pixel.

‰ Select Increase Height or Decrease Height from the Sizing toolbar to enlarge or reduce the
height of the shape by one pixel.

Note: The sizing commands are also available from the Size command in the Shape
menu.

When you use the sizing commands, movement is not confined to the grid.

Note: You can also use the keyboard to resize a shape. To do so, select the shape,
then hold down the CTRL key and a keyboard arrow key at the same time. The
top left-hand corner of the shape will remain in the same position, while the rest
of the shape will move in the direction of the arrow until you release the two keys.

12 • Visual T&D Diagram Editor


Moving the Vertices of a Complex Shape
With the Edit Vertices tool, you can modify the vertices and segments of a complex shape such as
a polygon, polycurve or closed curve.

‰ Use the Pointer or Selection tool to select the shape you want to modify.

‰ Select the Edit Vertices tool from the Drawing toolbar.

‰ Click on one of the vertices of the shape and drag it to the new position.

Tip: The shape of the mouse pointer changes to indicate a vertex that you can drag.

Rotating Shapes
Diagram Editor provides tools that you can use to change the orientation of a shape.

‰ The Free Rotate tool rotates a shape at any angle.

‰ The Rotate Left and Rotate Right commands change the orientation of the shape in fixed
90° increments.

‰ The Flip Vertical and Flip Horizontal commands flip the shape around either the vertical or
the horizontal geometric axis, to provide a mirror image.

Note: A shape rotates around its center of rotation, which is located at the center of the
shape’s selection rectangle.

Rotating a Shape at any Angle


‰ Use the Pointer or Selection tool to select the shape.

‰ Select the Free Rotate command on the Rotation toolbar or in the Shape menu.

‰ Click in the shape and drag the mouse until the shape is at the required angle. The shape will
rotate in 15-degree increments, if you have enabled Angle snap in the Grid Properties
dialog.

Note: The shape of the mouse pointer changes to indicate positions where the rotation
tool can be used to grab and rotate the shape.

Visual T&D Diagram Editor • 13


Rotating a Shape in 90° Increments
‰ Use the Pointer or Selection tool to select the shape.

‰ Select the Rotate Right command on the Rotation toolbar or in the Shape menu to rotate the
shape 90° to the right.

OR

‰ Select the Rotate Left command on the Rotation toolbar or in the Shape menu to rotate the
shape 90° to the left.

Flipping a Shape
‰ Use the Pointer or Selection tool to select the shape.

‰ Select the Flip Horizontal command on the Rotation toolbar or in the Shape menu to flip the
shape around the horizontal axis.

OR

‰ Select the Flip Vertical command on the Rotation toolbar or in the Shape menu to flip the
shape around the vertical axis.

Organizing Shapes in the Drawing


Typically, your diagrams will include a large number of shapes. Diagram Editor provides you with
commands to assist you in aligning, sizing or spacing the shapes in your drawing.

Selecting the Shapes to be Organized


Before using the commands in this group, you must first select the shapes to be organized. With
the sizing and alignment commands, one of these shapes will be used as a reference to which the
others will be matched.

‰ Select the shapes you want to organize by clicking on the shapes with the Pointer tool while
holding down the SHIFT key. The last shape you select will be used as the reference.

OR

‰ Use the Pointer or Selection tool to select all the shapes in an area of the drawing. The
reference shape will be the topmost shape in the stacking order.

Tip: When you select multiple shapes, you can identify the reference shape by the
selection handles, which are gray instead of white.

14 • Visual T&D Diagram Editor


Aligning Shapes
The Align commands in the Tools menu move the shapes you have selected so that they are all
aligned with the reference shape.

‰ Select the Align Left, Align Center and Align Right commands in the Tools menu or on the
Alignment toolbar to align the shapes vertically.

‰ Select the Align Top, Align Middle and Align Bottom commands in the Tools menu or on
the Alignment toolbar to align the shapes horizontally.

Making Shapes the Same Size

‰ Select the Make Same Width command in the Tools menu or on the Layout toolbar to
change the size of the shapes so that they match the width of the reference shape. The left side
of the shapes remains in the same position.

‰ Select the Make Same Height command in the Tools menu or on the Layout toolbar to
change the size of the shapes so that they match the height of the reference shape. The tops of
the shapes remain in the same position.

‰ Select the Make Same Size command in the Tools menu or on the Layout toolbar to change
the size of the shapes so that they match the size of the reference shape. The top left corners
of the shapes remain in the same position.

Distributing Shapes Evenly

‰ Select the shapes you want to organize.

‰ Select the Distribute Horizontally command in the Tools menu or on the Layout toolbar to
change the position of the shapes so that they are equally distributed between the leftmost and
rightmost selected shapes.

‰ Select the Distribute Vertically command in the Tools menu or on the Layout toolbar to
change the position of the shapes so that they are equally distributed between the topmost and

Visual T&D Diagram Editor • 15


bottommost selected shapes.

Grouping Shapes
Your diagrams will most probably contain complex pieces of equipment such as transformers and
alternators. While you can easily draw a transformer with a number of curved lines, it will take
you a long time to create your drawing if you need to represent a large number of similarly
complex shapes.

The Group command creates a new complex shape by grouping simple shapes together. Once
shapes are grouped, you manage the group as if it were a simple shape and you can apply the usual
commands to move, copy, rotate or align shapes.

Grouping simple shapes to create complex shapes

Grouping Shapes

‰ Select the shapes you want to group.

16 • Visual T&D Diagram Editor


‰ Select Group on the Structure toolbar or from the Grouping command in the Shape menu.

Note: When you add shapes to an existing group, you create a new group containing
the original group and the new shapes.

Ungrouping Shapes

‰ Select the shape you want to ungroup.

‰ Select Ungroup on the Structure toolbar or from the Grouping command in the Shape
menu.

Note: When you ungroup a shape that contains groups, only the most recent grouping
is undone and the original groups remain.

Connecting Shapes
Most diagrams are composed of shapes that are connected together by lines to indicate some kind
of relationship. When you use the Line tool to connect two shapes, Diagram Editor has no
knowledge of the relationship between the shapes. If you move a shape, the line is left dangling
and you have to repair the drawing.

When you connect two shapes with the Link tool, the shapes remain connected even when they
are moved.

The Link tool draws a line between connection points. To use the Link tool, you must first add
connection points to your shapes using the Connection Point tool. You then have to group each
connection point to its shape.

Adding Connection Points


To add a connection point to a shape:

‰ Select the Connection Point tool from the Drawing toolbar.

‰ Add the connection point at the required position in the shape.

‰ Use the Pointer or Selection tool to select both the shape and the connection point.

‰ Select Group on the Structure toolbar or from the Grouping command in the Shape menu.

Visual T&D Diagram Editor • 17


Linking the Shapes
The Link tool on the Drawing toolbar draws a straight line between two connection points. The
Orthogonal Link tool also draws a line between two connection points; however the line is not
diagonal but consists rather of horizontal and vertical segments.

Difference between the Link and Orthogonal Link tools

‰ Select the Link tool on the Drawing toolbar.

OR

‰ Select the Orthogonal Link tool on the Drawing toolbar.

‰ Click on the first connection point.

‰ Click on the second connection point.

Tips: The shape of the mouse pointer changes to indicate when you can click on a
connection point.

Adjusting the Link


The Link tool draws a straight line between two connection points. The path of the line cannot be
modified. The Orthogonal Link tool draws a line composed of horizontal and vertical segments.
The path of the line can be adjusted by moving the vertices between the segments.

‰ Use the Pointer tool to select the link between the two shapes.

‰ Use the mouse to drag the selection handles to the required position.

18 • Visual T&D Diagram Editor


Tip: The shape of the mouse pointer changes to indicate when you can drag a
selection handle.

Shape Properties
You can specify how the shapes should be drawn by setting the Properties of the shapes.
Depending on the type of shape, you can set the line drawing properties, the color fill properties or
text drawing properties.

The following table summarizes the drawing properties available for each type of shape.

Tool Line Fill Text Font Animation


Line √ √

Polygon √ √ √

Rectangle √ √ √

Polycurve √ √

Closed Curve √ √ √

Ellipse √ √ √

Text √ √ √ √ √

Image √

Connection Point √

Link √ √

Orthogonal Link √ √

To set the properties of a shape in your diagram:

‰ Select the shape.

‰ In the Shape menu, click Properties.

The Shape Properties dialog appears. The dialog contains different tabs, depending on the
type of shape you selected.

General Properties
The General tab of the Shape Properties dialog sets the name of the shape and identifies its type.

Visual T&D Diagram Editor • 19


Box Description
Name Sets the name of the shape. By default, Diagram Editor names the shape
according to its type. You will use this field to set a more meaningful name, such
as the name of the device on your site that the shape represents.

Type Indicates the basic type of the shape.

Note: Shapes created with the Image tool contain additional fields described under
"Image Properties" (below).

Image Properties
The General tab of the Shape Properties dialog contains additional fields when the shape is an
image inserted in the diagram with the Image tool.

20 • Visual T&D Diagram Editor


Object Description
Transparent Indicates whether the image’s background is to be transparent or opaque. If you
select transparent, you will have to select the transparency color.

Transparency color Indicates the color that is considered transparent. All pixels with this color will be
removed from the image and the background will show through.

Line Drawing Properties


The Line tab of the Shape Properties dialog sets the line drawing properties for all the shapes
that are based on a line or that have a contour.

Object Description
Color Selects the line drawing color.

Transparent Specifies that the line is to be invisible. Use this attribute to remove the contour
of filled shapes. When you select this field, all other line properties are disabled.

Style Sets the line drawing style. This field is available for 0 point (1 pixel thick) lines
only.

Thickness Sets the line drawing thickness. This field is available for solid lines only.

Color Fill Properties


The Fill tab of the Shape Properties dialog sets the drawing properties of closed surfaces.

Visual T&D Diagram Editor • 21


Object Description
Foreground color Sets the drawing color of a closed shape. If the Hatch field is set to No Hatch,
the shape will be filled with a solid color. If a hatch pattern is selected, this color
will be used to draw the lines of the hatching pattern.

Transparent fill Indicates that the shape is transparent. All other fields are disabled.

Background color If a hatch pattern is selected, this color will be used to fill the areas between the
lines of the hatching pattern.

Transparent If a hatch pattern is selected, the areas between the lines of the hatching pattern
background will be transparent.

Hatch Selects the hatch pattern to be applied to the shape.

Text Properties
The Text tab of the Shape Properties dialog sets the contents and display properties of shapes
created with the Text tool.

22 • Visual T&D Diagram Editor


Box Description
Text Text label displayed by the shape.

Multiple lines Indicates that the text can be displayed on multiple lines. If you do not put a
check mark, the text will be truncated to the width of the shape.

Automatically If selected, the shape will be automatically enlarged if the text does not fit in the
enlarge the shape to shape.
display text

Word wrap If Multiple Lines is selected, the text will be broken up into multiple lines on
word boundaries.

Horizontal Specifies whether the text should be left-aligned, centered or right-aligned.


alignment

Vertical alignment Specifies whether the text should be displayed at the top, center or bottom of the
shape.

Font Properties
The Font tab of the Shape Properties dialog sets the display font for shapes created with the Text
tool.

Object Description
Font Selects the name of the font to be used to display the text shape.

Font style Selects the font style: regular, bold, italics or bold italics.

Size Selects the font size.

Underline Indicates that the text is to be underlined.

Strikethrough Indicates that a line is to be drawn through the text.

Visual T&D Diagram Editor • 23


Object Description
Text color Selects the text display color.

Changing the Properties of Grouped Shapes


When you group shapes together, Diagram Editor creates a new complex shape containing the
grouped shapes. You can use the Shape Properties dialog to change the properties of every shape
in the group.

‰ Use the Pointer or Selection tool to select the grouped shape.

‰ Select the Properties command from the Shape menu. The Shape Properties dialog displays
the tabs appropriate for the grouped shapes.

‰ Change any property and the modification will be applied to all the shapes in the group.

Note: The Shape Properties dialog will not display the correct values if the shapes in a
group have different values for the same properties. However, if you select a new
value, this new value will be applied to all shapes.

Changing the Properties of Individual Shapes in a Group


You may need to change the properties of individual shapes in a group. While it is always possible
to ungroup the shapes in order to do so, Diagram Editor provides a much simpler method. The
Grouping dialog box displays the hierarchy of groups and allows you to access the properties of
the individual shapes.

‰ Use the Pointer or Selection tool to select the grouped shape.

‰ In the Shape menu, click Grouping, and then click Show.

24 • Visual T&D Diagram Editor


The Grouping dialog box displays a hierarchical view of all the shapes in the group. If a
group contains other groups, they are displayed as branches in the tree. Each shape is
identified by the value entered in the Name field of the General tab in the Shape Properties
dialog.

‰ Select the shape or branch to be modified.

‰ Click the Properties button to display the Shape Properties dialog for the selected item.

Saving and Loading Diagrams


The diagrams you create and edit with Diagram Editor are stored as files on your Windows
workstation. As with all programs, you manage your files using the commands in the File menu.

Once you have completed the diagram to your satisfaction, you can also save it on the computer
on which the Visual T&D server is running. A diagram on the server is available to all the
computers connected to the server.

The Diagram Viewer program automatically loads and displays the diagram stored on the selected
server. With Diagram Editor, you can retrieve the diagram from the server and save it as a file on
your own computer.

Saving a Diagram
To save the current diagram to a file:

‰ Select the Save or Save As command in the File menu.

‰ Enter the name of the diagram, and select the folder in which you want to save it.

Note: By default, all diagram files are stored in the Diagrams folder, within the Client
folder.

Saving a Diagram on the Server


You can save a diagram file on the Visual T&D server so that the Diagram Viewer will load it
automatically when it starts.

Note: Only users who have been assigned editing privileges can save a diagram file on
the Visual T&D server.

To save a diagram on the server:

‰ Use the Save to Server command in the File menu.

The diagram file will be saved on the server and made available to all computers connected to

Visual T&D Diagram Editor • 25


the server.

Warning: Saving the current diagram to the server overwrites the diagram associated
with the current site configuration.

Opening a Diagram Stored on Your Workstation


To open a diagram file:

‰ Select the Open command in the File menu.

‰ Select the folder and the diagram you want to open.

Note: Diagram Editor can only edit one diagram file at a time. If there already is an
open diagram, you will be prompted to save any changes.

Opening the Diagram Stored on the Server


To open the diagram stored in the Visual T&D server:

‰ Select the Open Site Diagram command in the Server menu.

Note: Diagram Editor can only edit one diagram file at a time. If there already is an
open diagram, you will be prompted to save any changes.

26 • Visual T&D Diagram Editor


Working with Data

Overview
The most important feature of Visual T&D Diagram Editor is its ability to create diagrams that
represent the operation of a process in real time.

In the previous chapters, you learned how to use Diagram Editor tools to create shapes and
diagrams. In the following sections, you will learn how to connect to the Visual T&D server,
access data points and create animated diagrams that change according to the values of these
points.

Variables and Data Points


The Visual T&D server manages the data acquisition and control hardware and provides the real-
time image of the monitored process. The server manages a configuration database that identifies
all of the points defined to monitor and control the process. Based on the configuration data, the
server scans the available data points and provides up-to-date values to the Visual T&D Explorer
and Visual T&D Diagram Editor programs.

For each data point, the server provides the following information that can be used to determine
the display of shapes in your diagrams:

‰ The tag name of the data point, which you will use to access the value.

‰ The value of the data point, which you can display or use to control shape properties.

‰ The quality of the data, which indicates whether the data is valid.

‰ The tags, which you use to store status information for each data point. For each data point,
you can store 16 tags that contain a TRUE or FALSE value.

‰ Alarm conditions on the data point.

From Diagram Editor, you can connect to the server and retrieve the list of all available data
points. In the program, we refer to these data points as variables. When you design your diagrams,

Visual T&D Diagram Editor • 27


you will use the variables in expressions that control the way shapes are displayed.

Animation Effects
All the shapes you create in Visual T&D Diagram Editor have static properties that indicate how
they are displayed in the diagram, their color, the thickness of the lines and their text attributes. A
shape can also have dynamic properties that become active when Diagram Editor enters the
Animation mode.

For instance, you can use a text shape to display either a static label or the results of the evaluation
of an expression. The expression can refer to the value of a variable associated with a data point.
The display of a variable is a very basic animation effect. You can also design more complex
effects, whereby a shape flashes or changes colors if a variable exceeds a threshold. Shapes can
appear, disappear or even be resized according to the results of expressions.

In the following sections, you will learn how to create expressions that refer to variables and how
to use these expressions to create various animation effects.

Animation Basics
Before going into all the details of the various types of animation, we will illustrate how to set up
a very simple animation effect.

Many electrical diagrams include shapes that represent open or closed switches. In the example
that follows, we will create a two-position switch that is displayed in green when open and red
when closed.

In a typical process control system, one or two data points would be used to indicate the state of
the switch. In our example, we will assume that there is a single data point called SW_OPEN that
is TRUE when the switch is open.

Drawing the Shape for the Open Switch


To draw the shape for the open switch:

‰ Use the Ellipse tool to draw the connection pads of the switch.

‰ Use the Line tool to draw the line in the open position.

28 • Visual T&D Diagram Editor


‰ Use the Properties command in the Shape menu to display the shape properties.

‰ Use the Line and Fill tabs of the Shape Properties dialog to set the line thickness and to set
the color to green.

Drawing the Shape for the Closed Switch


To create the closed switch, you will modify a copy of the open switch. Proceed as follows:

‰ Use the Pointer or Selection tool to select the components of the open switch.

‰ Select Copy from the Edit menu.

‰ Click in the diagram at the approximate position where you want to copy the shape.

‰ Select Paste from the Edit menu.

‰ Select the Pointer tool, and move the end point of the line to create the closed shape.

‰ Use the Line and Fill tabs of the Shape Properties dialog to set the color to red.

Grouping the Components


In the next steps, you will group all the components together to create a single shape containing
both switches: open and closed.

‰ Use the Pointer or Selection tool to select all the components of the open switch.

‰ Select the Group command from the Grouping selection in the Shape menu.

‰ Use the Properties command in the Shape menu and enter a significant name, such as
"Open", for the grouped shape.

‰ Repeat the above steps for the components of the closed shape and name the group "Closed".

‰ Use the Pointer tool to move both shapes until they overlap exactly.

‰ Use the Pointer or Selection tool to select both the open and closed shapes.

‰ Select the Group command from the Grouping selection in the Shape menu.

‰ Use the Properties command in the Shape menu and enter a significant name, such as
"Switch", for the grouped shape.

After these steps, you should have a group containing two other groups. You can use the Show
command in the Grouping selection of the Shape menu to display the shape hierarchy.

Visual T&D Diagram Editor • 29


Defining the Animation Effects
To animate the shape, you will hide the "Closed switch" group when the SW_OPEN variable is
TRUE and you will hide the "Open switch" group when the SW_OPEN variable is FALSE.

‰ Use the Pointer or Selection tool to select the shape.

‰ Select the Properties command in the Shape menu.

‰ Select the Animation tab from the Shape Properties dialog box.

‰ Select the "Closed" group.

‰ Click the Add button and select the Hide animation.

‰ Enter the following string in the Expression field in order to hide the shape when the data
point indicates that the switch is open:

30 • Visual T&D Diagram Editor


SW_OPEN

‰ Enter a significant name, such as "Hide if open", in the Description field.

‰ Select the "Open" group.

‰ Click the Add button and select the Hide animation.

‰ Enter the following string in the Expression field in order to hide the shape when the data
point indicates that the switch is closed:

NOT(SW_OPEN)

‰ Enter a significant name, such as "Hide if closed", in the Description field.

‰ If you want to save the drawing, click Save in the File menu.

Running the Animation


You have now defined all the steps of your animation and are ready to run it.

To do this, switch to Animation mode as follows:

‰ From the Animation menu, click Run.

Note: Since data point name SW_OPEN does not exist on the Visual T&D server, the
Unresolved Aliases and Nonexistent Variables dialog box will open. Click
Ignore to continue.

To stop the animation and return to Design mode:

‰ From the Animation menu, select Run to clear the checkmark besides this menu command.

This will stop the animation.

In the following sections, we will describe various animation effects that you can use to display
values or modify the display of your shapes in the diagram.

The Animation Properties of Shapes


You will use the Animation tab of the Shape Properties dialog to specify the animation effects
for the selected shape. You display the dialog by clicking the Properties command in the Shape
menu.

Visual T&D Diagram Editor • 31


Object Description
Grouping Displays the name of the selected shape or the hierarchical view of all the shapes
in the group. If a group contains other groups, they are displayed as branches in
the tree.

The operations you perform in the dialog apply to the selected shape or group of
shapes.

Animation order Displays the list of animation effects selected for the current shape or group of
shapes.

Add Displays the list of animation effects available for the selected shape. The
program displays a dialog box in which you will specify the animation
parameters.

Edit Displays the dialog box for the selected effect so that you can change the
parameters.

Move Up Moves the selected effect upwards in the list.

Move Down Moves the selected effect downwards in the list.

Delete Removes the selected effect from the list.

Working with Animation Expressions


An expression may be as simple as the name of a variable or it may contain complex conditional
calculations. The expression must be properly constructed and contain no syntax errors, or an error
will be reported when you animate the diagram.

The Expression Editor


All the animation effects share the use of the Expression Editor. The Expression Editor is a tool
that simplifies entering the expressions that are used to control the animation effects. The
Expression Editor box and buttons appear as part of the dialog that is displayed when you select a

32 • Visual T&D Diagram Editor


particular type of animation (hide, change colors, flash, etc.), through the Animation tab of the
Shape Properties dialog box.

Object Description
Expression Used to enter and edit the expression to be evaluated. You can enter the
expression directly from the keyboard or use the buttons to insert variable names,
arithmetic or logical operators, etc.

Arithmetic Used to select and enter arithmetic operators in the expression.

Relational Used to select and enter relational operators in the expression.

Logical and Binary Used to select and enter logical and binary operators in the expression.

Functions Used to select and enter functions in the expression.

Constants Used to select and enter logical constants in the expression.

Variables and Used to select and enter variable names and aliases in the expression. The
Aliases variables are the data points configured in the server. Aliases are names that are
used when you create generic shapes. Aliases must be associated with variables
before the diagram can be animated. See “Working with Aliases”, page 55.

Here are some examples of valid expressions:


NOT (SW_OPEN)
QualityOf(MA) = TRUE
NOT (TagOf(Mo_25-4.TS, 9) OR TagOf(Mo_25-4.TS, 10))

Arithmetic Operators
You can use the following arithmetic operators in expressions:

Operator Description
+ Calculates the sum of the left and right operands.

- Calculates the difference between the left and right operands.

* Calculates the product of the left and right operands.

/ Divides the left operand by the right operand.

Visual T&D Diagram Editor • 33


Operator Description
() Expressions are evaluated according to standard operator precedence. Parentheses
are used to group sub-expressions and control the order in which expressions are
evaluated.

1 + 2 * 3 evaluates to 7

(1 + 2) * 3 evaluates to 9

Relational Operators
You can use the following relational operators in expressions:

Operator Description
< Evaluates to TRUE if the left operand is less than the right operand.

> Evaluates to TRUE if the left operand is greater than the right operand.

<= Evaluates to TRUE if the left operand is less than or equal to the right operand.

>= Evaluates to TRUE if the left operand is greater than or equal to the right
operand.

= Evaluates to TRUE if the left operand is equal to the right operand.

!= Evaluates to TRUE if the left operand is different from the right operand.

Logical and Binary Operators


Logical operators are used to combine the results of logical expressions such as comparisons.
Binary operators are used to manipulate the individual bits of expressions or data points.

You can use the following logical and binary operators in expressions:

Operator Description
Logical AND Evaluates to TRUE if the left and right operands are both TRUE.

Logical OR Evaluates to TRUE if either the left or right operand is TRUE.

Logical NOT Evaluates to TRUE if the value to the right is FALSE.

Binary AND Calculates a bitwise AND between the left and right operands.

For instance, 12 BAND 5 evaluates to 4 (1100 BAND 0101 is 0100).

Binary OR Calculates a bitwise OR between the left and right operands.

For instance, 12 BOR 5 evaluates to 13 (1100 BOR 0101 is 1101).

Binary XOR Calculates a bitwise XOR between the left and right operands.

For instance, 12 BXOR 5 evaluates to 9 (1100 BXOR 0101 is 1001).

34 • Visual T&D Diagram Editor


Operator Description
Binary NOT Calculates a bitwise NOT of the value to the right.

For instance, BNOT 0 evaluates to -1 (BNOT …0000 is …1111).

Functions
You can use the following built-in functions in expressions:

Function Description
ABS( x ) Calculates the absolute value of x.

POW( x, y ) Calculates the value of x to the power of y.

QualityOf( point name ) Evaluates to TRUE if the value of the specified data point
is valid.

TagOf( point name ) Calculates the integer value of all tag bits for the specified
data point name.

TagOf( point name, tag bit x ) Calculates the Boolean value of tag bit x of the specified
data point name.

ActiveTagCountOf( point name ) Calculates the number of tag types currently set for the
specified data point name.

GetTagCount( point name) Calculates the total number of tags currently set for the
specified data point name.

GetTagType( point name) Returns the type of the highest priority tag for the specified
data point. Possible values are: TAG_TYPE_NONE if no
tag exists for the data point,
TAG_TYPE_INFORMATION for an information tag, and
TAG_TYPE_ALL_CONTROL_INHIBITED for a control
inhibition tag.

HasTagFor( point name, type) Evaluates to TRUE if the specified data point has a tag of
type type.

type can have one or more of the following values:

‰ TAG_TYPE_INFORMATION for an information tag.


‰ TAG_TYPE_ALL_CONTROL_INHIBITED for a
control inhibition tag.

To combine multiple types, use BOR.

Visual T&D Diagram Editor • 35


Function Description
IsAlarmAcknowledged( point name, type ) Evaluates to TRUE if the alarm of type type for the
specified data point has been acknowledged.

Use the ALARM_TYPE_ALL parameter to test for all


alarm conditions.

You can use the ALARM_BINARY_STATE,


ALARM_LEVEL_LOW, ALARM_LEVEL_HIGH and
ALARM_BAD_QUALITY parameters to test for specific
alarm conditions.

IsAlarmActive( point name, type ) Evaluates to TRUE if an alarm of type type is currently
displayed for the specified data point. If TRUE, you can
use the AlarmStateOf function to determine if the alarm
condition still exists.

Use the ALARM_TYPE_ALL parameter to test for at least


one alarm condition.

You can use the ALARM_BINARY_STATE,


ALARM_LEVEL_LOW, ALARM_LEVEL_HIGH and
ALARM_BAD_QUALITY parameters to test for specific
alarm conditions.

IsAlarmDisabled( point name ) Evaluates to TRUE if there is an alarm currently disabled


for the specified data point.

IsAlarmPermanent( point name ) Evaluates to TRUE if there is an alarm currently set as


permanent for the specified data point.

IsAlarmSilent( point name ) Evaluates to TRUE if there is an alarm currently set as


silent for the specified data point.

AlarmStateOf( point name, type ) Evaluates to TRUE if the alarm condition of type type for
the specified data point still exists. Evaluates to FALSE if
the alarm condition is returned to normal.

Use the ALARM_TYPE_ALL parameter to test for at least


one alarm condition.

You can use the ALARM_BINARY_STATE,


ALARM_LEVEL_LOW, ALARM_LEVEL_HIGH and
ALARM_BAD_QUALITY parameters to test for specific
alarm conditions.

GetAlarmPriority( point name ) Returns the alarm priority level for the specified data point.

Constants
You can use the following built-in constants in expressions:

Operator Description
TRUE Represents a logical true value. Any value other than 0
is considered true.

36 • Visual T&D Diagram Editor


Operator Description
FALSE Represents a logical false value. A value of 0 is
considered false.

ALARM_BINARY_STATE Represents an alarm triggered when a binary point


becomes TRUE.

ALARM_LEVEL_LOW Represents an alarm triggered when the value of an


analog data point falls below the lower threshold.

ALARM_LEVEL_HIGH Represents an alarm triggered when the value of an


analog data exceeds the upper threshold.

ALARM_BAD_QUALITY Represents an alarm triggered when the quality of a data


point turns bad.

ALARM_TYPE_ALL Represents all possible alarm conditions.

TAG_TYPE_NONE No tag is defined at the moment.

TAG_TYPE_ALL_CONTROL_INHIBITED Represents a control inhibition tag.

TAG_TYPE_INFORMATION Represents an information tag.

ALARM_PRIORITY_NONE Indicates that a given data point is not configured to


generate alarms.

Special-Purpose Logical Points


Visual T&D Diagram uses internal logical points to represent the state of internal information. Just
as with physical points, you can declare these logical points in different types of animation. These
points are local to the Visual T&D Diagram HMI.

Logical Point Description


__sys_alarmSoundEnabled Logical point that indicates whether the sound is enabled. Its value
will be TRUE if the sound is enabled, and FALSE if the sound is
disabled.

__sys_alarmSoundTriggered Logical point that indicates whether the sound has been triggered. Its
value will be TRUE if the sound is triggered and FALSE if the sound
has not been triggered. (The sound is triggered whenever a new alarm
enters the system.)

The Show Value Effect


The Show Value animation effect replaces the label of the selected text display shape with the
result of the expression evaluation.

You will typically use this effect to display the value of a data point or one of its tags.

When you select this type of effect, you must provide the following parameters in the dialog box:

Visual T&D Diagram Editor • 37


Box Description
Description Sets the name of the animation effect.

Expression The expression to be evaluated. The program displays logical values as "True" or
"False", while it displays numerical values with the requested number of decimal
places.

Decimal places Indicates the number of decimal places to be displayed. If you specify 0, there
will be no decimal point.

The Change Color Effect


The Change Color animation effect changes the display color of the selected display shape when
the expression evaluates to TRUE.

The result of the effect depends on the type of shape. Shapes with closed areas will be filled with
the selected color. Lines and text will be displayed in the selected color.

You will typically use this effect to display a shape with a special color to indicate that it is active
or that a value has reached a given threshold.

When you select this type of effect, you must provide the following parameters in the dialog box:

38 • Visual T&D Diagram Editor


Object Description
Description Sets the name of the animation effect.

Expression The expression to be evaluated. The shape will change colors if the condition
evaluates to TRUE.

Color Selects the color.

The Show Text Effect


The Show Text animation effect replaces the label of the selected text display shape with a
different label when the expression evaluates to TRUE.

You will typically use this effect to display a label or message whenever a data point tag is active
or when a value reaches a given threshold.

When you select this type of effect, you must provide the following parameters in the dialog box:

Visual T&D Diagram Editor • 39


Box Description
Description Sets the name of the animation effect.

Expression The expression to be evaluated. The original text label will be replaced with the
new value if the condition evaluates to TRUE.

Text Text label to be displayed when the condition is TRUE.

The Hide Effect


The Hide animation effect removes a shape from the display when the expression evaluates to
TRUE.

You will typically use this effect to conditionally hide or display shapes according to the value of
a data point or a tag.

When you select this type of effect, you must provide the following parameters in the dialog box:

40 • Visual T&D Diagram Editor


Box Description
Description Sets the name of the animation effect.

Expression The expression to be evaluated. The shape is hidden if the condition evaluates to
TRUE.

The Flash Effect


The Flash animation effect provides two different ways for a shape to flash in the drawing. The
shape either changes colors, or appears and disappears.

You will typically use this effect to indicate a special situation that requires user intervention.

When you select this type of effect, you must provide the following parameters in the dialog box:

Visual T&D Diagram Editor • 41


Object Description
Description Sets the name of the animation effect.

Expression The expression to be evaluated. The shape flashes if the condition evaluates to
TRUE.

Type Selects the type of animation effect.

The Hide effect alternately shows the shape and then removes it from the display.

The Color effect alternately shows the shape in its original color and in the
specified color.

Speed Selects the speed of the animation effect.

If you specify Fast, the animation takes place once per second.

If you specify Slow, the animation takes place once every 2 seconds.

The Scale Effect


The Scale animation effect changes the size of a shape according to the value of an expression.

You will typically use this effect to create sophisticated indicators, such as moving bar charts or
thermometer displays.

When you select this type of effect, you must provide the following parameters in the dialog box:

Object Description
Description Sets the name of the animation effect.

42 • Visual T&D Diagram Editor


Object Description
Expression The expression to be evaluated. The size of the shape changes according to the
value of the expression.

Expression range Indicates the minimum and maximum range of values of the expression.

Scaling range Indicates the scaling that will be applied to the shape, as a percentage of the
current size. A value of 100% represents the original size of the shape, while a
value of 0 makes the shape disappear.

The minimum value indicates the scaling that will be applied when the expression
is equal to or less than the minimum Expression range value.

The maximum value indicates the scaling that will be applied when the
expression is greater than or equal to the maximum Expression range value.

Dimensions to be Selects the dimensions of the shape that will be resized: width or height.
scaled

Anchor point Selects the part of the shape that remains stationary when the shape is resized.

The Move effect


The Move animation effect changes the position of a shape according to the value of an
expression. The shape keeps its original size and is moved within the area you specify.

You will typically use this effect to create sophisticated indicators, such as moving slider controls
or moving gauges.

When you select this type of effect, you must provide the following parameters in the dialog box:

Visual T&D Diagram Editor • 43


Object Description
Description Sets the name of the animation effect.

Expression The expression to be evaluated. The position of the shape within the movement
area changes according to the value of the expression.

Expression range Indicates the minimum and maximum values of the expression.

Horizontal Indicates whether the shape is to be moved horizontally and if so, by how many
movement range pixels.

Specifies by how many pixels the shape is to be moved when the expression is
greater than or equal to the maximum Expression range value.

Vertical movement Indicates whether the shape is to be moved vertically and if so, by how many
range pixels.

Specifies by how many pixels the shape is to be moved when the expression is
greater than or equal to the maximum Expression range value.

Direction Selects the direction of movement of the shape within the specified area.

Tip: To assist you, the program displays the outline of the movement area on the
diagram while you edit the parameters of this animation effect.

Combining Effects
You can assign any number of animation effects to a shape. In Animation mode, the program
evaluates the expression associated with each effect and performs all applicable animation. Thus,
you can create a shape that changes colors based on a value and then starts flashing when a
threshold is exceeded.

Note: When more than one effect of the same type becomes enabled, it is the last one
in the list that is applied. You can use the Move Up and Move Down buttons on
the Animation tab of the Shape Properties dialog, to move the effects around in
the list.

Using the Full Screen Display Setting


In the Animation mode, a Full Screen display setting is available. When a diagram is displayed
using this setting, the application window’s title bar, menu bar and toolbar disappear completely,
leaving only the diagram itself and the status bar.

44 • Visual T&D Diagram Editor


To view the diagram in “Full Screen”:

‰ From the View menu, click Full Screen.

OR

‰ Press the F11 key.

To revert to the normal display setting:

‰ Press the F11 key.

Using Diagram Editor in the Standalone HMI Mode


When Visual T&D is configured to run as standalone HMI, all the usual Windows’ user interface
functions are disabled, so that the end user can only use Visual T&D.

For more information about Visual T&D’s Standalone HMI mode, refer to the Visual T&D
Explorer User Manual.

In Visual T&D’s Standalone HMI mode, Diagram Editor is always started in the Animation mode.
You can always switch between this mode and the design mode, by following the steps described

Visual T&D Diagram Editor • 45


in “Switching Between the Design Mode and the Animation Mode”, page 4, except if Diagram
Editor is configured to run in the Kiosk mode.

The Kiosk Mode


An additional mode is also available while in the Standalone HMI mode: the Kiosk mode. When
Diagram editor is in the Kiosk mode:

‰ You cannot switch to the Design mode: the diagram is always animated.

‰ All contextual menus are disabled. However, the F1 key, which triggers the online help, is
functional.

‰ The diagram is always displayed using the Full Screen display setting.

The Kiosk mode cannot be activated at runtime: its activation must be specified during the
Standalone HMI mode configuration process. Refer to the Visual T&D Explorer User Manual for
more details.

46 • Visual T&D Diagram Editor


Sharing Diagram Components

Overview
Visual T&D Diagram Editor provides additional features to help you create diagrams based on
standard shapes.

Shape libraries provide you with a means to define a set of standard shapes that you will use for all
your diagrams. In fact, Cooper Power Systems provides a library known as the Basic Shapes
Library, which contains frequently used shapes, buttons and displays. These shapes are animated,
so that you can use them to monitor the value or quality of a data point, or to see if any alarms
have occurred and to acknowledge and clear the alarms, or to operate data points in your diagram.
For example, the library contains one button that opens (sets to off) a binary output point and
another that closes (sets to on) a binary output point. You could retrieve these two shapes from the
library and add them to your diagram. You would then specify which data point you want to
operate. Thereafter, you would just need to click the buttons directly in your diagram in order to
operate the binary output point. The Basic Shapes library is discussed in detailed under “The Basic
Shapes Library”, page 61.

You will undoubtedly use the Basic Shapes library extensively. However, you may also want to
create your own libraries containing shapes and animations that are specific to your diagrams and
are not in the Basic Shapes Library. Once you have added a shape to a library, you can manage the
versions of that shape. Whenever you modify a shape in a library, you can easily update all the
diagrams that use the shape.

Creating and Managing Shape Libraries


The main user interface to Diagram Editor shape libraries is the Library Manager dialog box.
The dialog box displays the available shape libraries and provides commands for managing their
contents.

The Library Manager Dialog Box


To display the Library Manager dialog box:

‰ Click Manager in the Library menu.

Visual T&D Diagram Editor • 47


The dialog box contains the following boxes and menus:

‰ Current libraries – The left side of the dialog box displays a hierarchical view of the currently
available libraries.

‰ Shapes – The right side of the dialog box displays a list of the shapes available in the selected
library or folder.

‰ The File menu – The File menu provides commands to help you manage the libraries and
their contents.

‰ The Shape menu – The Shape menu provides commands to help you manage the shapes in
the libraries.

Note: By default, all libraries are created in the Libraries folder, within the Client folder.

Creating a New Shape Library


To create a new empty shape library:

‰ Click Manager in the Library menu, to display the Library Manager dialog.

‰ Click New in the dialog's File menu.

‰ Enter the name of the new library.

Adding Shapes to Libraries


To add a shape to a library:

‰ Use the Pointer or Selection tool to select the shape in the diagram.

‰ In the Library menu, click Add Shape to Library.

48 • Visual T&D Diagram Editor


If the diagram contains at least one VBA procedure or function, the Export dialog box opens, so
that you can choose which VBA items you want to save with the shape. When the dialog opens,
all the VBA items associated with the shape are automatically selected since it is assumed that you
will want to save the shape with in its entirety. You can, however, deselect one or more VBA
items if you so choose. Click Next to continue. To know more about the Export function, see
“Exporting Parts of a Diagram”, page 53.

The program now displays a Save As dialog, which is actually the Library Manager dialog box
with two additional boxes at the bottom, in which you can enter a name and version for the shape.
The dialog also allows you to select the library in which you want the shape to be stored.

‰ Enter a name for the shape.

‰ Enter the version number of the shape.

‰ Select the destination library or folder (left pane).

‰ Click Save.

Creating Library Folders


If your shape library contains a large number of shapes, you can create folders to organize its
contents.

‰ In the Library Manager dialog box, select the library or an existing folder in the left pane of
the dialog box.

‰ Select the New Folder command from the File menu of the Library Manager dialog box.

‰ Enter the name of the folder.

Visual T&D Diagram Editor • 49


Moving Shapes to Another Folder or Library
You can move library shapes from one folder to another or even from one library to another.

‰ In the Library Manager dialog box, select the shape you want to move.

Either:

‰ Drag and drop the shape to the destination library or folder.

OR

‰ Click Move in the Shape menu of the Library Manager dialog box.

‰ The dialog title is replaced with Move To, and a Move button appears at the bottom of
the dialog box.

‰ In the left pane, select the destination library or folder.

‰ Click the dialog's Move button.

Renaming Libraries and Folders


You can rename your libraries and folders.

‰ In the Library Manager dialog box, select the library or folder you want to rename.

‰ Click Rename in the File menu of the Library Manager dialog box.

‰ Enter the new name.

Renaming Shapes
You can rename the shapes in your libraries.

‰ In the Library Manager dialog box, select the shape you want to rename.

‰ Click Rename in the Shape menu of the Library Manager dialog box.

‰ Enter the new name.

Deleting Libraries and Folders


You can delete libraries and folders.

‰ In the Library Manager dialog box, select the library or folder you want to delete.

‰ Click Delete in the File menu of the Library Manager dialog box.

50 • Visual T&D Diagram Editor


Deleting Shapes
You can delete shapes in your libraries.

‰ In the Library Manager dialog box, select the shape you want to delete.

‰ Click Delete in the Shape menu of the Library Manager dialog box.

Adding Library Shapes to a Diagram


When you add a library shape to your drawing, Diagram Editor can keep a link between the shape
in the drawing and the shape library. Later on, when you update the shape in the library, Diagram
Editor can automatically update all the shapes that are linked to the library.

If you choose to add the shape to the drawing without a link, you will be unable to update the
shape from the library. Adding an unlinked shape is similar to using the Copy and Paste
commands.

Adding Linked Shapes


To add a linked shape to your drawing:

‰ In the Library Manager dialog box, select the shape you want to add to your drawing.

Either:

‰ Drag and drop the selected shape onto the drawing, at the desired position.

OR

‰ In the Shape menu of the Library Manager dialog, click Add Linked Shape to Drawing.

‰ The shape gets added to your drawing.

‰ Drag the shape to the desired position.

Adding Unlinked Shapes


To add an unlinked shape to your drawing:

‰ In the Library Manager dialog box, select the shape you want to add to your drawing.

‰ Click Add Shape to Drawing in the Shape menu of the Library Manager dialog.

The shape gets added to your drawing.

‰ Drag the shape to the desired position.

Visual T&D Diagram Editor • 51


Working with Shape Versions
The Library Manager keeps track of the versions of your shapes. When you save a shape in a
library, you identify it by its name and version number. When you add a library shape to your
drawing, Diagram Editor stores the version number with the shape. Later on, when you update the
shape in the library, Diagram Editor can automatically update every occurrence of the shape in
your diagrams.

When you add a shape to the library, the program performs the following validations:

‰ If there is no shape with same name, the new shape is added to the library.

‰ If there already is a shape with the same name, but with a higher version number, the
operation is refused.

‰ If there already is a shape with the same name and version number, you will be prompted to
overwrite the library shape. Since both shapes have the same version number, the Update All
Linked Shapes command in the Library menu will not update any other occurrences of the
shape in the diagram.

‰ If there already is a shape with the same name, but with a lower version number, you will be
prompted to overwrite the library shape.

Updating Shapes in a Library


You can update shapes that are in a library and have been modified on your drawing. This feature
speeds up the process of modifying shapes in a library and spares you from having to save them
again. However, the command is available only if the shape is still linked.

To do this:

‰ Click Update Library in the shape's contextual menu.

If some Visual Basic modules or pages previously associated with the shape are missing, the
application will display them and will prompt you to provide the new associations.

If your diagram contains a grouped shape that you have stored in a library, and you now
change the structure of the grouped shape by adding a new shape to the group, for example,
the Update Library command will no longer be available for the modified shape. To update
the shape in the library, proceed as follows:

‰ Select the shape in the diagram.

‰ In the Library menu, click Add Shape to Library.

‰ In the Save As dialog, select the original shape.

‰ Leave the same name in the Name box, enter a new version number in the Version box,
and click Save.

52 • Visual T&D Diagram Editor


Updating the Shapes in a Drawing
If you have made changes to one or more library shapes, you will want to update any occurrences
of the shape or shapes in your drawing. Only shapes that are linked to the library can be updated.
You can update the linked shapes individually or you can choose to update all the shapes in the
drawing.

Updating a Single Shape


To update from the library, a single shape in the drawing:

‰ On your drawing, use the Pointer or Selection tool to select the shape to be updated.

‰ Click Update From Library in the Shape menu.

Updating all the Shapes in the Drawing


To update from the library, all the shapes in the drawing:

‰ Click Update All Linked Shapes in the Library menu.

Importing and Exporting Parts of a Diagram


Your diagram may contain pages or Visual Basic modules that required significant efforts to
create. You will certainly want to reuse some of these components in other diagrams.

The Export command of the File menu saves complete diagram pages will all their shapes and
Visual Basic modules, in a special type of data file. You can then use the Import command of the
File menu to merge these pages and modules into any other diagram.

Exporting Parts of a Diagram


To export diagram pages or Visual Basic modules:

‰ Click Export in the File menu.

The program displays a dialog box, showing you the pages that are currently in the Visual
Basic project for the selected shape. Note that the main page does not appear in the list.

Visual T&D Diagram Editor • 53


‰ Select the diagram page(s) you want to export.

‰ Click Next.

The program displays a second dialog box, listing all the Visual Basic project items in the
diagram pages you have selected.

‰ Select the items you want to export.

‰ Click Finish.

The program displays the Save As dialog box.

‰ Enter a name for the file and if need be, select a destination folder other than the suggested
folder (Diagrams).

Note: You cannot export the main page of your diagram. Therefore, the page does not
appear in the list of pages that can be exported.

54 • Visual T&D Diagram Editor


Importing Parts of a Diagram
To import diagram pages or Visual Basic modules saved with the Export command:

‰ Click Import in the File menu.

‰ In the appropriate folder, select the file to be imported.

Working with Aliases


The diagrams you design will most probably contain repetitive shapes. To simplify your task, you
will undoubtedly use the Copy and Paste commands to add multiple copies of a particular shape
to the diagram. However, when you copy a shape you also copy the animation effects, which are
all based on the value of the data points named in the expressions. To create a meaningful
diagram, you would have to edit each animation effect of each shape to change the names of the
data points.

Since this approach is not really convenient, Diagram Editor provides a simple method by which
you can create generic shapes that you can then easily associate with any data point. Instead of
directly naming points in the expressions, you will design your animation effects by using
symbolic values that we will call aliases. Before running the animation, you will simply associate
the aliases used in each shape with the real data points that are used to control and monitor your
process.

If your data points are named according to some systematic naming convention, Diagram Editor
can also provide you with a method for automatically associating aliases with data points.

Using Aliases in Animation Expressions


You can use an alias in an animation expression in exactly the same manner that you would use a
data point name, except that you surround the alias name with square brackets.

The Variables and Aliases button in the Expression Editor displays the list of all the variables
(data points) known to the server, as well as all the aliases you have defined for a shape. The
aliases are added to the end of the list, and their names are surrounded with square brackets so that
you can easily identify them.

Here are some examples of expressions containing aliases:


[IA]
QualityOf([MA])
NOT (TagOf([TS], 9) OR TagOf([TS], 10))

Manually Assigning Aliases to Variables


Before you can run a diagram that contains aliases, you must assign each alias to a variable, that
is, to a data point.

To manually assign the aliases for a particular shape:

Visual T&D Diagram Editor • 55


‰ Use the Pointer or Selection tool to select the shape in the drawing.

‰ Click Assign Aliases in the Animation menu.

To manually assign the aliases for all the shapes in your diagram:

‰ Click Assign Aliases in the Animation menu.

The program displays the Assign Aliases dialog box. If you selected a particular shape, you will
see the aliases used in that shape; otherwise, you will see a list of all the shapes in your diagram,
with all the aliases used in all the shapes.

In the screenshot below, we selected a particular shape in the diagram, called L3_ION. The shape
animation contains 3 aliases: current, polarity and voltage. We have already mapped current to a
data point called L3_ION_IA, and polarity to a data point called L3_ION_V1_Polarity. We are in
the process of using the drop-down list to choose a data point for voltage. The Resolution column
displays "Automatic" by default, but once you have chosen a data point in the drop-down list, it
displays "Manual" to indicate that you have manually assigned the alias to a data point.

Object Description
Shapes If you selected a shape before displaying the dialog, the Shapes section will
display the group hierarchy of the selected shape; otherwise, it will display all the
shapes in the diagram and their individual group hierarchies.

The Variables and aliases grid displays the list of variables and aliases used in
the selected shapes.

Variable Use the drop-down list to choose a data point for the alias shown in the same row.
An empty cell indicates that no data point has been assigned yet to the alias.

56 • Visual T&D Diagram Editor


Object Description
Alias This column lists the names of all the aliases used in the selected shapes.

Note that if you change the name in the Alias column, the name of the alias will
also be changed in the animation expressions that use the alias.

Resolution This column indicates whether the alias will be resolved automatically or
manually. To automatically assign aliases, you will use a Visual Basic procedure
in the Basic Shapes library. See "Automatically Assigning Aliases to Variables",
below.

Context This column indicates the name of the shape and the animation effect in which
the alias (or data point, if you did not use an alias in the animation expression) is
used.

Find Displays a dialog box, in which you can enter a name that you want to locate in
one of the columns of the grid.

Replace Displays a dialog box, in which you can enter a name that you want to locate in
one of the columns of the grid, as well as a replacement string.

Automatically Assigning Aliases to Variables


Before it displays a page, Diagram Editor automatically assigns all the aliases that have not been
set manually with the Assign Aliases command.

You can invoke the automatic alias assignment procedure while you are designing your diagram.
You will do this by using a Visual Basic object in the Basic Shapes library, called the
ResolveAlias object. This object contains a VBA module with 2 scripts that you can use to
automatically map aliases to data points in your diagrams:

‰ ResolveByName.
This procedure determines the data point name by appending the name of the alias to the
name of the shape. For example, if the shape were called F1_BRK_ and included an
animation expression that used an alias called [CONTROL], the procedure would map the
alias to the data point called F1_BRK_CONTROL.

‰ ResolveFromFile.
This procedure uses the name of the shape to look up the alias in an external CSV file. You
can use this procedure either when your data point naming convention is too complex for you
to use the ResolveByName procedure, or when the names of the data points are readily
available in an external file.

Using the ResolveByName Procedure


You will go through the following steps to resolve aliases using the ResolveByName procedure:

‰ Insert the ResolveAlias object in your diagram.

‰ Assign the ResolveByName procedure to the selected shape's Resolve Alias event.

Visual T&D Diagram Editor • 57


‰ Click Resolve Aliases in the Animation menu, to have Diagram Editor automatically assign
the aliases for the selected shape.

Here is a detailed description of each of the steps:

‰ Insert the ResolveAlias object in your diagram:

‰ Click Manager in the Library menu.

‰ In the Library Manager dialog, select the Resolve Alias folder in the Basic Shapes
library.

‰ In the right pane, select the ResolveAlias shape, and drag and drop it onto your diagram.

Note: When you save your diagram, the newly inserted ResolveAlias object becomes
part of the diagram. Thus, you will not have to retrieve the object from the library
the next time you open the diagram.

‰ Assign the ResolveByName procedure to the selected shape's Resolve Alias event:

‰ Select the shape for which you want to resolve the aliases.
In our example, we have selected an object called SimSS_025_F1_.
This grouped shape contains 3 aliases: [IA], [IB] and [IC], representing the phase A,
phase B and phase C current, respectively.

‰ Click Visual Basic Wizard in the Animation menu.

‰ In the wizard dialog, click Add or modify diagram event handlers, then click Next.

‰ In the Event Handlers dialog:

‰ Select the shape in the Select shape section.

‰ In the Select event handler section, choose the Resolve Aliases event, the
ResolveAlias module, and the ResolveByName procedure using the drop-down lists.

‰ Click the Add button.

The Resolve Aliases event handler gets added to the shape's event handlers, as
shown in the Event handlers box at the bottom of the dialog.

58 • Visual T&D Diagram Editor


‰ Click Finish.

‰ Click Resolve Aliases in the Animation menu, to have Diagram Editor automatically assign
the aliases for the SimSS_025_F1_ shape.

To view the results of the alias resolution:

‰ Click Assign Aliases in the Animation menu.

This will display the Assign Aliases dialog. In our example, we can see that Diagram Editor
has mapped each alias to a data point name consisting of the shape name plus the alias name.

Visual T&D Diagram Editor • 59


Using the ResolveFromFile Procedure
You will go through the following steps to resolve aliases using the ResolveFromFile procedure:

‰ Set up a comma-separated file (CSV) that shows the relationship between the aliases and the
data points.

‰ Insert the ResolveAlias object in your diagram.

‰ Assign the ResolveFromFile procedure to the shape's Resolve Alias event.

‰ Click Resolve Aliases in the Animation menu, to have Diagram Editor automatically assign
the aliases for the selected shape.

The first step is described below. The remaining steps are identical to those described for the
ResolveByName procedure, with the exception that you will assign the ResolveFromFile rather
than the ResolveByName procedure to the shape's Resolve Alias event. See "Using the
ResolveByName Procedure", above.

‰ Set up a CSV file that complies with the following format:

‰ A header line with the words: shape, alias and point, separated by commas.

‰ A series of lines containing, on each line:

‰ the name of a shape;

‰ the name of an alias;

‰ the name of the corresponding data point, each enclosed in quotes and separated by
commas.

For example:

shape,alias,point
"F1","IA","SimSS_025_F1_IA"
"F1","IB","SimSS_025_F1_IB"
"F1","IC","SimSS_025_F1_IC"
"F2","IA","SimSS_025_F2_IA"
"F2","IB","SimSS_025_F2_IB"
"F2","IC","SimSS_025_F2_IC"

Note that the ResolveFromFile procedure expects the CSV file to be called Aliases.csv. It also
expects the CSV file to be located in the Temp folder of your hard disk. If you use another name,
such as Maple Grove Aliases.csv, or store the file in some other folder, you must modify the
procedure accordingly. To do this:

‰ Select the shape to which you have assigned the ResolveFromFile procedure.

‰ Click Visual Basic Editor in the Animation menu.

‰ In the left pane of the Visual Basic Editor window, double-click ResolveAlias in the Modules
folder.

60 • Visual T&D Diagram Editor


‰ In the ResolveFromFile procedure, specify the appropriate information for folderName and
fileName.

If you have an error when resolving aliases, add a schema information file to the data source. To
do this:

‰ Using Notepad, create a new file

‰ Paste the following text in the new file:

[NameOfAliasesFile.csv]
ColNameHeader=True
Format=CSVDelimited
DecimalSymbol=.

‰ Modify the first line of the file to replace “NameOfAliasesFile.csv” by your csv filename.
For example, the first line of the file will look like this: [Maple Grove Aliases.csv]

‰ In the Notepad File menu, choose Save As…. The Save dialog will appear.

‰ Browse to your folder containing your .CSV file.

‰ In the Filename field, type schema.ini.

‰ Select All Files in the Save as type combo box.

‰ Press Save.

The Basic Shapes Library


Cooper Power Systems provides a library known as the Basic Shapes Library, which contains
frequently used shapes, buttons and displays. These shapes are animated, so that you can use them
to monitor the value or quality of a data point, or to see if any alarms have occurred and to
acknowledge and clear the alarms, or to operate data points in your diagram. For example, the
library contains one button that opens (sets to off) a binary output point and another that closes
(sets to on) a binary output point. You could retrieve these two shapes from the library and add
them to your diagram. You would then specify which data point you want to operate. Thereafter,
you would just need to click the buttons directly in your diagram in order to operate the binary
output point.

To help familiarize you with using the Basic Shapes library, we will go through an example. Our
example uses a simulation database and data points that we have in our diagram, but you can go
through the example using data points that exist in your own diagram.

Our diagram contains a binary input point called SimSS_220_L1_ALM1. This is a binary input
point representing an alarm on line 1. We would like to know at a glance, whether the alarm is on
or off. We would also like to know if the quality of the data point is good or bad.

Proceed as follows:

‰ Click Manager in the Library menu.

‰ In the Library Manager dialog, click the Labeled Indicators folder.

Visual T&D Diagram Editor • 61


‰ In the right pane, click the shape called Green-Red Labeled Square, and drag and drop it
onto your diagram.

If you look at the shape properties, you will see that the shape contains 3 "Change color"
animation effects. If you then look at the animation expressions, you will see that the first one
changes the color of the shape to green if a binary input point with an alias called
[BINARY_INPUT] is on, the second one changes the color to red if the data point is off, and the
third one changes the color to grey if the data point quality is bad.

‰ With the shape still selected, click the Shape menu, then Grouping, then Show.

‰ In the Grouping dialog, select Label and click Properties.

‰ In the Shape Properties dialog, click the Text tab, enter "L1 ALM" in the Text box, and
click OK.

‰ Close the Grouping dialog box.

The shape now looks like this:

‰ Click Assign Aliases in the Animation menu, and assign the data point called
SimSS_220_L1_ALM1 to the [BINARY_INPUT] alias (for this procedure, see “Manually
Assigning Aliases to Variables”, page 55).

‰ Click Run in the Animation menu, to run the animation.

The L1 ALM shape will turn green, red or grey each time there is a change in the state of the
data point.

62 • Visual T&D Diagram Editor


For the purpose of the test, you can provoke the changes in one of the following ways:

‰ On the real device, generate a real alarm, then clear the alarm, and then provoke a
communications failure or some other incident that will affect the quality of the data point,
and watch the L1 ALM square change colors.

OR

‰ If you are authorized to use simulation mode:

‰ Get into simulation mode via the Visual T&D Explorer Tools menu.

‰ Select the data point in the Real-Time Data view.

‰ In the View menu, click Data Point Properties, and directly manipulate the state and
quality of the data point, in order to see the L1ALM shape change colors on your
diagram.

OR

‰ If you can operate a binary output point that affects the state of the binary input point:

‰ Drag and drop the Click Open and Click Close shapes from the Buttons folder of the
Basic Shapes library onto your diagram.

‰ Each of these buttons operates a binary output point, and contains an animation that uses
an alias called [BINARY OUTPUT].

‰ For each button, click Assign Aliases in the Animation menu, and assign the alias to the
binary output point you are going to operate. In our simulation database, the binary
output point is called SimSS_220_L1_ALM1_CONTROL. For the alias assignment
procedure, see “Manually Assigning Aliases to Variables”, page 55.

‰ Click the Click Open and Click Close buttons, and watch the L1 ALM shape change
colors.

Working with Pages


When you start creating the diagrams for your site, you may feel constrained by the size of the
computer screen. With Visual T&D Diagram Editor, you are not limited to a single diagram page.
Your diagram can be composed of any number of pages that are displayed in the form of
background or pop-up windows. Note that only one page can be displayed in the background
window at a time.

With the display page management features, you will be able to create sophisticated diagrams that
provide increasing levels of detail. The background diagram page can represent the general status
of each device and by clicking on a device, you can display a detailed representation of all

Visual T&D Diagram Editor • 63


significant device data.

The Types of Pages in a Diagram


If your diagram contains only one page, it will be displayed in the main (background) window of
the program. When you add new pages to your diagram, you will decide whether these pages are
to be displayed in pop-up windows that overlap the background or whether they will be displayed
in the background window.

If you decide to create individual diagrams for each device on the site, you will soon realize that
these diagrams are quite similar and that the only differences are the names of the devices and
their data points. We have already seen that with Diagram Editor, you can create generic shapes
that contain aliases that are automatically or manually assigned to data points. In the same manner,
you can create diagram pages that contain generic shapes that will be dynamically renamed so that
the program can correctly assign the data points.

Managing the Pages in Your Diagram


The Pages dialog box allows you to display, create, modify or delete pages in your diagram.

To display the dialog box:

‰ From the View menu, select Pages.

Object Description
List of pages Displays the list of all the pages in your diagram. The diagram will always
contain at least one page.

Add Adds a new page to the diagram. Displays a dialog box in which you can set the
name and properties of the new page.

64 • Visual T&D Diagram Editor


Object Description
Properties Displays a dialog box in which you can modify the name and properties of the
selected page.

Default Set the selected page as the default page.

Delete Removes the selected page from the diagram.

Show Displays the selected page and makes it available for editing.

Adding a New Page or Modifying an Existing Page


To add a new page to your diagram or to modify an existing page:

‰ Click the Add or Properties button in the Pages dialog box.

The program displays a dialog in which you can specify the name and properties of the page:

The Display tab is the same than for the Page Properties dialog box (see “Setting up the Current
Page’s Properties”, page 4).

‰ Specify the page’s name.

‰ Specify the page’s width and height.

‰ Select how much the page will be zoomed in/out when the diagram is run.

‰ Select the background color.

‰ Select the Action tab.

Visual T&D Diagram Editor • 65


Object Description
Use background If selected, the page will be displayed in the background window.
window

Create new window If selected, the page will be displayed in a pop-up window.

Use the following If selected, the page will be used to display several pages using shape renaming
shape renaming tables (see List of tables, below).
tables

List of tables Displays the list of shape renaming tables defined for this page. That is, you will
assign generic names to the shapes on the page, and have the shapes dynamically
renamed via the renaming tables that you define here. Thus, you create just one
page from which you will display several pages. You can, therefore, use the page
to monitor several identical devices, as discussed under “Using a Single Diagram
Page to Monitor Multiple Devices”, page 69.

The box is available only if you selected Use the following shape renaming
tables.

Add Adds the name you entered in the upper box of the Tables section, to the list of
renaming tables assigned to the page.

Delete Deletes the selected table from the list of renaming tables.

Edit Displays the Rename Shapes dialog, which you can use to rename the shapes in
the table currently selected in the list. The procedure for renaming generic shapes
is outlined under “Using a Single Diagram Page to Monitor Multiple Devices”,
page 69.

Displaying the Pages of a Multiple-Page Diagram


The Basic Shapes library contains two buttons that you can use to open and close the pages in
your diagram. The procedure to follow is simple and is described here using as an example, a
diagram with a main page and 2 additional pages.

‰ Create a new diagram by clicking New in the File menu.

66 • Visual T&D Diagram Editor


‰ Add 2 new pages, called SEL351 and SEL387, which you will use to display information
originating from a SEL351 relay located on feeder 1 and a SEL387 relay located on feeder 2:

‰ In the View menu, click Pages.

‰ In the Pages dialog, click Add.

‰ Select the Display tab and enter the page name (SEL351 or SEL387).

‰ Select the Action tab and choose Create new window.

‰ Click OK.

‰ Repeat the previous steps for the second page.

‰ Click Close.

‰ Add 2 buttons to your main diagram page, that you will use to open the pages you have just
added:

‰ In the Library menu, click Manager.

‰ Open the Buttons folder of the Basic Shapes library.

‰ Drag and drop the Click Page Open shape onto your diagram.

‰ Copy and paste the shape, so that you now have 2 page opening buttons on your main
diagram page.

‰ Set up each button to open the appropriate page:

‰ Select the first button.

‰ In the Shape menu, click Grouping, and then click Show.

‰ In the Grouping dialog, click the Properties button.

‰ In the Shape Properties dialog, enter "SEL 351" in the Name box, and click OK.
SEL 351 will become the group name of the button shape. It is important to note that the
name of the button must be the exact name that you assigned to the page via the
Pages dialog.

Visual T&D Diagram Editor • 67


‰ In the Grouping dialog, click Label, and then click the Properties button.

‰ In the Shape Properties dialog, click the Text tab.

‰ In the Text box, enter "RELAY_F1", and click OK.

This text will appear on the button. We used "RELAY_F1" since we have a relay on
Feeder 1 and one on Feeder 2. We could, however, have entered any meaningful text.

Repeat the procedure for the second button, naming the button SEL 387 and labeling it
"RELAY_F2".

Your main diagram page now has these 2 buttons:

‰ On the SEL351 page, add a button to close the page:

‰ In the View menu, click Pages, and then click Show.

‰ In the Pages dialog, select SEL 351, and then click the Show button to display the page.

68 • Visual T&D Diagram Editor


‰ Drag and drop the Click Page Close button from the Basic Shapes library Buttons
folder onto the SEL 351 page.

‰ Assign a group name of "SEL 351" to the button, since the name of the button shape
must match the name of the page.

‰ Replace the button text with "EXIT" (or any other text, such as "CLOSE" or "MAIN").

‰ On the SEL 387 page, add a button to close the page. Call the button "SEL 387", and replace
the button text with "EXIT".

Now, the SEL351 and SEL387 pages each have the following button:

You must save the diagram before running it.

‰ In the File menu, click Save.

‰ The Save As dialog box appears. Select the folder where you want to save the diagram file
and type the file’s name.

‰ Click Save.

You are now ready to run your diagram.

‰ Click Run in the Animation menu.

The diagram will open on the main page.

‰ Click the RELAY_F1 button to have the SEL351 page appear in a pop-up window.

‰ On the SEL351 page, click the EXIT button to close the pop-up window.

‰ Click the RELAY_F2 button to have the SEL387 page appear in a pop-up window.

‰ On the SEL387 page, click the EXIT button to close the pop-up window.

Using a Single Diagram Page to Monitor Multiple Devices


A typical site will contain a large number of similar devices. There are two methods for creating
pages that display detailed information about these devices. The most elaborate method is to create
individual pages for each device. While you may copy the devices from one page to another, you
will still have to rename each shape and reassign the aliases.

Visual T&D Diagram Editor provides a method that greatly simplifies this process. You can create
a single page that is dynamically mapped to the devices when you run the diagram. This approach
saves time and effort not only when you first draw the diagram page, but also if you subsequently
need to make changes to the diagram. You have only one page to change.

Visual T&D Diagram Editor • 69


To do this, you will follow a few simple steps, which are best explained by an example.

Suppose that you have drawn your main diagram page. You would now like to monitor the data
points of 3 identical ION6200 devices located on lines 1, 2 and 3, respectively. You would like to
have the information for each device appear in a separate pop-up window that you would display
by clicking a button on the main diagram page. You can achieve this by drawing a single page to
represent the ION6200 device.

Proceed as follows:

‰ Using the View menu’s Pages command, add a new page named ION6200. In the Action tab,
select Create new window, and then select Use the following shape renaming tables. Add 3
shape renaming tables to the page, to which you assign meaningful names, such as
ION6200_L1, ION6200_L2, and ION6200_L3, respectively.

To add each table:

‰ Enter a table name in the upper box of the Tables section, and click the Add button.

The name of the new table gets added to the list shown in the lower box of the Tables section.

‰ Click OK to close the dialog box.

‰ Display the new ION6200 page. To do this, in the Pages dialog, select the ION6200 page and
click Show.

‰ Add the desired shapes to the page, and use aliases rather than data point names for the
animation effects.

In the example below, we created 3 animated shapes, to which we assigned the following
names:

‰ Measures.
This shape shows currents, line-to-neutral voltages, and line-to-line voltages.

‰ CommStatus.
This shape shows the device communication status.

‰ ExitButton.
This shape is a Basic Shapes library Click Page Close button that we will use to close the
page.

70 • Visual T&D Diagram Editor


‰ In the Pages dialog, select the ION6200 page and click Properties.

‰ In the Modify Page dialog, select the ION6200_L1 renaming table and click the Edit button.

Note: If no shape is present on the page, the Edit button is disabled.

‰ In the Rename Shapes dialog, rename each shape as shown below:

When you run the animation, the aliases used on the page will be resolved using the prefix
you specified here. For example, if the Measures shape has aliases called [IA], [IB], [IC] and
[IAvg], these will be dynamically resolved to ION_L1_IA, ION_L1_IB, ION_L1_IC and
ION_L1_IAvg.

‰ Click OK to return to the Modify Page dialog box.

‰ Select the ION6200_L2 renaming table and rename the same 3 shapes with ION_L2_, so the
aliases can be resolved using the ION_L2_ prefix. Repeat the process for table ION6200_L3,
renaming the 3 shapes with ION_L3_.

‰ Display the background page of your diagram.

‰ In the Library menu, click Manager, and then from the Basic Shapes library’s Buttons
folder, drag and drop 3 Click Page Open buttons onto your diagram.

‰ Assign to the first button shape, the name of the first renaming table: ION6200_L1, and enter
the text to be displayed on the button.

Visual T&D Diagram Editor • 71


‰ Assign to the second button shape, the name of the second renaming table: ION6200_L2, and
enter the text to be displayed on the button.

‰ Assign to the third button shape, the name of the third renaming table: ION6200_L3, and
enter the text to be displayed on the button.

The labels on the buttons are arbitrary. The names of the 3 button shapes, however, are not
arbitrary. They must match the names of the 3 shape renaming tables. If you need help
assigning names to the button shapes or modifying the text labels, see “Displaying the Pages
of a Multiple-Page Diagram”, page 66.

‰ In the Library menu, click Manager, and then from the Basic Shapes library Resolve Alias
folder, drag and drop the ResolveAlias shape onto your diagram.

‰ Add the ResolveByName event handler to each shape on the ION6200 diagram page that
requires alias resolution. For instructions, refer to “Automatically Assigning Aliases to
Variables”, page 57.

‰ For each of the 3 pages to be displayed, create a Visual Basic procedure that calls the
Document.OpenPage method to display the diagram page. The parameters of the method
must:

‰ specify the name of the page to be opened, namely, "ION6200" in this example;

‰ specify the name of the button shape that will be used to open the page.

Note: You will find an in-depth discussion on how to create Visual Basic scripts under
“Working with Scripts”, page 75.

You are now ready to run your diagram.

‰ In the Animation menu, click Run.

‰ Click the ION 6200 L1 button to display the ION6200 page in a pop-up window showing the
values for the ION6200 device on line 1, and then click the EXIT button to return to the main
diagram page.

‰ Click the ION 6200 L2 button to display the ION6200 page in a pop-up window showing the
values for the ION6200 device on line 2, and then click the EXIT button to return to the main
diagram page.

‰ Click the ION 6200 L3 button to display the ION6200 page in a pop-up window showing the
values for the ION6200 device on line 3, and then click the EXIT button to return to the main
diagram page.

The screenshot below shows the pop-up window for the ION6200 device located on line 2.

72 • Visual T&D Diagram Editor


Visual T&D Diagram Editor • 73
Working with Scripts

Overview
The basic functions of Diagram Editor are all you need to create sophisticated animated diagrams
that provide you with a basic real-time representation of a monitored process. While this may be
sufficient in many cases, the real power of Diagram Editor becomes available when you use the
built-in Visual Basic language to create scripts that support operator interaction.

The Visual T&D Diagram Editor includes the Microsoft Visual Basic for ApplicationsTM
technology. Using this technology, you can create sophisticated diagrams whereby operators can
use the mouse to display detailed views of your site and control the values of the data points.

Each shape you create in a diagram can generate events that launch Visual Basic scripts when the
shapes are added to a diagram or when the operator clicks on them with the mouse. These scripts
can open new diagram pages and access the Visual T&D server to read or write data points in
order to perform sophisticated control operations.

Diagram Editor Events


In order to create interactive diagrams, you will create scripts that are invoked whenever the
operator performs an operation such as clicking or double-clicking on a shape or moving the
mouse over a shape.

When the operator performs such an operation, Diagram Editor generates an event that you can
process by associating it with a Visual Basic procedure in your script. To create the scripts, you
will use the Visual Basic Wizard and the Visual Basic Editor.

The Visual Basic Wizard assists you in managing your Visual Basic project. The Wizard guides
you through the steps required to create new program modules and new Visual Basic procedures.
You will also use the Wizard to associate events and shapes with specific Visual Basic procedures.

Your Visual Basic project can contain as many event handling procedures as you want. You can
create an individual event handler for each shape, or share a single handler for any number of
shapes.

Visual T&D Diagram Editor • 75


Events and Operation Modes
As described in “Modes of Operation”, page 3, Diagram Editor provides two modes of operation:
the Design mode and the Animation mode.

Some Diagram Editor events are designed to support user interaction while in the Animation
mode; some other events are designed to support designer interaction in the Design mode.

The Click Event


When you click on a shape in the Animation mode, Diagram Editor invokes a procedure to
process the event:

Public Function OnClick(DiagramShape As Shape, _


X As Long, Y As Long, _
VirtKeyCode As VIRTUAL_KEY_CODE, _
MouseButton As MOUSE_BUTTON)
' add your code to process the Click event
End Function

The Click event handler has the following parameters:

Field Description
DiagramShape The Shape object on which the operator clicked.

X The horizontal position of the mouse in the diagram.

Y The vertical position of the mouse in the diagram.

VirtKeyCode The keyboard keys that were pressed when the shape was double-clicked:

‰ VKC_NONE.
No keys were pressed.
‰ VKC_ALT.
The ALT key was pressed.
‰ VKC_CONTROL.
The CTRL key was pressed.
‰ VKC_SHIFT.
The SHIFT key was pressed.

A combination of the above keys may have been pressed when the mouse was
clicked.

76 • Visual T&D Diagram Editor


Field Description
MouseButton The mouse button that was used to click on the shape:

‰ MOUSE_LEFT_BUTTON.
The left button was clicked.
‰ MOUSE_MIDDLE_BUTTON.
The middle button or the wheel was clicked.
‰ MOUSE_RIGHT_BUTTON.
The right button was clicked.

The Double-Click Event


When you double-click on a shape in the Animation mode, Diagram Editor invokes a procedure to
process the event:

Public Function OnDoubleClick(DiagramShape As Shape, _


X As Long, Y As Long, _
VirtKeyCode As VIRTUAL_KEY_CODE, _
MouseButton As MOUSE_BUTTON)
' add your code to process the Double Click event
End Function

The Double-Click event handler has the following parameters:

Field Description
DiagramShape The Shape object on which the operator double-clicked.

X The horizontal position of the mouse in the diagram.

Y The vertical position of the mouse in the diagram.

VirtKeyCode The keyboard keys that were pressed when the shape was double-clicked:

‰ VKC_NONE.
No keys were pressed.
‰ VKC_ALT.
The ALT key was pressed.
‰ VKC_CONTROL.
The CTRL key was pressed.
‰ VKC_SHIFT.
The SHIFT key was pressed.

A combination of the above keys may have been pressed when the mouse was
clicked.

Visual T&D Diagram Editor • 77


Field Description
MouseButton The mouse button that was used to click on the shape:

‰ MOUSE_LEFT_BUTTON.
The left button was clicked.
‰ MOUSE_MIDDLE_BUTTON.
The middle button or the wheel was clicked.
‰ MOUSE_RIGHT_BUTTON.
The right button was clicked.

Note: You can process both the Click and Double-Click events for a particular shape.
Both events are supported for the same shape and are distinct.

The Mouse Enter event


When the operator moves the mouse over a shape in the Animation mode, Diagram Editor invokes
a procedure to process the event:

Public Function OnEnter(DiagramShape As Shape)


' add the code to process the Mouse Enter event
End Function

The Mouse Enter event handler has the following parameters:

Field Description
DiagramShape The Shape object that the mouse entered.

The Mouse Leave Event


When the mouse leaves a shape in the Animation mode, Diagram Editor invokes a procedure to
process the event:

Public Function OnLeave(DiagramShape As Shape)


' add the code to process the Mouse Leave event
End Function

The Mouse Leave event handler has the following parameters:

Field Description
DiagramShape The Shape object that the mouse left.

78 • Visual T&D Diagram Editor


The Add Shape to Diagram Event
When you add a library shape to your diagram in the Design mode, Diagram Editor invokes a
procedure to process the event:

Public Function AddShape(DiagramShape As Shape, Page As String)


' add the code to process the Add Shape to Diagram event
End Function

The Add Shape to Diagram event handler has the following parameters:

Field Description
DiagramShape The Shape object added to the page.

Page The name of the diagram page to which the shape is added.

The Resolve Aliases Event


When you select the Resolve Aliases command from the Animation menu in the Design mode,
Diagram Editor invokes a procedure to process the event.

Public Function ResolveAlias(DiagramShape As Shape)


' add the code to process the Resolve Aliases event
End Function

The Resolve Aliases event handler has the following parameters:

Field Description
DiagramShape The Shape object for which you want to resolve the aliases.

The Diagram Editor Object Model


The scripts you create execute in an environment consisting of Diagram Editor application, the
current diagram, the shapes in the diagram, and the Visual T&D server. The Visual Basic language
provides access to objects that represent these elements. Your script interacts with the environment
by accessing the methods and properties of the objects.

The document entitled Visual T&D Developer Reference explains the Visual T&D Diagram object
model, in detail.

The Visual Basic Wizard


The Visual Basic Wizard assists you in managing your Visual Basic for Applications (VBA)
project and in performing the following tasks:

Visual T&D Diagram Editor • 79


‰ Creating new modules in the Visual Basic project.

‰ Creating new procedures in the Visual Basic project.

‰ Assigning procedures to events and shapes in your diagram.

Note: You do not need to use the Wizard to create modules and procedures. You can
perform these operations with the Visual Basic Editor. However, you must use
the Wizard to assign procedures to shapes and events.

Creating a New Module


You can use the Wizard to create a new Visual Basic module:

‰ Select the Visual Basic Wizard command from the Animation menu.

‰ Select the Create a new module option and click Next.

‰ Enter the name of your module.

Note: You can also create a new module with the Module command in the Insert menu
of the Visual Basic Editor.

Creating a New Procedure


You can use the Wizard to create a new procedure in a Visual Basic module:

‰ Select the Visual Basic Wizard command from the Animation menu.

‰ Select the Add a new procedure option and click Next.

The Wizard displays the following dialog box:

80 • Visual T&D Diagram Editor


‰ Select the destination module.

‰ Select the type of event to be processed. The Wizard will provide the correct parameters
according to the type of event.

‰ Enter the name of the procedure. Your scripts will be easier to read if you select a name that
corresponds to the type of event to be processed, such as: OnClick or MyShape_Click.

‰ Select the type of procedure. Use Function to create a Visual Basic procedure that can return
a result and that you can use in an expression. Use Subroutine to create a procedure that does
not return a result.

‰ Select the scope of the procedure. Use Public to indicate a procedure that is accessible to all
other procedures in all modules. Use Private to indicate a procedure that is accessible only to
the procedures in the module in which it is declared.

‰ Enter the parameters and return type for the procedure. The contents of this field are
automatically set when you select an event type to be processed.

‰ The Event Handlers dialog box will open at the end of this procedure’s creation (see
“Assigning Procedures to Events and Shapes”, below).

Note: You can also create a new procedure with the Procedure command in the Insert
menu of the Visual Basic Editor.

Assigning Procedures to Events and Shapes


You will use the Wizard to assign procedures to events and shapes in your drawing.

‰ Select the Visual Basic Wizard command from the Animation menu.

Visual T&D Diagram Editor • 81


‰ Select the Add or modify diagram event handlers and click Next.

The Wizard displays a panel that contains the following fields:

Object Description
Select shape Displays the hierarchy of the shape selected in the diagram, or of all available
shapes if none was selected.

Select the shape or group to which you want to assign a procedure.

Event Select the type of event to be processed:

‰ Click
‰ Double-click
‰ Mouse Enter
‰ Mouse Leave
‰ Add shape to diagram
‰ Resolve alias

Module Select the module that contains the procedure.

Procedure Enter the name of the procedure.

Propagate to parents Indicates whether the event will be propagated upwards in the hierarchy to the
enclosing groups.

Propagate to Indicates whether the event will be propagated downwards in the hierarchy to the
children enclosed groups and shapes.

Add Adds the procedure to the list of event handlers.

82 • Visual T&D Diagram Editor


Object Description
Delete Removes the selected procedure from the list of event handlers.

Event handlers Displays the list of event handlers.

The Visual Basic Integrated Development


Environment

Visual T&D Diagram Editor provides a standard integrated development environment (IDE) for
convenient development of the Microsoft ® Visual Basic ® for Applications (VBA) procedures
that you will require to automate your diagrams.

The development environment is consistent with those found across all VBA-enabled applications
such as Microsoft ® Office. If you have used VBA in any of these applications, Diagram Editor’s
environment will be familiar to you.

For complete details on using the development environment and writing procedures, see the VBA
online help.

Launching the Visual Basic Editor


The Visual Basic Editor is a built-in part of Diagram Editor. To launch Visual Basic Editor:

‰ Select the Visual Basic Editor command from the Animation menu.

To program the various functions required for your application, refer to the Visual T&D Developer
Reference.

Visual T&D Diagram Editor • 83

You might also like