Schneider Electric Application Editor, FactoryLink (6.5.0) User Guide

Schneider Electric Application Editor, FactoryLink (6.5.0) User Guide | Manualzz
Application Editor Guide
FactoryLink 6.6.0 / September/ 1998 / 000A*DOC-APE*000*660
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
FactoryLink 6.6.0
©Copyright 1984 - 1998 United States Data Corporation. All rights reserved.
- NOTICE The information contained herein is confidential information of United States Data Corporation, a Delaware corporation, and is
protected by United States copyright and trade secret law and international treaties. This document may refer to United States
Data Corporation as “USDATA.”
Information in this document is subject to change without notice and does not represent a commitment on the part of United
States Data Corporation (“USDATA”). Although the software programs described in this document (the “Software Programs”)
are intended to operate substantially in accordance with the descriptions herein, USDATA does not represent or warrant that
(a) the Software Programs will operate in any way other than in accordance with the most current operating instructions
available from USDATA, (b) the functions performed by the Software Programs will meet the user's requirements or will
operate in the combinations that may be selected for use by the user or any third person, (c) the operation of the Software
Programs will be error free in all circumstances, (d) any defect in a Software Program that is not material with respect to the
functionality thereof as set forth herein will be corrected, (e) the operation of a Software Program will not be interrupted for
short periods of time by reason of a defect therein or by reason of fault on the part of USDATA, or (f) the Software Programs
will achieve the results desired by the user or any third person.
U.S. GOVERNMENT RESTRICTED RIGHTS. The Software is provided with RESTRICTED RIGHTS. Use, duplication, or
disclosure by the government of the United States is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights
in Technical Data and Computer Software clause at DFARS 252.227-7013 or in subparagraphs (c)(1) and (2) of the
Commercial Computer Software—Restricted Rights clause at 48 CFR 52.227-19, as applicable. Contractor/Manufacturer is
United States Data Corporation, 2435 North Central Expressway, Suite 100, Richardson, TX 75080-2759. To the extent
Customer transfers Software to any federal, state or local government agency, Customer shall take all acts necessary to
protect the rights of USDATA in Software, including without limitation all acts described in the regulations referenced above.
The Software Programs are furnished under a software license or other software agreement and may be used or copied only
in accordance with the terms of the applicable agreement. It is against the law to copy the software on any medium except as
specifically allowed in the applicable agreement. No part of this manual may be reproduced or transmitted in any form or by
any means, electronic or mechanical, including photocopying and recording, for any purpose without the express written
permission of USDATA.
Trademarks. USDATA and FactoryLink are registered trademarks of United States Data Corporation.
Open Software Bus is a registered trademark licensed to United States Data Corporation.
All other brand or product names are trademarks or registered trademarks of their respective holders.
Application Editor in this book
•
•
•
Table of Contents
•
Application Editor in the Application Editor
Application Editor
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Structure of the Application Editor Guide . . . . . . . . . . . . . . . . . . . . . . . . . .
How To Use This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
15
16
16
18
Application Editor at a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Part I
Application Editor Basics
1
The Application Editor Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Graphic Elements as Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Referencing Objects in your Drawings . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Attributes and Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Power Packs and Power DragOns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting the Application Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using an Icon for Windows NT and Windows 95 Platforms . . . . . . . . . .
Using the Start Menu on Windows 95 Platform . . . . . . . . . . . . . . . . . . .
Using the Configuration Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Application Editor Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exiting the Application Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
32
32
32
33
34
34
34
34
35
35
36
Working With Drawing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Working With Multiple Drawing Files Simultaneously . . . . . . . . . . . . . . . .
Opening Drawing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Opening an Existing Drawing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a New Drawing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Saving a Drawing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
39
39
40
41
FactoryLink 6.6.0 / Application Editor / 3
•
•
Application Editor
•
•
Saving with the Original Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Saving with a New Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting a Drawing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Printing a Drawing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Closing a Drawing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
41
41
43
44
44
Sharing Drawings Between Applications . . . . . . . . . . . . . . . . . . . . 45
Exporting Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Importing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4
Controlling Your View of the Drawing . . . . . . . . . . . . . . . . . . . . . . . 51
Controlling the Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Grid and Snap Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zooming on Object or Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zooming on Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zooming on Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zoom Out 100% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing the Display Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting Whole Drawing Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing Actual Run-time Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Toggling Between Display Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Default Actual Size Window . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
52
55
56
56
56
56
57
57
57
58
59
Configuring Run-time Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Creating Run-time Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Defining Window Size and Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Setting the Top Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6
Tag Definition Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Creating or Editing a Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Tag Definition Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing a Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tag Naming Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Added Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 / FactoryLink 6.6.0 / Application Editor
68
68
69
69
71
72
72
Application Editor
Tags Referencing Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Defining Element Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Working with Element Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Working with Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Full Template Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Simple Template Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
The Tag Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Basic Tag Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Tag Persistence Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
General Alarm Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Advanced Alarm Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Group Alarm Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Data-Point Logging Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Scaling/Deadband Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Device Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Part II
Screen Construction
7
Drawing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
The Drawing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Undo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing Simple Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing a Straight Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing a Spline (Curved Line) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing a Square or Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing a Polygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing an Ellipse (Circle or Oval) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing an Arc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing a Parabola . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing a Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding Text to a Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Composite Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Combining Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connecting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Separating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
106
107
109
109
110
110
111
111
112
112
113
114
115
116
116
116
117
FactoryLink 6.6.0 / Application Editor / 5
•
•
Application Editor
•
•
8
Editing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
The Editing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Object Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Line Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Object Fill Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Text Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Cutting, Copying, Pasting, and Deleting Objects . . . . . . . . . . . . . . . . . . . . .
Cutting an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copying an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pasting an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Moving and Aligning Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Moving an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Aligning Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rotating an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Snapping an Object to the Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reshaping and Resizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reshaping an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resizing an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resizing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Moving and Object Front or Back . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with Object Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Renaming an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Searching for an Object in a Drawing . . . . . . . . . . . . . . . . . . . . . . . . .
120
121
122
123
125
127
127
127
128
128
129
129
130
132
133
134
134
134
135
136
136
137
137
137
Part III
Object Animation
9
Animating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Animation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Static and Animated Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dynamic and Static Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Level Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Testing the Animation of a Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Color/Analog Value Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Blink Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 / FactoryLink 6.6.0 / Application Editor
142
143
144
145
146
147
150
Application Editor
10
Animating Input/Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Animating Text as an Input Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Animating Text as an Output Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
11
Animating a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Animating a Real-Time Only Chart Object . . . . . . . . . . . . . . . . . . . . . . . . . 164
Assigning a Pen for the Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Animating a Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
12
Animating an Object as a Button . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
13
Paint and Bar Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Animating a Paint Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Animating an Object as a Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
14
Animating an Object as a Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Animating Symbol Object to Represent a Value . . . . . . . . . . . . . . . . . . . . . . 190
Simulate Object Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
15
Working With Power Packs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Guidelines for Using Template Variables . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Template Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using a Template Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying the Template Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Combining Template Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unresolved Template Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Attaching Power DragOns to I/O Devices . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding Security to Power DragOns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FactoryLink Supplied PowerPacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Frames1, Frames2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Gauges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
197
198
200
202
202
203
203
204
205
205
206
207
209
210
210
FactoryLink 6.6.0 / Application Editor / 7
•
•
Application Editor
•
•
Keypads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Misc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Motors1, Motors2, Motors3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
power SPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pumps1, Pumps2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Radios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
S1trend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Style1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Valves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Vessels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16
211
212
212
214
214
215
217
218
219
220
223
224
225
Drawing-Level Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Print Screen Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Beep Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Function Key Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Part IV PowerVB Animation
17
PowerVB Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
When to Use PowerVB vs.IML and CML . . . . . . . . . . . . . . . . . . . . . . .
Differences Between PowerVB and Microsoft Visual Basic . . . . . . . . . . . . .
Opening PowerVB from the Application Editor . . . . . . . . . . . . . . . . . . . . . .
Power VB Symbol Name memory Limitation . . . . . . . . . . . . . . . . . . . . . . . .
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
236
236
237
237
238
PowerVB Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
PowerVB Animation Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Search Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Event Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 / FactoryLink 6.6.0 / Application Editor
240
240
246
247
248
249
Application Editor
19
Attaching a Script to an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Creating a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding Comments to a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PowerVB Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating Graphic Object Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Printing Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exporting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Document PowerVB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pasting to the Clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Names and Object IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reserved Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
PowerVB Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Drawing/Window Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing Routines menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mouse Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mouse Routine Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mouse Routines Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Troubleshooting – Overlapping Objects . . . . . . . . . . . . . . . . . . . . . . . .
Text Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text Input Routines Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTDB Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining Tag Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding a New Tag Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modifying an Existing Tag Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting an Existing Tag Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declaring Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
251
254
254
255
255
255
255
255
256
256
257
259
259
263
263
264
268
269
269
271
271
271
272
273
274
Using Variables to Declare PowerVB Objects . . . . . . . . . . . . . . . . 275
Implicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Troubleshooting – Implicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . .
Arrays as Implicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Explicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTDBObjectValue Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Arrays as Explicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
275
276
277
278
278
280
FactoryLink 6.6.0 / Application Editor / 9
•
•
Application Editor
•
•
Parent and Child Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Troubleshooting – Explicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . .
Explicit Variables vs. Implicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declaring Dimension Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rules for Naming Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expression Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Type Coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
280
282
284
284
286
286
287
287
288
Using Properties and Methods in PowerVB . . . . . . . . . . . . . . . . . 289
RTDB Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTDBObject.Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTDBObject.Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTDBObject.Active . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTDBObject.Force . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Graphic Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
This Object Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RedrawOn and RedrawOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Bottom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Bold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Italic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Underline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.LineColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.FillColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.BackColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.TextColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Parent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.BackgroundUpdate . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.ActionValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10 / FactoryLink 6.6.0 / Application Editor
289
289
290
291
291
292
292
292
293
293
294
294
295
295
296
296
297
297
298
299
299
300
300
301
301
302
Application Editor
Graphic Object Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.HasAnimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing/Window Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing Object Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Window Object Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Window.Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Miscellaneous Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Critical/EndCritical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LockRTDB/UnlockRTDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Public Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PowerVB Variables and FactoryLink Tag Types . . . . . . . . . . . . . . . . . .
Private Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
Rotating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GraphicObject.Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Implementing Rotation in PowerVB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Composite Object Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sub-object Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RedrawOn/RedrawOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Development Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24
303
303
304
304
305
305
306
306
307
307
309
310
310
311
313
313
314
315
317
317
317
318
PowerVB User-Defined Sub Procedures and Functions . . . . . . 319
Sub Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
25
Creating PowerVB Libraries and Templates . . . . . . . . . . . . . . . . 323
PowerVB Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a PowerVB Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the PowerVB Library Editor . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calling a Library Function or Subroutine . . . . . . . . . . . . . . . . . . . . . .
PowerVB Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Template Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
323
324
326
326
328
328
FactoryLink 6.6.0 / Application Editor / 11
•
•
Application Editor
•
•
26
Hierarchical Graphic Object Naming . . . . . . . . . . . . . . . . . . . . . . . 329
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Naming Objects in the Application Editor . . . . . . . . . . . . . . . . . . . . . .
Graphical Object Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Referencing Graphic Objects in PowerVB Scripts . . . . . . . . . . . . . . . . . . . .
Implicit Referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Explicit Referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performance Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Finding an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
329
329
330
330
331
331
333
336
337
337
Debugging a PowerVB Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Reviewing Printed PowerVB Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Document PowerVB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Printing a Single Script or Part of a Single Script . . . . . . . . . . . . . . . . . . . .
Other Debugging Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error Message Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
On Error Statement at Run Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Print Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the BASIC Print Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Examples of Print Statements and the Output Generated . . . . . . . . . .
Print Statements with Multiple Running Events . . . . . . . . . . . . . . . . .
Header Information In Debug Output File . . . . . . . . . . . . . . . . . . . . . .
Location of Debug Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Disabling Debug Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using LogView to Display Debug Output . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting LogView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting a File to View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Full Path Names Option When Viewing File Icons . . . . . . .
Viewing a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Refresh Rate and Updating Viewer Window’s File Contents Area . . . .
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Case Sensitivity Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12 / FactoryLink 6.6.0 / Application Editor
339
339
340
340
341
342
343
343
343
345
347
350
350
351
353
353
353
355
356
356
358
359
359
Application Editor
Reserved Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PowerVB Code Attached to Sub-Objects . . . . . . . . . . . . . . . . . . . . . . . .
Multi-threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Endless Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Execution Order at Run Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
359
359
359
360
360
Part V
Security
28
Graphic Object Security Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FLADMIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Planning Security for your Application . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deciding How Authorized Users Will Log in and Out . . . . . . . . . . . . .
Determining Object Security Requirements . . . . . . . . . . . . . . . . . . . . .
Implementing Security in your Application . . . . . . . . . . . . . . . . . . . . . . . . .
Security and Stacked Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
Configuring Security Using FLADMIN . . . . . . . . . . . . . . . . . . . . . 375
Accessing FLADMIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a Security Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Password Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Administrator Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
365
365
365
366
367
368
369
369
370
371
373
376
377
380
383
384
Setting up Security Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Using Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Security Login Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining Login Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logging Security Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
388
390
393
395
397
FactoryLink 6.6.0 / Application Editor / 13
•
•
Application Editor
•
•
Part VI DXF Converter
31
Converting and Importing DXF Files . . . . . . . . . . . . . . . . . . . . . . . 401
Conversion Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing the FactoryLink DXF Converter in Windows . . . . . . . . . . . .
Converting a Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Default Conversion Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conversion Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Customizing the Conversion Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Translate File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Translate File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conversion Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
402
402
403
405
405
408
408
410
411
411
411
Part VII Error Messages
32
Application Editor Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
14 / FactoryLink 6.6.0 / Application Editor
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Preface
P URPOSE
The FactoryLink 6.6.0 Application Editor Guide is an object-oriented drawing
package with tools, such as straight and curved lines, circles, polygons, and text
lines, used to graphically illustrate user interface screens in FactoryLink
applications.
This guide is prepared to present the technical information programmers need to
complete their applications.
The following guidelines help focus our purpose and goals to meet customer
requirements:
• Accuracy is paramount—This FactoryLink documentation must provide
accurate and reliable information and procedures.
• Time is valuable—This FactoryLink documentation must guide the
programmer through what he needs to know quickly and efficiently.
A UDIENCE
The major audience of this manual is programmers who design and develop
FactoryLink applications.
In addition, FactoryLink Customer Support Services personnel use the
procedures and examples included here to help you develop and troubleshoot your
applications.
S TRUCTURE
OF THE
A PPLICATION E DITOR G UIDE
The Application Editor Guide is part of the Core set of manuals in the overall
FactoryLink Documentation Set. Refer to the Preface in Fundamentals for the
structure of the entire Documentation Set.
This manual is divided into seven major parts:
• Application Editor Basics
• Screen Construction
• Object Animation
• Power VB Animation
• Security
• DXF Converter
• Error Messages
FactoryLink 6.6.0 / Application Editor Guide / 15
•
•
How To Use This Manual
•
•
H OW TO U SE T HIS M ANUAL
The material in this manual is presented sequentially in performance order. We
recommend you read the entire manual to familiarize yourself with the complete
procedure before you proceed to develop your application.
… at a Glance
Located within each part of this manual is a section named … at a Glance. This
section provides a quick key to locations to find information to perform the
procedures detailed in that part with hypertext links to those locations.
C ONVENTIONS
The material in the Documentation Set adheres to the guidelines published in The
Digital Technical Documentation Handbook by Schultz, Darrow, Kavanagh, and
Morse; Developing International User Information by Jones, Kennelly, Mueller,
Sweezy, Thomas, and Velez; and corporate style guidelines.
This manual uses the following conventions:
Convention
Description
…
Horizontal ellipsis points indicate the omission of
material from an example. The information is
omitted because it is not important to the topic
being discussed.
.
.
.
Vertical ellipsis points indicate the omission of
information from an example or command format.
The information is omitted because it is not
important to the topic being discussed.
italic type
Italic type is used to denote user-supplied variables
in command examples.
Italic type also sets off references to specific
documents.
monospace type
Monospace type is used to denote command names
and code examples or example output.
bold monospace type
Bold monospace type is used in command examples
to indicate words that must be typed literally.
16 / FactoryLink 6.6.0 / Application Editor Guide
Conventions
Convention
Description
sans serif type
Sans Serif type is used to set off field names,
button names, and keys on the keyboard.
press nnnnn
Press is used to denote a key on the keyboard. The
key name will appear in a sans serif type.
click on nnnnn
Click on is used to denote a button on the screen.
The button name will appear in a sans serif type.
Shift+F1
The + indicates the keys must be pressed
simultaneously.
Shift+F1 indicates you hold down the Shift key
while you press another key or mouse button
(indicated here by F1).
Other key combinations are presented in the same
manner.
F1 F2 F3
The space between the key callouts indicates press
and release.
The key sequence F1 F2 F3 indicates you press and
release F1, then F2, and then F3.
Other key combinations are presented in the same
manner.
File>Open
The > indicates a progression through a menu
sequence.
File>Open indicates you choose Open from the File
menu to perform the required action.
Other menu sequences are presented in the same
manner.
FLAPP\user\drw\mydrw.g
The \ indicates the directory structure for the
listed file.
FLAPP\user\drw\mydrw.g indicates the drawing file
mydrw.g is located in the drw sub-directory of the
user sub-directory to the FLAPP directory.
Other directory structures are presented in the
same manner.
FactoryLink 6.6.0 / Application Editor Guide / 17
•
•
Getting Help
•
•
Convention
Description
[]
Brackets indicate an optional argument. You can
choose none, one, or all of the options.
{ } and |
Braces indicate a choice. You must choose one of
the elements. The vertical bar separates choices
within braces.
Example Syntax
Example syntax using these conventions is provided below:
command input_file [input_file…] {a|b} output_file
where
command
input_file
[input_file…]
{a|b}
output_file
is typed as it is displayed in the syntax.
indicates a variable the user supplies.
indicates the user can optionally supply multiple input file
names, each name separated by a space.
indicates either the a or b must be specified as an argument.
indicates the user must specify an output file.
G ETTING H ELP
Contact your Sales or Customer Support Representative for help troubleshooting
problems.
Also, help files are included for each configuration panel. These are accessed by
clicking on Help on the panel menu bar.
18 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Application Editor at
a Glance
For details on performing the following steps...
Go to...
1. Read what the Application Editor does, including
Graphic Elements as Objects (Referencing
Objects in your Drawings and Objects Attributes
and Animation)
Power Packs and Power DragOns
Starting the Application Editor (Using an Icon
for Windows NT and Windows 95 Platform,
Using the Start Menu on Windows 95 Platform,
Using the Configuration Manager, and Using the
Command Line)
The Application Editor Window
Exiting the Application Editor
Chapter 1, “The
Application Editor
Overview“
2. Read about Working with Drawing Files,
including Working with Multiple Drawing Files
Simultaneously
Opening Drawing Files (Opening an Existing
Drawing)
Creating a New Drawing File
Saving a Drawing File (Saving with the Original
Name and Saving with a New Name)
Deleting a Drawing File
Printing a Drawing File
Closing a Drawing File
Chapter 2, “Working
With Drawing Files”
3. Read about Sharing Drawing Between
Applications, including Exporting Files and
Importing Files.
Chapter 3, “Sharing
Drawings Between
Applications”
FactoryLink 6.6.0 / Application Editor Guide / 19
Application Editor
at a Glance
Using Application Editor
•
APPLICATION EDITOR AT A GLANCE
•
•
•
Using Application Editor
4. Read about Controlling your View of the
Drawing, including
Controlling the Grid
Using the Grid and Snap Options
Zooming On Object or Area (Zooming on
Object, Zooming on Area, and Zoom Out 100%)
Changing the Display Scale (Selecting Whole
Drawing Scale, Viewing Actual Run-time Size,
and Toggling Between Display Scales)
Setting the Default Actual Size Window
Chapter 4, “Controlling
Your View of the
Drawing”
5. Read about Configuring Run-time Windows,
including Creating Run-time Windows, Defining
Window Size and Placement, and Setting the
Top Window.
Chapter 5, “Configuring
Run-time Windows”
6. Read about Tag Definition Dialog, including
Creating or Editing a Tag (The Tag Definition
Dialog, Creating a Tag, and Editing a Tag)
Tag Parameters
Tags Referencing Arrays (Defining Element
Arrays and Working with Element Arrays)
Working with Templates (Full Template Items and
Simple Template Items)
The Tag Dictionary
Basic Tag Definitions
Tag Persistence Definitions
General Alarm Definitions
Advanced Alarm Definitions
Group Alarm Definitions
Data-Point Logging Definitions
Scaling/Deadbanding Definitions
Device Interface
Chapter 6, “Tag
Definition Dialog”
20 / FactoryLink 6.6.0 / Application Editor Guide
APPLICATION EDITOR AT A GLANCE
Using Application Editor
Chapter 7, “Drawing
Objects”
FactoryLink 6.6.0 / Application Editor Guide / 21
Application Editor
at a Glance
7. Read about Drawing Objects, including
The Drawing Tools (Selecting Objects and
Undo)
Drawing Simple Objects
Drawing a Straight Line
Drawing a Spline (curved line)
Drawing a Square or Rectangle
Drawing a Polygon
Drawing an Ellipse (Circle or Oval)
Drawing an Arc
Drawing a Parabola
Drawing a Legend
Adding Text to a Drawing
Creating Composite Objects (Combining
Objects, Connecting Method, and Separating
Objects)
•
APPLICATION EDITOR AT A GLANCE
•
•
•
Using Application Editor
8. Read about Editing Objects, including
The Editing Tools
Setting Object Attributes
Setting Line Attributes
Setting Object Fill Attributes
Setting Text Attributes
Cutting, Copying, Pasting, and Deleting
Objects (Cutting an Object, Copying an Object,
Pasting a Object, and Deleting an Object)
Moving and Aligning Objects (Moving an
Object and Aligning Objects)
Rotating an Object
Snapping an Object to the Grid
Reshaping and Resizing (Reshaping an
Object, Resizing an Object, and Resizing Test)
Object Placement (Moving and Object Front or
Back)
Working with Object Names (Renaming an
Object and Searching for an Object in a Drawing)
Chapter 8, “Editing
Objects”
9. Read about Animating Objects, including The
Animation Tools, Static and Animated Objects,
Dynamic and Static Attributes, Object Level
Animation, Testing the Animation of a Drawing,
Color/analog Value Table, and Blink Rate.
Chapter 9, “Animating
Objects”
10. Read about Animating Input/Output Fields,
including Animating Text as an Input Field and
Animating Test as an Output Field.
Chapter 10, “Animating
Input/Output Fields”
11. Read about Creating a Real-time Trend Chart,
including Animating a Real-Time Only Chart
Object, Assigning a Pen for the Chart, and
Animating a Legend.
Chapter 11, “Animating a
Chart”
12. Read about Animating an Object as a Button.
Chapter 12, “Animating
an Object as a Button”
22 / FactoryLink 6.6.0 / Application Editor Guide
APPLICATION EDITOR AT A GLANCE
Using Application Editor
Chapter 13, “Paint and
Bar Animation”
14. Read about Animating an Object as a Symbol,
including Animating Symbol Object to Represent
a Value and Simulate Object Rotation.
Chapter 14, “Animating
an Object as a Symbol”
15. Read about Working with Power Packs,
including Guidelines for Using Template
Variables, Creating a Template Object, Using a
Template Object, Displaying the Template
Configuration, Combining Template Objects,
Unresolved Template Variables, Attaching Power
DragOns to I/O Devices, and Adding Security to
Power DragOns.
Chapter 15, “Working
With Power Packs”
16. Read about Drawing-Level Animation, including
Print Screen Animation, Beep Animation, and
Function Key Animation.
Chapter 16,
“Drawing-Level
Animation”
17. Read about PowerVB Overview, including Opening
PowerVB from the Application Editor.
Chapter 17, “PowerVB
Overview”
18. Read about PowerVB Editor, including
File Menu (Using the Import and Export Dialog)
Edit Menu
Search Menu
Event Menu
Help Menu
Chapter 18, “PowerVB
Editor”
19. Read about Attaching a Script to an Object,
including
Creating a Script
Calculating Graphic Object Movement
Chapter 19, “Attaching a
Script to an Object”
FactoryLink 6.6.0 / Application Editor Guide / 23
Application Editor
at a Glance
13. Read about Paint and Bar Animation, including
Animating a Paint Object and Animating an
Object as a Bar.
•
APPLICATION EDITOR AT A GLANCE
•
•
•
Using Application Editor
20. Read about PowerVB Events, including
Drawing/Window Events (Drawing Routines
Menu)
Mouse Events (Mouse Routine Arguments,
Mouse Routines Menu, and Troubleshooting Overlapping Objects)
Text Events (Text Input Routines Menu)
RTDB Events (Tag Routines Menu)
Defining Tag Events (Adding a New Tag Event,
Modifying an Existing Tag Event, and Deleting an
Existing Tag Event)
Declaring Events (Adding Comments to a Script
and Removing an Event from a Script)
Chapter 20, “PowerVB
Events”
21. Read about Using Variables to Declare
PowerVB Objects, including
Implicit Variables (Troubleshooting and Arrays
as Implicit Variables)
Explicit Variables (RTDBObject Value Function
and Parent and Child Methods)
Troubleshooting-Explicit Variables (When to
Use Set and Meaningless Values)
Chapter 21, “Using
Variables to Declare
PowerVB Objects”
24 / FactoryLink 6.6.0 / Application Editor Guide
APPLICATION EDITOR AT A GLANCE
Using Application Editor
Chapter 22, “Using
Properties and Methods
in PowerVB”
23. Read about Rotating Objects, including
Overview (Definitions)
GraphicObject.Rotate
Implementing Rotation in PowerVB
(Composite Object Rotation, Sub-object
Rotation, and RedrawOn/RedrawOff
Development Rotation
Chapter 23, “Rotating
Objects”
FactoryLink 6.6.0 / Application Editor Guide / 25
Application Editor
at a Glance
22. Read about Using Properties and Methods in
PowerVB, including
RTDB Object Properties (RTDBObject.Value,
RTDBObject.Type, RTDBObject.Active, and
RTDBObject.Force)
Graphic Object Properties (“This” Object
Variable, RedrawOn and RedrawOff,
GraphicObject.Type, GraphicObject. Left,
GraphicObject.Bottom, GraphicObject.Width,
GraphicObject.Height, GraphicObject.Text,
GraphicObject.Font, GraphicObject.Bold,
GraphicObject.Italic, GraphicObject.Underline,
GraphicObject.LineColor,
GraphicObject.FillColor,
GraphicObject.BackColor,
GraphicObject.TextColor, GraphicObject.Name,
GraphicObject.BackgroundUpdate, and
GraphicObject.ActionValue)
Graphic Object Methods
(GraphicObject.Rotate, GraphicObject.Reset,
and GraphicObject.HasAnimation)
Drawing/Window Object Properties (Drawing
Object Variable, Drawing.BackColor, Window
Object Variable, and Window.Title)
Miscellaneous Statements (Critical/EndCritical
and LockRTDB/UnlockRTDB)
Public Variables (PowerVB Variables and
FactoryLink Tag Types)
Private Variables
•
APPLICATION EDITOR AT A GLANCE
•
•
•
Using Application Editor
24. Read about Creating PowerVB Libraries and
Templates, including
PowerVB Libraries (Creating a PowerVB
Library, Using the PowerVB Library Editor, and
Calling a Library Function or sub-routine)
PowerVB Templates (Template Variables)
Chapter 25, “Creating
PowerVB Libraries and
Templates”
25. Read about Hierarchical Graphic Object
Naming, including
Overview
Object Names
Naming Objects in the Application Editor
Referencing Graphic Objects in PowerVB
Scripts (Implicit Referencing and Explicit
Referencing)
Performance Considerations
Object IDs (Finding an Object)
Chapter 26,
“Hierarchical Graphic
Object Naming”
26 / FactoryLink 6.6.0 / Application Editor Guide
APPLICATION EDITOR AT A GLANCE
Using Application Editor
Chapter 27, “Debugging
a PowerVB Script
FactoryLink 6.6.0 / Application Editor Guide / 27
Application Editor
at a Glance
26. Read about Debugging a PowerVB Script,
including
Printing PowerVB Code
Document PowerVB
Printing a Single Script or Part of a Single
Script
Other Debugging Methods
Error Message Box
On Error Statement at Run Time
Using Print Statements (Overview, Using the
BASIC Print Statement, Examples of Print
Statements and the Output Generated, Print
Statements with Multiple Running Events,
Header Information in Debug Output File,
Location of Debug Output File, and Disabling
Debug Output)
Using LogView to Display Debug Output
(Overview, Starting LogView, Selecting a File to
View, Using the Full Path Names Option When
Viewing File Icons, Viewing a File, and Refresh
Rate and Updating Viewer Window’s File
Contents Area)
Troubleshooting (Case Sensitivity Issues,
Reserved Words, PowerVB Code Attached to
Sub-Objects, Multi-threading, Endless Loops,
and Execution Order at Run Time)
•
APPLICATION EDITOR AT A GLANCE
•
•
•
Using Application Editor
27. Read about Security, including
Key Concepts (Application Administrator,
Application User, and Security Class)
FLADMIN
Security Options
Planning Security for your Application
(Deciding How Authorized Users Will Log In and
Out and Determining Object Security
Requirements)
Implementing Security in your Application
Security and Stacked Buttons
Chapter 28, “Graphic
Object Security
Overview”
28. Read about Configuring Security Using
FLADMIN, including Accessing FLADMIN,
Defining a Security Class, Defining a User,
Setting the Password Type, and Setting the
Administrator Password.
Chapter 29, “Configuring
Security Using
FLADMIN”
29. Read about Setting up Security Options,
including Setting Security Login Options,
Defining Error Messages, Defining Login
Messages, and Logging Security Events.
Chapter 30, “Setting up
Security Options”
30. Read about Converting and Importing DXF Files,
including
Conversion Considerations (Installing the
FactoryLink DXF Converter in Windows and
Installing the DXF Converter in OS/2)
Converting a Drawing
Using the Default Conversion Settings
(Conversion defaults)
Customizing the Conversion Settings
(Creating a Translate File and Using the
Translate File)
Troubleshooting (Conversion Errors and Error
Messages)
Chapter 31, “Converting
and Importing DXF
Files”
31. Read about Error Messages.
Chapter 32, “Application
Editor Messages”
28 / FactoryLink 6.6.0 / Application Editor Guide
Data Reporting Configuration Guide
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Part I
Application Editor
Basics
29
•
•
•
Chapter 1
•
Application Editor Guide
The Application Editor
Overview
Each screen is represented by a file. These files are stored under
{FLAPP}>domain>drw, with the default domain, USER. A .g extension identifies the
files as FactoryLink application screens. A base set of graphic files is delivered
with FactoryLink to be used to build custom screens for your application. See the
FactoryLink On-line Release Notes for a list of the files shipped with this version
of FactoryLink.
The Application Editor is an object-oriented drawing package. This means each
graphic element, such as a line, a circle, or a piece of text is seen as an individual
object. Each object can have assigned attributes and animation characteristics.
• Attributes control the look of the object, such as its color or text size.
• Animation controls the action of the object, such as a color change when a limit
is met.
This chapter describes the concepts you must understand to use the Application
Editor. The topics included are
• Graphic elements as objects
• How to open and exit the Application Editor
• Managing your drawing files
• Controlling how your screens work during run time
FactoryLink 6.6.0 / Application Editor Guide / 31
Application Editor
Basics
Operators access data in the real-time database through graphical user interface
screens. You illustrate a graphical user interface screen by using the Application
Editor (APPEDIT) drawing tools—working with objects, such as straight and
curved lines, circles, polygons, and text lines.
1
•
THE APPLICATION EDITOR OVERVIEW
•
Graphic Elements as Objects
•
•
G RAPHIC E LEMENTS
AS
O BJECTS
A screen usually includes several components or objects. Some objects, such as the
straight lines in the following illustration, stand alone. Others are combined into
more complex shapes.
Text lines, such as the one in the illustration, are separate objects. Each object is
either a simple object, a composite object, or a subobject.
• Simple objects are single objects, such as lines, circles, and text, that are not
composed of any other objects. They are the basic building blocks of a graphics
display. The top and bottom lines as well as the text are simple objects in the
illustration above.
• Composite objects are collections of objects. That is, two or more objects
grouped together to form a single object. The button in the illustration is a
composite object.
• Subobjects are the components of the composite object. Subobjects contain
either simple objects, composite objects, or both. The button is composed of one
simple object, the octagon, and one composite object, the two rectangles.
Referencing Objects in your Drawings
The Application Editor uses object names to reference each simple, composite, or
subobject. When an object is created, the Application Editor generates and assigns
a number, such as #00137, to the object. To help you identify the objects later, we
recommend renaming them with text based references, such as Stop App Button.
Refer to “Renaming an Object” on page 134 for details on how to do this.
Object Attributes and Animation
You assign attributes and animation to an object. Attributes control how it is
displayed, such as its color, fill pattern, or text style. Refer to
“Setting Object Attributes” on page 117 for details on defining object attributes.
Animation controls the action of the object, such as a color change when a limit is
met. Refer to “Object Animation” in this guide for details on defining object
animation.
32 / FactoryLink 6.6.0 / Application Editor Guide
THE APPLICATION EDITOR OVERVIEW
Power Packs and Power DragOns
P OWER P ACKS
AND
P OWER D RAG O NS
1
Power Pack files work like any drawing file, except that when you open a Power
Pack file, the Application Editor is automatically in the copy/paste mode. When
you select an object from a Power Pack drawing, the Application Editor
immediately copies it into the buffer so it can be pasted into an open drawing file.
All Power Pack files have a .gp extension.
A basic set of Power Packs are included with FactoryLink. These Power Packs
include an assortment of buttons, sliders, gauges, valves, pumps, motors, and
vessels. Refer to Chapter 15, “FactoryLink Supplied PowerPacks” for a complete
description of the supplied Power Packs and their associated Power DragOns.
The template animation allows you to animate an object with variables. When you
duplicate an object in normal graphics drawing, you must edit the animation for
the new object after it is duplicated. With template animation, you can define
which animation features are constant or variable for each duplicated object.
When the object is duplicated, you are prompted to provide definitions for variable
animation features.
Objects defined using variables are template objects, and the variables defined in
the object are template variables. Any object, whether simple or composite,
becomes a template object when you define one or more template variables.
Refer to “Working with Power Packs” on page 195 for details on how to create your
own Power Packs and Power DragOns.
FactoryLink 6.6.0 / Application Editor Guide / 33
Application Editor
Basics
Drawings containing objects animated as templates and placed in a library of
drawings are collectively known as Power Packs. You create and animate the
objects once and place them in Power Packs for repeated use. These drawings,
known as Power DragOns, are then used to create applications quickly and easily.
The also help standardize the appearance of the application.
•
THE APPLICATION EDITOR OVERVIEW
•
Starting the Application Editor
•
•
S TARTING
THE
A PPLICATION E DITOR
The Application Editor can be started using up to four different methods,
depending on the platform you are developing your application on.
Using an Icon for Windows NT and Windows 95 Platforms
If you are running FactoryLink on a Windows NT or Windows 95 platform, you
can start the Application Editor from the FactoryLink Program Group.
Double-click here to
open the Application
Editor
To start, double-click on the Application Editor icon for the application you would
like to work on. If you have more than one application, you may have more than
one program group. Be sure to select the program group for the desired
application.
Using the Start Menu on Windows 95 Platform
Windows 95 provides an alternative for starting the Application Editor. Use the
Start Menu as follows to open the appropriate program group and Application
Editor:
Start>Programs>{FactoryLink 6.6.0 Program Group}>Application Editor
Using the Configuration Manager
Choose Application Editor to start the Application Editor from the Configuration
Manager Main Menu.
34 / FactoryLink 6.6.0 / Application Editor Guide
THE APPLICATION EDITOR OVERVIEW
The Application Editor Window
Using the Command Line
APPEDIT
T HE A PPLICATION E DITOR W INDOW
After starting the Application Editor, the following window displays.
The menu bar at the top of the screen provides the following menus and
commands:
• File includes commands that provide access to manipulate entire drawings.
• Edit includes commands for selecting and editing objects.
• View includes commands for controlling what you see on-screen and which tools
are available for drawing use.
• Draw includes commands for drawing all objects.
• Attributes includes commands for specifying the line, fill, text, and screen
styles, and for defining an object name.
• Animation includes commands for specifying animation included in the
drawing during run time.
• Application includes commands for specifying application attributes.
• Windows includes commands for specifying the tiling or cascading of open
drawing files and a list of the open drawings to allow you to switch to another
open drawing easily.
• Help includes menu and application help.
Instructions for how to use these commands are described throughout this
manual.
FactoryLink 6.6.0 / Application Editor Guide / 35
1
Application Editor
Basics
Enter the following command to start the Application Editor from the command
line:
•
THE APPLICATION EDITOR OVERVIEW
•
Exiting the Application Editor
•
•
E XITING
THE
A PPLICATION E DITOR
Perform the following steps to close the Application Editor.
1 Choose File>Exit to close he Application Editor.
Caution: This is the only correct way to exit the Application
Editor. If you use any other method to exit, you may
lose or corrupt data.
2 The Warning! dialog displays if you modified any files since the last save.
3 Click on the appropriate command button.
Save
Saves the changes before closing the file.
Discard
Closes the file without saving the changes. Any element names
created are retained in the object list.
Cancel
Cancels the close of the file and returns you to the open drawing.
36 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 2
Working With Drawing
Files
Caution: All drawings in an application should be in a single
domain, preferably the USER domain.
Unpredictable results may occur if drawings exist in
more than one domain in an application.
Two different drawing file types are used within FactoryLink: standard drawing
and power pack drawings. Either type can be exported from its application and
imported into another application. FactoryLink uses the following file extensions
to identify each type of drawing file:
.g
Identifies a standard drawing file
.gp
Identifies a power pack drawing file
.gx
Identifies an exported drawing file
.gpx
Identifies an exported power pack drawing file
.gs
Identifies PowerVB source code
.gc
Identifies compiled PowerVB code
.gps
Identifies PowerVB source code associated with a power pack
.gpc
Identifies compiled PowerVB code associated with a power pack
.pls
Identifies PowerVB library source files
.plc
Identifies compiled PowerVB library files
.plx
Identifies exported PowerVB libraries
FactoryLink 6.6.0 / Application Editor Guide / 37
Application Editor
Basics
Each user interface screen is a unique drawing file. Drawing files are stored in the
FactoryLink application directory structure. The drawings created in the USER
domain are stored in {FLAPP}\user\drw while the drawings created in the SHARED
domain are stored in {FLAPP}\shared\drw. Most applications are created with all
drawings in the USER domain.
2
•
WORKING WITH DRAWING FILES
•
Working With Multiple Drawing Files Simultaneously
•
•
W ORKING W ITH M ULTIPLE D RAWING F ILES S IMULTANEOUSLY
You can have multiple drawing files open at the same time; however, only one will
be active at a time. The drawing file on top of the others is the active drawing file.
When you create or open a drawing file, the file name assigned to the drawing is
added to a list of open files. You can view this list from the Windows menu. The
active drawing file has a check mark next to its name.
Check mark
indicating active
window
To make a listed drawing file active, choose it from this menu. All actions
described in this manual act on the active drawing file unless otherwise noted.
38 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH DRAWING FILES
Opening Drawing Files
O PENING D RAWING F ILES
2
Opening an Existing Drawing File
Perform the following steps to open an existing drawing file:
1 Choose File>Open to display the Open USER Domain Drawing dialog.
2 Choose the drawing from the list displayed below the File Name: field. The drawing
name you choose is displayed in the File Name: field.
3 Click OK to complete opening the drawing.
Note: Double-clicking on the drawing name in the list also opens
the file directly.
FactoryLink 6.6.0 / Application Editor Guide / 39
Application Editor
Basics
When the Application Editor is first started, it opens into the USER domain. If
you are developing drawings in the SHARED domain, you need to change the
domain by choosing Switch Domain from the Application menu. For the purposes
of our discussions here, we will use the USER domain unless noted otherwise.
•
WORKING WITH DRAWING FILES
•
Creating a New Drawing File
•
•
C REATING
A
N EW D RAWING F ILE
Perform the following steps to open a new drawing file:
1 Choose File>Open to display the Open USER Domain Drawing dialog.
2 Double click in the File Name: field to highlight the currently selected drawing
name and enter a 1 to 8 character name in the File Name: field.
The Application Editor adds the .g extension for you.
3 Click OK to complete opening the newly created drawing file. The screen displays
in grey, the FactoryLink screen default color. To change the color at this time,
choose Screen Color from the Attributes menu and make your selection from the
color palette displayed.
40 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH DRAWING FILES
Saving a Drawing File
S AVING
A
D RAWING F ILE
2
There are two ways to save a drawing file:
Save retains changes you made to the active (frontmost) drawing.
The new version of the drawing replaces the old version.
Save As
Save As allows you to save a copy of the active drawing using a
different name. If you make changes to the drawing prior to
duplicating it, the original drawing remains unchanged when you
use Save As.
Saving with the Original Name
Perform the following step to save the drawing with its original name after
making changes:
1 Choose File>Save. The file that existed before you made modifications is
overwritten.
Saving with a New Name
Perform the following step to save the drawing with a new name:
1 Choose File>Save As to display the Save USER Domain Drawing As dialog, if you
are currently working in the USER domain. This is the default domain for the
Application Editor.
FactoryLink 6.6.0 / Application Editor Guide / 41
Application Editor
Basics
Save
•
WORKING WITH DRAWING FILES
•
Saving a Drawing File
•
•
Choosing Save As displays the Save SHARED Domain Drawing As dialog, if you
are currently working in the SHARED domain.
You can only work in one domain at a time; therefore, if you want to change
domains, you must close all open drawings and switch domains by choosing
Application>Switch Domains. To save a drawing to a different domain, you must
export and then import into the other domain.
2 Double click in the File Name: field and enter a 1 to 8 character name. The
Application Editor adds the .g extension for you.
3 Click on OK to complete the save.
42 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH DRAWING FILES
Deleting a Drawing File
D ELETING
A
D RAWING F ILE
2
Perform the following steps to delete a drawing file:
2 Select the drawing from the list displayed below the File Name: field. The files
listed are the same type as the current active window (.g for a drawing file, .gp for
a power pack window) and in the same domain.
To select a different file type, press the down arrow from the scroll box in the File
Type: field. The list in the File Name: field changes to display the appropriate
drawing files.
To select a different domain, choose it from the Domains: field. The list in the File
Name: field changes to display the appropriate drawing files.
3 Click on OK to complete the deletion.
Note: When you delete a file, the elements defined in the file
are also deleted from the cross-reference list; however, the
element names remain in the object list.
FactoryLink 6.6.0 / Application Editor Guide / 43
Application Editor
Basics
1 Choose File>Delete to display the Delete File dialog.
•
WORKING WITH DRAWING FILES
•
Printing a Drawing File
•
•
P RINTING
A
D RAWING F ILE
Perform the following steps to print a drawing file:
1 Choose File>Print Screen to send the drawing file to the default printer the
operating system configured.
C LOSING
A
D RAWING F ILE
Perform the following steps to close a drawing file (only the active or frontmost
drawing is closed with this action):
1 Choose File>Close to close the file.
2 The Warning! dialog displays when you close a drawing that has been modified but
not saved.
3 Choose one of the following command buttons:
Save
Saves the changes before closing the file.
Discard
Closes the file without saving the changes. Any element names
you created are retained in the object list.
Cancel
Cancels the close of the file and returns you to the open drawing.
44 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 3
Sharing Drawings
Between Applications
FactoryLink 6.6.0 / Application Editor Guide / 45
Application Editor
Basics
You share drawings between applications or domains by exporting them from one
application or domain and importing them into another.
3
•
SHARING DRAWINGS BETWEEN APPLICATIONS
•
Exporting Files
•
•
E XPORTING F ILES
Exporting a drawing file saves the file in a multiplatform format so it can be
easily shared between FactoryLink applications on any platform. Exporting
converts the drawing into an ASCII file. The converted ASCII file not only
includes the drawing objects, but it can also include the object animation and
element definitions.
The file is exported to the {FLAPP}\domain\drw directory of the current application,
where domain is the domain of the file being exported. The ASCII file is named
the same name as the selected drawing with the letter x appended to the file
extension.
For example, if you export a file named mydraw.g, the resulting ASCII file is
named mydraw.gx. This is true for power pack drawings as well. If you export a
power pack drawing named mypwrdrw.gp, the resulting ASCII file is named
mypwrdrw.gpx.
Perform the following steps to export a drawing file:
1 Choose File>Export to display the Export dialog.
2 Select the drawing from the list displayed below the File Name: field. The files
listed are the same type as the current active window (.g for a drawing file, .gp for
a power pack window) and in the same domain.
46 / FactoryLink 6.6.0 / Application Editor Guide
SHARING DRAWINGS BETWEEN APPLICATIONS
Exporting Files
Press the down arrow from the scroll box in the File Type: field to select a different
file type.
3
To select a different domain, choose it from the Domains: field.
3 Choose the appropriate radio button in the Options field.
Graphics only
Graphics +
animation
Graphics + all
configuration
Exports only the graphics of the drawing. Animation and
configuration details are not included.
Exports the drawing graphics with the included animation. You
cannot import animation if it has not been saved with the export.
Exports the drawing graphics with the included animation and
configuration settings, such as alarms, scaling, or I/O.
4 Click the OK button to complete the export. Clicking on Cancel cancels the export.
Caution: Do not edit the converted ASCII file.
FactoryLink 6.6.0 / Application Editor Guide / 47
Application Editor
Basics
You may select more than one file name to export multiple files.
•
SHARING DRAWINGS BETWEEN APPLICATIONS
•
Importing Files
•
•
I MPORTING F ILES
Importing converts the exported ASCII drawing files from other FactoryLink
applications or domains to files that are readable by this FactoryLink application
or domain. The import places the element definition information included within
the file in the object database.
The file is imported to the {FLAPP}\domain\drw directory of the current application,
where domain is the destination domain selected when importing the files. The
drawing file is named the same name as the selected import with the letter x
removed from the file extension.
Perform the following steps to import the drawing file to an application:
1 Choose File>Import to display the Import dialog.
2 Select the drive where the files to import are located from the Drives: field and the
appropriate directory from the Directory: field.
If the path shown in the directory field is not accurate, double click the two dots
(..) in the Directory: list to display path elements.
3 Select the drawing from the list displayed below the Files field. The files listed are
the same type as the current active window (.gx for a drawing file, .gpx for a power
pack).
Press the down arrow key from the scroll box in the File Type: field to select a
different file type.
48 / FactoryLink 6.6.0 / Application Editor Guide
SHARING DRAWINGS BETWEEN APPLICATIONS
Importing Files
4 Select the destination domain from the Destination Domain field.
5 Deselect the appropriate check boxes, if you want to change the default settings
3
for the messages that display as you import files.
Before creating
tags
Warns if existing files will be overwritten.
Indicates when new tag names will be added. (This is especially
helpful if you are using FactoryLink Lite which only allows a
total of 1024 application defined tags.)
When tag definition
is different
Indicates these elements have already been defined with different
type, domain, length, or dimensions.
When tag usage is
different
Indicates these elements have already been defined with a
different configuration, such as alarms, and I/O.
6 Choose the appropriate radio button in the Options field.
Graphics only
Imports the drawing graphics only. If the exported file was saved
with animation, the animation will not be imported.
Graphics +
animation
Imports the drawing graphics with the animation that was saved
with it. If the exported file was not saved with animation, the
animation will not be imported.
Graphics + all
configuration
Imports graphics, animation, and all configuration such as
alarms, scaling, or I/O.
7 Click on Import to complete the import. Click on Cancel to cancel the import.
FactoryLink 6.6.0 / Application Editor Guide / 49
Application Editor
Basics
Before replacing
files
•
SHARING DRAWINGS BETWEEN APPLICATIONS
•
Importing Files
•
•
50 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 4
Controlling Your View
of the Drawing
• How the grid is displayed
• How much of an object or area is viewed
• The display scale the drawing is shown in
• Default actual size window for all drawings in editing session
A drawing must be open to perform these actions.
FactoryLink 6.6.0 / Application Editor Guide / 51
Application Editor
Basics
This chapter describes how to control the view of your drawing. You can control
the following features:
4
•
CONTROLLING YOUR VIEW OF THE DRAWING
•
Controlling the Grid
•
•
C ONTROLLING
THE
G RID
The Grid is used for precision drawing. It works with the Snap option to allow you
to draw, size, and place objects exactly.
Perform the following steps to turn on the Grid and define how it displays:
1 Choose View>Grid to display the Grid/Snap Options dialog.
Grid
Snap
Logical Coordinate
System
Allows you to turn on the grid and to define how it is displayed.
Allows you to turn on the Snap option and to define the snap
tolerance.
Displays the width and height of the screen in drawing units. The
default is 1024 for the width and 768 for the height. Do not
change these values.
2 Select the Show Grid check box to display the grid.
3 Select the Draw with solid lines check box to display the grid with solid lines.
Deselect the check box to display the grid with dotted lines.
Define the Number of Grid Lines Displayed
4 The Make Grids Square check box is selected to display a square grid. The grid is
calculated based on the Horizontal Grids field entry. When this option is selected,
the Vertical Grids: and the Snap Points/Vertical Grid: are deactivated.
52 / FactoryLink 6.6.0 / Application Editor Guide
CONTROLLING YOUR VIEW OF THE DRAWING
Controlling the Grid
5 Deselect the check box to display the grid based on the values established in the
Horizontal and Vertical Grids: field.
4
Application Editor
Basics
6 Enter the values to control the grid size in the Horizontal Grids: and Vertical Grids:
fields.
Horizontal Grids:
Number of grids displayed in a row. This number can be any
number between 1 and the number displayed in the Logical
Coordinate System Width field. Using the default 64, the following
illustrates where the grid lines will be displayed along a width of
1024 points.
Points 1
16
32
48
1008 1024
...
Grid Lines1
2
3
4
63
64
Width = 1024 points
If Horizontal Grid is 64, there is a grid line every
for a total of 64 lines displayed (1024 ÷ 64 = 16).
Vertical Grids:
Number of grids displayed in a column. This number can be any
number between 1 and the number displayed in the Logical
Coordinate System Height field. This option is not available when
FactoryLink 6.6.0 / Application Editor Guide / 53
•
CONTROLLING YOUR VIEW OF THE DRAWING
•
Controlling the Grid
•
•
the Make Grids Square option is activated. Using the default 48,
the following illustrates where the grid lines are displayed along
a height of 768 points.
Points
1
Grid Lines
1
2
16
3
32
...
47
752
48
768
Height = 768 points
If Vertical Grid is 48,
there is a grid line every
16 points for a total of
48 lines displayed
(768 ÷ 48 = 16).
Define Snap Tolerance
7 The Enable Snap Points check box is defaulted to turn on the snap option. Enter
the values to control the tolerance of the snap in the Snap Points/Horizontal Grid:
and Snap Points/Vertical Grid: fields.
Snap
Points/Horizontal
Grid:
Number of snap points within a grid box an object will snap to as
it is moved left or right.
Snap
Points/Vertical
Grid:
Number of snap points within a grid box an object will snap to as
it is moved up or down. Grids: field.
Snap Point set at 2
(default)
Snap Point set at 4
1
1
2
3
2
4
1
54 / FactoryLink 6.6.0 / Application Editor Guide
2
1
2
3
4
CONTROLLING YOUR VIEW OF THE DRAWING
Using the Grid and Snap Options
U SING
THE
G RID
AND
S NAP O PTIONS
4
To snap an object to the grid perform the following steps:
1 Select the objects to snap.
2 Choose Edit>Snap. This snaps the four corners of the object bounding box to the
nearest snap points.
The object is resized to fit its new bounding box.
FactoryLink 6.6.0 / Application Editor Guide / 55
Application Editor
Basics
Snap can be used in two ways—by enabling the snap function in the Grid/Snap
Options dialog as detailed in “Controlling the Grid” on page 52 or by selecting the
items to be snapped individually and applying the snap command.
•
CONTROLLING YOUR VIEW OF THE DRAWING
•
Zooming on Object or Area
•
•
Z OOMING
ON
O BJECT
OR
A REA
The zoom feature controls how much of the object or drawing is displayed in the
graphics window. Zoom magnifies the object or area for detailed editing. This
section describes how to magnify an object or an area in the drawing.
Zooming on Object
Perform the following steps to magnify an object or group of objects in the
drawing:
1 Select the object or group of objects you want to magnify.
2 Choose View>Zoom on Object. The selected objects are magnified.
3 Choose View>Zoom on Object again and the objects magnify again. Objects can be
magnified until they fill the entire drawing window. They will not be magnified
out of view.
4 Choose View>Zoom Out 100% to return the object to normal size.
Zooming on Area
Perform the following steps to zoom on an area in the drawing:
1 Choose View>Zoom on Area.
2 Place the cursor over the starting position of the area you want to magnify and
click and hold down the left mouse button.
3 Drag the cursor over the area you want to magnify. A box is displayed indicating
the selected area.
4 Release the mouse button. The area within the box is magnified.
5 Choose View>Zoom Out 100% to return the area to normal size.
Zoom Out 100%
Perform the following step to return a zoomed object or area to normal size:
1 Choose View>Zoom Out 100% to return the area to normal size.
56 / FactoryLink 6.6.0 / Application Editor Guide
CONTROLLING YOUR VIEW OF THE DRAWING
Changing the Display Scale
C HANGING
THE
D ISPLAY S CALE
4
Depending on the size of your drawing window, the drawing may not necessarily
be at the same scale as it will display in the run-time application. You can view
how the drawing will display in the run-time application using the actual size
scale.
While creating a drawing, you can change between each of these scales. This
section describes how to select each scale.
Selecting Whole Drawing Scale
Perform the following step to view the entire drawing:
1 Choose View>Whole Drawing to display the entire drawing in the drawing window. If
you change the size of the window, the drawing scales to the new window size.
Viewing Actual Run-time Size
At run time, the drawing is placed proportionally into its associated run-time
window. Perform the following steps to view the drawing as it will display at run
time:
1 Ensure you have a window defined where the drawing will be displayed. Refer to
Chapter 5, “Configuring Run-time Windows” for details.
2 Choose View>Actual Size to display the Frame Window Selection dialog, listing the
windows available for displaying drawings at run time.
FactoryLink 6.6.0 / Application Editor Guide / 57
Application Editor
Basics
When you are creating a drawing, you can view the entire drawing using the
whole drawing scale. This view helps you make overall composition and layout
decisions for the drawing.
•
CONTROLLING YOUR VIEW OF THE DRAWING
•
Changing the Display Scale
•
•
The available windows are listed in the Window: field.
3 Select the window where the drawing will be displayed from those provided in the
Window list. The drawing is displayed in the selected window.
If you resize the drawing window so it is larger than its run-time window, a line is
displayed showing where the run-time window ends.
Run-time window
size
Actual size window
If you draw in this area, it does
not display at run time.
Limit of run-time window
If you draw outside the run-time window size, the objects in this area do not
display at run time.
Resizing the actual size window during development does not change the size of
the drawing at run time.
If you view the drawing at actual size and then save it, the association with this
actual size window is saved. The next time you open it, you can press F7 (Toggle
View command) to view it in this actual size window.
Toggling Between Display Scales
All drawings are displayed in whole drawing view when you open them. For
drawings that have an association with an actual size window, you can toggle
between the full window scale and the actual size scale in one of two ways:
• Press the F7 function key.
• Select View>Toggle View.
58 / FactoryLink 6.6.0 / Application Editor Guide
CONTROLLING YOUR VIEW OF THE DRAWING
Setting the Default Actual Size Window
S ETTING
THE
D EFAULT A CTUAL S IZE W INDOW
You can set this program argument starting the Application Editor from the
command line using the following command:
appedit -w actualsize_window
where actualsize_window is the name of the window where the drawing displays
at run time.
For example, the following command:
appedit -w fl_main
defines fl_main as the default actual size window for this editing session.
If you start the Application Editor from the Configuration Manager Main Menu or
the Program Manager, you cannot set a default actual size window.
FactoryLink 6.6.0 / Application Editor Guide / 59
4
Application Editor
Basics
You can associate a default actual size window with all drawings for an editing
session by using the -w program argument when starting the Application Editor.
This default does not apply to drawings that already have an actual size window
association, only those that do not. This is especially useful if you have several
drawings not associated with actual size windows you want to view in the same
actual size window.
•
CONTROLLING YOUR VIEW OF THE DRAWING
•
Setting the Default Actual Size Window
•
•
60 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 5
Configuring Run-time
Windows
To display a drawing at run time, you must specify a window for displaying it.
This chapter describes how to associate a drawing with a window for run-time
display.
You can have multiple drawings displayed in the same window by configuring an
input text field or button to permit you to change the drawing displayed in the
window.
You can have multiple windows open when the Run-Time Manager is started, and
you can specify which of these windows should be displayed on top of all the other
windows. This chapter describes how to specify which window is the top window.
FactoryLink 6.6.0 / Application Editor Guide / 61
Application Editor
Basics
At run time, drawings are displayed in windows. The window controls how the
drawing is displayed: its size and position. You can have multiple window
definitions, depending on how many unique types of windows you want to use to
display drawings. For example, you can have a large window to display large
drawings and a smaller window to display smaller drawings.
5
•
CONFIGURING RUN-TIME WINDOWS
•
Creating Run-time Windows
•
•
C REATING R UN - TIME W INDOWS
This section explains how to set up a run-time window and how to specify the
drawing you want to display in it.
1 Choose Application>Window Setup to display the Edit Window Selection dialog.
2 Either select a window name from the Window list or enter a window name
between 1 and 16 characters in the Window field. You should restrict this to 8
characters if portability is an issue.
3 Click on OK to display the Window Attributes dialog.
Window you are configuring is
listed here.
62 / FactoryLink 6.6.0 / Application Editor Guide
CONFIGURING RUN-TIME WINDOWS
Creating Run-time Windows
4 Select the Size Border check box to specify whether or not to display a sizing
If you do not specify a sizing border, you cannot adjust the size of the window
using the cursor at run time.
5 Select the Title Bar check box to specify whether or not to display a title bar
showing the name of the window. A title bar allows you to move the window at run
time.
All windows under Motif have a title bar whether or not you select this option.
6 Select the Maximize Button check box to specify whether or not to display
maximize/minimize buttons. If selected, the maximize/minimize buttons are
located in the top-right corner of the window. The maximize button makes the
active window full screen; the minimize button makes the active window an icon.
If you do not select this option, you cannot maximize or minimize the window at
run time.
Note: Selecting the Maximize Button also enables the System
Menu, even though the System Menu check box remains
unchecked.
7 Select the System Menu check box to specify whether or not to display a button
that lets you open the System Menu from this window. If selected, the System
Menu button is located at the top-left corner of the window and has a small
horizontal line.
The System Menu provides the following capabilities:
Restore
Move
Restores the window to its original size after it has been
minimized or maximized.
Allows you to move the window without dragging the cursor.
To move a window, choose Move and move the pointing device.
The window moves with the cursor. When the window is in the
desired location, press the left button. The window remains in its
new location.
Size
Minimize
Activates the window’s size borders so you can resize the window.
When the window is the desired size, press the left button. The
window remains at its new size.
Shrinks the window to an icon.
FactoryLink 6.6.0 / Application Editor Guide / 63
5
Application Editor
Basics
border around the window. The sizing border allows you to resize the window at
run time. If the sizing border is present, the cursor changes to a double-sided
arrow when it crosses the window border.
•
CONFIGURING RUN-TIME WINDOWS
•
Creating Run-time Windows
•
•
Maximize
Close
Displays the window in a full screen size.
This option is always disabled.
8 Select Resize Behavior>Clip to specify whether or not the objects in a window
remain the same size when you resize a window. This means the window gets
smaller but the objects do not. If you select this option and size a window too small
to hold the entire drawing, you will only be able to see part of the drawing.
Title Bar displayed
Graphic clipped during
run time when window is
resized.
Maximize and Minimize
buttons display here
during run time.
9 Enter the name of the digital tag whose value enables this window in the Window
Enable Control field. When the tag value changes to 1, the window is enabled.
Forcewriting 1 to this tag places the window in the foreground and refreshes the
contents. The tag specified should be in the USER domain.
Use this tag only to animate a button which enables or disables a window.
Caution: If this tag in used in any other animation, your
system will lock up.
10 Enter the name of the default drawing to display in this window when the window
is enabled in the Startup Display Name: field.
11 Enter the name of a message tag that defines which drawing to display in the
Current Display/Load Display Tag: field. If you do not define this field or if the value
of this tag is blank, the default drawing is used.
If neither of these fields is defined, the RUNMGRU drawing is used. This is the
default value of the FL_MAINWINNAME tag.
12 After you complete the Window Attributes dialog, click on OK to close the dialog and
save the information. If you have entered the names of any tags not already
defined, the Tag Definition dialog is displayed.
64 / FactoryLink 6.6.0 / Application Editor Guide
CONFIGURING RUN-TIME WINDOWS
Defining Window Size and Placement
13 Enter data for any tags displayed. Refer to the field description where the tag
name was defined for details on valid data types.
5
14 If you want to change the size and position of the window, refer to the “Defining
D EFINING W INDOW S IZE
AND
P LACEMENT
Perform the following steps to change the size and position of a window:
1 Choose Application from the Application Editor menu bar.
2 Choose Application>Window Size/Position... to display the View Window Selection
dialog.
3 Select a window to view from the Window: field.
4 Click on OK to display a blank window.
5 Size the blank window to the desired size using the mouse or arrow keys and move
it to the desired location.
6 Press one of the following keyboard keys:
Enter
Esc
Saves a window’s new size and location. The blank window
disappears from the screen and the drawing area returns to
active. At run time, the window is displayed on the screen in the
size and location specified.
Cancels the change and clears the window.
FactoryLink 6.6.0 / Application Editor Guide / 65
Application Editor
Basics
Window Size and Placement” on page 65 for details.
•
CONFIGURING RUN-TIME WINDOWS
•
Setting the Top Window
•
•
S ETTING
THE
TOP W INDOW
You can configure multiple windows to open when the Run-Time Manager is
started. You can also configure which window should open first and is displayed
on the top of all the other windows. The default top window is FL_MAIN.
Perform the following steps if you want to configure a different top window:
1 Open the Configuration Manager.
2 Select the USER domain.
3 Choose Window Management from the Configuration Manager Main Menu to
display the Window Management Control panel.
4 Provide the following information in this panel:
Top Tag
Name of the tag that contains the name of the window that
should appear on top of all the other windows when Run-Time
Manager is started. If you do not define this field, the tag
TOPWINDOW_U is used.
Default
Name of the window displayed on top if the value of Top Tag is
blank.
66 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 6
Tag Definition Dialog
6
This chapter describes how to configure tag names and associated data element
information using the Tag Definition dialog.
FactoryLink 6.6.0 / Application Editor Guide / 67
Application Editor
Basics
When developing a FactoryLink application, each data element stored in the
real-time database is assigned a logical name, called a tag, which is used to
reference the element. Usually a variety of information is associated with each
unique data element, such as the tag name, alarm limits, scaling, deadband,
logging, persistence and I/O information. This information must be stored in
many different tables accessed by FactoryLink when it is running an application.
When creating an application in the Application Editor, this information can be
input automatically to the appropriate tables when assigning a tag name to a new
data element or modifying an existing tag through the Tag Definition dialog.
•
TAG DEFINITION DIALOG
•
Creating or Editing a Tag
•
•
C REATING
OR
E DITING
A
TAG
The Tag Definition Dialog
The Tag Definition dialog is used to create or modify tags. Separate tabs contain
information about different tag parameters. The tab options available are
dependent upon the tag type and domain chosen and the program options
installed for your system. For example, if you did not select and install the
Allen-Bradley driver option, that tab will not be displayed.
To view a particular tab, position the cursor on the tab header near the top of the
dialog box and click the left mouse button. The contents of that tab will be brought
to the foreground. Some tabs (Alarms, Logging, Scale/Dead) have two asterisks
(**) in front of the tab title if the tab is configured for the tag.
Some tabs have sub-tabs on the right side of the tab when it is in the foreground.
To view the contents of a particular sub-tab, position the cursor on the sub-tab and
click the left mouse button.
When all information has been entered or modified for a tag, click on OK to save
the information and exit the Tag Definition dialog. To leave the dialog without
making any changes, click on Cancel. To learn more about a particular topic, click
on Help.
Subtab
Tab Header
OK Button
68 / FactoryLink 6.6.0 / Application Editor Guide
Cancel Button
Help Button
TAG DEFINITION DIALOG
Creating or Editing a Tag
Creating a Tag
6
The Tag Definition dialog is displayed in the following situations:
• When a template item a tag has not yet been defined for is pasted into a screen.
Refer to the section “Working with Templates” for more information on pasting
template items.
Editing a Tag
If a tag needs to be edited after it is created, the Tag Definition dialog is accessed in
the following ways:
• When a field is chosen during development, press CTRL + T.
• When Application>Tag Dictionary is chosen from the Application Editor Menu Bar,
the Tag Dictionary dialog displays. Choose the desired tag and click on Edit to
display the Tag Definition dialog for that tag. Refer to the section “The Tag
Dictionary” on page 82 for more information about using the Tag Dictionary.
Click on Edit on the upper right side of the General tab for the tag to edit general
information for an existing tag.
Apply button
Edit button
FactoryLink 6.6.0 / Application Editor Guide / 69
Application Editor
Basics
• When creating a new data element, if you assign a tag name that has not yet
been defined on the animation screen, and click on OK.
•
TAG DEFINITION DIALOG
•
Creating or Editing a Tag
•
•
When the edit function is selected, all other tabs associated with the tag
disappear. Changes to the information on the Basic sub-tab for the tag must be
made before any other changes can be executed. If the tag is a SHARED domain
tag already used in the SHARED domain, the tag domain cannot be changed.
Array dimensions can be increased from the existing dimensions or decreased if
the items being eliminated have not already been referenced in FactoryLink. If a
tag was not originally created as an array, it cannot be changed to be an array tag.
Likewise, the number of dimensions cannot be changed. For example, tag [3][4]
cannot be changed to tag [3].
When all changes to the Basic sub-tab information are complete, click on Apply in
the upper right corner of the dialog. The changes are made and all other tabs
associated with the tag displays again and can be edited.
When all editing to information for the tag is completed, click on OK to save all the
options.
70 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Defining Tags
D EFINING TAGS
6
Tag Names
pump1_tmp
pump2_tmp
pump3_tmp
(Logically represents
an element in database)
Realtime database
Elements
Once an element is defined, you can make unlimited references to this element.
Any FactoryLink task containing a reference to an element can read and write
data to and from the element at run time.
During development, FactoryLink stores tag names in the FLAPP directory in the
object database table. This information is updated to the .CT files when the
run-time application is started.
Some tags are already defined in FactoryLink when it is shipped. Others are
defined during application development either within the Configuration Manager
or the Application Editor.
This chapter describes how to define tag names for database elements and
provides some suggestions on how to use tags in your application.
FactoryLink 6.6.0 / Application Editor Guide / 71
Application Editor
Basics
Data stored in the real-time database is an element. Each element is assigned a
logical name called a tag. This tag is used to reference the element in the real-time
database.
•
TAG DEFINITION DIALOG
•
Tag Naming Guidelines
•
•
TAG N AMING G UIDELINES
The following guidelines apply when you assign a tag name:
[<node>:]<name>[<dims>][.<ext>]
where
<node>
Is limited to 8 characters.
<name>
Is limited to 32 characters.
If using an array, add delimiters of up to 16 characters.
Refer to “Defining Element Arrays” for more details.
If using PowerNet, use the model:
32 characters less 7 characters = 25 characters.
Refer to “Tag Naming Conventions” in the Communications
Configuration Guide for more details.
If using Scaling and Deadbanding, use the model.
32 characters less 7 characters less 9 characters.
Refer to “Scaling/Deadbanding Definitions” in the Application
Editor Guide for details on the added extensions.
<dims>
Is limited to 16 characters.
<ext>
Is limited to 16 characters.
The maximum tag name length, including <node>, <name>, <ext>, and the
separators : and . is 32. Legal characters for the <node>, <name>, and <ext> strings
are:
• {A-Z}
• {a-z}
• {0-9}
• {@$_}
These strings cannot begin with a number or contain spaces.
System Added Extensions
When defining tag attributes in the Tag Definition dialog, new tags are created
automatically from the originally defined tag name if you are using PowerNet or
Scaling and Deadbanding.
72 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Tag Naming Guidelines
PowerNet
Scaling and Deadbanding
When a new tag is created, an extension of up to 8 characters plus a colon (9
characters maximum) is added. These additional characters reduce the maximum
length of the original tag name; therefore, the maximum effective length of the
original tag name is 32 less 7 less 9, or 16.
If you are not sure if you will be using PowerNet or Scaling and Deadbanding, you
may choose to define tag names using only 16 characters. Also, remember if
shortening tag names, do not reduce the length of the extensions.
FactoryLink 6.6.0 / Application Editor Guide / 73
6
Application Editor
Basics
When a new tag is created, an extension of up to 6 characters plus a dot (7
characters maximum) is added. These additional characters reduce the maximum
length of the original tag name; therefore, the maximum effective length of the
original tag name is 32 less 7, or 25. If the original tag name plus extension
exceeds 32 characters, a warning is issued.
•
TAG DEFINITION DIALOG
•
Tags Referencing Arrays
•
•
TAGS R EFERENCING A RRAYS
Defining Element Arrays
A tag name is assigned to a single element or a group of elements (sometimes
called an array). Using a single tag to define a group of elements permits certain
FactoryLink tasks, such as Math & Logic, to perform operations on an entire
element array using only one reference to the array, rather than using separate
references to each element in the array. Arrays can be single-dimensional or
multi-dimensional. Single-dimensional arrays are limited to indexes from [0] to
[65533]. Multi-dimensional arrays are limited a combined total of 65533 indexes;
for example [2][32767] and [3][21844] are valid configurations, but [2][50000] is
not.
To specify a tag as an array, enter the value(s) that define the array dimensions in
the tag name definition field when creating the tag initially. The number(s) should
be placed in square brackets [n] immediately following the tag name. Leave no
spaces between the tag name and the array dimensions or between any set of
array dimensions for multi-dimensional arrays.
Once a tag is created as a non-array tag, it cannot be changed into an array
element. Once a tag is created as an array tag, however, the number of array
elements can be increased or decreased. Therefore, if you are developing an
application, know that a tag will be an array, and know the number of dimensions
in the array but not the exact number of elements in each array, create the tag as
tagname[0][0]..., and specify the actual number of elements at a later time.
74 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Tags Referencing Arrays
Specify a number one less than the number actually required because the array
starts counting at 0. For an array with 3 elements, enter the number 2 in the
array dimensions field to receive 3 elements: 0, 1, 2.
6
Application Editor
Basics
Tag defined with one-dimensional array
Defining One-dimensional Arrays
Enter a single number to define a one-dimensional array as the array dimension
to specify the number of elements in the array. Each element has a unique
identifier consisting of the tag name defined in the Tagname field and one of the
array identifier numbers: tagname[n]
For example, if 3 elements for an array are specified by entering the number 2 in
square brackets as part of the tag temp[2], the following three elements are
created in the real-time database:
• temp[0]
• temp[1]
• temp[2]
Defining Multi-dimensional Arrays
Enter multiple numbers to define multi-dimensional arrays in square brackets
following the tag name to specify the number of elements in the array. Up to five
dimensions can be defined for each array. Each element has a unique identifier
FactoryLink 6.6.0 / Application Editor Guide / 75
•
TAG DEFINITION DIALOG
•
Tags Referencing Arrays
•
•
consisting of the tag name defined in the Tagname field and dimensional array
identifier numbers: tagname[n1][n2]...
Tag defined with multi-dimensional array
For example, if a tag named tryp is to be an array that has two dimensions with 2
elements in the first dimension and 3 elements in the second dimension, specify
the tag name as tryp[2][3] when creating the tag. The following six elements are
created in the real-time database:
• tryp[0][0]
• tryp[0][1]
• tryp[0][2]
• tryp[1][0]
• tryp[1][1]
• tryp[1][2]
Working with Element Arrays
Once a tag is created as a multi-dimensional array, each element is accessed
through the Tag Definition dialog.
76 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Tags Referencing Arrays
To increase or decrease the number of elements in the array, access the Tag
Definition dialog for the tag. If the tag is already created, click on Edit. Make any
necessary changes to the Array Dimensions field and click on Apply.
Edit Button
Array Dimensions field
Note: If you are decreasing the number of elements in the array,
ensure any of the elements being deleted have not been
referenced elsewhere in FactoryLink. If you delete a referenced
tag, the program will not compile correctly, and the run-time
program will not execute.
FactoryLink 6.6.0 / Application Editor Guide / 77
Application Editor
Basics
Apply Button
6
•
TAG DEFINITION DIALOG
•
Tags Referencing Arrays
•
•
The information contained on the General tab is the same for all elements of an
array. Other information pertaining to the tag, such as logging, can be configured
for all elements of an array or differently for specific array elements. Click on the
desired tab to configure information for the tag.
Array Subscript field
OK Button
Use the arrows on the right side of the Array Subscript field to scroll through the
array elements or type in the desired value. When the desired array element is
displayed, enter any necessary information or make any changes. Click on OK at
the bottom of the dialog or click on a different tab.
A window displays asking if you wish to apply this information to all elements of
the array. If you do, click on YES. If you wish to make this information apply only
to the specific array element you are configuring, click on Cancel. The information
is saved only for that array element.
When viewing the tag dictionary, array tags only display once as tagname[0][0]....
To access any individual element of the array, choose the tag, click on Edit, and
proceed as described above.
78 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Working with Templates
W ORKING
WITH
TEMPLATES
6
Full Template Items
Any template referenced from an animation dialog is a full template and has all
the functionality described in “Guidelines for Using Template Variables” on page
197.
Full template items
created in Animation Dialog
When you finish defining the animation for the tag and click on OK, a pop-up
window displays, asking for the prompt string to be displayed when this template
item is pasted.
Prompt string for tag
FactoryLink 6.6.0 / Application Editor Guide / 79
Application Editor
Basics
Template animation allows you to animate an object with variables. When
creating a template item, define which animation features are constant or
variable for the object. When the object is duplicated, a prompt asks for definitions
for the variable animation features.
•
TAG DEFINITION DIALOG
•
Working with Templates
•
•
When an object containing full template items is pasted into a drawing, a dialog
displays, prompting you to enter the values for all the full template items.
Prompt string created
when defining tag
displays when object
is pasted.
Simple Template Items
Any template defined in the Tag Definition dialog is referred to as a simple
template item. When creating or editing a template in the Application Editor, any
values in the Tag Definition dialog fields, except those on the Basic sub-tab, can be
configured as template items if the tag name is a template. A simple template
item functions like a regular template item, but a prompt string cannot be defined
for a simple template item; it is generated automatically.
Tag name defined
as template item
80 / FactoryLink 6.6.0 / Application Editor Guide
Simple template items
created in Tag Definition
Dialog
TAG DEFINITION DIALOG
Working with Templates
Note: In Single Point edit dialog:
• If the tag being edited is a normal tag (i.e. not a template variable), then the
“?” feature is not available.
When an object containing simple template items is pasted into a screen, a dialog
displays, prompting you to enter the values for all the simple template items.
Tag name prompt
appears when object
is pasted
Only the template name and a field to enter the values in is displayed.
If the object being pasted contains both full and simple template items, two
dialogs display. The first prompts for values for the full template items; the second
prompts for values for the simple template items.
If you enter a template name in the Tag Definition dialog already defined from an
animation dialog, it assumes the value from the full template item.
If a simple template name is assigned on one of the tabs of the Tag Definition dialog
and the same template name is used on a different tab of the same Tag Definition
dialog, the system treats these items as two different templates.
The simple templates are specified in one of two ways:
• The template variable can be entered in the field in braces: {port_id}. Templates
can also be entered as a combination of a template variable and text. For
example: {port}ID.
• If the field is too short to enter the template name, a ? can be placed in the field.
FactoryLink 6.6.0 / Application Editor Guide / 81
Application Editor
Basics
• For template variables, the “?” feature is automatically added to all
drop-down selection boxes.
6
•
TAG DEFINITION DIALOG
•
The Tag Dictionary
•
•
T HE TAG D ICTIONARY
The tag dictionary provides a method to view all the tags in the application.
Up Arrow
Tag Name field
Function buttons
Slider bar
Down arrow
The slider bar scrolls through the tags. One hundred tags display at a time. To see
another block of 100 tags, use the up/down arrow buttons next to the slider bar to
move to another block of tags.
Selecting a Tag
Type the name of the desired tag in the Tag Name: field or choose the desired tag
by clicking on it with the mouse and press ENTER on the keyboard to display the
tag in the Tag Name: field. If unsure of the tag name, type in the first few
characters of the name (noting that the sorting is case-sensitive) and press ENTER
on the keyboard. That portion of the list displays and the desired tag can be
chosen.
Click on Close to close the Tag Dictionary.
Click on Help for help about the Tag Dictionary.
82 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
The Tag Dictionary
Creating a New Tag
Editing a Tag
To edit the information for an existing tag, ensure the name of the desired tag is in
the Tag Name: field as described above and click on Edit. The Tag Definition dialog
for the tag displays and the information for the tag can be edited.
Deleting a Tag
To delete an existing tag, you must first delete all references to the tag in the
application. Do this by checking the cross-reference list as described below. After
you have removed all references to the tag, ensure the name of the desired tag is
in the Tag Name: field as described above and click on Delete. You cannot delete a
tag with any references.
Cross-Referencing a Tag
To view a cross-reference list for a particular tag, ensure the name of the desired
tag is in the Tag Name: field as described above and click on Xref. The
cross-reference list for the tag displays:
The size of the field columns can be modified by selecting the bar between the
fields (in the column name row) and moving it.
FactoryLink 6.6.0 / Application Editor Guide / 83
6
Application Editor
Basics
To create a new tag, type in the name of the tag and click on New. The Tag
Definition dialog displays and information for the tag can be entered.
•
TAG DEFINITION DIALOG
•
The Tag Dictionary
•
•
The columns on this list provide information about the tag used in the application.
Each row contains information about a particular reference to the tag:
Tagname
CT Name/Anim
Type
Lists the name of the tag information is displayed for.
The name of the configuration table or type of animation the tag
is used in.
Table Name/
Drawing
The name of the table or drawing the tag is referenced in.
Column Name
/Anim Field
The name of the table column or animation field the tag is
referenced in.
Record/Obj. Name
CT Domain
Sub-record ID Pen
Name
Tag Dimensions
Task Name
The record number assigned to the item in a table, or the object
number assigned when animating an object.
The domain (SHARED or USER) the tag is referenced in.
The name of the sub-record or pen that references the tag.
The dimensions of the tag if it is an array.
The name of the task (GRAPH, EDI, DISTALAOG) that uses the
information in the referenced tag.
84 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Basic Tag Definitions
B ASIC TAG D EFINITIONS
6
General selected
Basic selected
The fields on this sub-tab define general information about the tag.
Description
Type
Enter a description of up to 80 characters that defines the
purpose of the tag.
Choose the format for the data referenced by this tag. Valid data
types may depend on the type of field being defined. Below is a
list of all valid data types:
Digital binary data type. Its value can be a 0 or 1.
Analog 16-bit, signed integer. Its value can range between
negative and positive 32,768.
Floating-point IEE double precision number with 31 places to the
right of the decimal.
Message any combination of alphanumeric characters. Its
length is controlled by its tag definition.
FactoryLink 6.6.0 / Application Editor Guide / 85
Application Editor
Basics
When the Tag Definition dialog displays, the Basic sub-tab of the General tag
definition tab displays as the top layer. This dialog is used to enter information
about the tag, such as a description, tag type, domain, and default value. If the tag
is an array, the array dimensions are also entered here. For message type tags,
specify the message length.
•
TAG DEFINITION DIALOG
•
Basic Tag Definitions
•
•
Long analog
16-bit signed integer. Its value can range from
negative to positive 2 billion.
Mailbox variable length data organized as a queue.
Domain
Choose the domain this tag should be used in:
SHARED The data contained within this tag is available
from the SHARED or USER environment. It can
be read, used and/or modified by all users.
USER The data contained within this tag is available
only from the USER environment.
If this tag is created as a shared tag and is referenced in the
SHARED domain, the domain for the tag cannot be changed.
If the tag was created in the USER domain, the domain can be
changed.
Most tag options (tabs) are only available for tags to be used in
the SHARED domain.
Array Dimensions
If this tag is used to reference an array, the array dimensions
display in this field. This field is blank if the tag is not an array. If
this tag is defined as an array, this field is used to add or remove
elements from the array. If removing elements from an array,
ensure the element(s) being deleted is not referenced elsewhere in
FactoryLink. Refer to “Tags Referencing Arrays” on page 74 for
details on defining arrays.
Message Length
This field defines the maximum length for Message tags. If you do
not specify a length, FactoryLink calculates the correct length the
first time a message is written to the tag.
Default Value
This field defines the value written to the tag when FactoryLink
is started.
86 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Basic Tag Definitions
Follow Domain
Persistence
Note: Persistence for the domain must be configured for this
option to work.
To define tag-specific persistence parameters, use the persistence
sub-tab to define the tag-specific parameters. Refer to “Tag
Persistence Definitions” on page 88 for more details on defining
tag-specific persistence.
If no persistence option is chosen for this tag, the value is not
saved for restoration after an unexpected shutdown.
FactoryLink 6.6.0 / Application Editor Guide / 87
6
Application Editor
Basics
Choose this box to use the persistence settings defined for the
domain. The default configuration is no persistence configured for
either domain. Refer to Chapter 1, “Persistence” in the Core Tasks
Configuration Guide to define persistence for an entire domain.
•
TAG DEFINITION DIALOG
•
Tag Persistence Definitions
•
•
TAG P ERSISTENCE D EFINITIONS
Persistence is used to save the values of an active FactoryLink application at
predetermined times so data will not be lost if the system shuts down
unexpectedly. Persistence can be configured for an entire domain and/or on a
per-tag-basis. For the domain, the user can specify which elements need to be
saved and how often to save them. If certain elements need to be saved at a
different interval, the domain persistence can be superseded for the element using
this persistence function. Refer to Chapter 1, “Persistence” in the Configuration
Guide for a detailed description of the Persistence function.
When the Persistence sub-tab is chosen from the General tag definition tab, the
following dialog displays.
General selected
general selected
88 / FactoryLink 6.6.0 / Application Editor Guide
Persistence selected
TAG DEFINITION DIALOG
Tag Persistence Definitions
Enter the following information for the tag:
Use Domain
Settings
Controls how often the element value is saved to a disk file. This
can be one or both of the following. If both options are chosen, the
element value is saved based on a time trigger and when it
changes.
On Time Saves the tag value based on a time trigger.
On Exception Saves the tag value based on a change in the data
stored in the tag.
Restoring
Controls whether the element change status flag is set to on or off
when restoring the saved value to the element.
Status On The element change status flag is set to on when
restoring the saved value.
Status Off The element change status flag is set to off when
restoring the saved value.
FactoryLink 6.6.0 / Application Editor Guide / 89
6
Application Editor
Basics
Save
Choose this box to use the persistence settings defined for the
domain. To check the persistence settings for the domain, access
the Configuration Manager. To define tag-specific persistence
parameters, ensure this box does not contain an X, and use the
rest of the fields on the persistence tab to define the tag-specific
parameters.
•
TAG DEFINITION DIALOG
•
General Alarm Definitions
•
•
G ENERAL A LARM D EFINITIONS
Before configuring alarms, refer to Part XIV, “Distributed Alarm Logger” in the
Reporting section for an overview of alarm functionality, if necessary. If two
asterisks (**) are in front of the word Alarm on the tab, it indicates configuration
information is on the tab. When the Alarm tab is chosen from the Tag Definition
dialog, the Basic Alarm sub-tab displays:
Alarms selected
Basic selected
The condition, limit, and group displays for any configured alarms. Highlight the
desired alarm and modify the attributes using the Condition Attributes box at the
bottom of the screen to change this information. Enter information for the alarm
in the Condition Attributes box to create a new alarm:
Condition
Choose the condition the alarm tag type or alarm ID will be
checked under. Valid values are
HIHI, HI, GT or >An alarm is triggered when the value of the
element is greater than the value specified by the
limit.
LOLO, LO, LT or <An alarm is triggered when the value of the
element is less than the value specified by the
limit.
90 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
General Alarm Definitions
LE or <= An alarm is triggered when the value of an analog
or floating-point element is less than or equal to
the value specified by the limit.
or floating-point element is greater than or equal
to the value specified by the limit.
EQ or = An alarm is triggered when the value of an analog
or floating-point element is equal to the value
specified by the limit.
NE or < > An alarm is triggered when the value of an analog
or floating-point element is not equal to the value
specified by the Limit.
For example, an acceptable temperature range is 40-100 degrees.
If the temperature exceeds 90, you want to set a HI alarm to alert
the operator. If the temperature exceeds 95, it would be
considered critical, and this could be configured as the HIHI
alarm. In addition, you may want to set an alarm when the
temperature is > 85 so the operator can take steps to prevent the
temperature from ever reaching a dangerous level. In all three
cases, the condition for the tag is greater than but each alarm is
differentiated from the other.
Group
Choose the alarm group name from the list. Create the name of a
new alarm group by going to the Group Alarms tab.
Priority
Enter a number between 1 and 9999 to specify the priority of the
alarm for filtering and sorting purposes. The default is 1, the
highest priority.
* Limit
Enter the value constant or a tag name for an element against
which the condition is checked. If the condition reaches this limit,
the alarm condition occurs.
Area
Enter an alphanumeric string to specify the area the alarm
resides in for filtering and sorting purposes. If alarms are
distributed along the network, use this field to designate and sort
by server/client or local/remote.
* Deadband
Enter the value constant or a tagname for an element above or
below the limit the alarm will remain active for.
FactoryLink 6.6.0 / Application Editor Guide / 91
Application Editor
Basics
GE or >= An alarm is triggered when the value of an analog
6
•
TAG DEFINITION DIALOG
•
General Alarm Definitions
•
•
The deadband works in conjunction with the condition and limit
specified for the alarm. Once the alarm is triggered when the tag
fulfills the condition and limit parameters, it remains active until
it moves past its limit by the deadband amount.
For example, if the alarm trigger condition is set to activate when
the tag temp_set is equal to 85 degrees F and the deadband is set
to 5, the alarm will be triggered at 85 degrees and will not return
to normal until the temperature has dropped back below 80
degrees (85 less 5 for the deadband).
If a tag is used, it must be the same data type as the tag and the
tag name referenced in the *Limit field.
A message type tag is not valid in the *Deadband field.
Valid Entry: standard tag name or constant
Valid Data Type: analog, longana, float
To add an alarm, specify the alarm condition attributes to the list of configured
alarms, then click on Add.
To delete an alarm, select it by clicking on it in the Configured Alarms list to
highlight it and click on Delete.
To update an alarm, select it by clicking on it in the Configured Alarms list to
highlight it. Make any changes in the Condition Attributes box and click on
Update. The changes displays in the Configured Alarms list.
For those items preceded by an asterisk (*), either a value or a tag name can be
entered in the field. If an unused tag name is entered in one of these items, when
you click on Add, Update, OK or move to another tab, a Tag Definition dialog for the
new tag displays.
To clear all alarms for a tag, press Clear in the upper right corner of the tab. To
add an alarm to the list of configured alarms, click on Add.
92 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Advanced Alarm Definitions
A DVANCED A LARM D EFINITIONS
6
Alarms selected
Advanced selected
Enter the following information if you wish to use advanced alarm functions:
Message Text
Enter up to an 80 character alphanumeric string to specify the
alarm message text to be displayed for this individual alarm. This
text normally displays after the group alarm text. This message
text can be enhanced with up to four variables, 1-4, described
below. The variables are scanned in order, 1 to 4. The default
message is tagname= %d.
Variable 1-4
Enter the name of the tag whose element will be used as part of
the alarm message at run time in place of the variable (1-4)
specifier indicated within the text of the Message Text. When the
message is displayed, this variable is substituted for the specifier
at run time. The default for variable 1 is tagname. ANALOG,
LONGANA, FLOAT or message are valid data tag types for this
variable.
Hiding
To hide the chosen alarm, place an X in the Hiding box and enter
the name of the digital tag in the USER domain that hides the
alarms. If the Hiding field is left blank, the alarm is processed as a
standard alarm.
FactoryLink 6.6.0 / Application Editor Guide / 93
Application Editor
Basics
If two asterisks (**) are in front of the word Alarm on the tab, it indicates
configuration information is on the tab. When the Advanced sub-tab is chosen
from the Alarm Definitions Tab, the Advanced Alarm sub-tab displays.
•
TAG DEFINITION DIALOG
•
Advanced Alarm Definitions
•
•
Time-stamp
Format
Enter the format to be used by the input element in the Time
Stamp tag. Valid values are:
NULL Time-stamping format is not used
USA USA time format (yymmddhhmmss)
EUROPE European time format (ddmmyyhhmmss)
USA_HS USA time format with 1/1000 sec
(yymmddhhmmsstt)
EUR_HS European time format with 1/1000 sec
USA_L Long USA time format
EUROPE_L Long European time format
USA_HSL Long USA time format with 1/1000 sec
EUR_HSL Long European time format with 1/1000 sec
Time Stamp Tag
Enter the name of a message tag to specify the exact time the
alarm occurred. This message is supplied with the alarm tag
change. If no tag is supplied here, the time-stamping is
determined by when the change is detected by the Alarm Logger.
Complete this tag a correct value before the alarm tag is changed.
Status Tag
Enter the name of the analog or digital tag that represents the
status of this alarm in the active alarm list. Valid statuses are
Initial (INI), Acknowledged (ACK), Normal (NRM), or Idle
(IDLE).
If an unused tag name is entered for Variable, Hide tag or Time-stamp tag, a Tag
Definition dialog for the new tag displays when you click on OK or move to another
tab.
94 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Group Alarm Definitions
G ROUP A LARM D EFINITIONS
6
Alarms selected
Alarm Groups
selected
Alarms can be grouped to facilitate administration or analysis. Enter the
following information if use of the group alarm functions is desired:
Alarm Group
Choose a group name from the list of existing groups, or create a
new alarm group name of up to 16 alphanumeric uppercase
characters.
Message
Enter a message of up to 40 alphanumeric characters to specify
the alarm message to be displayed for all alarms belonging to this
group. This text is normally placed in front of the individual
alarm text.
Hide Tag
Enter the name of the tag (must be a digital type tag) used to hide
alarms for the group. Leave this field blank to deactivate this
feature. If a tagname entered has not been used before, when you
click on Add, Update, OK or move to another tab, a Tag Definition
dialog for the new tag displays.
Audible
Check this box to generate an audible signal when an alarm is
generated. If the box is not checked (default setting), no alarm is
generated.
FactoryLink 6.6.0 / Application Editor Guide / 95
Application Editor
Basics
Two asterisks (**) in front of the word Alarm on the tab indicates configuration
information is on the tab. When the Alarm Groups sub-tab is chosen from the
Alarm Definitions tab, the following displays.
•
TAG DEFINITION DIALOG
•
Group Alarm Definitions
•
•
Log
Check this box to indicate an alarm belonging to this group is
logged in the alarm table after it is removed from the active list.
If the box is not checked (default value), the alarm will not be
logged to the table after being removed from the active list.
Print Device #
Enter the number of the print device where the alarm state
changes will be routed for printing. This number corresponds to
the line number of the print device identified in the Print Spooler
Information panel. The default blank or 0 disables this function.
ACK
Indicate whether or not alarms belonging to this group need to be
acknowledged by the operator. Valid values are:
NO Operator acknowledgment is not required. The
alarm disappears from the active list when it
returns to normal. This is the default setting.
YES Operator acknowledgment is required. The
acknowledge time and operator are logged, if
configured for such.
RST The operator must acknowledge the alarm but
cannot do so until the alarm has returned to
normal.
If this field is set to YES or RST, the Unack Alarms Count Tag
field in the General Alarm Setup panel must be set for the alarms
in the unacknowledged state to be counted.
Display Attributes
Set the foreground and background color and whether or not the
tag blinks for the initial, acknowledged, and normal state of the
alarms on the alarm display.
Click on ADD in the upper right hand corner of the tab to create a new alarm
group. If you are updating existing alarm groups, click on UPDATE to save
modifications to the record.
96 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Data-Point Logging Definitions
D ATA -P OINT L OGGING D EFINITIONS
6
Data-Point Logging can be configured to occur based on one or more of the
following:
• A change in the tag (exception logging)
• A change in a trigger tag
• A fixed-time interval
If using multiple logging methods results in a tag value being logged more than
once during a given second, any value logged after the first recorded value is
ignored.
Refer to Part XI, “Data Point Logger” in the Data Logging Configuration Guide for
a detailed description of how Data-Point Logging functions.
When the Logging tab is chosen from the Tag Definition dialog, the following
displays:
FactoryLink 6.6.0 / Application Editor Guide / 97
Application Editor
Basics
The Data-Point Logging definition tab is used to specify which FactoryLink tags
are written to the historical databases and what trigger causes the tag element to
be recorded. Two asterisks (**) in front of the word Logging on the tab indicates
configuration information on the tab. Data Point Logger comes with five
preconfigured tables data can be written to, or the user can create other tables as
needed. For each tag element recorded, the tag name, value, and time of recording
are written to the Data-Point database.
•
TAG DEFINITION DIALOG
•
Data-Point Logging Definitions
•
•
Enter the following information, if use of the Data-Point Logging function is
desired:
Log Table
Choose the name of the log table to which the tag element should
be written. Data Point Logger comes with five tables
preconfigured for efficient storage and retrieval of certain tag
types. These log tables are:
FLOATVAL Used to store floating value data.
LONGANA Used to store long analog (large integer) data.
ANALOG Used to store analog (small integer) data.
LOGDATA Used to store general log data.
TRENDATA Used to store data used for trend analysis.
To create a new table, you must use the Data-Point Schema Control
panel and the Data-Point Logger Control panel in the Configuration
Manager.
Log On Change
Choose this box (click on box with arrow and an x displays in the
box) if the tag data is to be recorded to the database table when
the data in the tag changes.
Log On Trigger
Enter the name of the trigger tag to be used in this field if the tag
data is to be recorded to the database table when a trigger occurs.
If the tagname entered has not been used before, a Tag Definition
dialog for the new tag displays when you click on Apply or OK or
move to another tab.
Log On Interval
If the tag data is to be recorded to the database table at a specific
time interval, enter the time interval number in the Log Rate
field and use the radio buttons to indicate if the interval is
seconds, minutes, hours, or days.
For example, if the tag data should be written to the database
table every 2.5 minutes, enter the number 150 in the Log Rate
field and click on the Seconds radio button.
98 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Scaling/Deadband Definitions
S CALING /D EADBAND D EFINITIONS
6
mx + b = y
where
x
is the raw value
m
is the multiplier
b
is a constant
y
is the result
Deadbanding is used to indicate a band, or area, around a value that is small
enough to be insignificant, so the value does not need to be recalculated. This
saves processing time and improves system efficiency.
Two asterisks (**) appearing in front of the word Scale/Deadb on the tab indicates
configuration information is on the tab.
When the Scale/Deadband tab is chosen from the Tag Definition dialog, the
following displays:
FactoryLink 6.6.0 / Application Editor Guide / 99
Application Editor
Basics
Scaling is used to convert, or scale, incoming raw data to a different value range, if
needed. Use of the scaling task eliminates the need to process data through an
intermediate routing mechanism or to write code to perform the scaling function.
The scaling task, if given the conversion factor and/or offset, perform the linear
scaling calculations automatically using the formula:
•
TAG DEFINITION DIALOG
•
Scaling/Deadband Definitions
•
•
When raw and scaled ranges are specified as a value, the system automatically
creates and defines the following tags associated with the tag tagname:
• tagname.raw
• tagname.eumin
• tagname.eumax
• tagname.rawmin
• tagname.rawmax
• tagname.dead
• tagname.lock
The value for a scaled tag configured in the Application Editor is calculated on
change and written to the scaled tag tagname. Note that for a scaled tag
configured in the Configuration Manager, the value is written to the tagname.raw
tag, and the scaling is performed.
The tag names assigned for the deadbanding and lock functions can be replaced
with other tag names, if desired.
Refer to the Core Task Section of the FactoryLink Configuration Guide for more
information on the Scaling and Deadbanding function.
If use of the scaling or deadbanding function is desired, enter the following
information:
Scaling Values
Enter the minimum and maximum values for the raw (incoming)
data and the minimum and maximum values for the scaled
(engineering units) data displayed in FactoryLink.
For example: the temperature in a tank needs to be monitored in
a range between freezing and boiling. The tank temperature
probe records incoming (raw) data in a Celsius scale, and you
prefer to have the temperatures displayed in FactoryLink
(engineering units) of a Fahrenheit scale. Enter the following
values in the fields:
Raw High: 100 (the boiling point in the Celsius scale)
Raw Low: 0 (the freezing point in the Celsius scale)
Eng Unit High: 212 (the boiling point in the Fahrenheit scale)
Eng Unit Low: 32 (the freezing point in the Fahrenheit scale)
FactoryLink automatically determines the appropriate scaling
values and converts incoming data to the engineering unit values.
100 / FactoryLink 6.6.0 / Application Editor Guide
TAG DEFINITION DIALOG
Scaling/Deadband Definitions
Disable Tag
When you specify a scaling function for a tag, FactoryLink
automatically creates a tag named tagname.dead that performs a
deadbanding function for the tag. Deadbanding creates a band, or
area, around a tag value. If the tag value remains within this
band, the value is not rewritten to the database. If the tag value
exceeds this range, the tag value is rewritten, and a band around
the new value is recalculated. Therefore, the deadband value
should be small enough that the change would not be important
enough to require attention. If desired, enter the name of a
different tag or a constant value to perform this function.
For example, if a temperature change of 2 degrees in either
direction is not considered significant, enter a 2 in the
deadbanding value field and choose the Absolute Change radio
button. If a change of 2% of the value is not considered
significant, a 2 could be entered in the deadbanding value field
and the Percent Change radio button could be chosen.
If a tagname is entered in one of these items NOT used before, a Tag Definition
dialog displays when you click on OK or move to another tab.
FactoryLink 6.6.0 / Application Editor Guide / 101
6
Application Editor
Basics
Deadbanding
When you specify a scaling function for a tag, FactoryLink
automatically creates a tag named tagname.lock that performs a
disabling function to temporarily disable the scaling feature for
the tag. If desired, enter the name of a different tag to perform
this function.
•
TAG DEFINITION DIALOG
•
Device Interface
•
•
D EVICE I NTERFACE
The Device Interface tabs refer to protocol-specific tasks for external devices that
could be providing data to FactoryLink. Tabs only display for the protocol-specific
modules installed for your particular system. The data for this tag is either
coming from or going to a device that supports the protocol used by the task.
Certain address and table information for the external device must be entered.
Choose the tab for that device, and a dialog similar to the one below displays. The
actual fields vary, depending on the type of protocol module used. Refer to the
Device Interface Guide for detailed information on each type of external device.
Address
Information
Table Information
(read only)
Information, such as the logical station number, type, port
number, read table name, and data type, is entered for the tag. A
detailed explanation for each field is provided in the Device
Interface Guide.
Information about the selected table, such as the read and write
trigger, whether information is written automatically or on
exception, and whether or not an unsolicited read will be
performed, display for the read table specified above. A detailed
explanation for each field is provided in the Device Interface
Guide.
If a tagname is entered in one of these items NOT used before, a
Tag Definition dialog displays when you click on OK or move to
another tab.
102 / FactoryLink 6.6.0 / Application Editor Guide
Data Reporting Configuration Guide
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Part II
Screen Construction
103
•
•
•
•
Chapter 7
Drawing Objects
This chapter includes instructions for drawing components used to develop
user-interface screens. The following topics are included:
• A description of the drawing tools including the Application Editor menu bar
and toolbox.
• Instructions on how to use the tools to draw objects on the screen.
7
Screen Construction
FactoryLink 6.6.0 / Application Editor Guide / 105
•
DRAWING OBJECTS
•
The Drawing Tools
•
•
T HE D RAWING TOOLS
The Application Editor provides a variety tools through the menus and the Tools
box to assist you in developing a drawing.
The Menus
The Draw, Attributes, and Edit menus are the primary menus used when first
developing your screens. The Draw menu includes the commands for drawing all
objects. The Attributes menu includes commands for specifying the line, fill, text
and screen styles and for defining an object name. The Edits menu includes
commands for selecting and editing objects.
The Tools Box
The Tools box provides quick access to many of the drawing tools found in the
Draw and Edit menus. It also includes tools found in other menus, such as
Animation and Application.
The Tools box is displayed by default. Choose View>Toolbox to toggle the Tools box
open or closed.
The following illustrates the Tools box and identifies the tools used for drawing
and selecting objects:
Select
Text
Line
Polygon
Box
Ellipse (circle)
Arc
Parabola
Spline (curve)
Legend
Other tools will be identified as needed throughout this manual.
106 / FactoryLink 6.6.0 / Application Editor Guide
DRAWING OBJECTS
The Drawing Tools
Selecting Objects
Once an object is drawn, you can perform many actions on it, such as cutting,
pasting, grouping, changing their size, setting display characteristics, and
animating. Before you can perform an action on an object, it must be selected.
This section describes how to select objects.
To select an object, choose Edit>Select Object. The cursor becomes an arrow.
Selecting Simple Objects
To select a single object, place the cursor inside the object and click the left mouse
button. Eight solid blocks or handles display around the object, indicating it is
selected. An additional handle displays in the middle of the object. This handle is
used for moving the object.
7
Move Handle
Selection Cursor Tool
Selecting a Group of Objects
To select a group of objects, press and hold the left button and drag a border
around the objects you want to select, then release the mouse button. The border
must completely enclose every object you want to select. Handles display around
the group.
Drag a border
around the objects
to be selected
Selection
Handle
FactoryLink 6.6.0 / Application Editor Guide / 107
Screen Construction
Selection
Handles
•
DRAWING OBJECTS
•
The Drawing Tools
•
•
Selecting a Composite Object
Composite objects are two or more subobjects grouped together. To select a
composite object, place the cursor inside the object and click the left mouse button.
Hollow blocks or handles display around the object, indicating it is selected.
Composite Select Handle
If the selected object site is on top of another object site and you select again, the
Application Editor displays the composite selection handles for the next layered
object.
Selecting a Subobject
Choose Edit>Select Subobject from the Edit menu to select individual subobjects
contained within the composite object without ungrouping the composite. Perform
the following steps to select subobjects comprising a composite object:
1 Select a composite object. Composite select handles display around the entire
object.
2 Hold the Ctrl key down while clicking on the subobject with the selection tool. A
solid line borders the composite object and selection handles display around the
selected subobject.
Optionally, you choose Edit>Select Subobject and then click on the subobject to
select it.
Subobject Select Handle
108 / FactoryLink 6.6.0 / Application Editor Guide
DRAWING OBJECTS
Drawing Simple Objects
If the selected subobject is a simple object, the handles are solid. If the selected
subobject is another composite, the handles are hollow. You can repeat this
procedure to go a layer deeper until you cannot select more composite objects.
The selection handles relocate to the selected subobject as you select different
subobjects within the composite.
Click outside the a subobject but within its composite to select a composite object
in an overlapping layer. The solid border around the composite changes to the
composite selection handles. Click anywhere outside of the composite to deselect
the composite entirely. The composite selection handles disappear.
Undo
Choose Edit>Undo to reverse the last action performed in the active drawing,.
Undo operates on a per drawing basis. You can undo the last action performed in
each open drawing after making the drawing active. The last action performed is
displayed next to the Undo option when you access the Edit menu.
The Undo option is displayed gray and cannot be selected if the last action
performed cannot be reversed.
D RAWING S IMPLE O BJECTS
Simple objects are single objects, such as lines, circles, and text, that are not
composed of any other objects. They are the basic building blocks of a graphics
display. For example, the following are simple objects:
TextString
You must select each object individually to perform an action on it, such as to
move it.
FactoryLink 6.6.0 / Application Editor Guide / 109
Screen Construction
The Undo option does not undo any element names created with the last action.
The element names remain in the object list.
7
•
DRAWING OBJECTS
•
Drawing a Straight Line
•
•
D RAWING
A
S TRAIGHT L INE
1 Choose Draw>Line.
2 Place the cursor where you want the line to start and press the left mouse button.
3 Drag the cursor to draw a line in the drawing area. Continue dragging the cursor
until the line is the desired length, then release the mouse button.
D RAWING
A
S PLINE (C URVED L INE )
1 Choose Draw>Spline.
2 Place the cursor where you want the curved line to start and press the left mouse
button.
3 Drag the cursor to draw a line in the drawing area. Continue dragging the cursor
until the line has the same endpoint as the desired curve, then release the mouse
button.
4 Move the cursor to another position and press the left mouse button. The end
point of the line moves to the point where you released the button, making a
best-fit curve based on the starting point of the cursor, the first point where you
released the mouse button, and the second point where you released the mouse
button.
110 / FactoryLink 6.6.0 / Application Editor Guide
DRAWING OBJECTS
Drawing a Square or Rectangle
5 Repeat Step 4 until the curve is the desired shape.
6 Press the right mouse button to end drawing of the curved line.
D RAWING
A
S QUARE
OR
R ECTANGLE
1 Choose Draw>Box.
2 Place the cursor where you want the rectangle or square to start and press the left
mouse button.
3 Drag the cursor to draw a box in the drawing area. Continue dragging the cursor
D RAWING
A
P OLYGON
1 Choose Draw>Polygon.
2 Place the cursor where you want the polygon to start and press the left mouse
button.
3 Drag the cursor to draw a line in the drawing area. You must draw the first line by
dragging the cursor or it will disappear when you press the right mouse button to
complete the polygon.
4 Release the left mouse button.
FactoryLink 6.6.0 / Application Editor Guide / 111
Screen Construction
until the box is the desired shape, then release the left mouse button.
7
•
DRAWING OBJECTS
•
Drawing an Ellipse (Circle or Oval)
•
•
5 Move the cursor to another position in the drawing area and press the left button.
Another line is displayed that connects the current point to the previous point.
Repeat this step until the polygon is the desired shape.
6 Press the right mouse button to end drawing of the polygon.
D RAWING
AN
E LLIPSE (C IRCLE
OR
O VAL )
1 Choose Draw>Ellipse.
2 Place the cursor where you want the ellipse or circle to start and press the left
mouse button.
3 Drag the cursor to draw an ellipse or circle in the drawing area. Continue
dragging the cursor until the object is the desired shape, then release the left
mouse button.
D RAWING
AN
A RC
1 Choose Draw>Arc.
2 Place the cursor where you want the arc to start and press the left mouse button.
3 Drag the cursor to draw an ellipse or circle in the drawing area.
112 / FactoryLink 6.6.0 / Application Editor Guide
DRAWING OBJECTS
Drawing a Parabola
4 Continue dragging the cursor to enlarge or shrink the ellipse or circle to the
desired size, then release the mouse button.
5 Press and hold the left mouse button down. The ellipse or circle disappears. Drag
the cursor to display a pie-shaped wedge with the same radius as the ellipse.
6 Drag the cursor until the arc is the desired size
7 Release the mouse button. The sides of the wedge disappear leaving an arc in the
drawing area.
A
Screen Construction
D RAWING
7
P ARABOLA
1 Choose Draw>Parabola.
2 Place the cursor where you want the parabola to start and press the left mouse
button.
3 Drag the cursor to draw a line in the drawing area. Continue dragging the cursor
until the line has the same end point as the desired parabola, then release the
mouse button.
FactoryLink 6.6.0 / Application Editor Guide / 113
•
DRAWING OBJECTS
•
Drawing a Legend
•
•
4 Place the pointer anywhere on the line and press the left mouse button. Drag the
cursor until the parabola is the desired shape, then release the left mouse button.
D RAWING
A
L EGEND
A legend is a rectangle that is already scaled with division marks and labeled
from 0 to 100. You can use legends as labels for the axes of graphs and charts or
with movable objects, such as a slider.
Perform the following steps to draw a ruled legend:
1 Choose Draw>Legend.
2 Place the cursor where you want the legend to display and click the left mouse
button.
3 Drag the cursor to draw a box in the drawing area.
4 Continue dragging the cursor until the box is the desired shape, then release the
left mouse button. A rectangle is displayed with a scale that is divided into five
equal units and each unit is divided into quarters. The scale is labeled from 0 to
100.
114 / FactoryLink 6.6.0 / Application Editor Guide
DRAWING OBJECTS
Adding Text to a Drawing
The scale grows and shrinks with the size of the rectangle. If you draw the
rectangle vertically, the scale is displayed on the right; and if you draw the
rectangle horizontally, the scale is displayed along the top.
A DDING TEXT
TO A
D RAWING
1 Choose Draw>Text.
2 Place the cursor where you want the text to display and click the left mouse
button to display a text bar.
3 Type the text you want to display in the drawing.
FactoryLink 6.6.0 / Application Editor Guide / 115
7
Screen Construction
When drawing objects to be animated are data input fields (such as text objects),
the order you draw the objects in determines the order the cursor moves to each
field when the TAB key is pressed.
•
DRAWING OBJECTS
•
Creating Composite Objects
•
•
C REATING C OMPOSITE O BJECTS
Composite objects are collections of objects. Two or more objects grouped together
form a single object.
Group simple objects into composite objects in one of two ways.
• Combining—Groups two or more objects as a composite object retaining their
original shape and position.
• Connecting—Groups two or more objects as a composite object and connects
their points. The look of the object changes based on its point locations.
Combining Objects
The combining method groups two or more objects as a composite object, retaining
their original shapes and positions. Combine objects in one of two ways: using the
Edit menu or from the toolbar. This section describes how to combine objects using
the Edit menu.
Perform the following procedure to combine objects:
1 Select the objects you want to group.
2 Choose Edit>Combine.
The chosen objects are combined. The attributes, name and animation for each
individual object are preserved. A new object name is assigned to the composite
object.
Connecting Method
The connecting method joins two or more objects to form a single object. It does
this by adding a line from one end point to another end point until the group forms
a single object. Connection starts with the object closest to the lower-left corner of
the selected group. For example, if you draw two of the lines needed to form a
triangle as shown below, the third line is drawn to connect the two lines.
Before connect
116 / FactoryLink 6.6.0 / Application Editor Guide
After connect
DRAWING OBJECTS
Creating Composite Objects
Connect objects in one of two ways: through the Edit menu or from the toolbar.
Perform the following procedure to connect objects:
1 Select the objects you want to connect.
2 Choose Edit>Connect.
A new object name is assigned to the composite object.
Separating Objects
When two or more objects have been combined or connected to comprise a
composite object, you can separate them as individual objects.
Perform the following procedure to separate objects:
1 Select the objects you want to ungroup. Refer to “Selecting Objects” on page 107
2 Choose Edit>Separate.
The name, attributes and animation for each individual object are preserved, but
the composite object name is discarded.
Note: When a composite object is created, each individual object
can be defined to have the same or different attributes and
animation. When a composite object is separated, each
individual object maintains the attributes and animation
defined for it.
FactoryLink 6.6.0 / Application Editor Guide / 117
7
Screen Construction
for details.
•
DRAWING OBJECTS
•
Creating Composite Objects
•
•
118 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 8
Editing Objects
You can perform many actions upon an object once it is selected. This chapter
describes how to perform the following actions.
• Setting object attributes
• Copying an object
• Pasting an object
• Deleting an object
• Aligning an object
8
• Moving an object to front or back
Screen Construction
• Reshaping an object
• Moving the placement of an object
• Rotating an object
• Resizing an object
• Resizing text
• Reversing last action
FactoryLink 6.6.0 / Application Editor Guide / 119
•
EDITING OBJECTS
•
The Editing Tools
•
•
T HE E DITING TOOLS
The Application Editor provides a variety tools through the menus and the Tools
box to assist you in editing a drawing.
The Menus
The Attributes and Edit menus are the primary menus used for editing the
components of your screens. The Attributes menu includes commands for
specifying the line, fill, text and screen styles and for defining an objects name.
The Edits menu includes commands for selecting and editing objects.
The Tools Box
The Tools box provides quick access to many of the drawing tools found in the
Attributes and Edit menus. It also includes tools found in other menus, such as
Draw and Animation.
The Tools box is displayed by default. Choose View>Toolbox to toggle the Tools box
open or closed.
The following illustrates the Tools box and identifies the tools used for editing and
selecting objects.
Select
Reshape
Rotate
Cut
Copy
Paste
Align
Bring to Front
Send to Back
Combine
Connect
Separate
Line Attributes
Fill Attributes
Text Attributes
Other tools will be identified as needed throughout this manual.
120 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Setting Object Attributes
S ETTING O BJECT A TTRIBUTES
You can assign attribute and animation to an object. The attributes of an object
control how it is displayed, such as its color, fill pattern, or text style. The chart
below shows the attributes associated with each object type.
Table 8-0 Attributes Associated with each Object Type
Attributes
Line
Fill
Text
Object
Color
Style
Color
Style
Font
Color
Style
Line
X
X
X
X
Arc
X
X
X
X
Parabola
X
X
X
X
Box
X
X
X
X
Ellipse
X
X
X
X
Polygon
X
X
X
X
Spline
X
X
X
X
Text
X
X
X
X
X
X
X
Legend
X
X
X
X
X
X
X
8
FactoryLink 6.6.0 / Application Editor Guide / 121
Screen Construction
The rest of this chapter describes how to set or change these attributes for objects
included in your drawings.
•
EDITING OBJECTS
•
Setting Line Attributes
•
•
S ETTING L INE A TTRIBUTES
Each time you start the Application Editor, the line color is set to white and the
line style to solid. This section describes how to change the color and style (solid or
dash) of a line. Once set, any new lines drawn inherit the existing attributes. If
you want to change the color or style of an existing line, you must select the line
before performing the following procedure.
1 If you are changing the color and style attributes of existing lines, choose the
object containing the lines; otherwise, proceed to the next step.
2 Choose Attributes>Lines to display the Line Attributes dialog. The Sample field shows
the current settings. This field changes when you make a new selection.
3 Make a choice in each of the following fields:
Color
Select the line color. This palette provides 64 colors. For VGA
monitors that display only 16 colors, unavailable colors show as
multi-colored dots. The line is shown in the closest solid color
available if you choose a dithered color.
Style
Choose a line style. Your options are a solid or a dashed line.
Visible
Specify whether or not the line is visible. If the line is chosen, it is
visible.
4 Click on OK to save the line attributes. Any chosen lines and any new lines drawn
acquire these attributes.
122 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Setting Object Fill Attributes
S ETTING O BJECT F ILL A TTRIBUTES
Each time you start the Application Editor, the fill style is set to transparent, the
foreground fill color to white, and the background fill color to black. This section
describes how to change the fill color and transparency of an object.
Once set, any new objects drawn inherit the existing attributes. If you want to
change the fill color or transparency of an existing object, you must select the
object before performing the following procedure.
1 If you are changing the fill color and transparency attributes of an existing object,
select it; otherwise, proceed to the next step.
2 Choose Attributes>Fill to display the Fill Attributes dialog. The Sample field shows the
current settings. This field changes when you make a new selection.
8
Screen Construction
3 Select a fill style from the Style palette. This can be one of the following:
Solid
Transparent
Hatch
Fills objects with the color chosen in the Foreground color palette.
Any background color chosen is ignored.
Makes objects transparent so only the object outline is visible.
The color used is the color chosen for displaying lines.
Fills objects with a pattern of lines or dots (depending on the
platform) in the foreground and background colors chosen.
FactoryLink 6.6.0 / Application Editor Guide / 123
•
EDITING OBJECTS
•
Setting Object Fill Attributes
•
•
4 Select a foreground color from the Foreground color palette. This palette provides
64 colors. For VGA monitors that can display only 16 colors, the other 48 colors
show as multi-colored dots.
5 If you select hatch as the fill style, select a background color from the Background
color palette. This palette provides 64 colors. For VGA monitors that can display
only 16 colors, unavailable colors show as multi-colored dots.
6 Click on OK to save the attributes. Any chosen objects and any new objects drawn
acquire these attributes.
124 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Setting Text Attributes
S ETTING TEXT A TTRIBUTES
You can set the text attributes of font, font height, color, style, and alignment for
new text, or change these attributes for existing text. The font, font height, color,
and style attributes apply to all text, static or animated. The alignment attribute
applies only to animated text.
Each time you start the Application Editor, the text color is set to white, the font
size is set to 16-point, and the font style is set to System. This section describes
how to change these attributes for a text object.
Once set, any new text objects drawn inherit the existing attributes. If you want
to change the attributes of an existing text object, you must select the object
before performing the following procedure.
1 If you are changing the attributes of an existing text object, select it; otherwise,
proceed to the next step.
8
show in the Preview box at the bottom of this box.
3 Choose from the following attributes:
Font Name
Font Size
Select the font you want to use from the available typefaces. Use
the scroll bar to display all the options. For portability to other
platforms, use True Type or Type 1 fonts.
Select the size of the font ranging between 4 to 128 points.
FactoryLink 6.6.0 / Application Editor Guide / 125
Screen Construction
2 Choose Attribute>Text to display the Text Attributes dialog. The current settings
•
EDITING OBJECTS
•
Setting Text Attributes
•
•
Text Color
Background Color
Style
Select the color of the text. This palette provides 64 colors. For
VGA monitors that display only 16 colors, unavailable colors
show as multi-colored dots.
Select the color displayed behind the text. This palette provides
64 colors. For VGA monitors that display only 16 colors, the other
48 colors show as multi-colored dots.
Choose a text style. This can be one of the following:
Bold
Displays text in boldface type.
Italic
Displays text in italicized type.
Underline Displays text with a line under it.
Opaque Places a solid background behind the text to hide
anything behind the text. Animated text always
receives an opaque background.
Border Places a box around the text in the color and style
chosen for line attributes.
Variable Enables resizing using the resize handles. This
option is only used in OS/2 and we recommend you
do not use it because of portability issues. Other
platforms let you proportionally resize text
without this option chosen.
Clip Hides the end of static text at run time when the
text exceeds its bounding box. (Static text is
unanimated text.) For example, if the window is
slightly larger at run time than when you created
it, the text size may increase to maintain the same
proportions. In some cases the new font size is
larger than the size of the bounding box, causing
the text to exceed its bounding box.
Alignment
Select the alignment of animated text within the text field. This
applies only to text animated as input text or output text and can
be one of the following:
Left Left-justifies the text within the field. You must
specify this option for text fields that contain
messages.
Center Centers text horizontally within the field.
126 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Cutting, Copying, Pasting, and Deleting Objects
Right Right-justifies the text within the field. You must
specify this option for text fields that contain
analog text.
Top Places the text at the top of the field.
Middle Centers the text vertically within the field.
Bottom Places the text at the bottom of the field.
4 Click on OK to save the attributes. Any chosen objects and any new objects drawn
acquire these attributes.
C UTTING , C OPYING , P ASTING ,
AND
D ELETING O BJECTS
Cutting an Object
8
This section describes how to cut objects.
1 Select the objects you want to cut.
2 Choose Edit>Cut.
The name, attributes, and animation for each individual object are preserved with
the object.
Copying an Object
This section describes how to copy objects.
Perform the following procedure to copy objects:
1 Select the objects you want to copy.
2 Choose Edit>Cut.
The name, attributes, and animation for each individual object are preserved with
the object.
FactoryLink 6.6.0 / Application Editor Guide / 127
Screen Construction
Perform the following procedure to cut objects:
•
EDITING OBJECTS
•
Cutting, Copying, Pasting, and Deleting Objects
•
•
Pasting an Object
This section describes how to paste objects that have been copied or cut.
Perform the following procedure to paste objects:
1 Cut or copy the objects you want to paste, as described above.
2 Choose Edit>Paste. The cursor changes to a crosshair (+).
3 Position the cursor in the area of the drawing where you would like to place the
objects and press the left mouse button. The objects are pasted into the drawing.
The name, attributes, and animation for each individual object are preserved with
the object.
The Application Editor remains in paste mode until a different function is chosen.
Repeated clicks of the left mouse button result in additional pastes.
Deleting an Object
This section describes how to delete objects.
Perform the following procedure to delete objects:
1 Select the objects you want to delete.
2 Choose Edit>Delete. The objects are removed from the drawing area.
128 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Moving and Aligning Objects
M OVING
AND
A LIGNING O BJECTS
Moving an Object
When you select an object, eight handles display around the object and one is
displayed in the middle of the object. You can use the middle handle to move the
object to another location.
Move Handle
Perform the following steps to move an object:
2 Place the cursor on the middle handle, then press and hold the left mouse button.
The handles disappear.
3 Drag the object to its new location, then release the mouse button.
FactoryLink 6.6.0 / Application Editor Guide / 129
Screen Construction
1 Select the object you want to move.
8
•
EDITING OBJECTS
•
Moving and Aligning Objects
•
•
Aligning Objects
The Application Editor aligns objects based on their bounding boxes. You can align
objects along a vertical line (left, center, or right), along a horizontal line (top,
center, or bottom), or equidistant so they have an equal amount of space between
them. Perform the following steps to align objects.
1 Select the objects you want to align.
2 Choose Edit>Align to display the Align, Space, and Size dialog.
Alignment
Options
Equidistant
Spacing
Options
Sizing
Options
This dialog provides options that control:
• Horizontal and vertical alignment
• Space between objects
• Size of objects
130 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Moving and Aligning Objects
3 Select the box next to the horizontal and vertical alignment you want. An X is
displayed in the box. If you do not define an alignment for either horizontal or
vertical, the objects keep their current alignment.
Vertical (column)
alignment
Left side alignment
Center column alignment
Right side alignment
Bottom alignment
Horizontal (row)
alignment
Center row alignment
Top alignment
4 Select the box next to the equidistant spacing you want. An X is displayed in the
box.
Equidistant vertical (column) spacing
5 Select the box next to the sizing you want. An X is displayed in the box. Sizing
stretches or shrinks all chosen objects to the same size, either horizontally or
vertically.
Vertical (column)
stretching
Vertical (column) shrinking
Horizontal (row) shrinking
Horizontal (row)
stretching
6 Click on OK. The chosen group of objects align accordingly.
Note: If you use the vertical Space option with text objects
whose bounding boxes are larger than the text, the space
between the text is unequal, although the space between the
bounding boxes is equal. To ensure equal vertical spacing
between text objects whose bounding boxes are larger than the
text, first use the Grow/Shrink option on the chosen text objects
to shrink the bounding boxes to the text, then use the vertical
Space option.
FactoryLink 6.6.0 / Application Editor Guide / 131
Screen Construction
Equidistant
horizontal
(row) spacing
8
•
EDITING OBJECTS
•
Rotating an Object
•
•
R OTATING
AN
O BJECT
The rotate command allows you to rotate a polygon, line, box, ellipse, arc,
parabola, or spline 90 degrees in a clockwise direction. Composite objects made up
of any of the previously mentioned simple objects can also be rotated.
The pivot point is always set to the bounding box center.
1 Select the object you want to rotate.
2 Choose Edit>Rotate. This turns the object 90 degrees clockwise.
3 Choose Edit>Rotate to turn the object again.
132 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Snapping an Object to the Grid
S NAPPING
AN
O BJECT
TO THE
G RID
This section describes how to snap an object to the grid.
1 Select the objects you want to snap.
8
nearest grid points. The object is resized to fit in its bounding box.
FactoryLink 6.6.0 / Application Editor Guide / 133
Screen Construction
2 Choose Edit>Snap. This snaps the four corners of the object bounding box to the
•
EDITING OBJECTS
•
Reshaping and Resizing
•
•
R ESHAPING
AND
R ESIZING
Reshaping an Object
This section describes how to reshape an object.
1 Select the object you want to reshape.
2 Choose Edit>Reshape. The object’s outline is displayed with handles.
3 Point to a handle, press and hold the left mouse button and drag it. Notice the
object changes shape in response to the direction you drag the mouse. Release the
mouse button when you finish.
4 Repeat Step 3 for the other handles to adjust the shape of the object.
5 Choose the Select mode to cancel the Reshape mode, When the shape is
satisfactory.
Resizing an Object
When you select an object, eight handles display around the object and one is
displayed in the middle of the object. You can use the eight handles surrounding
the object to stretch or shrink the object.
Resize handles
Use the resize handles to stretch or shrink objects in the following directions. You
cannot use the resize handles to change the shape of the object.
• Vertically—To resize vertically, use any of the three resize handles above or
below the object.
• Horizontally—To resize horizontally, use any of the three resize handles at the
left or right of the object.
• Vertically and horizontally—To resize both vertically and horizontally, use the
corner resize handles.
You can also use handles to proportionally resize text objects. You cannot resize
text nonproportionally.
134 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Reshaping and Resizing
Perform the following steps to resize an object:
1 Select an object. Handles display around the object.
2 Place the cursor on one of the handles and press the left mouse button. The
handles disappear.
3 Drag the cursor in the direction you want to stretch or shrink it until you have
achieved the desired size, then release the mouse button.
When you resize an object smaller than its handles, it may be difficult to select the
object without selecting the handles. In this case, drag a border around the object
to select it.
Caution: Do not reduce the size of a graphic object to a
You can stretch text until it reaches its maximum font size. Once you reach
maximum font size, further stretching only increases the size of the text bounding
box. The text remains at its maximum size.
Stretching a text bounding box beyond the text maximum font size affects the
vertical spacing between text objects.
Resizing Text
Occasionally, the beginning or end of text disappears when text is resized. This
can happen when you resize a window at development or run time or when
FactoryLink resizes a drawing to fit inside its run-time window.
Before
After
FactoryLink 6.6.0 / Application Editor Guide / 135
8
Screen Construction
dimension of less than ten pixels in height or width
because you may not be able to restore the object to
its original size. If you lose the original dimensions
of an object, reload the drawing. Refer to
“GraphicObject.Width” on page 294 and
“GraphicObject.Height” on page 295 for more
details.
•
EDITING OBJECTS
•
Object Placement
•
•
Press F8 or choose Recalc Text Clip from the Edit menu to correct this problem,.
This recalculates the text bounding box so all text is displayed.
To avoid text clipping:
• Create your drawings in actual size view and choose Recalc Text Clip from the
Edit menu before saving the drawing.
4 If your platform supports scalable fonts, such as True Type or Type 1 fonts, use
them. Fonts that only come in predefined sizes are more likely to clip.
O BJECT P LACEMENT
Moving and Object Front or Back
This section describes how to move an object in front of or behind another object.
1 Select the objects you want to move to the front or back.
1 Choose Move to Front or Move to Back from the Edit menu, or choose the Move to
Front or Move to Back tools from the toolbar. The object moves in front of or
behind all other objects.
136 / FactoryLink 6.6.0 / Application Editor Guide
EDITING OBJECTS
Working with Object Names
W ORKING
WITH
O BJECT N AMES
Renaming an Object
When objects are drawn, they are given a numerical object name.
Perform the following steps to assign a unique name to an object:
1 Select the object you want to rename.
2 Choose Object Name from the Attributes menu. The Object Name dialog is
displayed.
8
4 Click on OK.
Searching for an Object in a Drawing
This section describes how to find an object in a drawing using its object name.
1 Choose Find from the Edit menu. The Select Object Name dialog is displayed,
listing all the top-level objects in the active drawing.
2 Select an object name from the list or enter an object name in the Find Object field.
Click on OK. The object with that name is surrounded by handles, indicating its
location.
FactoryLink 6.6.0 / Application Editor Guide / 137
Screen Construction
3 Enter the name you want to assign to the object.
•
EDITING OBJECTS
•
Working with Object Names
•
•
138 / FactoryLink 6.6.0 / Application Editor Guide
Data Reporting Configuration Guide
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Part III
Object Animation
139
•
•
•
•
Chapter 9
Animating Objects
You can animate objects in a graphics file to perform an action, such as to change
color, size, and position, or to display information. The action occurs based on the
value of an element in the real-time database. Animating objects links the object
to the data element that controls its action. There are two levels of animation:
• Object level—Animation is defined for a single object. You can apply the
following types of animation to an object:
• Input text—Operator can write values to a real-time database element.
• Output text—Displays current value of a real-time database element.
• Chart—Graphically displays element values on a strip chart.
• Legend—Displays the chart range.
• Pen—Draws the element value on a chart.
• Paint—Changes color based on limits.
• Bar—Graphically displays element values on a bar chart.
• Symbol—Graphically displays element values as symbols.
• Button—Performs an action, such as displaying another drawing.
• Template—Preserves objects, their attributes and animation for repeated use
as a baseline.
• Power VB—Allows animation scripts to be attached to FactoryLink 6.6.0
graphic objects.
• Drawing level—Animation is defined for the drawing. You can apply the
9
following types of animation to a drawing:
• Beep—Produces an audible beep.
• Function key—Performs an action in response to pressing a key.
This chapter discusses the concepts you must understand to animate objects. The
remainder of this part describes how to animate objects for each animation type.
FactoryLink 6.6.0 / Application Editor Guide / 141
Object Animation
• Print screen—Prints the contents of a drawing window.
•
ANIMATING OBJECTS
•
Animation Tools
•
•
A NIMATION TOOLS
The Application Editor provides a variety tools through the menus and the Tools
box to assist you in editing a drawing.
The Menus
The Animation menu is the primary menu used for animating the components of
your screens. It includes commands for animating bars, buttons, symbols, charts,
legends, painting, and specifying text as input or output fields.
The Tools Box
The Tools box provides quick access to many of the drawing tools found in the
Animate menu. It also includes tools found in other menus, such as Draw and
Edit.
The Tools box is displayed by default. Choose View>Toolbox to toggle the Tools box
open or closed.
The following illustrates the Tools box and identifies the tools used for animating
and selecting objects.
Select
Output Text
Input Text
Paint
Bar
Symbol
Chart
Button
Legend
Test
Other tools will be identified as needed throughout this manual.
142 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING OBJECTS
Static and Animated Objects
S TATIC
AND
A NIMATED O BJECTS
Objects not animated are considered static. A drawing can contain a combination
of both object types. If you overlap an animated object with a static object, you
may get unwanted results. For example, if you place a static object on top of an
animated object, the animated object moves in front of the static object when the
value of the element associated with the animated object changes.
To prevent this from happening, insert the -01 flag in the Program Arguments field
for the GRAPH task from the System Configuration Information panel.
The argument causes the static object to be redrawn when the value of the
animated object it overlaps changes.
9
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 143
•
ANIMATING OBJECTS
•
Dynamic and Static Attributes
•
•
D YNAMIC
AND
STATIC A TTRIBUTES
Some of the animation dialogs in the Application Editor have optional fields that
let you assign attributes associated with these fields to an object at run time.
Attributes you can assign to an object at run time are called dynamic attributes.
The following table lists these optional fields and their associated attributes.
Table 9-0 Object Attributes
Optional field
Foreground Color Control
Associated attribute
The object foreground color.
Background Color Control The object background color.
X Position Control
The object’s horizontal position in the
application drawing.
Y Position Control
The object’s vertical position in the
application drawing.
Dynamic attributes override static attributes.
Perform the following steps to assign an attribute to an object at run time:
1 Enter a tag name referencing an element in the appropriate optional field during
animation.
2 Configure another task, such as Math & Logic, to change the value of the element.
Run-time graphics reads this value and uses it to display the object in the
application drawing.
3 Set the -t flag in the Program Arguments field for the GRAPH task from the
System Configuration Information panel to control which attributes are displayed
(static or dynamic) when a screen is redrawn.
• If you set the -t flag, static attributes display after a screen is redrawn.
• If you do not set the -t flag, the dynamic attributes display after a screen is
redrawn.
144 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING OBJECTS
Object Level Animation
O BJECT L EVEL A NIMATION
Not all objects can be animated with all animation types. The following table lists
the animation types permitted for each object type.
Table 9-0 Animation Types for Each Object Type
Animation
Object
Input
Text
Out
Text
Paint
Bar
Sym
Button
PwrVB
Line
X
X
X
X
X
Arc
X
X
X
X
X
Parabola
X
X
X
X
X
Box
X
X
X
X
X
Ellipse
X
X
X
X
X
Polygon
X
X
X
X
X
Spline
X
X
X
X
X
X
X
X
X
Text
Legend
X
Lgnd
X
Chart
X
X
X
When you open a drawing and open the Animation menu without an object
selected, a check mark displays next to the animation characteristic selected for
the drawing.
FactoryLink 6.6.0 / Application Editor Guide / 145
Object Animation
When you select an animated object and open the Animation menu, a check mark
displays next to each animation characteristic selected for the object. The
animation also shows as a check mark on the toolbar.
9
•
ANIMATING OBJECTS
•
Testing the Animation of a Drawing
•
•
TESTING
THE
A NIMATION
OF A
D RAWING
Perform the following steps to test the animation and attributes assigned to an
object:
1 Choose Animation>Test to display all static and animated objects in its window. If
desired, resize the window the drawing is displayed in.
2 Choose Test Cycle (or press Enter) to test the animation of objects other than
buttons, function keys, or Power VB. Each animated object makes a single step
through its animation limits.
This tests each animated object except for those animated as buttons or function
keys by stepping once through its animation limits.
3 Choose a button or press a function key to test its animation. A dialog displays
indicating the action taken and tag name associated with the button or function
key.
Button or Function Key Detected
Key: key_name, Action: action,
!Tagname: name
where
key_name
Is the key selected from the F-KEY field on the Button or Function
Key dialog. If a key combination is used, key_name is the
combination of keys from the F-KEY field and the Shift field.
action
Is the selected for the button or function key from the Action field
on the Button or Function Key dialog.
name
Is the name of the element defined for the button or function key.
When this box displays, it demonstrates the button or function key performs as
animated.
4 Click on OK to clear the box from the screen.
5 To end the test at any time, choose Test again to return to the drawing mode.
146 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING OBJECTS
Color/Analog Value Table
C OLOR /A NALOG VALUE TABLE
This section provides the analog values of the colors in the color palette shown
below.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
The names of the colors in the color palette and their associated analog values are
displayed in the following table.
Table 9-0 Color Analog Values
Analog
Value
Color
Analog
Value
Color
Red
1
Orange-Red
2
Orange-Red
3
Yellow Orange
4
Yellow
5
Green-Yellow
6
Yellow-Green
7
Pale Green
8
Green
9
Lime Green
10
Sea Green
11
Aquamarine
FactoryLink 6.6.0 / Application Editor Guide / 147
Object Animation
0
9
•
ANIMATING OBJECTS
•
Color/Analog Value Table
•
•
Table 9-0 Color Analog Values (Continued)
Analog
Value
Color
Analog
Value
Color
12
Cyan
13
Light Blue
14
Sky Blue
15
Medium Blue
16
Blue
17
Midnight Blue
18
Cornflower Blue
19
Orchid
20
Magenta
21
Pink
22
Coral
23
Firebrick
24
Indian Red
25
Sienna
26
Brown
27
Sandy Brown
28
Khaki
29
Light Olive Green
30
Med Olive Green
31
Dark Olive Green
32
Spring Green
33
Forest Green
34
Dark Green
35
Dark Aquamarine
36
Turquoise
37
Cadet Blue
38
Slate Blue
39
Steel Blue
40
Navy Blue
41
Blue-Violet
42
Violet
43
Dark Orchid
44
Red-Violet
45
Plum
46
Maroon
47
Dark Maroon
48
Black
49
Dark Gray-4
50
Dark Gray-3
51
Dark Gray-2
52
Dark Gray-1
53
Med. Gray-6
148 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING OBJECTS
Color/Analog Value Table
Table 9-0 Color Analog Values (Continued)
Analog
Value
Color
Analog
Value
Color
54
Med. Gray-5
55
Med. Gray-4
56
Med. Gray-3
57
Med. Gray-2
58
Med. Gray-1
59
Light Gray-4
60
Light Gray-3
61
Light Gray-2
62
Light Gray-1
63
White
9
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 149
•
ANIMATING OBJECTS
•
Blink Rate
•
•
B LINK R ATE
Each animation type that allows for the blinking of an object provides a rate
choice of slow or fast blink. The fast blink speed within an application is controlled
by setting the -bxxxx parameter in the System Configuration panel where xxxx is
the period of blinking in milliseconds. The default is 1000 ms if this parameter is
not set.
150 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 10
Animating
Input/Output Fields
You can animate text objects in two ways:
• As output fields—Displays numeric values or text messages.
• As input fields—Accepts input from the keyboard and writes it to a real-time
database element.
This chapter describes how to animate text objects as input or output fields.
10
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 151
•
ANIMATING INPUT/OUTPUT FIELDS
•
Animating Text as an Input Field
•
•
A NIMATING TEXT
AS AN I NPUT
F IELD
A text object animated as an input field accepts input from the keyboard and
writes it to a real-time database element. At run time, a reverse video cursor
displays in the input text field. If more than one field is animated as input text,
the cursor displays in input fields based on the object name.
At run time:
• Press Tab to move through the fields according to the input text’s object name.
Input text displays in the order it is created.
• When positioned in a field, press Esc to delete old data from the field before
typing new data.
• When you enter an out-of-range value in a field, a message displays notifying
you of the error. Until you acknowledge the error, the system will not update
animated objects. When you acknowledge the error, the system positions the
cursor in the field containing the error.
Perform the following steps to animate a text object as an input field:
1 Choose Draw>Text.
2 Place the cursor where you want the text to display and click the left mouse
button to display a text bar.
3 Type the format of the text to be entered in this field. Type an uppercase X for each
character position. For example, type XXXXX for a five-character field. Input is
compared to this format. If any text is entered in this field that exceeds the limits
set by this format, the entry is rejected.
If the text to be entered in this field will contain a decimal point, you must include
a decimal in the text format, as in XXX.XXX. Input is compared to this format. If
the number of digits entered to the left of the decimal exceed the number of digits
defined in the format, the entry is rejected and asterisks are written to the
element. If the number of digits entered to the right of the decimal exceed the
number of digits defined in the format, the entry is accepted; however, it is
truncated to fit in the available positions.
If the text to be entered in this field defines the name of a window and the name of
a drawing to open in that window, use the following format if the specified action
for this field is TOP:
XXXXXXXXX[:XXXXXX]
152 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING INPUT/OUTPUT FIELDS
Animating Text as an Input Field
where the Xs before the colon define the window name. You can specify up to 16
positions to hold the window name. The Xs after the colon define the drawing
name. You can specify up to 8 positions to hold the drawing name. The drawing
name is optional.
If the text to be entered in this field defines the name of a window and the name of
a drawing to open in that window, use the following format if the specified action
for this field is DRW:
[XXXXXXXXX]:XXXXXXX
where the Xs before the colon define the window name. You can specify up to 16
positions to hold the window name. The window name is optional. The Xs after the
colon define the drawing name. You can specify up to 8 positions to hold the
drawing name.
4 The Application Editor remains in text mode so you can place the cursor in
multiple locations to add text. Change to select mode to exit text mode.
5 Select the text you want to animate.
6 Choose Animate>Input Text to display the Input Text Animation dialog. The name of
the object selected displays in the title.
10
Tag
Enter a name to reference the element that receives the input.
Valid Entry: standard tag name
Valid Data Type: digital, analog, longana, float, message
FactoryLink 6.6.0 / Application Editor Guide / 153
Object Animation
7 Provide the following information in this dialog:
•
ANIMATING INPUT/OUTPUT FIELDS
•
Animating Text as an Input Field
•
•
Range Check
Parameters
Range check parameters define the numerical limits of the
element. The operation defined in the Action field of this dialog is
not performed if the result of the operation exceeds these limits.
These fields do not apply if the tag defined in the Tag field is a
message. This field is optional.
Maximum Enter a number to indicate the high range for
the limit.
Minimum Enter a number to indicate the low range for the
limit.
Action
Defines the action taken when text is entered in this field. This
can be one of the following:
SET Writes the value entered in the input field to the
real-time database element referenced by the
name defined in the Tag field on this dialog. This
action and the NUL action are the only two actions
valid for a message tag.
ADD Adds the value entered in the text input field to
the current value of the database element
referenced by the name defined in the Tag field on
this dialog.
SUB Subtracts the value entered in the text input field
to the current value of the database element
referenced by the name defined in the Tag field on
this dialog.
TOP Opens the window specified in the input field and
moves it to the top.
If a drawing is also specified, the drawing displays
in the window.
If a drawing is not specified, the default drawing
specified for the window displays.
154 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING INPUT/OUTPUT FIELDS
Animating Text as an Input Field
DRW Opens a drawing and places it in a window. The
DRW action only loads a drawing into a window. It
does not change the order of windows or make a
window active.
If a window is also specified, the drawing displays
in the specified window.
If a window is not specified, the drawing displays
in the current window (the window where the
operator types the window name).
PAN Moves back and forth along a chart using the
numeric range as the panning distance. This is
valid only if you are showing chart data in
historical mode. Refer to the task where you have
configured your chart for more details.
ZM Zooms in or out to expand or reduce the time
period viewed on a chart. This is valid only if you
are showing chart data in historical mode. Refer to
the task where you have configured your chart for
more details.
MOD Switches between real-time and historical mode
when displaying data on a chart. If the tag is set to
0, real-time mode is displayed. If it is set to 1,
historical mode is displayed.
NUL No action is taken. This action and the SET action
are the only two actions valid for a message tag.
Options>
Background
updates
Color Controls
Choose this option if you want to use the field as both an input
text and an output text field. If this option is not selected, the
field can only be used to enter text.
Defines the text foreground and background colors and blink rate
of the text field.
FactoryLink 6.6.0 / Application Editor Guide / 155
10
Object Animation
The actions ON, OFF, TGL (toggle), ENB (enable), MON (momentary on), MOF
(momentary off), and STP (stop) are available but rarely used as actions for input
text. If any of these actions are defined, the action occurs whenever text is entered
into the input text field. For example, if the input text tag action is ON, anytime
text is entered in the input field, the tag is set to ON.
•
ANIMATING INPUT/OUTPUT FIELDS
•
Animating Text as an Input Field
•
•
Foreground Enter the name of an analog tag that defines the
color of choice for this text field at run time.
When the Tag Definition dialog displays, enter the
analog in the Value field that corresponds to the
desired color. Refer to Chapter 9, “Animating
Objects” for a list of analog values that correspond
to colors on the color palette.
Background Enter the name of an analog tag that defines the
color of choice for the text field background at run
time.
When the Tag Definition dialog displays, enter the
analog in the Value field that corresponds to the
desired color. Refer to Chapter 9, “Animating
Objects,” for a list of analog values that correspond
to colors on the color palette.
Blink Enter the name of a digital tag that controls the
blink rate of the input text. This tag is initialized
with a value according to the blink speed chosen.
This can be one of the following:
None Text does not blink. This is the default.
Slow Text blinks slowly.
Fast Provides a blink every second.
Position Controls
Defines the horizontal and vertical location of the text field in the
drawing.
X Enter the name of an analog tag that controls the
horizontal location of the object in the drawing.
The value of the left side of the drawing is 0 and
the value of the right side of the drawing is 32000.
If you leave the field blank, the text displays
where you drew it. If you specify a tag without
writing a value to it, the value defaults to the
default value of the tag you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
horizontally within the display.
156 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING INPUT/OUTPUT FIELDS
Animating Text as an Input Field
Y Enter the name of an analog tag that controls the
vertical location of the object in the drawing. The
value of the bottom of the drawing is 0 and value of
the top of the drawing is 32000.
If you leave the field blank, the text displays
where you drew it. If you specify a tag without
writing a value to it, the value defaults to default
value of the tag you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
vertically within the display.
Object Security
Defines the security of the object. Refer to Part V, “Security” in
this book for details on defining security classes and logins.
Security class Select the appropriate security class from the
pull-down list field.
Log Message Enter a text string to identify the object for the
security log.
8 Click on OK to save the animation information.
10
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 157
•
ANIMATING INPUT/OUTPUT FIELDS
•
Animating Text as an Output Field
•
•
A NIMATING TEXT
AS AN
O UTPUT F IELD
A text object animated as an output field can display the value of a real-time
database element.
Perform the following steps to animate a text object as output text:
1 Choose Draw>Text.
2 Place the cursor where you want the text displayed and click the left mouse
button to display a text bar.
3 Type the format of the text to be displayed in this field. Type an uppercase X for
each character position. For example, type XXXXX for a five-character field.
Output is compared to this format. If the output exceeds the limits set by this
format, the displayed text is truncated; however, the total width of the field must
be enough to accommodate the longest possible entry.
FactoryLink uses proportional font spacing in displaying the text. More space is
required to display the letter w than the letter i. The Xs used to mark the text
output set the character count and width of the field. If the displayed output is
within the character count but the size of the characters displayed exceeds the
width of the field, the text displayed will be truncated.
Include a decimal in the text format, as in XXX.XXX if the text to be displayed in
this field will contain a decimal point. Output is compared to this format.
If the field is not large enough to display a particular floating-point value and only
least-significant digits up to the decimal are truncated, the task writes the value
in the number of available character positions.
If the task truncates the decimal or any digits to the left of the decimal, the task
does not write the value. Instead, it writes asterisks indicating significant digits
are lost.
If you do not specify a decimal in the field, the task writes floating-point values
with all of the digits to the left of the decimal and as many digits as possible to the
right of the decimal.
If the text to be displayed in this field is the date and time, you can enter the
format you want to use to display this information. You can specify any
combination of the following. Separate formats with the spaces and punctuation
marks (colons, dashes, commas) you want shown at run time.
year
Displays a four-digit year (1995)
158 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING INPUT/OUTPUT FIELDS
Animating Text as an Output Field
yr
mon
mo
Displays a two-digit year (95)
Displays an alpha month abbreviation (Feb)
Displays a two-digit month (01-12)
dy
Displays a two-digit day of month (01-31)
hr
Displays military hours (0-23)
ah
Displays hour of day (1-12)
mi
Displays minute (0-59)
sc
Displays second (0-59)
ap
Displays two-character am/pm indicator
dow
Displays day of the week
Note: FactoryLink supports only these English-language
format tokens.
4 The Application Editor remains in text mode so you can place the cursor in
multiple locations to add text. Change to select mode to exit text mode.
5 Select the text you want to animate.
6 Choose Animation>Output Text to display the Output Text Animation dialog.
10
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 159
•
ANIMATING INPUT/OUTPUT FIELDS
•
Animating Text as an Output Field
•
•
7 Specify the following information:
Tag
Enter a name to reference the element displayed in the text field.
To display the start time for a chart, you must use the same name
defined in the Starting Time field on the Chart Animation dialog.
To display the end time for a chart, you must use the same name
defined in the Ending Time field on the Chart Animation dialog.
If you leave this field blank, the static text does not change. Place
a tag in the Alternate Comparison field to change the color of static
text.
The tag specified must be one of the following types: digital,
analog, longana, float, or message.
Color Changes
The fields in this area define color changes when limits are met.
To define a color, you must double click the color button to display
the color palette and select the desired color. The color button
reflects the color selected. Specify the following to effect color
changes. Do this for each limit you want to set. You can specify up
to 16 limits.
FG Specify the text color used when the limit is met.
BG Specify the background color of the text field
when the limit is met.
Blink Specify the blink animation used when the limit
is met. This field toggles through none (no
blink), slow (slow blink), or fast (fast blink).
None is the default.
*Limit Enter the limit where the change occurs. This
can either be a numeric value or the name of a
tag whose value defines the limit.
The tag specified must be one of the following
types: analog, longana, or float.
Alternate
Comparison Tag
Name of the tag to compare with the defined limits to determine
the text and background color. You can use the same tag name as
the one used in the Tag field of this dialog unless the tag type is
message. If you leave this field blank, no limit changes are
performed.
The tag specified must be one of the following types: digital,
analog, longana, or float.
160 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING INPUT/OUTPUT FIELDS
Animating Text as an Output Field
Foreground Enter the name of an analog tag that defines the
color of choice for this text field at run time.
When the Tag Definition dialog is displayed, enter
the analog in the Value field that corresponds to
the desired color. Refer to Chapter 9, “Animating
Objects” for a list of analog values that
corresponds to colors on the color palette.
Background Enter the name of an analog tag that defines the
color of choice for the text field background at run
time.
When the Tag Definition dialog displays, enter the
analog in the Value field that corresponds to the
desired color. Refer to Chapter 9, “Animating
Objects” for a list of analog values that
corresponds to colors on the color palette.
Blink Enter the name of a digital tag that controls the
blink rate of the input text. This tag is initialized
with a value according to the blink speed chosen.
This can be one of the following:
None Text does not blink. This is the default.
Slow Text blinks slowly.
Fast Provides a blink every second.
Position Controls
Defines the horizontal and vertical location of the text field in the
drawing.
If you leave the field blank, the text displays
where you drew it. If you specify a tag without
writing a value to it, the value defaults to the
default value of the tag you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
horizontally within the display.
FactoryLink 6.6.0 / Application Editor Guide / 161
10
Object Animation
X Enter the name of an analog tag that controls the
horizontal location of the object in the drawing.
The value of the left side of the drawing is 0 and
the value of the right side of the drawing is 32000.
•
ANIMATING INPUT/OUTPUT FIELDS
•
Animating Text as an Output Field
•
•
Y Enter the name of an analog tag that controls the
vertical location of the object in the drawing. The
value of the bottom of the drawing is 0 and value of
the top of the drawing is 32000.
If you leave the field blank, the text displays
where you drew it. If you specify a tag without
writing a value to it, the value defaults to default
value of the tag you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
vertically within the display.
8 Click on OK to save the animation information.
162 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 11
Animating a Chart
You can graphically display data on charts using chart animation. Chart
animation is used in trending data and in showing statistical data.
You can chart trending data from the real-time database or a relational database.
This chapter describes how to animate chart objects for showing data from the
real-time database. Refer to Part XII, ”Trending” in the Reporting for specific
details on animating charts to show trending data from a relational database.
Refer to “Drawing and Animating Display Charts” in the PowerSPC
Configuration Guide for details on animating charts to show statistical data.
The steps involved in creating and animating a real-time trend chart are
described below. References are made to sections of this manual that provide the
details for performing each step.
1. Draw a rectangle to contain the chart and at least one legend object next to it
or under it.
2. Animate the rectangle as a chart. Refer to “Animating a Real-Time Only Chart
Object” on page 164 for details on animating a chart.
3. Assign a pen. Refer to “Assigning a Pen for the Chart” on page 167 for details
on animating a pen.
4. Animate the legend. Refer to “Animating a Legend” on page 170 for details on
animating a legend.
11
Note: Trending performance is affected if the chart object is
FactoryLink 6.6.0 / Application Editor Guide / 163
Object Animation
partially covered by another window, or if the chart is only
partially visible in a window. If only a part of the chart object is
visible, the chart must be redrawn each time it is updated. This
slows performance, especially if the chart is updated frequently.
•
ANIMATING A CHART
•
Animating a Real-Time Only Chart Object
•
•
A NIMATING
A
R EAL -TIME O NLY C HART O BJECT
This section describes how to animate a rectangle as a chart object. The drawing
shown below is the sample chart you will animate using this procedure.
Legend
1 Select the object you want to animate as a chart. In this case, select the box to the
right of the legend.
2 Following the Attributes>Fill path, define a foreground color for the chart. You
cannot use a transparent or hatch fill style in a trend chart.
3 Choose Animation>Chart to display the Chart Animation dialog.
164 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING A CHART
Animating a Real-Time Only Chart Object
4 Complete the following required areas of the dialog:
Data Source or
Scroll Trigger Tag
Scroll Direction
Enter the name of the tag that triggers one pen movement in the
specified direction.
Select the direction you want the trend to move. This can be up,
down, right, or left.
Initial Chart
Duration
Select a scale for the chart and enter the amount of time the chart
can display. For example, if you type 2 in the field and choose
Hours, the chart displays two hours of data.
Chart Scroll
Frequency
Enter the frequency for plotting data, expressed as unit of time
per data point. For example, type 1 and choose Secs to plot a
point every second.
Starting Time
Leave this field blank. This field is not used for real-time only
trending.
Ending Time
Leave this field blank. This field is not used for real-time only
trending.
Zoom
Leave this field blank. This field is not used for real-time only
trending.
Pan
Leave this field blank. This field is not used for real-time only
trending.
Mode
Leave this field blank. This field is not used for real-time only
trending.
Cursor Position
# of X
Enter an analog tag that contains the value of the chart
background color.
11
Refer to Chapter 9, “Animating Objects"” for a list of analog
values that correspond to colors on the color palette. If you leave
this field blank, use the Fill Attributes dialog to define the
background color.
Object Animation
Chart Color
Enter an analog tag that controls the location of the value cursor
on the chart. A value cursor is a vertical or horizontal line,
depending on the trending direction, indicating the value of the
pen where it intersects the value cursor.
Enter a positive integer to indicate the number of grid lines on
the horizontal (X) axis. If you use zero or if the Grid On/Off element
is set to 0, grid lines are not drawn.
FactoryLink 6.6.0 / Application Editor Guide / 165
•
ANIMATING A CHART
•
Animating a Real-Time Only Chart Object
•
•
# of Y
Enter a positive integer to indicate the number of grid lines on
the vertical (Y) axis. If you use zero or if the Grid On/Off element is
set to 0, grid lines are not drawn.
Enter an analog tag that contains the value of the chart’s grid
color. Refer to Chapter 9, “Animating Objects"” for a list of analog
values that correspond to colors on the color palette.
Grid Color
Grid On/Off
Select a color for the grid. If the grid and the chart background
colors are the same, the grid is invisible.
Enter a digital tag to turn the grid on and off. If the value of the
tag is 1 (ON), a grid is displayed on the chart. If the tag is 0
(OFF), no grid is displayed. If you leave this field blank, the grid
cannot be activated.
5 Assign a pen to the chart. Refer to “Assigning a Pen for the Chart” on page 167 for
details.
166 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING A CHART
Assigning a Pen for the Chart
A SSIGNING
A
P EN
FOR THE
C HART
A trend chart uses pens to draw lines and plot data received from a database.
Each pen retrieves data from an element in the database.
You can create as many pens as you need to correspond to different sources of data
you want to trend. You can usually distinguish up to 15 pen colors, but a more
practical number is about 8 pens per chart.
Pen
Each pen draws a different trend
line. This chart uses two pens.
Pen 2
You can change the appearance of a trend line by changing the pen style. For
example, you can set the color of the line to blue, change the line style to dotted,
and place circles where points are plotted.
Each pen operates independently of the other pens. Pens within a single chart can
use different scales.
Perform the following steps to assign pens to a chart:
1 Choose Edit Pens from the Chart Animation dialog to display the Select Pen dialog.
2 Type the name of the pen object to be defined in the Pens field to create a new pen.
Select a pen from the pen list to edit a previously defined pen.
11
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 167
•
ANIMATING A CHART
•
Assigning a Pen for the Chart
•
•
3 Choose OK to display the Pen dialog.
4 Define the data to trend. One pen trends one data element.
5 Provide the following information for each pen used to trend data.
Tag
Tag name assigned to the real-time database element trended by
this pen. The tag specified must be one of the following types:
analog, longana, or float.
Database
Leave this field blank. This field is not used for real-time only
trending.
Table
Leave this field blank. This field is not used for real-time only
trending.
Column
Leave this field blank. This field is not used for real-time only
trending.
Maximum
Enter the maximum value the pen can plot. Values above this
limit are not plotted on the trend chart.
Minimum
Enter the minimum value the pen can plot. Values below this
limit are not plotted on the trend chart.
168 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING A CHART
Assigning a Pen for the Chart
Max Tag
Enter the name of a tag that defines the maximum value the pen
can plot. This value replaces the value specified in the Maximum
field. Values above the limit specified in this tag are not plotted
on the trend chart. This is optional
Min Tag
Enter the name of a tag that defines the minimum value the pen
can plot. This value replaces the value specified in the Minimum
field. Values below the limit specified in this tag are not plotted
on the trend chart. This is optional
Color
Enter the color used to display the pen. Choose a pen color by
double clicking the color button and then double clicking the color
you want to use on the color palette.
Limit
Define the limit the pen color changes at. This can either be a
number or the name of a tag that contains the limit value. You
can dynamically change the limit at run time if you use a tag.
Line Style
Marker Style
Select the style of line drawn by the pen.
Select the graphical symbol to display at each plotted point.
Symbols are the same color as the pen they are associated with.
Interpolation Style
Select the type of line to use to connect points drawn by the pen.
Choose Across Gaps to connect gaps in the trending data using
the specified interpolation style. In a time-based chart, gaps occur
when a sample does not get logged at the expected frequency.
Gaps occur when you forcibly create them in an event chart.
Cursor Value Tag
Enter the name of the tag that defines the plotted point of the pen
line that it intersects. The tag specified must one of the following
types: analog, longana, or float.
6 Choose OK to save the information. This returns you to the Chart Animation dialog.
11
7 Choose OK to save the information.
page 170.
FactoryLink 6.6.0 / Application Editor Guide / 169
Object Animation
8 Animate the legend using the information provided in “Animating a Legend” on
•
ANIMATING A CHART
•
Animating a Legend
•
•
A NIMATING
A
L EGEND
Perform the following steps to animate a legend for a real-time only trend chart.
Real-time only charts can only be animated based on time.
1 Select the legend object you want to animate. Verify no other objects overlap the
legend object.
2 Choose Animation>Legend to display the Legend Animation dialog.
3 Provide the following information:
Direction
Select the direction to display the legend scale in (major and
minor division marks).
Parent Chart
Reserved for future use.
Legend Type
Choose Time as the mode for the scale of the legend.
Division Type
Select the scale to display between the minimum and maximum
values. This can be one of the following:
Count The legend scale is divided equally by the number
specified in the Major Divisions field or the value the
operator writes to this tag at run time. The
formula used to calculate this value is:
(Maximum - Minimum) ÷ Major Divisions
170 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING A CHART
Animating a Legend
Units The legend scale is incremented by the number
specified in the Major Divisions field or the value the
operator writes to this tag at run time from the
minimum to the maximum.
Refer to the following example for both count and units legends
with a maximum of 100 and a minimum of 0 and 5 major
divisions. FactoryLink divides the scale between 0 and 100 into 5
equal parts for the count legend. FactoryLink increments the
scale between 0 and 100 by 5 for the units legend.
Count Legend
Maximum Value = 100
Minimum Value = 0
Major Divisions = 5
Minor Divisions = 0
100
80
60
40
20
0
Scale Maximum
Units Legend
100
95
90
85
80
75
70
65
60
55
40
35
30
25
20
15
10
5
0
Enter a maximum value for the trend chart legend. This can be
one of the following:
Value Enter a maximum value for the legend. This can
be any positive or negative integer or
floating-point numeric constant.
displayed on the legend with the time displayed on
the chart object.
Scale Minimum
Enter a minimum value for the trend chart legend. This can be
one of the following:
Value Enter a minimum value for the legend. This can be
any positive or negative integer or floating-point
numeric constant.
FactoryLink 6.6.0 / Application Editor Guide / 171
Object Animation
Tag Enter the tag name specified in the Ending Time
field on the Chart dialog to synchronize the time
11
•
ANIMATING A CHART
•
Animating a Legend
•
•
Tag Enter the tag name specified in the Starting Time
field on the Chart dialog to synchronize the time
displayed on the legend with the time displayed on
the chart object.
Number of Major
Divisions
Enter the number of major divisions for the trend chart legend.
This can be one of the following:
Value Enter a positive or negative integer or
floating-point numeric constant. This field works
with the Division Type field to determine how the
number of major divisions are displayed.
Tag Enter the name of a tag whose value dynamically
updates the major divisions of the legend. To
change the number of major divisions, animate an
input-text field that writes to this tag.
For example, a metric ruler 5 centimeters long
would have 5 major divisions—one for each
centimeter. This ruler would have also have 25
minor divisions—one every 2 millimeters.
Minor divisions
Major divisions
Number of Minor
Divisions
1
2
3
4
5
Enter the number of minor divisions for the trend chart legend.
The minor divisions are displayed between the major divisions on
the trend chart legend. This can be one of the following:
Value If the division type is count, enter any positive
integer, including zero. If the division type is units,
enter any positive or negative number.
Tag Enter the name of a tag whose value dynamically
updates the minor divisions of the legend.
Configure an input animation or other task that
writes to this tag to change the number of minor
divisions.
172 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING A CHART
Animating a Legend
Format
Enter the formatting characteristics for the legend scale. This can
be one of the following:
year Year with four digits, for example, 1997
yr Year with two digits, for example, 97
mon Alphabetical month abbreviation, for example,
Jan, Feb, or Mar
mo Month numerically, for example, 5 (for May)
dy Day of the month using two digits, for example, 09,
10, 11
hr Hour of the day in 24-hour format (military time),
for example, 09 or 21 (9:00 am and 9:00 pm,
respectively)
ah Hour of the day in 12-hour format, for example, 9
is displayed for both 9:00 am and 9:00 pm
mi Minute, for example, 07 is displayed for seven
minutes past the hour
sc Second, for example, 07 is displayed at seven
seconds past the minute
ap am and pm
dow Day of the week
You can combine time formats, separating them
with spaces and punctuation marks as necessary.
For example, enter mon day, year to show the date
as Jan 03, 1997. Type ah:mi ap to show the time as
9:07 pm.
save the data and return to the legend object.
FactoryLink 6.6.0 / Application Editor Guide / 173
Object Animation
4 Choose OK when you have completed entering all the information on this dialog to
11
•
ANIMATING A CHART
•
Animating a Legend
•
•
174 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 12
Animating an Object as
a Button
You can animate an object so, when selected, it performs an action. For example,
you can animate a button that opens another window or closes the application.
Perform the following steps to animate a button object to perform an action.
1 Select the object you want to animate.
2 Choose Animation>Button to display the Button Animation dialog.
12
Mouse Click or
Key
Select the mouse button or keystroke that activates the button.
This works in conjunction with the left mouse button; that is, you
can use this method to activate the button in addition to clicking
the left mouse button.
FactoryLink 6.6.0 / Application Editor Guide / 175
Object Animation
3 Fill out this dialog. Provide the following information to animate the object:
•
ANIMATING AN OBJECT AS A BUTTON
•
•
•
For example, if you choose F1, you activate the button by pressing
the F1 function key or by clicking on the button object using the
left mouse button. The following table lists the possible options
and defines the key sequence that corresponds to the option.
Table 12-0 Mouse or Key Options
Option
Key sequence
Option
Key sequence
NUL
None
PDN
Page Down
BT1
Reserved
END
End
BT2
Reserved
HME
Home
BT3
Reserved
LFT
Left arrow
BRK
Break
UP
Up arrow
BSP
Backspace
RGT
Right arrow
TAB
Tab
DWN
Down arrow
BTB
Shift+Tab
PSC
Print Screen
Enter (OS/2 only)
INS
Insert
Alt-Graph
DEL
Delete
PSE
Pause
SCR
Scroll Lock
CLK
Caps Lock
ENT
Enter
ESC
Esc
SYS
SysReq
PUP
Page Up
NL
ALGA
Alt, Ctrl and Shift
F1 - F24
Function keys 1 to 24
Select one of these to add to the alternate key sequence defined to
activate the mouse button. For example, if you specify INS in the
Mouse Click or Key field and choose Alt, you must press Alt+Insert to
use the alternate method to activate the button. Keys like BTB,
SYS, and BRK with shift, alt, ctrl don’t work.
176 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING AN OBJECT AS A BUTTON
Action
Defines the action taken when the button is activated. This can
be one of the following:
SET Writes the value of the Value or Tag field to the
real-time database element referenced by the
Destination Tag field on this dialog.
ADD Adds the value of the Value or Tag field to the
real-time database element referenced by the
Destination Tag field on this dialog.
SUB Subtracts the value of the Value or Tag field from
the real-time database element referenced by the
Destination Tag field on this dialog.
TOP Opens the window specified in the Value field and
displays the drawing currently defined for the
window.
If you want to specify a different drawing, define
both the window name and drawing name
separated by a colon in the Value field, using the
following format:
window_name:drawing_name
Refer to Step 3, Animating Text as an Input Field,
for details on text formatting.
DRW Opens a drawing and places it in the current
window.
MON Sets digital tag to ON when mouse is placed over
object with left mouse button depressed. Sets tag
to OFF when the button is released.
object with left mouse button depressed. Sets tag
to OFF when the button is released.
NUL No action is taken.
FactoryLink 6.6.0 / Application Editor Guide / 177
Object Animation
MOF Sets digital tag to OFF when mouse is placed over
12
•
ANIMATING AN OBJECT AS A BUTTON
•
•
•
Source Value or
Tag
Enter the value to use to perform the action. This can either be a
constant defined in the Value field or a variable defined in the Tag
field. You can only specify one of these fields.
Value Fixed constant to combine with the value in the
Destination Tag field to perform the action specified
in the Action field.
Tag Name of the tag that contains the value to combine
with the Destination Tag field to perform the action
specified in the Action field. The tag specified must
be one of the following types: digital, analog,
longana, float, or message.
Destination Tag
Tag name used to reference the real-time database element that
receives the action. The tag specified must be one of the following
types: digital, analog, longana, float, or message.
Range Check
Parameters
Range check parameters define the numerical limits of the
element. The operation defined in the Action field of this dialog is
not performed if the result of the operation exceeds these limits.
These fields do not apply if the tag defined in the Tag field is of
type message.
Maximum Enter a number to indicate the high range for
the limit.
Minimum Enter a number to indicate the low range for the
limit.
Position Controls
Defines the horizontal and vertical location of the text field in the
drawing.
X Enter the name of an analog tag that controls the
horizontal location of the object in the drawing.
The value of the left side of the drawing is 0 and
the value of the right side of the drawing is 32000.
If you leave the field blank, the text is
displayed where you drew it.
If you specify a tag without writing a value to
it, the value defaults to the default value of the tag
you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
178 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING AN OBJECT AS A BUTTON
another real-time input so the object moves
horizontally within the display.
Y Enter the name of an analog tag that controls the
vertical location of the object in the drawing. The
value of the bottom of the drawing is 0 and value of
the top of the drawing is 32000.
If you leave the field blank, the text is
displayed where you drew it.
If you specify a tag without writing a value to
it, the value defaults to default value of the tag
you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
vertically within the display.
Object Security
Defines the security of the object.
Security class Select the appropriate security class from the
pull-down list field.
Log Message Enter a text string to identify the object for the
security log.
4 Choose OK to save the animation information.
Note: You may stack buttons on top of one another, but this
practice is not recommended if you have security defined on any
of them. Refer to “Security and Stacked Buttons” on page 373
for more detail.
12
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 179
•
ANIMATING AN OBJECT AS A BUTTON
•
•
•
180 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 13
Paint and Bar
Animation
This chapter describes how to:
• Animate an object with paint. You can change the color of an object as the value
of a real-time database element changes using Paint animation.
• Animate a bar object. Bar animation lets you graphically represent the value of
an element. You can change the movement and color of the bar as the value of a
real-time database element changes.
A NIMATING
A
P AINT O BJECT
Perform the following steps to assign color changes to an object:
1 Select the object to be animated.
2 Choose Animation>Paint to display the Paint Animation dialog.
13
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 181
•
PAINT AND BAR ANIMATION
•
Animating a Paint Object
•
•
3 Specify the following information:
Tag
Enter a name to reference the element that affects the object
color. The tag specified must be one of the following types: digital,
analog, longana, float, or message.
Color Changes
The fields in this area define color changes when limits are met.
To define a color, you must double click the color button to display
the color palette and choose the desired color. The color button
reflects the color selected. Specify the following to effect color
changes. Do this for each limit you want to set. You can specify up
to 16 limits.
Foreground Enter the name of an analog tag that defines the
color of choice for this text field at run time.
When the Tag Definition dialog is displayed, enter
the analog in the Value field that corresponds to
the desired color. Refer to Chapter 9, “Animating
Objects” for a list of analog values that correspond
to colors on the color palette.
Background Enter the name of an analog tag that defines the
color of choice for the text field background at run
time.
When the Tag Definition dialog is displayed, enter
the analog in the Value field that corresponds to
the desired color. Refer to Chapter 9, “Animating
Objects” for a list of analog values that correspond
to colors on the color palette.
Blink Enter the name of a digital tag that controls the
blink rate of the input text. This tag is initialized
with a value according to the blink speed chosen.
This can be one of the following:
None Text does not blink. This is the default.
Slow Text blinks slowly.
Fast Provides a blink every second.
Position Controls
Defines the horizontal and vertical location of the text field in the
drawing.
X Enter the name of an analog tag that controls the
horizontal location of the object in the drawing.
182 / FactoryLink 6.6.0 / Application Editor Guide
PAINT AND BAR ANIMATION
Animating a Paint Object
The value of the left side of the drawing is 0 and
the value of the right side of the drawing is 32000.
If you leave the field blank, the text is
displayed where you drew it.
If you specify a tag without writing a value to
it, the value defaults to the default value of the tag
you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
horizontally within the display.
Y Enter the name of an analog tag that controls the
vertical location of the object in the drawing. The
value of the bottom of the drawing is 0 and value of
the top of the drawing is 32000.
If you leave the field blank, the text is
displayed where you drew it.
If you specify a tag without writing a value to
it, the value defaults to default value of the tag
you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
vertically within the display.
4 Choose OK to save the animation information.
13
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 183
•
PAINT AND BAR ANIMATION
•
Animating an Object as a Bar
•
•
A NIMATING
AN
O BJECT
AS A
B AR
Perform the following steps to animate an object as a bar:
1 Select the object to be animated.
2 Choose Animation>Bar to display the Bar Animation dialog.
3 Specify the following information:
Tag
Maximum
Enter a name to reference the element that affects the objects
movement and color. The tag specified must be one of the
following types: digital, analog, longana, float, or message.
Enter the maximum value that can display on the uni-directional
bar. This field does not apply to bi-directional bars.
You can enter either a constant value or name of a tag that
contains the maximum value. If you enter a tag name, the upper
limit can be changed during run time. The tag specified must be
one of the following types: analog, longana, or float.
Minimum
Enter the minimum value that can display on the uni-directional
bar. This field does not apply to bi-directional bars.
You can enter either a constant value or name of a tag that
contains the minimum value. If you enter a tag name, the lower
limit can be changed during run time. The tag specified must be
one of the following types: analog, float, or longana.
184 / FactoryLink 6.6.0 / Application Editor Guide
PAINT AND BAR ANIMATION
Animating an Object as a Bar
Direction
Direction the color moves when the value of the tag specified in
the Tag field of this dialog increases or decreases. You can
configure bars to grow either horizontally or vertically and in one
or two directions.
If you want the color movement to occur uni-directionally,
choose one of the first four options. Uni-directional bars move in
only one direction from the point of origin.
If you want the color movement to occur bi-directionally,
choose one of the last two options. Bi-directional bars move in
both a positive and negative direction from the point of origin.
The following table shows how uni-directional and bi-directional bars work.
Table 13-0 Unidirectional and Bidirectional Bars
Unidirectional Bars
Bidirectional Bars
If the Tag field
If the Tag field
Then the bar is:
element value is:
element value is:
Then the bar is:
not colored
< the anchor
point
moves in a
negative
direction
(toward the Min.
value)
> the Min. value
and
< the Max. value
colored to the
value of the Tag
field element
= the anchor
point
is a single line at
the anchor
point
= the Max. value
completely
colored
> the anchor
point
moves in a
positive
direction
(toward the
Max. value).
Bidirectional
Anchor Point
Color Changes
Enter the value the color in a bi-directional bar grows from. The
anchor point has no effect on uni-directional bars.
The fields in this area define color changes when limits are met.
To define a color, you must double click the color button to display
the color palette and select the desired color. The color button
FactoryLink 6.6.0 / Application Editor Guide / 185
13
Object Animation
< the Min. value
•
PAINT AND BAR ANIMATION
•
Animating an Object as a Bar
•
•
reflects the color selected. Specify the following to effect color
changes. Do this for each limit you want to set. You can specify up
to 16 limits.
Foreground Enter the name of an analog tag that defines the
color of choice for this text field at run time.
When the Tag Definition dialog displays, enter the
analog in the Value field that corresponds to the
desired color. Refer to Chapter 9, “Animating
Objects” for a list of analog values that correspond
to colors on the color palette.
Background Enter the name of an analog tag that defines the
color of choice for the text field background at run
time.
When the Tag Definition dialog displays, enter the
analog in the Value field that corresponds to the
desired color. Refer to Chapter 9, “Animating
Objects” for a list of analog values that correspond
to colors on the color palette.
Blink Enter the name of a digital tag that controls the
blink rate of the input text. This tag is initialized
with a value according to the blink speed chosen.
This can be one of the following:
None Text does not blink. This is the default.
Slow Text blinks slowly.
Fast Provides a blink every second.
Position Controls
Defines the horizontal and vertical location of the text field in the
drawing.
X Enter the name of an analog tag that controls the
horizontal location of the object in the drawing.
The value of the left side of the drawing is 0 and
the value of the right side of the drawing is 32000.
If you leave the field blank, the text is
displayed where you drew it.
If you specify a tag without writing a value to
it, the value defaults to the default value of the tag
you entered.
186 / FactoryLink 6.6.0 / Application Editor Guide
PAINT AND BAR ANIMATION
Animating an Object as a Bar
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
horizontally within the display.
Y Enter the name of an analog tag that controls the
vertical location of the object in the drawing. The
value of the bottom of the drawing is 0 and value of
the top of the drawing is 32000.
If you leave the field blank, the text is
displayed where you drew it.
If you specify a tag without writing a value to
it, the value defaults to default value of the tag
you entered.
To write a numerical value to this element,
configure a function key, the Math & Logic task, or
another real-time input so the object moves
vertically within the display.
4 Choose OK to save the animation information.
13
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 187
•
PAINT AND BAR ANIMATION
•
Animating an Object as a Bar
•
•
188 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 14
Animating an Object as
a Symbol
You can use symbol animation for two purposes:
• To represent the values of an element
• To create a moving image
This chapter describes how to achieve both of these purposes.
You can use either of the following two methods to display symbols at run time:
• Method 1—Erases the existing symbol by redrawing the symbol background
(the part of the screen behind the symbol) then draws the new symbol.
Because graph spends time redrawing the background to mask the previously
displayed symbol, this method affects system performance.
To use Method 1, insert a -p (not case-sensitive) in the graph task row of the
Program Arguments column in the System Configuration Information panel.
• Method 2—Draws only the new symbol.
Method 2 requires you to combine a solid object, such as a box or a circle, with
the symbol to serve as the symbol’s background. Because graph does not redraw
the part of the screen behind the symbol to mask the previous symbol, the
symbol must have its own background to mask the previous symbol.
Therefore, as the new symbol is drawn on the screen, its background object
masks the previously displayed symbol.
Do not enter the -p argument in the System Configuration Information panel to
use Method 2.
14
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 189
•
ANIMATING AN OBJECT AS A SYMBOL
•
Animating Symbol Object to Represent a Value
•
•
A NIMATING S YMBOL O BJECT
TO
R EPRESENT
A
VALUE
Perform the following steps to animate an object to represent the value of an
element:
1 Select the object you want to animate.
2 Choose Animation>Symbol to display the Symbol Animation dialog.
3 Specify the following information:
Tag
Shape Changes
Enter a name to reference the element controlling the symbol for
this object. The tag specified must be one of the following types:
digital, analog, longana, float, or message.
The fields in this area define the changes for this object when
limits are met. Define these for each limit you want to set. You
can specify up to 8 limits.
Blink Specify the blink animation used when the limit is
met. This field toggles through none (no blink),
slow (slow blink), or fast (fast blink). Fast blink is
the default.
Name Name of symbol to display when limit is met. This
name must match the name of an object in the
SYMBOLS.G file for this application.
190 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING AN OBJECT AS A SYMBOL
Animating Symbol Object to Represent a Value
Limit Enter the limit where the change occurs. This can
either be a positive or negative numeric value or
the name of a tag whose value defines the limit.
The tag specified must be one of the following
types: analog, longana, or float.
X
Enter the name of an analog tag that controls the horizontal
location of the object in the drawing. The value of the left side of
the drawing is 0 and the value of the right side of the drawing is
32000.
If you leave the field blank, the text is displayed where you
drew it.
If you specify a tag without writing a value to it, the value
defaults to the default value of the tag you entered.
To write a numerical value to this element, configure a function
key, the Math & Logic task, or another real-time input so the
object moves horizontally within the display.
Y
Enter the name of an analog tag that controls the vertical
location of the object in the drawing. The value of the bottom of
the drawing is 0 and value of the top of the drawing is 32000.
If you leave the field blank, the text is displayed where you
drew it.
If you specify a tag without writing a value to it, the value
defaults to default value of the tag you entered.
To write a numerical value to this element, configure a function
key, the Math & Logic task, or another real-time input so the
object moves vertically within the display.
Width
To configure a task to write a numerical value to this element,
configure a function key, Math & Logic, or other real-time input
so the width of the symbol changes.
If no task writes a value to this element, the symbol is
displayed in its drawn width.
FactoryLink 6.6.0 / Application Editor Guide / 191
14
Object Animation
Name of analog tag that contains a value that controls the width
of the symbol. The maximum width value is 32000, which makes
the symbol as wide as the display.
•
ANIMATING AN OBJECT AS A SYMBOL
•
Animating Symbol Object to Represent a Value
•
•
Height
Name of analog tag that contains a value that controls the height
of the symbol. The maximum height value is 32,000, which makes
the symbol as tall as the display.
To configure a task to write a numerical value to this element,
configure a function key, Math & Logic, or other real-time input
so the height of the symbol changes.
If no task writes a value to this element, the symbol is
displayed in its drawn width.
4 Click on OK to save the information after you complete the Symbol Animation
dialog.
192 / FactoryLink 6.6.0 / Application Editor Guide
ANIMATING AN OBJECT AS A SYMBOL
Simulate Object Rotation
S IMULATE O BJECT R OTATION
Because symbols represent the value of an element, you can use them to simulate
object rotation at run time.
You can use PowerVB to rotate an object during run time. Refer to Part IV,
“PowerVB Animation” for more information.
Perform the following steps to simulate object rotation:
1 Draw one symbol for each incremental position of the object rotation in the file
SYMBOLS.G. These symbols represent the object at run time. You can draw up to
eight symbols to represent a single object.
The following example of the SYMBOLS.G file shows a propeller drawn in four
positions so it appears to rotate in 45 degree increments.
Each of these four symbols represent the propeller object.
14
3 Configure an area on an Application Editor screen the object rotates in.
FactoryLink 6.6.0 / Application Editor Guide / 193
Object Animation
2 Draw a bounding box to locate the object on the drawing. The object in the
SYMBOLS.G file is sized to this object.
•
ANIMATING AN OBJECT AS A SYMBOL
•
Simulate Object Rotation
•
•
4 Animate this area as a Symbol, linking the symbols drawn in the SYMBOLS file to
this area using the procedure provided in the “Animating Symbol Object to
Represent a Value” on page 190.
5 Configure a task so the element is set to the next consecutive number based on
another element, such as a timer.
As each incremental position of the propeller is displayed, the propeller appears to
rotate.
194 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 15
Working With Power
Packs
Template animation allows you to animate an object with variables. When you
duplicate an object in normal graphics drawing, you must edit the animation for
the new object after it is duplicated. With template animation, you define which
animation features are constant or variable for each duplicated object. When the
object is duplicated, you are prompted to provide definitions for variable
animation features.
Objects defined using variables are template objects, or Power DragOns, and the
variables defined in the object are template variables. Any object, whether simple
or composite, becomes a template object when you define one or more template
variables. They are used to perform graphical, logical, process, and
communication operations and incorporate all the information necessary to
display and control automation equipment. They define I/O communication,
scaling, alarming, logging, and security as well as define the graphical rendering
of the device.
You enter a template variable in any field of an Animation dialog that accepts text
input. You cannot enter template variables in fields where you choose information,
such as radio buttons, check boxes, list boxes, and palettes.
You place Power DragOns in a library of drawings collectively known as Power
Packs. Power Pack files work just like any drawing file, except that when you
open a Power Pack file, the Application Editor is automatically in the copy/paste
mode. When you select an object from a Power Pack drawing, the Application
Editor immediately copies it into the buffer so it can be pasted into an open
drawing file. All Power Pack files have a .gp extension.
Power DragOns fall into two general categories:
• Those that produce no tags. Many Power DragOns implement animation by
using PowerVB to directly set window, drawing, and graphic object properties,
or there may be no pre-designed animation associated with the Power DragOn.
• Those that create or reference tags. Power DragONs can create and reference
scalar or structured tags. If the prompt reads Tag Name, the Power DragOn can
FactoryLink 6.6.0 / Application Editor Guide / 195
Object Animation
Power Packs are designed to be sized to any display and provide a clear resolution
at edit and runtime. The architecture of Power Packs provide for easy expansion
and enhancement.
15
•
WORKING WITH POWER PACKS
•
•
•
create a scalar tag, reference an existing scalar tag or reference any member of
an existing structured tag. If the prompt reads Process tag name, it can only
create or reference a structured tag.
You can customize Power DragOns easily using the Application Editor drawing
and animation.
If customizing is only desired on a single use of the Power DragOn, you
should modify the pasted Power DragOn in the drawing.
If you will be using the customized Power DragOn multiple times, either
customize the original in the Power Pack or make a copy in the Power Pack and
customize it.
196 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
Guidelines for Using Template Variables
G UIDELINES
FOR
U SING TEMPLATE VARIABLES
This section lists the guidelines to use when defining template variables.
• The format for a template variable is a character string enclosed in braces { }. A
template variable name has the same syntax as an element name.
• You can specify multiple template variables within a field.
For example,
{assy_line}{mach_no}
• You cannot nest template variables; that is, enclose a template variable within
another template variable. For example, the following entry is not a valid use of
a template variable.
{tnum{valvnum}}
• You can specify multiple template variables within an object animation
configuration. For example, you can specify both the Minimum and Maximum
fields as template variables.
• You can use the same template variable in more than one field in an object
animation. For example, in the Bar Animation dialog, you can use the same
template variable for the Minimum field and the first Limit field, because the
initial value of the bar and its first limit are equal.
• You can use the same template variable in more than one object within a
composite object. For example, given a composite object that contains a bar
object and an output-text object, you can specify both objects to have the same
template variable in the Tag field of their Animation dialog. The text field
displays the value associated with the variable numerically, and the bar
displays the same value graphically.
• You can use template animation with object-level animation options, but not
with drawing-level animation.
15
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 197
•
WORKING WITH POWER PACKS
•
Creating a Template Object
•
•
C REATING
A
TEMPLATE O BJECT
Perform the following procedure to animate an object as a template:
1 Select the object you want animate.
2 Choose Animation>Object Level Animation you wish to animate.
Do not choose any Drawing Level Animation types (Print Screen, Beep, or Function Key)
because template animation does not apply to these animation types.
3 Animate the object as required, but enter template variables in the fields where
you want values to be different for each instance of the object. Refer to the
appropriate section in this manual for details on each animation type.
You must enclose template variables in braces { } and use the same syntax as an
element name. Variable names can be from 1 to 30 characters long counting the
braces, which count as two characters.
4 Click on OK. The Define Template Variable dialog displays.
5 The name of the variable you are defining displays in the Variable field.
6 Specify the following information:
Prompt String
Message to display to prompt for this variable definition when
this template object is duplicated. This can be a 1 to 64 character
alphanumeric string.
The name of the template variable is used as the prompt string if
you leave this field blank.
7 Click on OK. The Tag Definition dialog displays if you entered a template variable in
a field that expects a tag name.
198 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
Creating a Template Object
8 If you want to define this field now, enter data for any tags that display. Specify
the following for each tag:
• Domain
• Element type
• Dimension (if an element array)
• Default value
• Description
Click on Cancel if you want to define these fields when you paste the object.
15
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 199
•
WORKING WITH POWER PACKS
•
Using a Template Object
•
•
U SING
A
TEMPLATE O BJECT
Perform the following steps to duplicate a template object:
1 Select the template object.
2 Choose Edit>Copy to copy the object into the buffer.
3 Choose Edit>Paste. Place the cursor where the object is to be pasted and press the
mouse button. The Template dialog displays.
4 Specify the following information:
Name
Lists the prompt strings you entered for the template variables.
Value
Values substituted for template variables for this object. Enter a
value for each prompt string.
The number of characters in the value depends on the number of
characters in the static portion (characters other than the
template variable) of the variable name because the maximum
number of characters in an element name is 32. For example, if
the variable name is tank{tnum}level, the static portion of the
variable name is tanklevel. Because there are 9 characters in
tanklevel, the maximum number of characters that can be
substituted for tnum is 23.
[32 (maximum characters in an element name) - 9 (number of
characters in tanklevel) = 23]
200 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
Using a Template Object
Class:
Type of template object used to create this new object. Use this
field to establish classes for your template objects, associating
each object with its source template. The system does not use this
information; it is for your reference.
You can enter an alphanumeric string from 1 to 16 characters.
Description:
Description of the template object. This is for your reference only.
You can enter an alphanumeric string from 1 to 64 characters.
5 Click on OK to save the information. If you created a template variable requiring
element definition information but did not enter it, the Tag Definition dialog
displays now, prompting you for that information.
If the Tag Definition dialog does not display, the system pastes the new object and
substitutes the values you entered for each prompt string into their associated
template variables.
If FactoryLink generates a new element after you click on OK, it uses the element
definition information supplied with the template variable for the new element
without prompting you.
6 Specify the domain, element type, dimension (if an element array), default value,
and description of the element, and click on OK. The Tag Definition dialog closes
and the system pastes the new object, substituting the values you entered for each
prompt string into their associated template variables.
15
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 201
•
WORKING WITH POWER PACKS
•
Displaying the Template Configuration
•
•
D ISPLAYING
THE
TEMPLATE C ONFIGURATION
You can display the template configuration for objects you created from template
objects on the Animation dialog in one of two ways:
• As template variables from the source template object
• As element names/values resulting from template variable substitutions
Choose Template Variables from the View menu do display the template
configuration as template variables. Deselect Template Variables to display the
template configuration as element names/values. Each time the Application
Editor starts, it defaults to displaying the element names/values in the animation
dialog.
If you choose to display the template configuration as element names/values, the
Application Editor allows you to distinguish which element names/values on the
Animation dialog result from template variable substitutions and which do not.
Element names/values that result from template variable substitutions display in
a different text/background color combination than the other fields on the dialog.
The Template Variables option applies globally to all drawings; therefore, you do
not need to open a drawing to set this option.
C OMBINING TEMPLATE O BJECTS
When combining template objects that use the same variables, the Application
Editor checks for conflicts in the prompts for those variables. The Application
Editor completes the Combine operation if the prompts for the variables are the
same in each object that is to be combined.
The Application Editor displays an error in the Variable Conflict dialog if the
prompts differ (you entered different prompts for the same variable in different
objects).
The Application Editor displays the first prompt you entered for the displayed
variable. If you click on OK, the Application Editor resolves the prompt conflict by
assigning this prompt to the variable wherever the variable is used in the
composite; however, you can change the prompt for this variable. After you click
on OK, the Application Editor displays the next variable that has a prompt
conflict, if one exists. When you have resolved all prompt conflicts, the Application
Editor completes the Combine operation.
Click Abort to cancel the Combine operation.
202 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
Unresolved Template Variables
U NRESOLVED TEMPLATE VARIABLES
Whenever you save a drawing or perform an animation test on a drawing, the
Application Editor checks it for variables that do not have a value entered in the
Template dialog. When a variable does not have a value, it is called unresolved.
Perform the following steps to resolve unresolved template variables:
1 Use Edit>Find to locate the object in the drawing. Enter the object name given in
the Animation Error dialog.
2 Choose Animation>Template.
3 Enter the missing value for the variable prompt string.
The Application Editor completes the save whether or not you resolve the
variables.
If you do not enter values for all of the template variables in the drawing, at run
time, the system will not load the drawing containing the unresolved variables.
Instead, the system displays the following message:
Unable to load (drawing name) because of Unresolved
Template Variables.
Open the drawing in the Application Editor and perform an animation test to
resolve the variables. The Application Editor displays an error message indicating
the object name with the unresolved variable. Follow the steps above for resolving
variables.
A TTACHING P OWER D RAG O NS
TO
I/O D EVICES
There are a number of restrictions associated with using I/O device template
variables. Template tag definitions are not shared between fields within a single
animation, different animation types on a single object, or animations on different
subobjects within an animation. Even though the string representing the
FactoryLink 6.6.0 / Application Editor Guide / 203
Object Animation
The Power DragOns supplied with FactoryLink do not request information about
I/O devices. You can add prompts that complete the device interface tables. If
customizing is only desired on a single use of the Power DragOn, you should fill
out the specific I/O address information in the pasted Power DragOn in the
drawing. If you will be using the customized power DragOn multiple times, either
customize it or enter a template variable like {IO} instead of a specific I/O address.
15
•
WORKING WITH POWER PACKS
•
Adding Security to Power DragOns
•
•
template tag definition may be the same, the associated single point configuration
is unique for every instance of that template tag definition.
For cases where a template tag string is defined in two places, the pasting
operation causes Application Editor to work on both references separately. So
after Application Editor creates the records for the first template reference, it
detects this configuration when processing the second template reference and
issues an overwriting warning. You are, in effect applying the second definition
over the first.
The best approach to this situation is to attach the I/O device single point
information to only one of the template tag references. The second reference to the
template can define the base attributes of the tag (e.g. SHARED, DIGITAL) but
not include the single point information. When the paste occurs the I/O device
information comes from only one of the references, not both, eliminating the
overwrite.
Template references within PowerVB scripts cannot define tags, so they have no
I/O information attached to cause an overwrite. Template references for tag event
triggers do define tags, so they can have single point template definitions
associated.
A DDING S ECURITY
TO
P OWER D RAG O NS
Configure Security by applying the desired security class to the button animation
of the Power DragOn.
204 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
F ACTORY L INK S UPPLIED P OWER P ACKS
Bars
Run-time Features
The Bars Power Pack includes both horizontal and vertical bars with and without
legends and with and without numeric displays. Each renders a value as a solid
bar graph. The height or width of the bar is determined by the value of the tag.
The minimum and maximum values displayed in the legend are attached to the
process tag tag.eumin and tag.eumax values. The range of the bar graph can be
modified at run time by changing the values of these tags.
15
Template Prompts
Sizing and Rotating
Bar graphs can be sized but not rotated. The legend may have to be resized to
match the new bar height for bars that contain legend animation objects.
FactoryLink 6.6.0 / Application Editor Guide / 205
Object Animation
Process tag name
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
Real-time database elements
Bar graphs create or reference an analog or floating-point process tag. When the
Power DragOn object is pasted on a screen, the system creates the following tags
when a new tag name is entered in the template dialog.
{tag}
{tag}.eumax {tag}.eumin
{tag}.raw
{tag}.rawmax
{tag}.rawmin
{tag}.lock
Customizing
The bar graphs are composed of three animated components: a bar, a legend, and
a text output.Click on the checked animation tool to display the correct animation
dialog and modify the animation properties as desired.
BORDERS
Run-time Features
You can use borders to provide a simulated 3D panel for your drawings.
After you have pasted one of the transparent borders into a drawing, run-time
performance is improved by selecting the item and choosing Edit>Separate to
separate the object into its component parts.
206 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
Template Prompts
None
Real-time database elements
None
Sizing and Rotating
You can size and rotate borders. Rotating an inset border 180 degrees changes it
to a raised border.
BUTTONS
15
Buttons will:
• appear to be depressed when the button is clicked.
• change background color when button is pointed at.
• change the color of text when button is pointed at.
• display tooltip help when the button is pointed at.
FactoryLink 6.6.0 / Application Editor Guide / 207
Object Animation
Run-time Features
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
See the Style1 section for more information about enabling or disabling these
features.
The following buttons comprise the Buttons Power Pack:
System: Displays the Run-Time Manager drawing.
Change Drawing: Enables you to add buttons to displays that allow the operator
to choose a different drawing at run time. If desired, you can change the caption
text to the name of the actual drawing.
Push Button: Does not perform any actions. Use this button as a starting point
to create a custom button.
Momentary: Sets a digital tag to 1 while the mouse button is depressed and
returns the value to 0 when the mouse button is released.
Toggle: Toggles the state of a digital tag between 0 and 1 each time the button is
clicked. The button appears depressed when the tag value is 1 and raised when its
value is 0.
Shutdown: Sets the necessary tags to cause both the USER and SHARED
domains of the FactoryLink programs to exit or stop running.
Arrows: Increment or decrement a process tag. The single arrow buttons change
the tags value by one, the double arrows by the specified amount. The begin and
end arrows set the process tag to its engineering units minimum or maximum
value.
Template Prompts
Vary
Real-time database elements
The System, Change Drawing, Push Button, Shutdown, Help, and Alarm buttons
do not produce tags. The Momentary and Toggle buttons create or reference an
existing digital tag. The Arrow buttons create or reference an existing process tag.
Sizing and Rotating
You can size buttons but not rotate them. When you stretch a button horizontally,
the text remains the same size and centered. When you stretch a button vertically,
the text size increases proportionally with its height. You change the text size by
selecting the text and setting its attributes.
208 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
CHECKS
Run-time Features
You view and set the state of digital tags using Check Box Group. The tag value is
1 when the box is filled and 0 when it is empty. You toggle the state by clicking the
box or its descriptive text on the right.
Template Prompts
Tag name
Real-time database elements
15
Sizing and Rotating
You can size check boxes but not rotate them.
Customizing
You change the text associated with a selection by selecting the text and, when the
text cursor is shown, enter the new text.
FactoryLink 6.6.0 / Application Editor Guide / 209
Object Animation
The single check box creates or references a single digital tag. A check box group
creates or references an existing digital array tag.
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
Frames1, Frames2
The Power DragOns in the Frame Power Pack enable you to add additional
frames to the FLNEW application. Choose File>Open, then enter a new name to
add a new drawing. A blank screen is displayed. Paste a Frame Power DragOn
into the new drawing, then choose Edit>Separate to separate the objects. This
significantly improves run-time performance.
GAUGES
Run-time Features
The Gauges Power Pack includes dials, LEDs, and text fields. The needle position
on the dials indicates the value of the tag. The minimum and maximum values
displayed are attached to the process tag’s tag.eumin and tag.eumax values. The
range of the dial scale can be modified at run time by changing the values of these
tags.
210 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
Template Prompts
Process tag name
Real-time database elements
Dials create or reference an analog or floating-point process tag. When the Power
DragOn object is pasted on a screen, the system creates the following tags after a
new tag name is entered in the template dialog.
{tag}
{tag}.eumax {tag}.eumin
{tag}.raw
{tag}.rawmax
{tag}.rawmin
{tag}.lock
Sizing and Rotating
Dials can be sized but not rotated. After sizing the dial, you may need to change
the font size of the text.
Customizing
Dials are composed of two animated components: a needle and output text. At run
time, the needle is rotated around the center of the faceplate object. If desired, the
text output is deleted without affecting the needle’s operation. Colors can be
changed by selecting a component and changing its color.
KEYPADS
15
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 211
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
Misc
Motors1, Motors2, Motors3
The Motors Power Packs include motor Power DragOns that allow you to view
and control a motor’s state.
212 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
Run-time Features
Digital status motors indicate whether the motor is running or stopped and
control actions to start or stop the motor.
Speed status motors provide information about the motor speed and control
actions to start or stop the motor and set its speed.
The minimum and maximum speeds are defined by the process tag tag.eumin and
tag.eumax values. The range of the motor speed is modified at run time by
changing the values of these tags.
Template Prompts
Process tag name
Real-time database elements
Digital status motors create or reference a digital process tag. When the Power
DragOn object is pasted on a screen, the system creates the following tags after a
new tag name is entered in the template dialog.
{tag}
{tag}_command
Speed status motors create or reference two analog or floating-point process tags
and a digital command tag. When the Power DragOn object is pasted on a screen,
the system creates the following tags after a new tag name is entered in the
template dialog.
{tag}
{tag}.eumax
{tag}.eumin
{tag}.raw
{tag}.rawmax
{tag}.rawmin
{tag}.lock
{tag}_sp
{tag}_sp.eumax
{tag}_sp.eumin
{tag}_sp.raw
{tag}_sp.rawmax
{tag}_sp.rawmin
{tag}_sp.lock
{tag} is the actual motor speed, {tag}_sp is the speed control and {tag}_command is
the motor start/stop control tag.
Sizing and Rotating
Motors can be both sized and rotated.
FactoryLink 6.6.0 / Application Editor Guide / 213
Object Animation
{tag}_command
15
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
PIPES
Power SPC
214 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
Pumps1, Pumps2
The Pumps Power Packs include pump Power DragOns that allow you to view and
control a pump’s state.
Run-time Features
Digital status pumps provide status indicating whether the pump is running or
stopped and control actions to start or stop the pump.
Speed status pumps provide status indicating the pump's speed and control
actions to start or stop the pump and set its speed.
Template Prompts
Process tag name
FactoryLink 6.6.0 / Application Editor Guide / 215
15
Object Animation
The minimum and maximum speeds are defined by the process tag’s tag.eumin and
tag.eumax values. The range of the pump speed can be modified at run time by
changing the values of these tags.
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
Real-time database elements
Digital status pumps create or reference a digital process tag. When the Power
DragOn object is pasted on a screen, the system creates the following tags when a
new tag name is entered in the template dialog.
{tag}
{tag}_command
Real-time database elements
Speed status pumps create or reference two analog or floating-point process tags
and a digital command tag. When the Power DragOn object is pasted on a screen,
the system creates the following tags when a new tag name is entered in the
template dialog:
{tag}
{tag}.eumax
{tag}.eumin
{tag}.raw
{tag}.rawmax
{tag}.rawmin
{tag}.lock
{tag}_sp
{tag}_sp.eumax
{tag}_sp.eumin
{tag}_sp.raw
{tag}_sp.rawmax
{tag}_sp.rawmin
{tag}_sp.lock
{tag}_command
{tag} is the actual pump speed, {tag}_sp is the speed control and {tag}_command is
the pump start/stop control tag.
Sizing and Rotating
Pumps can be both sized and rotated.
216 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
RADIOS
Run-time Features
Radio buttons provide a way at run-time to set the value of an analog tag
according to a selection list. Clicking the radio button or the text to its right sets
the analog tag value to the selection value.
Template Prompts
Tag name
Real-time database elements
Radio button groups create or reference a single analog tag.
15
Sizing and Rotating
Customizing
You change the text associated with a selection by selecting it and entering the
new text.
You can change the value set by a radio button selection. Choose the radio button
and change the button animation to set the desired value. You must also choose
the radio button and change the value associated with its paint animation.
FactoryLink 6.6.0 / Application Editor Guide / 217
Object Animation
Radio buttons can be sized but not rotated.
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
S1TREND
Template Prompts
Tag name
Real-time database elements
Trend charts create or reference one analog or floating-point process tag for the
pen value and create several digital and analog tags for chart control. When the
Power DragOn object is pasted on a screen, the system creates the following tags
after a new tag name is entered in the template dialog.
{tag}
{tag}.eumax {tag}.eumin {tag}.raw
{tag}.rawmax {tag}.rawmin {tag}.lock
trendchart{chart}Cursor
trendchart{chart}End
trendchart{chart}Grid
trendchart{chart}Mode
trendchart{chart}ModeDisplay
trendchart{chart}Pan
trendchart{chart}Pen1
trendchart{chart}Start
trendchart{chart}Zoom
218 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
Sizing and Rotating
Trend charts can be sized but not rotated.
Customizing
You can add additional pens to the chart. Choose chart animation, then choose the
Pens button. Follow the standard procedure for adding pens to a chart.
SLIDERS
Run-time Features
Template Prompts
Process tag name
FactoryLink 6.6.0 / Application Editor Guide / 219
15
Object Animation
The Sliders Power Pack includes different types of sliding control buttons.
Changing the value of the tag moves the position of slider button and moving the
position of the slider button sets the value of the tag. The minimum and maximum
values for the slider are attached to the process tag’s tag.eumin and tag.eumax
values. The range of the slider can be modified at run time by changing the values
of these tags.
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
Real-time database elements
Sliders create or reference an analog or floating-point process tag. When the
Power DragOn object is pasted on a screen, the system creates the following tags
after a new tag name is entered in the template dialog.
{tag}
{tag}.eumax {tag}.eumin
{tag}.raw
{tag}.rawmax
{tag}.rawmin
{tag}.lock
Sizing and Rotating
Sliders can be sized and rotated. After re-sizing the slider, you may need to resize
the background and button.
Customizing
The Slider is composed of one animated object, the button. If desired, all other
components can be deleted without affecting the slider operation. Colors can be
changed by selecting a component and changing its color.
Style1
The Style1 Power Pack includes Power DragOns that do not show at run time but
affect the way other Power DragOns in the Power Packs operate. Place any Style1
Power Pack items to be used on the Splash screen since they only need to execute
once. These Power DragOns execute methods in the Style1 PowerVB library
(style1.pls).The Style1 Power Pack items include tooltips and outlines for buttons,
buttons displayed behind process Power DragOns, and pop-up command panels.
Others cause buttons to change their background color or appearance when they
are pointed at or change the color of their text.
220 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
Style1 Initialize
The Style1 Initialize Power DragOn sets the defaults for all Power DragOns that
use the style1 methods. The following defaults are set:
• Style1 Button1 depress = Enabled
• Style1 Button1 Highlight Background = Disabled
• Style1 Button1 Highlight Text = Disabled
• Style1 Process On color = Red
• Style1 Process Off color = Green
• Style1 Process Transition color = Green
• Style1 Button1 ToolTip = Disabled
• Style1 Button1 Outline = Disabled
• Style1 Process Outline = Disabled
• Style1 Process Object Selected = Toggle state of selected Power DragOn
Style1Button1 Highlight Background
Add this Power DragOn to the Splash display to cause all Style1 buttons to
change their background color when selected. To change the highlight color of all
buttons, change the Fill Color of this Power DragOn in the Splash display.
Style1 Button1 Highlight Text
Add this Power DragOn to the Splash display to cause all Style1 buttons to
change their text color when selected. To change the highlight color of all buttons,
change the Text Color of this Power DragOn in the Splash display.
Style1 Button1 Disable Key Press
15
Style1 Process Colors
Add this Power DragOn to the Splash display to change the status color of all
Style1 process Power DragOns. To choose different status colors, simply select the
text of this Power DragOn in the Splash display and change the Fill Color.
FactoryLink 6.6.0 / Application Editor Guide / 221
Object Animation
Add this Power DragOn to the Splash display to disable the appearance of all
Style1 buttons being depressed with a mouse down action.
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
Style1 Button1 ToolTip
Add a Style1 Button1 ToolTip Power DragOn to each display where you want to
have tooltip text displayed near all Style1 buttons and process Power DragOns
when they are chosen. Each time you add additional Power DragOns to a display
with this feature, you must move this Power DragOn to front. To change the
tooltip color, font, or text size, change the attributes of the Power DragOn in the
each display.
Style1 Button1 Outline
Add a Style1 Button1 Outline Power DragOn to each display where you want an
outline to be displayed around all Style1 button Power DragOns when they are
chosen. Each time you add additional Power DragOns to a display with this
feature, you must move this Power DragOn to front. To change the highlight
outline’s line style or color, change the attributes of this Power DragOn in each
display.
Style1 Process Outline
Add a Style1 Process Outline Power DragOn to each display where you want to
have a 3D button displayed around all Style1 process Power DragOns when they
are chosen. Each time you add additional Power DragOns to a display with this
feature, you must move this Power DragOn to the front. At run time this button
will depress with mouse down actions like other Style1 buttons.
Style1 Process Command
Add a Style1 Process Command Power DragOn to each display where you want to
have a control panel displayed near all Style1 process Power DragOns when they
are chosen. Each time you add additional Power DragOns to a display with this
feature, you must move this Power DragOn to front. At run time the two buttons
of this Power DragOn allow you to proceed with the commanded operation or
cancel it.
222 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
Tutorial
The Tutorial Power Pack contains a collection of Power DragOns copied from the
other Power Packs. When these template items are pasted onto a screen, default
values are provided in the template dialogs. The only Power DragOn not copied
from another Power Pack is the Simulator.
15
Object Animation
FactoryLink 6.6.0 / Application Editor Guide / 223
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
VALVES
Run-time Features
The Valves Power Pack includes valve Power DragOns that allow you to view and
control a valve state. Each renders the valve state using the colors set by the
Style1 Process Colors Power DragOn.
Template Prompts
Process tag name
Real-time database elements
Valves create or reference a digital process tag. When the Power DragOn object is
pasted on a screen, the system creates the following tags a new tag name is
entered in the template dialog.
{tag}
{tag}_command
Sizing and Rotating
Valves can be both sized and rotated.
224 / FactoryLink 6.6.0 / Application Editor Guide
WORKING WITH POWER PACKS
FactoryLink Supplied PowerPacks
VESSELS
Run-time Features
Each vessel renders a single value as a solid blue vertical bar graph. The height of
the bar is determined by the value of the tag. The minimum and maximum values
for the vessel are attached to the process tag’s tag.eumin and tag.eumax values. The
scale of the vessel can be modified at run time by changing the values of these
tags.
Template Prompts
1 Process tag name
15
2 Default maximum level
Vessels create or reference an analog or floating-point process tag. When the
Power DragOn object is pasted on a screen, the system creates the following tags
after a new tag name is entered in the template dialog.
{tag}
{tag}.eumax {tag}.eumin
{tag}.raw
{tag}.rawmax
{tag}.rawmin
{tag}.lock
FactoryLink 6.6.0 / Application Editor Guide / 225
Object Animation
Real-time database elements
•
WORKING WITH POWER PACKS
•
FactoryLink Supplied PowerPacks
•
•
Sizing and Rotating
Vessels can be sized but not rotated.
Customizing
Vessels contain one animated component, a bar graph. You modify this by
sub-selecting the animated component. When selected, a green check is displayed
in the bar graph animation in the toolbox. Choose the checked animation tool to
display or modify the animation properties.
226 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 16
Drawing-Level
Animation
Drawing-level animations are not linked to an object in the drawing. Instead, they
are linked to a real-time element that executes the action when changed. You can
configure drawing-level animation to perform the following actions:
• Print the screen
• Beep when a condition occurs
• Respond to a key press
This chapter describes how to configure these actions.
To activate these options, you must first open a drawing. Drawing-level
animations do not use an object but rather define an element so when the element
value is 1 (ON), it causes the animation to occur. Although you define this element
for the drawing, you can associate it with an animated object. For example, you
can animate a button object using the same element defined for the Print Screen
option, so when the operator selects the button object at run time, it prints the
screen.
The Function Key command on the Animation menu allows you to tie real-time
elements to keyboard function keys. Then, at run-time, the operator can press the
associated function key to perform the action. FactoryLink performs the specified
operation, such as changing the active drawing in a window or shutting down a
task.
16
Object Animation
FactoryLink 6.6.0 / Application Editor / 227
•
DRAWING-LEVEL ANIMATION
•
Print Screen Animation
•
•
P RINT S CREEN A NIMATION
Perform the following steps to animate an object to print the contents of a screen
after selecting an object.
1 Select the object you want to animate.
2 Choose Animation>Print Screen to display the Print Screen Animation dialog.
3 Specify the following information:
Enable Tag
Enter the name of the digital tag that controls screen printing.
The screen is printed when the tag value changes to 1.
4 Choose one of the following:
OK
Saves the information
Cancel
Discards the information
Delete
Deletes the tag definition
228 / FactoryLink 6.6.0 / Application Editor
DRAWING-LEVEL ANIMATION
Beep Animation
B EEP A NIMATION
Beep animation allows you to configure the computer to beep on conditions at run
time. This is useful for alerting the operator of a change in conditions requiring
immediate attention.
For example, you can use the name of the element specified in a Math & Logic
procedure that sets the element value to 1 when a particular process value is
reached, thereby causing the computer to beep.
Perform the following steps to configure a tag to beep:
1 Select the object you want to animate.
2 Choose Animation>Beep to display the Beep Animation dialog.
3 Provide the following information:
Enable Tag
Enter the name of the digital tag that causes the computer to
beep. When the tag value is 1, the computer beeps.
4 Choose one of the following:
OK
Saves the information
Cancel
Discards the information
Delete
Deletes the tag definition
16
Object Animation
FactoryLink 6.6.0 / Application Editor / 229
•
DRAWING-LEVEL ANIMATION
•
Function Key Animation
•
•
F UNCTION K EY A NIMATION
Function Key animation animates a key on the keyboard or a button on the
pointing device to execute an action when it is pressed. Function Key animation is
like Button animation except Function Key animation is used to animate actual
buttons (keyboard keys or pointing device buttons) while button animation is used
to animate button objects on the display.
Note: The Alt-F6 key is generally trapped by Microsoft Windows
and changes window focus from the current top window to the
next window in the order. Use of the Alt-F6 key should be
avoided on any application which may need to run under
Windows 95 or Windows NT.
Perform the following steps to animate a function key:
1 Select the object you want to animate.
2 Choose Animation>Function Key to display the Select Function Key dialog listing all
defined function keys. The box is blank if none are defined.
230 / FactoryLink 6.6.0 / Application Editor
DRAWING-LEVEL ANIMATION
Function Key Animation
3 Provide the following information:
Function Key
Abbreviation of the function key you want to perform the action.
This can be one of the following:
Table 16-0 Function Key Abbreviations
Description
Keystroke
options
Description
Keystroke
options
No key
NUL
Page Up
PUP
Reserved
BT1
Page Down
PDN
Reserved
BT2
End
END
Reserved
BT3
Home
HME
Break
BRK
Left arrow
LFT
Backspace
BSP
Up arrow
UP
Shift + Tab (back tab)
BTB
Right arrow
RGT
NL
Down arrow
DWN
Enter
ALG
Tab
TAB
Pause
PSE
Enter
ENT
Caps Lock
CLK
SysRq
SYS
Escape
ESC
Delete
DEL
Insert
INS
Function keys F1 - F24
F1 to F24
FactoryLink 6.6.0 / Application Editor / 231
16
Object Animation
Alt graph
•
DRAWING-LEVEL ANIMATION
•
Function Key Animation
•
•
4 Click on OK. The Button Animation dialog displays.
5 Complete the dialog. Refer to Chapter 12, “Animating an Object as a Button”, for
detailed instructions.
6 Click on OK to save the animation information.
232 / FactoryLink 6.6.0 / Application Editor
Manual Name Variable Applied Here
PowerVB Animation
FactoryLink 6.6.0 / September 1988 / 000A*DOC-PVB*000*660233
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Part IV
•
•
•
•
Chapter 17
PowerVB Overview
17
At run time, scripts are triggered by events. In FactoryLink, changes in tags can
trigger many events such as:
• PLC Communications
• File Operations
• Recipe Operations
PowerVB supports these FactoryLink events as well as other built-in graphical
events, which will be discussed thoroughly in the next chapter.
PowerVB is an interpreted language.The code runs under the graphic task and is
multi threaded.This means the code for different objects and/or different drawings
runs at the same time if the drawings are both loaded into enabled windows at the
same time. Performance varies based on the amount of code being executed.
Be familiar with programming in BASIC or Visual Basic® before using PowerVB.
Refer to the PowerVB Language Reference Guide for specific syntax information.
It is generally good practice to limit PowerVB scripts to those controlling
graphical manipulation. PowerVB is not recommended for use in some cases.
These include:
• If the script is lengthy enough to require significant debugging.
• For computation-complex executions because PowerVB is slower than
IML/CML.
• If only tags are manipulated and only tag events are used (IML).
FactoryLink 6.6.0 / Application Editor Guide / 235
PowerVB Animation
PowerVB is an animation tool based on Microsoft Visual Basic®. It allows Visual
Basic compatible scripts to be attached to FactoryLink graphic objects. These
scripts may manipulate graphic objects in many ways at run time, including
making the object rotate, move, or change color. Scripts can be attached to a single
graphic object, a composite graphic object, or a piece of a composite object.
•
POWERVB OVERVIEW
•
Differences Between PowerVB and Microsoft Visual Basic
•
•
When to Use PowerVB vs.IML and CML
Use the following list to help determine whether to use PowerVB, IML, or CML.
For more information about IML, refer to Chapter 12, “Math & Logic Task
Definition” in Core Tasks in the FactoryLink Configuration Guide. For more
information about CML, refer to Chapter 9, “Compiled Math & Logic” in Core
Tasks in the FactoryLink Configuration Guide.
Use IML/CML:
• When speed is a factor.
• When a needs to be triggered at a continuous interval, for example to average 2
points so the result can be logged. In addition to being slower, the PowerVB will
not run if the drawing it resides on is not loaded.
Use PowerVB:
• When the application needs to react to certain types of events, like mouse
movements.
• When certain properties, such as font type and color, need to be changed.
• To control the execution and behavior, such as maximizing and minimizing, of
non-FactoryLink programs. PowerVB provides standard routines which can be
called from any PowerVB script. All called PowerVB routines must be declared
before being referenced in a PowerVB script.
• To control graphics effects.
D IFFERENCES B ETWEEN P OWER VB
AND
M ICROSOFT V ISUAL B ASIC
The following lists differences between PowerVB and Microsoft Visual Basic.
• Microsoft Visual Basic is forms based, PowerVB uses drawings.
• Microsoft Visual Basic features drag and drop controls onto forms, PowerVB
requires code to be entered into an object using an editor.
• Microsoft Visual Basic objects are windows objects like buttons and list boxes.
PowerVB objects are graphics objects like lines, boxes, and circles.
• Microsoft Visual Basic can not rotate objects at run time.
• Microsoft Visual Basic does not supports templates for code / object portability,
PowerVB does.
• Microsoft Visual Basic external functions and sub procedures can be declared at
the form level, PowerVB requires these to be declared at the object level.
• Microsoft Visual Basic forms can have event procedures, PowerVB can only
have object events.
236 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB OVERVIEW
Opening PowerVB from the Application Editor
• Microsoft Visual Basic requires DLLs to run (VBRUN300.DLL), PowerVB
17
includes all necessary files.
• Microsoft Visual Basic can use third party extensions such as VBX and OCX
multi-platform, although there are commands and function which are platform
specific.
• Microsoft Visual Basic is single threaded, whereas PowerVB is multi threaded.
• Microsoft Visual Basic can run code from the editor, PowerVB requires
FactoryLink to be running.
• Microsoft Visual Basic objects are all located at the form level. They can be
grouped, but this does not change their object reference. PowerVB objects form
an object hierarchy,
O PENING P OWER VB
FROM THE
A PPLICATION E DITOR
Select a graphic object; then open the PowerVB animation editor by choosing
Animation>PowerVB or by clicking the PowerVB icon on the Application Editor
Toolbar.
Choose File>Open PowerVB Lib to open a PowerVB library.
P OWER VB S YMBOL N AME
MEMORY
L IMITATION
There is a 64K byte limitation to the memory available for public symbol names
for all the graphics loaded during runtime. Examples of public symbols are:
• Public variables
• Dim variables declared outside subroutines
• Tagnames
• Tagname members
A “create script error” message will be generated when the limit has been
exceeded, and the graphics task will shut down. The solutions are:
• Limit the number of scripts
• Move non-graphic manipulation code to IML/CML
• Shorten public, global, and external variable names
• Limit use of public, global, and external variables
• Use local RTDBObjects instead of tagnames to read and write values
FactoryLink 6.6.0 / Application Editor Guide / 237
PowerVB Animation
controls, PowerVB can not.
• Microsoft Visual Basic only runs on Windows operating systems, PowerVB is
•
POWERVB OVERVIEW
•
For More Information
•
•
For example:
dim x as RTDBObject
set x = RTDBObjectValue (tagname)
this.text = x value
Note that most tagnames members can only be accessed via local RTDBObject
variables such as x. type, x. raw, x. max, x. min, etc.
F OR M ORE I NFORMATION
This guide is intended to provide you with basic understanding of how to create
PowerVB scripts. See the PowerVB Language Reference Guide for a reference to
each function available in PowerVB.
238 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 18
PowerVB Editor
18
FactoryLink 6.6.0 / Application Editor Guide / 239
PowerVB Animation
This chapter explains the various menu options available in the PowerVB
animation editor. Because PowerVB has no configuration panels, PowerVB
animation is set up by entering code in the editor window.
•
POWERVB EDITOR
•
PowerVB Animation Editor
•
•
P OWER VB A NIMATION E DITOR
File Menu
Use the File menu for the following reasons:
• To validate and save a script
• To import or export information
• To delete PowerVB animation from a graphic object
• To close the PowerVB animation editor.
Choose one of the following options from the File menu:
Validate
Save
Checks the object script for errors. If the script is valid, a message
displays in the bottom left of the window. If the script contains an
error, an alert window displays. The text where the error occurs
displays in the bottom left of the window, and the line containing
the error is highlighted in the animation editor.
Saves the object script.
240 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EDITOR
PowerVB Animation Editor
Import
Allows you to import ASCII text into the current editor window.
Refer to “Using the Import and Export Dialog” on page 242 for a
description of fields in the Import dialog.
18
PowerVB Animation
Export
Allows you to export either the selected text in the object script or
the entire script to a text file. This is useful for printing the script
or attaching the script to another object.
FactoryLink 6.6.0 / Application Editor Guide / 241
•
POWERVB EDITOR
•
PowerVB Animation Editor
•
•
Refer to “Using the Import and Export Dialog” on page 242 for a
description of fields in the Export dialog.
Delete
Close
Deletes all of the PowerVB animation for the object. A message
window displays to verify the script should be deleted.
Closes the PowerVB animation editor. If changes have been made
to the script since it was last saved, the editor prompts to see if
the changes should be saved.
Using the Import and Export Dialog
The Import and Export dialogs operate similarly. Each dialog consists of the
following components:
• Menubar
• Current path combo box
• Files area
• Chosen file text box
• Open or Save button
• Apply button
• Cancel button
Menubar
Current Path Combo Box
Files Area
Chosen File Text Box
Open/Save, Apply, and
Cancel Buttons
242 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EDITOR
PowerVB Animation Editor
History Menu
Recent Files List
Marked Directories List
Recent Files List
Marked Directories
List
Marks recently selected directory paths. Choose a path in this list
to change the chosen path.
Shows directory paths marked with the Mark option under the
Special menu. Choose a path in this list to change the chosen
path.
Special Menu
The Special menu is used to change to the home directory, insert the current
directory in the marked directories list, or remove the current directory from the
marked directories list.
Home
Mark
Unmark
Changes the current path to the home path. For example, on
Windows NT a user home path is defined in the environment
variables HOMEDRIVE and HOMEPATH. This is the path
holding the user log-in script and other information.
Adds the current path to the marked directories list under the
History menu.
Removes the current path from the marked directories list under
the History menu.
FactoryLink 6.6.0 / Application Editor Guide / 243
18
PowerVB Animation
The History menu is used to change to a specific path. The section above the
horizontal line is the recent files list. The bottom section is the marked directories
list.
•
POWERVB EDITOR
•
PowerVB Animation Editor
•
•
View Menu
The View menu is used to change the order of the files and directories shown in the
file area of the dialog.
By Name
Sorts files in the file area by their names.
By Date Modified
Sorts files in the file area by the date they were last modified.
Files are sorted from least recently modified to most recently
modified.
By Date Created
Sorts files in the file area by the date they were created. The files
are sorted from the oldest to the newest.
Volumes Menu
The Volumes menu is used to display the current directory for each drive.
Current Paths List
Choose a path in this list to change the current path.
Current Path Combo Box
Box below menu bar that displays a list of the components of the current path and
backs up the current path to one of its parent directories.
Files Area
List below Current Path Combo Box that displays the files and directories in the
current path. The top left button changes the current path to its parent path. The
bottom left button changes the current path down one level to the directory chosen
in the files list, if a directory is selected. The list shows the files and directories
according to the order chosen under the View Menu. The scrollbar on the right of
the list shows more files if too many files exist to display at once.
244 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EDITOR
PowerVB Animation Editor
Chosen File Text Box
Open or Save Button
The Open or Save button is in the lower-left corner of the dialog and is used to open
(import) or save (export) text. This button says Open when importing or Save
when exporting. No importing or exporting actually occurs until this button is
pressed.
Apply Button
The Apply button imports or exports the selected text. Choosing Open or Save also
achieves this result.
Cancel Button
The Cancel button is in the lower-right corner of the dialog and is used to cancel
the import or export operation. No text is imported or exported when this button
is pressed.
FactoryLink 6.6.0 / Application Editor Guide / 245
18
PowerVB Animation
The Chosen File Text Box displays the name of the file to be opened or saved. The
text above the entry field is either Open: or Save as:, depending on whether text is
being imported or exported. This box is filled in automatically when a file is
chosen in the Files Area. Typing a name into the entry field selects a file without
having to use the Files Area list.
•
POWERVB EDITOR
•
PowerVB Animation Editor
•
•
Edit Menu
Use the Edit menu to cut, copy, paste, or delete code in an object script.
Choose the following options from the Edit menu:
Undo
Erases the previous action(s) performed in PowerVB. Undo as
many actions as needed from the time the script was last saved.
Redo
Repeats the action previously completed.
Cut
Cuts the selected text and posts it to the clipboard.
Copy
Copies the selected text to the clipboard.
Paste
Pastes the text from the clipboard to the PowerVB animation
editor. If the text is selected in the editor, the pasted text replaces
the selected text.
Delete
Deletes the selected text without pasting it to the clipboard.
246 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EDITOR
PowerVB Animation Editor
Search Menu
Use the Search menu to locate specific text in an object script.
18
PowerVB Animation
Choose the following options from the Search menu:
Find
Find Next
Finds the first occurrence of the designated text in the object
script. If the text is found, the cursor moves to the location. A
beep sounds if no matching text is found. The Find option operates
only the animation or library script being edited.
Finds the next occurrence of the designated text in the object
script. A beep sounds if no other occurrence exists beyond the
current location of the cursor in the editor.
PowerVB Search options search the script from the current location of the cursor
to the end of the code. Move the cursor to the beginning of the script before using
these options to ensure the entire script is searched.
FactoryLink 6.6.0 / Application Editor Guide / 247
•
POWERVB EDITOR
•
PowerVB Animation Editor
•
•
Event Menu
Use the Event menu to choose the type of event routine incorporated into an object
script. A sub-menu listing specific events is displayed for each event category
available for the selected object.
Depending on the type of object selected, all types of routines may not be
available. For example, text input routines are not available unless the current
object is a text object that has input animation.
Choose from the following options:
Drawing Routines
Displays a list of drawing events. Specific drawing subroutine
options are discussed in the “Drawing/Window Events” on page
259.
Mouse Routines
Displays a list of mouse events. Specific mouse subroutine options
are discussed in the “Mouse Events” on page 263.
Text Input
Routines
Displays a list of text input events. Specific text input subroutine
options are discussed in the “Text Events” on page 269.
Tag Routines
Define Tag Event
Displays a list of defined tag events. Specific tag subroutine
events are discussed in the “RTDB Events” on page 271.
Allows you to define tag events. Tag events trigger an event
during run time based on the value of one or more tags changing.
248 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EDITOR
PowerVB Animation Editor
Help Menu
Choose from the following options:
Menubar Options
Displays online help about the menu options available in the
PowerVB animation editor.
PowerVB Editor
Displays online help about the PowerVB editor.
Event Routines
Displays online help about the event routines that may be
attached to an object in PowerVB.
FactoryLink 6.6.0 / Application Editor Guide / 249
18
PowerVB Animation
Use the Help menu for online information about menu options using the PowerVB
animation editor, event routines, and object properties.
•
POWERVB EDITOR
•
PowerVB Animation Editor
•
•
Object Properties
Displays a list of the properties available for the object whose
script is being edited.
If text is selected in the editor when this menu option is chosen,
the selected text is interpreted as a graphic object name and
properties for that object are displayed. For example, if the script
for an object named Box is being edited and Object Properties is
chosen when no text is selected, then Box’s PowerVB properties
display. If the text \Rectangle is selected and the drawing has a
top-level object named Rectangle, then Rectangle’s PowerVB
properties display.
250 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 19
Attaching a Script to
an Object
C REATING
A
S CRIPT
Perform the following steps to create a script:
1 Create an object in the Application Editor.
2 Select the object.
3 Choose Attributes>Object Name. Name the object and click on OK to accept the new
name.
This step is optional, but it is a good idea to name objects that will be referenced
from other objects because the object name serves as its reference in the
subroutine code. Refer to Chapter 26, “Hierarchical Graphic Object Naming” for
more information on naming objects.
FactoryLink 6.6.0 / Application Editor Guide / 251
PowerVB Animation
This section details the procedure for attaching a PowerVB script to an object.
This procedure is used for any type of event routine coded in an object script.
Specific information about each of the events, variables used in their subroutines,
and examples of PowerVB code for specific events follow this procedure.
19
•
ATTACHING A SCRIPT TO AN OBJECT
•
Creating a Script
•
•
4 Choose Animation>PowerVB to will display the PowerVB animation editor window.
5 Choose the type of event routine to be attached to the object from the Event menu.
When an event routine is selected, its beginning and ending statements display in
the PowerVB animation editor window. The beginning statement is
Sub <drawing>_<object id>_<event>
The ending statement is always
End Sub
252 / FactoryLink 6.6.0 / Application Editor Guide
ATTACHING A SCRIPT TO AN OBJECT
Creating a Script
6 Add the necessary PowerVB code in the PowerVB animation editor window.
Typically this code opens FactoryLink properties. Information on each type of
PowerVB event follows this procedure.
FactoryLink application containing PowerVB on a
different platform. Several statements in the BASIC
language PowerVB supports are only available on
PC operating systems - Windows NT, Windows 95,
and OS/2. Also be aware that some BASIC
statements are restricted to Windows NT or
Windows 95. The PowerVB Language Reference
Guide provides information on which statements are
restricted to which platforms, syntax, and
commands.
Click on a checked item in the Event pull-down menu to jump the cursor to the
location of the subroutine in the script. This is helpful when navigating through a
lengthy script.
7 After entering the necessary code, validate it to ensure the script can be executed
at run time. Choose File>Validate to validate the code. If the code contains an error,
a message is displayed and the first incorrect line of code is highlighted. Correct
any errors and repeat this step until validation is successful.
8 Choose File>Save to save the object script and close the PowerVB animation editor.
Note: Closing the PowerVB animation editor is optional.
Remember that leaving the PowerVB animation editor open
while writing code requires frequent saving until the drawing
is closed. If the PowerVB animation editor is open, toggle to the
Application Editor before proceeding to Step 9.
9 Choose File>Save in the Application Editor to save the drawing.
Note: This is important because both the PowerVB code and
the object must be saved for proper execution of the object script.
10 Run the application to test the animation.
Note: The Test command in the Application Editor cannot test
PowerVB functions. The application must be run to test the
PowerVB code.
11 Debug the script if necessary. Refer to Chapter 27, “Debugging a PowerVB Script”
for information on debugging PowerVB code.
FactoryLink 6.6.0 / Application Editor Guide / 253
PowerVB Animation
Caution: Be careful using statements that may be ported to a
19
•
ATTACHING A SCRIPT TO AN OBJECT
•
Creating a Script
•
•
Adding Comments to a Script
Add an apostrophe to the beginning of text that serves as a comment in the script.
A comment can be displayed on a line by itself or after a BASIC statement.
Comments can also begin with the word REM if no BASIC statement precedes the
comment on the same line.
Another alternative is enclosing the comment with a slash and the * character, as
shown in the following example. Refer to the PowerVB Language Reference Guide
for more information on coding subroutines in PowerVB.
Sub cj1_g1145_MouseMove [(X As Long, Y As Long)]
‘Comment: Move this object where the mouse was moved
this.Left = X ‘Comment: Move object horizontally
this.Bottom = Y ‘Move object vertically
REM this is also a comment
/*This is also a comment.*/
End Sub
PowerVB Files
PowerVB creates the following additional files:
*.GS
PowerVB source code for a specific drawing file.
*.GC
Compiled PowerVB code for a specific drawing file.
*.GPS
PowerVB source code associated with a power pack.
*.GPC
Compiled PowerVB code associated with a power pack.
*.PLS
PowerVB library source files.
*.PLC
Compiled PowerVB library files.
*.PLX
Exported PowerVB libraries.
Caution: Do not delete these files or your PowerVB will not
work.
254 / FactoryLink 6.6.0 / Application Editor Guide
ATTACHING A SCRIPT TO AN OBJECT
Calculating Graphic Object Movement
C ALCULATING G RAPHIC O BJECT M OVEMENT
Coordinates for an object are defined with the Left and Bottom properties.
FactoryLink coordinates are numbered from the bottom-left corner, which is 0,0,
and the numbers increase as you move upward or to the right. It is simple to
calculate the right (object.Left + object.Width) and top (object.Bottom +
object.Height) coordinates of the object, if necessary.
All coordinates are relative to the bottom left corner of the drawing, not the
bottom left corner of the selected object. The coordinate range is approximately
32,000 horizontal (along the X axis) and 24,000 vertical (along the Y axis),
depending on the properties of the specific display and the shape of the window
the drawing displays in.
P RINTING S CRIPTS
Perform one of the following procedures to print a script:
Exporting Text
1 Select the text to be printed.
2 Choose File>Export. Enter a name for the ASCII-format file.
3 Print the code.
Using Document PowerVB
1 Choose File>Document PowerVB in the Application Editor. A message box is
displayed with the name of the report that will be generated.
2 Open the report through a text editor.
3 Print the report.
Pasting to the Clipboard
1 Copy the text directly into a text editor using the clipboard.
2 Print the code.
FactoryLink 6.6.0 / Application Editor Guide / 255
19
PowerVB Animation
The coordinate location and anchor points of an object are important when
considering and calculating object movement. Unlike Microsoft Visual Basic®,
PowerVB uses the same coordinate system as other types of animation.
•
ATTACHING A SCRIPT TO AN OBJECT
•
Reserved Words
•
•
Object Names and Object IDs
When you create a graphic object, it receives a default name which the application
developer can replace (Attributes, Object Name). These default names are in the
form of hxxxx where xxxx is a sequential number starting at 1001. Each object also
gets an ID in the form of #xxxx where xxxx is also a sequential number.
Object names and IDs are important to understand because the object name can
be used in the body of the PowerVB code while the object ID is used to generate
the event procedure names. Do not use duplicate procedure names in the same
drawing. The object ID, unlike the object name, is always unique; therefore, no
duplicate event procedure names occur.
R ESERVED W ORDS
All statements and function names in the PowerVB Language Reference Guide as
well as all properties and methods are considered reserved words. These words
cannot be used as variable names in PowerVB.
256 / FactoryLink 6.6.0 / Application Editor Guide
ATTACHING A SCRIPT TO AN OBJECT
Literals
L ITERALS
19
Table 19-0 Literals supported by PowerVB
Literal
Description
10
Integer whose value is 10.
43265
Long whose value is 43,265.
5#
Double whose value is 5.0. A number type can be explicitly set
using any of the following type-declaration characters.
%
Integer
&
Long
#
Double
!
Single
5.5
Double whose value is 5.5. Any number with a decimal point
is considered a double.
5.4E100
Double expressed in scientific notation.
&HFF
Integer expressed in hexadecimal.
&047
Integer expressed in octal.
&HFF#
Double expressed in hexadecimal.
“hello”
String of five characters: hello.
“““hello””” String of seven characters: “hello”. Quotation marks can be
embedded within strings by using two consecutive quotation
marks.
#1/1/1994#
Date value whose internal representation is 34335.0. Any
valid date can appear with #’s. Date literals are interpreted at
execution time using the local settings of the host
environment. To ensure that date literals are correctly
interpreted for all locales, use the international date format:
YYYY-MM-DD HH:MM:SS#
FactoryLink 6.6.0 / Application Editor Guide / 257
PowerVB Animation
Literals are values of a specific type. The following table shows the different types
of literals supported by PowerVB.
•
ATTACHING A SCRIPT TO AN OBJECT
•
Literals
•
•
258 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 20
PowerVB Events
20
D RAWING /W INDOW E VENTS
Use drawing/window events to perform the following types of operations at run
time:
• Events that happen when a drawing is loaded or unloaded from memory
• Events that happen when a window gains or loses focus
Open these events from the Drawing Routines menu.
Drawing Routines menu
The following graphic is the Drawing Routines menu.
FactoryLink 6.6.0 / Application Editor Guide / 259
PowerVB Animation
PowerVB events determine when PowerVB code is initiated at run time. For
example, a PowerVB routine could be assigned to run when the drawing is loaded.
Many different types of events come built in to PowerVB; however, you may also
define your own types of events. This chapter describes the PowerVB built-in
events as well as user-defined events.
•
POWERVB EVENTS
•
Drawing/Window Events
•
•
DrawUnload
A DrawUnload event occurs when the drawing is about to be unloaded from
memory. This event occurs every time the drawing is unloaded from a window
whether it is loaded in other windows or not.
Sample Code:
sub mouse_g1005_DrawUnload
window.title = old_title ‘reset windows title
end sub
Note: If a window is removed/dismissed by setting the enable
tag to 0, the DrawingUnload event is not triggered for the active
drawing (the WinLostFocus event is triggered).
DrawLoad
A DrawLoad event occurs when the drawing is loaded into memory. The
DrawLoad event occurs every time the drawing is loaded into a window whether it
is already loaded in other windows or not.
260 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EVENTS
Drawing/Window Events
For example, the ceramic injection drawing title changes with the code that
follows.
20
PowerVB Animation
Sample Code:
sub mouse_g1006_DrawLoad
old_title = window.title ‘save window’s previous
‘title
window.title = “Mouse Events” ‘change window’s title
WinLostFocus
A WinLostFocus event occurs when a window loses input focus or is no longer the
top window.
FactoryLink 6.6.0 / Application Editor Guide / 261
•
POWERVB EVENTS
•
Drawing/Window Events
•
•
Sample Code:
sub misc1_g1020_WinLostFocus
this.text = “Window Lost Focus”
end sub
WinGotFocus
A WinGotFocus event occurs when a window receives input focus or becomes the
top window.
Sample Code:
sub misc1_g1001_WinGotFocus
this.text = “Window Got Focus”
end sub
Debug windows focus events carefully. If an error occurs in a window focus event,
the error pop-up message causes another window focus event, which may cause
another error. This results in an infinite loop.
Note: The WinGotFocus event is not triggered if a drawing is
loaded into an open window; it is only triggered if the drawing
is loaded into a new window.
262 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EVENTS
Mouse Events
M OUSE E VENTS
20
Mouse events are used in PowerVB to perform the following types of operations:
• Animate an object to show when you press and release a mouse button
• Indicate when the mouse is passed over an object
For non-rectangular objects, mouse events are captured within the bounding box
of the object (defined as an imaginary rectangle enclosing the object). If objects
overlap, the object on top generates the mouse routine.
Open mouse events through the Mouse Routines sub-menu.
Mouse Routine Arguments
Mouse routines take either two arguments (X As Long, Y As Long) or three
arguments (Button As Integer, X As Long, Y As Long).
The Button As Integer argument defines which button is pressed, released, or
clicked to cause an event. The value of Button is checked against the pre-defined
constants as in the following example:
Sub drwg_g1003_MouseDown (Button As Integer, X As Long, _
Y As Long)
if Button and Left_Button then
REM left button pressed, released, or clicked
elseif Button and Right_Button then
REM right button pressed, released, or clicked
elseif Button and Middle_Button then
REM middle button pressed
end if
End Sub
The X As Long and Y As Long arguments define the horizontal and vertical
coordinates of the mouse at the time the event occurred.
FactoryLink 6.6.0 / Application Editor Guide / 263
PowerVB Animation
• Click and drag objects
•
POWERVB EVENTS
•
Mouse Events
•
•
Mouse Routines Menu
The following graphic is the Mouse Routines menu.
MouseMove (X as long, Y as long)
A MouseMove event occurs when the mouse is moved over an object.
Sample Code:
sub mouse_g2001_MouseMove(X As Long, Y As Long)
if mouse_button_state = 1 then
This.Left = X - XOffset.value
This.Bottom = Y - YOffset.value
end if
end sub
264 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EVENTS
Mouse Events
MouseUp (button as integer, X as long, Y as long)
Sample Code:
sub Drawing_Object_MouseDown(Button As Integer, X As Long,_
Y As Long)
’ This code gives the effect of a button being pressed
This.c(“LeftLine”).linecolor = 57
This.c(“TopLine”).linecolor = 57
This.c(“RightLine”).linecolor = 63
This.c(“BottomLine”).linecolor = 63
end sub
sub Drawing_Object_MouseUp(Button As Integer, X As Long, _
Y As Long)
' This code gives the effect of a button being released
This.c(“LeftLine”).linecolor = 63
This.c(“TopLine”).linecolor = 63
This.c(“RightLine”).linecolor = 57
This.c(“BottomLine”).linecolor = 57
end sub
MouseDown (button as integer, X as long, Y as long)
A MouseDown event occurs when a button on the mouse is pressed. An example of
PowerVB code using this event is illustrated in the discussion of the MouseUp
event.
FactoryLink 6.6.0 / Application Editor Guide / 265
20
PowerVB Animation
A MouseUp event occurs when a mouse button is released and even if the mouse
cursor is moved off the object before the button is released.
•
POWERVB EVENTS
•
Mouse Events
•
•
Dragging an Object
Use the MouseUp and MouseDown routines to identify whether the object is
selected. Use MouseMove to drag the selected object to a new location on the
screen. The following example illustrates PowerVB code to achieve this
animation.
Private Mouse_Is_Down As Integer, X_Offset As Integer,_
Y_Offset As Integer
sub Drawing_g1002_MouseMove(X As Long, Y As Long)
If Mouse_Is_Down then
’ Move object while mouse button is down
This.Left = X - X_Offset
This.Bottom = Y - Y_Offset
End If
end sub
sub Drawing_g1002_MouseUp(Button As Integer, X As Long, Y As_
Long)
Mouse_Is_Down = FALSE
end sub
sub Drawing_g1002_MouseDown(Button As Integer, X As Long,_
Y As Long)
If Button = LEFT_BUTTON Then Mouse_Is_Down = TRUE
’ Calculate where user clicked on object
X_Offset = X - This.Left
Y_Offset = Y - This.Bottom
end sub
When a mouse button is pressed while the mouse cursor is over an object that
responds to the MouseDown, MouseMove, or MouseUp events, that object gains
mouse focus. All MouseMove events go to an object with mouse focus even if the
mouse cursor moves off the object. Mouse focus is lost when the button is released.
266 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EVENTS
Mouse Events
EndPointedAt (X as long, Y as long)
An EndPointedAt event occurs when the mouse stops being over an object.
sub Drawing_Object_EndPointedAt(X As Long, Y As Long)
’ Change this object back to gray when the cursor moves away
This.Fillcolor = GRAY
end sub
Click (button as integer, x as long, y as long)
A Click event occurs when the mouse button is pressed and released while over an
object. A click event does not occur if the mouse is moved off of the object before
the button is released. A click event does occur if the mouse is moved off of the
object and back onto the object before the button is released.
Sample Code:
Click (button as integer, x as long, y as long)
’Force tag ’ThisTag’ to 1
ThisTag.Force 1
end sub
BeginPointedAt (x as long, y as long)
A BeginPointedAt event occurs when the mouse initially moves over an object.
Sample Code:
sub Drawing_Object_BeginPointedAt(X As Long, Y As Long)
’ Change this object to red when the cursor is over it
This.Fillcolor = RED
end sub
FactoryLink 6.6.0 / Application Editor Guide / 267
PowerVB Animation
Sample Code:
20
•
POWERVB EVENTS
•
Mouse Events
•
•
Troubleshooting – Overlapping Objects
If objects are overlapping, the top-most object with a mouse event defined receives
all mouse events of that type, as demonstrated in the following example.
ObjectA
ObjectB
If both ObjectA and ObjectB have Click events and you click on ObjectB, the Click
routine for Object B will run but not ObjectA. If this type of behavior is required,
put all of the Click event code in ObjectA and, based on the X and Y parameters in
the Click event, determine where the Click occurred.
If ObjectA has a MouseMove event but ObjectB does not, ObjectA receives the
MouseMove events, even if the mouse is pointing at ObjectB.
If ObjectA has a EndPointedAt event, it executes when the mouse cursor enters
Object B.
268 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EVENTS
Text Events
T EXT E VENTS
20
Text Input Routines Menu
The Text Input Routines menu is displayed below. The following paragraphs explain
the text input events.
EnterKey
An EnterKey event occurs when the enter key is pressed if the contents of the Edit
field have not been written to the RTDB.
Sample Code:
sub Drawing_Object_EnterKey
’ Change the contents of this field to uppercase
This.Text = UCase(This.Text)
end sub
FactoryLink 6.6.0 / Application Editor Guide / 269
PowerVB Animation
Text events in PowerVB code are used to perform various operations. Only text
objects with input text animation can have these events. If a text event is defined
for another object, the event subroutine is never invoked.
•
POWERVB EVENTS
•
Text Events
•
•
LostFocus
A LostFocus event occurs when a text object has keyboard focus, then loses it.
Sample Code:
sub Drawing_Object_LostFocus
‘Indicate that this field no longer has focus by changing
‘text to black
This.Textcolor = BLACK
end sub
GotFocus
A GotFocus event occurs when a text object gets keyboard focus. For example, an
input text field has focus at run time when the cursor is positioned in that field. To
gain focus, you click on the field or tab to the field.
Sample Code:
sub Drawing_Object_GotFocus
‘Indicate that this field has focus by
‘changing text to red
This.Textcolor = RED
end sub
Change
A Change event occurs when the contents of a text object change.
Sample Code:
sub Drawing_Object_Change
‘Update the window title with the contents of this
‘text object
Window.Title = This.Text
end sub
270 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EVENTS
RTDB Events
RTDB E VENTS
20
The combination of all of the tag events for an object can have a maximum of 50
different tags in the trigger lists.
D EFINING TAG E VENTS
Tags are used to trigger certain FactoryLink or custom-created events at run time
when one or more tag values change.
Adding a New Tag Event
1 Choose Event>Define Tag Event in the PowerVB animation editor to display the
Define Tag Event window.
2 Enter a name for this event in the Event Name field of the dialog.
3 Enter the applicable tag in the Tag List Edit field.
4 Click on Add, or press return, to add the tag to the trigger list.
FactoryLink 6.6.0 / Application Editor Guide / 271
PowerVB Animation
RTDB events are used to perform various operations. These events do not have
pre-defined names. Define the name of a RTDB event and its trigger elements in
the PowerVB animation editor. RTDB events do not take any arguments. A list of
the tag routines defined is available in the Tag Routines menu. Click on the name
of a routine to jump to the appropriate place in the script for that routine.
•
POWERVB EVENTS
•
Defining Tag Events
•
•
5 Click on OK to accept the new tag event information. The beginning and ending
statements for the subroutine are created in the PowerVB animation editor
window.
6 Enter the code for this event in the PowerVB animation editor window.
The example below outlines the procedure for creating and implementing an event
that occurs once each second. A tag event named onesecond using the tag A_SEC
is used to implement an analog clock. The object SecondHand rotates 6 degrees
every second (variables ClockFaceHorizCenter and ClockFaceVertCenter would
have been previously calculated).
sub drawing_object_onesecond
\SecondHand.rotate ClockFaceHorizCenter,_
ClockFaceVertCenter, 6
end sub
Tag events are defined at the object level. It is possible to have a tag defined as
part of more than one tag event. Also, more than one tag can be used as a trigger
for a single tag event. Repeat Steps 3 and 4 in the example to add as many tags as
desired to a tag event’s trigger list.
Modifying an Existing Tag Event
Use the Define Tag Event Window to change the name of an existing tag event or
change the list of tags used to trigger it.
1 Choose Event>Define Tag Event to display the Define Tag Event window.
2 Click on the arrow next to the Event Name field to display a list of the existing tag
events.
3 Select a tag event from this list. The name is displayed in the Event Name field.
4 Alter the tag event as necessary.
272 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB EVENTS
Defining Tag Events
Renaming a Tag Event
Adding a Tag
Enter the tag name in the entry field above the Add button to add a tag to the tag
list for the tag event. Click on Add to insert the tag into the list.
Removing a Tag
Select the tag to remove it from the tag list for the tag event, or click on Remove to
delete the tag from the list.
5 Once a tag event has been altered in the Define Tag Event window, click on OK to
apply the changes to the code in the editor or click on Cancel to discard the
changes.
Note: Once the tag event has been altered, the PowerVB editor
script must still be saved to make the change permanent.
Deleting an Existing Tag Event
Use the Define Tag Event window to delete an existing tag event.
1 Choose Event>Define Tag Event to display the Define Tag Event window.
2 Click on the arrow next to the Event Name field to display a list of the existing tag
events.
3 Select a tag event from this list to display the name in the Event Name field.
4 Click on Delete to remove this tag event. The event, as well as all the code in its
subroutine, is deleted.
FactoryLink 6.6.0 / Application Editor Guide / 273
20
PowerVB Animation
Click on Rename to rename the tag event. A message box displays, prompting for a
new name. Once a new name is entered, the tag event code in the animation editor
changes to use the new name.
•
POWERVB EVENTS
•
Declaring Events
•
•
D ECLARING E VENTS
Event routine declarations are generated when a routine is chosen from the event
menu. All events in PowerVB have the same declaration statement format:
sub drawing_object_event [(arguments)]
where
drawing
is the name of the drawing to which the PowerVB animation is
attached
object
is the ID of the object to which the PowerVB event is attached
event
is the event name
[(arguments)]
is the list of arguments for the event, if any
For example, the MouseMove event for object z1002 on drawing button.g is
declared as:
sub button_z1002_MouseMove (x as long, y as long)
A statement declaration in a PowerVB script is highlighted in the following
example.
Do not change the declaration text of FactoryLink-created subroutine statements
or the routine will not be triggered properly.
274 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 21
Declare an object for RTDB and graphics objects in PowerVB code in one of
following ways:
• Implicit
• Explicit
I MPLICIT VARIABLES
If the RTDB or graphics object name is used as a variable name in an object’s
PowerVB code, a connection is made automatically to the object. This works with
FactoryLink defined names as well as user-created names. For example, the
following code integrates the meaning of the FactoryLink tag A_SEC and a
graphic object named \graphname.
Sub Somedwg_someobj_DrawLoad
dim I% as integer
‘set I equal to the current second value
I% = A_SEC.Value
‘move the box to the right 20 units
\graphname.Left = \graphname.Left + 20
End Sub
When this code is validated or saved in the PowerVB editor, PowerVB recognizes
A_SEC as a FactoryLink tag and \graphname as a graphics object and uses these
variables with the appropriate meaning.
FactoryLink 6.6.0 / Application Editor Guide / 275
21
PowerVB Animation
Using Variables to
Declare PowerVB
Objects
•
USING VARIABLES TO DECLARE POWERVB OBJECTS
•
Implicit Variables
•
•
However, if a local variable is defined with the same name as a RTDB or graphics
object, the variable overrides the implicit meaning. For example, the variable
A_SEC has no special tag meaning in the following code:
Sub somedwg_someobj_DrawLoad
Dim A_SEC As Integer, I As Integer
I = A_SEC ‘Not a RTDB element
End Sub
Troubleshooting – Implicit Variables
PowerVB recognizes RTDB or graphic object names only if they are defined before
they are used in a script. For example, if you create a script that refers to a
variable named PumpMotor without explicitly defining the variable, saving the
drawing, and then defining a tag named PumpMotor, the variable in the script
has no special tag meaning. However, if you alter the script later, re-save the
drawing, or export and then import the drawing or application the script is
attached to, PowerVB detects that PumpMotor is an RTDB element and uses it as
such.
Avoid using variable names identical to tag names because this makes the
PowerVB script difficult to debug and maintain.
Implicit variable names are case-sensitive. Graphic object names must be
displayed in the correct case every time they are used. RTDB element names must
be displayed in the correct case at least once in a script.
For example, the name A_SEC is recognized as a tag in both places in the
following code (when used as a_Sec and A_SEC) because it is spelled with the
correct case at least once.
a_Sec = 5
A_SEC = 20
Do not create two tags whose names vary only by case. Both tags could not be used
as implicit variables in PowerVB.
276 / FactoryLink 6.6.0 / Application Editor Guide
USING VARIABLES TO DECLARE POWERVB OBJECTS
Implicit Variables
Arrays as Implicit Variables
The following example illustrates legal uses of an array:
‘Set Motors [3] [2] to 20
Motors (3, 2) = 20
‘If Motors [4] [1] has changed, do something
If Motors (4,1) .Changed Then
‘other part of the code
End If
‘Force write the value 50 into Motors [5] [5]
Motors (5,5) .Force 50
The following code illustrates illegal uses of tag arrays as implicit variables:
‘Can’t use remote node (PowerNet) syntax
remote_node:some_tag = 20
‘Can’t use square brackets - use SomeTag (5,6)
SomeObj [5] [6] = 20
‘Can’t use “dot properties” like “.Raw” implicitly
SomeObj.Raw = 30
FactoryLink 6.6.0 / Application Editor Guide / 277
21
PowerVB Animation
Tag arrays are partially supported when using implicit tag variables. Use array
dimensions with the BASIC array syntax, but do not use remote node prefixes or
dot property suffixes. Use the tag properties with tag arrays.
•
USING VARIABLES TO DECLARE POWERVB OBJECTS
•
Explicit Variables
•
•
E XPLICIT VARIABLES
Explicit declarations provide flexibility in PowerVB coding, although using them
requires extra typing. Explicit declarations are necessary to use properties of a
tag or PowerNet tags.The following example illustrates the use of explicit variable
declaration:
dim x as RTDBObject
set x = RTDBObjectValue (“A_SEC”)
x.Value = 5
RTDBObjectValue Function
Although an explicit drawing or window variable cannot be set as the output of a
function like RTDBObjectValue, a variable of type DrawingObject or
WindowObject can be explicitly defined. This is mainly used for passing drawing
and window objects to subroutines in a library, as in the following example:
Sub SetDrawingColorToCommonColor (d as DrawingObject)
d.BackColor = BLUE
‘blue is the common color to use for all drawing backgrounds)
End Sub
The special function RTDBObjectValue associates explicit RTDB object variables
with the actual RTDB elements. The string used in these functions does not have
to be a simple string literal. It can be any variable expression that evaluates to a
string.
278 / FactoryLink 6.6.0 / Application Editor Guide
USING VARIABLES TO DECLARE POWERVB OBJECTS
Explicit Variables
For example, the following code sets all the RTDB elements in the given array to
the given value:
Dim RTDB_var as RTDBObject, I as Integer
For I = 1 to Ubounds (names)
‘link variable to a tag
Set RTDB_var = RTDBObjectValue (names (I%))
rtdb_var = new_value ‘change value of tag
Next I
End Sub
Note: Functions ‘UBound’ and ‘LBound’ do not recognize
implicit RTDBObject arrays.
When using the RTDBObjectValue function, use the same case as when the RTDB
object was defined.
For example, the following code refers to the same tag value because PowerVB is
not case-sensitive regarding variable names:.
x = thistag.value
y = THISTAG.value
FactoryLink 6.6.0 / Application Editor Guide / 279
PowerVB Animation
Sub SetRTDBObjs (names () as string, new_value as long)
21
•
USING VARIABLES TO DECLARE POWERVB OBJECTS
•
Explicit Variables
•
•
The following code, however, refers to different tags:.
private tagval as RTDBObject
set tagval=RTDBObjectValue(“thistag”)
x = tagval.value
set tagval=RTDBObjectValue(“THISTAG”)
y = tagval.value
Arrays as Explicit Variables
Unlike implicit array references, use brackets to indicate array subroutines when
defining a tag array element explicitly with the RTDBObjectValue function.
Sample Code:
’These two sets of code have the same result
’Explicitly declared object array
dim x as RTDBObject
dim i as Integer
For i = 0 to 10
set x = RTDBObjectValue(“arraytag[“ & trim(str$(i))_
& ”]”)
x.Value = 5
Next i
' Implicitly declared object array
For i = 0 to 10
arraytag(i).Value = 5
Next i
Parent and Child Methods
The Drawing.Child method associates explicit graphic object variables with the
actual graphic objects.
280 / FactoryLink 6.6.0 / Application Editor Guide
USING VARIABLES TO DECLARE POWERVB OBJECTS
Explicit Variables
The .parent and .child methods of graphic objects can also link explicit graphic
object variables with actual graphic objects.
The following code example illustrates the difference between explicit and implicit
variable declaration.
Sample Code:
’ This code (5 lines) is the same as...
dim x as RTDBObject
dim i as Integer
For i = 0 to 10
set x = RTDBObjectValue(“tag” & trim(str$(i)))
x.Value = 5
Next i
' this code (10 lines).
tag0.value = 5
tag1.value = 5
tag2.value = 5
tag3.value = 5
tag4.value = 5
tag5.value = 5
tag6.value = 5
tag7.value = 5
tag8.value = 5
tag9.value = 5
tag10.value = 5
FactoryLink 6.6.0 / Application Editor Guide / 281
PowerVB Animation
Refer to Chapter 26, “Hierarchical Graphic Object Naming” for more information
on parent and child graphic object relationships.
21
•
USING VARIABLES TO DECLARE POWERVB OBJECTS
•
Explicit Variables
•
•
Troubleshooting – Explicit Variables
When to Use Set
Verify you are using the Set statement when using explicit variables.
Sample Code:
dim tag as RTDBObject
Set tag = A_SEC
tag = A_SEC
The first statement lets the variable tag represent the RTDB element called
A_SEC.The second statement sets the value of whatever RTDB element tag refers
to the current value of A_SEC. Use set only to refer a tag variable to a specific
RTDB element or the resulting error can be difficult to identify and correct.
Meaningless Values
It is possible to set explicit RTDB and graphic object variables to a meaningless
value.
Sample Code:
Sub SomeDrawing_SomeObjectID_SomeEvent
Dim Tag As RTDBObject
Set Tag = RTDBObjectValue(“WHOOPIE”)
Tag.Value = 50
End Sub
282 / FactoryLink 6.6.0 / Application Editor Guide
USING VARIABLES TO DECLARE POWERVB OBJECTS
Explicit Variables
Sub SomeDrawing_SomeObjectID_SomeEvent
Dim Tag As RTDBObject
Set Tag = RTDBObjectValue(“WHOOPIE”)
If Tag Is Not Nothing Then
' now we're sure tag is a valid variable
Tag.Value = 50
End If
End Sub
The run-time error could also be trapped using the following code:
Sub someDrawing_SomeObjectID_SomeEvent
Dim O As GraphicObject
Set O = Drawing.Child(“JOE”)
If O Is Nothing Then
MsgBox “Uh oh, the drawing has no child named JOE”
Exit Sub
End If
End Sub
Refer to the PowerVB Language Reference Guide for more information on Set and
Nothing.
FactoryLink 6.6.0 / Application Editor Guide / 283
21
PowerVB Animation
In the preceding example, the set statement puts the special value nothing into
the variable Tag because the FactoryLink application does not have an RTDB
element named WHOOPIE. The next statement, which sets the value of Tag at 50,
causes a run-time error. Trap this error using the On Error functionality of BASIC
or using code like the following:
•
USING VARIABLES TO DECLARE POWERVB OBJECTS
•
Explicit Variables vs. Implicit Variables
•
•
E XPLICIT VARIABLES
VS . I MPLICIT
VARIABLES
When referring to objects in PowerVB code, use implicit variables whenever
possible since in addition to less typing and steps needed to implement, implicit
references are checked during validation. Explicit references are checked during
run time, so they are more difficult to debug.
However, explicit references are necessary in certain situations. Use objects use
explicit references for graphics objects in the following cases:
• When using variables to build the reference. These are often built for similarly
named objects in a loop.
• When there are _ in the object name (version 6.0.0)
Use explicit references for RTDB objects in the following cases:
• When using variables to build the name. These are often built for similarly
names objects in a loop.
• When referencing tags which only have capitalization differences in the same
PowerVB object.
• When referencing PowerNet tags, following the Domain:Tag syntax, or tags
with attributes such as tag.raw generated by the scaling and deadbanding task.
D ATA TYPES
When creating a variable, the data type must be specified. Since a variable is a
name of a memory address where PowerVB stores the data, PowerVB must know
how many memory cells to put aside for this data to most efficiently use your
computer’s resources.
For example, PowerVB needs to reserve much less memory to store the number 1
than to hold Pi computed to seventeen decimal places. The following table outlines
the different data types available in PowerVB.
284 / FactoryLink 6.6.0 / Application Editor Guide
USING VARIABLES TO DECLARE POWERVB OBJECTS
Data Types
21
Table 21-0 PowerVB Data Types
Data
Type
Description
Range
Space
Required
%
Integer
Integer numbers
-32768 to 32767
2 bytes
&
Long
Integer numbers
-2,147,483,648 to
2,147,483,647
4 bytes
#
Double
Real (float) numbers
4.94E-324 to 1.79E38
8 bytes
!
Single
Real (float) numbers
1.40E-45 to 3.40E38
4 bytes
Date
Date
-922,337,203,685,477.5808 to
922,337,203,685,477.5807
8 bytes
0 to approx. 65500
characters
1 byte per
character
@
Currency Fixed-decimal
numbers
Boolean
True/False
Object
Variant
$
String
None
Userdefined
type
Text
Arrays
FactoryLink 6.6.0 / Application Editor Guide / 285
PowerVB Animation
Suffix
•
USING VARIABLES TO DECLARE POWERVB OBJECTS
•
Declaring Dimension Variables
•
•
D ECLARING D IMENSION VARIABLES
PowerVB reserves the required memory space when a variable is declared. The
amount depends on the type of variable.
Use the Dim (short for dimension) statement to declare a variable. When the
variable is created it is set to the initial value of 0 or empty depending on whether
the variable is a number or a string.
Rules for Naming Variables
Observe the following rules when naming variables:
• The first character in the variable name must be a letter.
• The only characters allowed in variable names are letters, numbers, and the
underscore character.
• The variable name must be 40 characters or fewer in length.
• The variable name cannot be the same as a PowerVB reserved word, such as
Sub, End, If, or While.
The following table lists some incorrect variable declarations.
Table 21-0 Variable Declaration Problems
Statement
Problem
Dim 1Address As String
Variable name begins with a number.
Dim First&LastName As
String
Variable name contains the & character.
Dim Birth Date As Integer
Variable name contains a space.
Dim End As Integer
Variable name contains the PowerVB
reserved word “End”.
286 / FactoryLink 6.6.0 / Application Editor Guide
USING VARIABLES TO DECLARE POWERVB OBJECTS
Expression Evaluation
E XPRESSION E VALUATION
21
result# = i% * d#
In some cases, the data type each operand is promoted to is different than that of
the most precise operand. This is dependent on the operator and the data types of
the two operands and is noted in the description of each operand.
If an operation is performed between a numeric expression and a String
expression, then the String expression is usually converted to be of the same type
as the numeric expression. For example, the following expression converts the
String expression to an Integer before performing the multiplication:
result = 10 * “2”‘Result is equal to 20.
There are exceptions to this rule, as noted in the description of the individual
operators.
TYPE C OERCION
PowerVB performs numeric type conversion automatically. Automatic conversions
sometimes result in overflow errors, as shown in the following example:
d# = 45354
i% = d#
In this example, an overflow error is generated because the value contained in d#
is larger than the maximum size of an Integer.
FactoryLink 6.6.0 / Application Editor Guide / 287
PowerVB Animation
PowerVB allows expressions to involve different data of different types. When this
occurs, the two arguments are converted to the same type by promoting the less
precise operand to the same type as the more precise operand. For example,
PowerVB promotes the value of i% to a Double in the following expression:
•
USING VARIABLES TO DECLARE POWERVB OBJECTS
•
Rounding
•
•
R OUNDING
When floating-point values (Single or Double) are converted to integer values
(Integer or Long), the fractional part of the floating-point number is lost, rounding
to the nearest integer value. PowerVB uses Baker’s rounding:
• If the fractional part is larger than .5, the number is rounded up.
• If the fractional part is smaller than .5, the number is rounded down.
• If the fractional part is equal to .5, the number is rounded up if it is odd and
down if it is even.
For example,
Before Rounding
After Rounding to Whole Number
2.1
2
4.6
5
2.5
2
3.5
4
288 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 22
Using Properties and
Methods in PowerVB
RTDB O BJECT P ROPERTIES
RTDB object properties allow manipulation of certain aspects of an RTDB object
(tag) during run time. RTDB objects are basically tag variables. Tags are
immediately available to PowerVB code if they exist in the realtime database. The
PowerVB editor will not create tags for you except during the Tag Event definition
process, discussed in “Defining Tag Events” on page 271.
RTDBObject.Value
RTDBObject.Value is a read/write variant property that holds the value of the
RTDB element. Use .Value after a tag name to utilize the value of the tag. For
example, in the statement if old_value = A_SEC, A_SEC could be either a tag or a
declared variable within the subroutine. If the same statement read if
old_value = A_SEC.Value then, there is no confusion that the value the code should
identify is that of a tag. RTDBObject.Value is the default property for a tag
variable and can be referred to in any of the following ways:
‘set RTDB element x’s value to 10
x.Value = 10
‘read value of the RTDB element x
I% = x.Value
‘now set x’s value to 20
x = 20
‘read value of RTDB element x again
I% = x
FactoryLink 6.6.0 / Application Editor Guide / 289
PowerVB Animation
A property is an attribute of the object that can be read from and, unless
designated as read-only, written to. A method is an action on an object.
22
•
USING PROPERTIES AND METHODS IN POWERVB
•
RTDB Object Properties
•
•
Although the .Value property is not required, use it to distinguish between
references to local variables and tags to make the code more readable.
RTDBObject.Type
RTDBObject.Type is a read-only integer property that tells the type of the RTDB
element. (Mailbox RTDB elements are not supported in PowerVB code.) This type
can be compared to one of the following constants:
• FL_DIGITAL
• FL_ANALOG
• FL_LONGANA
• FL_FLOAT
• FL_MESSAGE
Sample Code:
sub DisplayType (Name as string)
dim obj as RTDBObject
dim typ as string
set obj = RTDBObjectValue (Name)
select case obj.type
case FL_DIGITAL
typ = “digital”
case FL_ANALOG
typ = “analog”
case FL_FLOAT
typ = “float”
case FL_MESSAGE
typ = “message”
case FL_LONGANA
typ = “long analog”
case else
typ = “unknown and unsupported”
end select
msgbox “The RTDB element” & Name & “ is a “ & typ &
“RTDB element”
end sub
290 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
RTDB Object Properties
RTDBObject.Active
Sample Code:
sub Drawing_Object_TagEvent
If A_SEC.Active Then
\txtMessage.Text = “This event triggered by A_SEC”
If OTHER_TAG.Active then
\otherTxtMessage.Text = “This event also_
triggered by OTHER_TAG
End If
End If
end sub
RTDBObject.Force
RTDBObject.Force writes a value into an RTDB element and sets the element
change flag even if the value did not change. By contrast, a regular write with the
statement rtdb_obj = newvalue or rtdb_obj.Value = newvalue, sets the
changed flag for this RTDB object only if newvalue is different from the previous
value.
Sample Code:
‘turn the motor on by forcing its RTDB element to 1
Motor.Force 1
‘force a new string into ErrorMessage object
ErrorMessage.Force “New Error Message”
FactoryLink 6.6.0 / Application Editor Guide / 291
22
PowerVB Animation
RTDBObject.Active is a read-only integer property that is true if the tag is
triggered for the current RTDB event subroutine. When a tag event can be
triggered by several different tags, it is possible for more than one tag to be Active
at the same time. This value can be true only inside an RTDB event subroutine.
•
USING PROPERTIES AND METHODS IN POWERVB
•
Graphic Object Properties
•
•
G RAPHIC O BJECT P ROPERTIES
Graphic object properties are used to manipulate certain aspects of an object
during run time. Some graphic object properties may only be used for specific
types of graphics objects. A BASIC run-time error results if properties are used
with an object of the wrong type.
This Object Variable
The this variable is a special graphics object variable available when a PowerVB
subroutine is attached to a graphic object in a drawing. The this variable is a
convenient way to access the graphics object the subroutine is attached to. Use the
this variable in place of the object name when assigning variable properties in
PowerVB. Because this always refers to the currently-selected object, code using
the this variable is portable and can be copied, called, or imported, and applied to
several different objects. This means code would not need to be modified if the
name of the current graphics object changed.
RedrawOn and RedrawOff
Normally, visible changes to a graphic object take place immediately. If a graphic
object is moved diagonally towards the lower left corner of the screen by changing
its left property and then its bottom property, the object moves left across the
screen and then vertically down the screen during run time. The RedrawOff
statement makes the movement across the screen invisible during run time.
Using the RedrawOn statement after moving the graphic means the graphic is
displayed in the new location with no visible movement across the screen.
Issue the RedrawOn statement as many times as the RedrawOff statement
during the execution of an event routine or redrawing is turned off until the event
routine finishes.
Sample Code:
RedrawOff ‘don’t show changes in Box01’s position
‘Move the box to the left and down
Box01.left = Box01.left - 200
Box01.bottom = Box01.bottom - 200
RedrawOn ‘show Box01 in its new position
292 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Graphic Object Properties
GraphicObject.Type
• FL_DRAWING
• FL_BOX
• FL_ELLIPSE
• FL_POLYGON
• FL_TEXT
• FL_COMPOSITE
• FL_LEGEND
• FL_LINE
• FL_PARABOLA
Sample Code:
if this.type = FL_BOX then
msgbox “This PowerVB code is attached to a_
Box object.”
end if
GraphicObject.Left
GraphicObject.Left is a read/write long integer value that defines the left position
of the object along the x axis. Use this property to move an object along the x axis.
Coordinates in PowerVB are discussed in “Calculating Graphic Object Movement”
on page 255.
Sample Code:
‘Move the box to the right a little.
Box01.left = Box01.left + 100
FactoryLink 6.6.0 / Application Editor Guide / 293
22
PowerVB Animation
GraphicObject.Type is a read-only integer property that defines the type of the
graphics object. The constants available to check this value against are
•
USING PROPERTIES AND METHODS IN POWERVB
•
Graphic Object Properties
•
•
An object can become invisible if its left value is set out of the range of 0 to 32000.
For example, changing the left value to 40000 would make an object invisible.
If the object has an animation type with X and Y coordinate animation, then
conflicts could occur when writing to this property. In the case an event that
changes both the X and Y coordinates tag and the left property, the change that
happens last governs the position of the object. Reading the property always
shows the proper left coordinate.
Note: A pen change on a chart may cause the pen lines to
disappear until the chart has enough samples to redraw the
line.
GraphicObject.Bottom
GraphicObject.Bottom is a read/write long integer value that defines the bottom
position of the object along the y axis. Use this property to manipulate the location
of an object on the y axis.
Sample Code:
‘Move the box up a little
Box01.bottom = Box01.bottom + 100
Moving the bottom outside this range can make the object invisible.
GraphicObject.Width
GraphicObject.Width is a read/write long integer value that defines the current
width of an object. Use this property to make an object narrower or wider. If the
graphic object is a text object, changing the width moves the text but does not
make it any wider.
Sample Code:
‘Make the ellipse wider
Ellipse01.Width = Ellipse01.Width + 200
294 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Graphic Object Properties
If the object has an animation type with Bar animation, changing this value
makes the bar fill value incorrect for horizontal bars. The bar uses its original size
when calculating the amount to fill.
GraphicObject.Height
GraphicObject.Height is a read/write long integer value that defines the height of
an object. Use this property to make a graphic object shorter or taller. If the
graphic object is a text object, changing the height alters both the width and the
height.
Sample Code:
‘Make the parabola shorter
Parab.height = parab.height - 100
GraphicObject.Text
GraphicObject.Text is a read/write string value that holds the text contained in a
text object. This property is only valid for text object variables. One use of this
property is to read the unprocessed text in a text object that has input animation
attached.
Sample Code:
msgbox “Input field contains “ & InputFld.text
‘now clear the input field
InputFld.text = “ “
If this property is used on a non-text object, the current sub procedure stops
executing at the line that contains the GraphicObject.Text statement.
If the text object has symbol animation, this property can be changed but the
changes are not reflected on the screen.
FactoryLink 6.6.0 / Application Editor Guide / 295
PowerVB Animation
Similarly, if the object has chart animation, changing the width causes horizontal
charts to properly use the new width while drawing. Vertical charts still scale to
the original size.
22
•
USING PROPERTIES AND METHODS IN POWERVB
•
Graphic Object Properties
•
•
GraphicObject.Font
GraphicObject.Font is a read/write string value that contains the name of the font
used for a text object. This property is valid only for text object variables and is
restricted to the fonts on your system.
Sample Code:
‘Change to Courier New font
InputFld.font = “Courier New”
If this property is used on a non-text object, the current sub procedure stops
executing at the line that contains the GraphicObject.Font statement.
Font substitutions on your system might result in a point-size change. The text is
displayed in the previous font if the font name is changed to a valid one.
If the text object has symbol animation, this property can be changed but the
changes are not reflected on the screen.
GraphicObject.Bold
GraphicObject.Bold is a read/write integer string value. The text is bold when this
property value is true (non-zero). The text is not bold if the property value is false.
This property is valid only for text object variables.
Sample Code:
‘Toggle the bold attribute of the text object
if Txt.bold then
Txt.bold = False ‘bold off
else
Txt.bold = True ‘bold on
end if
If this property is used on a non-text object, the current sub procedure stops
executing at the line that contains the GraphicObject.Bold statement.
If the text object has symbol animation, this property can be changed but the
changes are not reflected on the screen.
296 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Graphic Object Properties
GraphicObject.Italic
If this property is used on a non-text object, the current sub procedure stops
executing at the line that contains the GraphicObject.Italic statement.
If the text object has symbol animation, this property can be changed but the
changes are not reflected on the screen.
Sample Code:
‘Make the text italicized
Txt.italic = True
GraphicObject.Underline
GraphicObject.Underline is a read/write integer value. If the property value is
true, the text is underlined. This property is valid for only text object variables. If
this property is used on non-text objects, the current sub procedure stops
executing.
Sample Code:
‘Make the text underlined
Txt.underline = True
If the text object has symbol animation, this property can be changed but the
changes are not reflected on the screen.
FactoryLink 6.6.0 / Application Editor Guide / 297
22
PowerVB Animation
GraphicObject.Italic is a read/write integer property that italicizes text if the
property value is true (non-zero). The text is not italicized if the value is false.
This property is valid only for text object variables.
•
USING PROPERTIES AND METHODS IN POWERVB
•
Graphic Object Properties
•
•
GraphicObject.LineColor
GraphicObject.LineColor is a read/write integer value used to set or retrieve the
line color of a graphics object.
Sample Code:
‘Make the line color red
Box.linecolor = 0 ‘zero is red
The valid range of colors is 0 to 63, which corresponds to the color palette in the
color dialogs in the Application Editor. Any value less than 0 or more than 63 is
read as 0 or 63, respectively. These limits are the same for all …Color properties.
Pre-defined constants are available for the more common colors, so you need not
reference them using their numbers. These constants are
• RED
• ORANGE
• YELLOW
• GREEN
• CYAN
• BLUE
• MAGENTA
• PURPLE
• BLACK
• GRAY (or GREY)
• SILVER
• WHITE
Any color property used with a composite object affects all of the child objects of
the composite.
298 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Graphic Object Properties
GraphicObject.FillColor
Sample Code:
‘Make the fill color white for the composite and all its ‘child
objects
Comp.fillcolor = WHITE
If the object has bar animation or symbol animation, this property is read only. If
it has paint animation, the attribute can be changed but is overwritten by the first
paint animation color change. On objects with chart animation this property can
be changed; but, as the trend line is redrawn, the original fill color is redrawn.
GraphicObject.BackColor
GraphicObject.BackColor is a read/write integer value used to set or retrieve the
background color of a graphics object.
Sample Code:
‘Make the background color black
Box.backcolor = BLACK
FactoryLink 6.6.0 / Application Editor Guide / 299
22
PowerVB Animation
GraphicObject.FillColor is a read/write integer value used to set or retrieve the fill
color of a graphics object.
•
USING PROPERTIES AND METHODS IN POWERVB
•
Graphic Object Properties
•
•
GraphicObject.TextColor
GraphicObject.TextColor is a read/write integer value used to set or retrieve the
text color for a graphics object. This property is valid only for text object variables.
The current sub procedure stops executing if this property is used on non-text
objects.
Sample Code:
‘If this script is attached to a text object, change the
‘object’s text color
if this.type = FL_TEXT then
this.textcolor = GREY
else
msgbox “Not a text object - can’t change text color”
end if
If the text object has symbol animation, this property can be changed but the
changes are not reflected on the screen.
GraphicObject.Name
GraphicObject.Name is a read-only string value used to retrieve the basic name of
a graphic object.
Sample Code:
‘Let the user know this object’s name
MsgBox “Hi, I am object” & This.Name
300 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Graphic Object Properties
GraphicObject.Parent
Sample Code:
Move composite object which contains the selected object to location
mouseX, mouseY.
this.p.left = mouseX
this.p.bottom = mouseY
Note: If the parent object is part of a composite object, this
relationship is identified as .p.p in the code.
GraphicObject.BackgroundUpdate
GraphicObject.BackgroundUpdate is a read/write integer value used to set or
retrieve the BackgroundUpdate flag value for a text graphics object with input
text animation. If this property is set to true (non-zero), the object responds to
background updates.
Sample Code:
‘Toggle background update setting
if InputFld.BackgroundUpdate then
InputFld.BackgroundUpdate = false
else
InputFld.BackgroundUpdate = true
end if
FactoryLink 6.6.0 / Application Editor Guide / 301
22
PowerVB Animation
GraphicObject.Parent is a read-only property used to reference the composite
object to which the named object belongs. The parent object can be abbreviated as
.p in the code.
•
USING PROPERTIES AND METHODS IN POWERVB
•
Graphic Object Properties
•
•
GraphicObject.ActionValue
GraphicObject.ActionValue is a read/write string value used to set or retrieve the
value field for objects with button or function key animation. It is only valid for
objects with these animation types. Function key animation is not attached to an
object but rather directly to the drawing. To reference the property for function
key animation, use the function name, entered during the animation
configuration. If the object does not have button or function key animation, the
current sub procedure will stop executing.
Note: Button or function key animation have either source
value or a source tag. This field only returns the source value;
the source tag can be handled via the normal tag functions.
Sample Code:
‘If an object has button animation with action set to DRW,
‘the actionvalue property can be changed to load different
‘drawings
\Button1.ActionValue = “RUNMGRS”
302 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Graphic Object Methods
G RAPHIC O BJECT M ETHODS
22
GraphicObject.Rotate
GraphicObject.Rotate is a subroutine used to rotate a graphics object around a
specified point by a specified number of degrees.
Refer to Chapter 23, “Rotating Objects” for information about rotating graphic
objects.
Sample Code:
‘This RTDB event is triggered once per second
private center_x as long, center_y as long
sub Drawing_Object_onesecond
‘determine the center of the clock
center_x = \Clock.left + (\Clock.width / 2)
center_y = \Clock.bottom + (\Clock.height / 2)
‘move the second hand on the clock one second
6 degrees out of 360 degrees.
‘forward, which is
\SecondHand.rotate center_x, center_y, 6
end sub
Note: Rotating complex objects can be processor-intensive and
may adversely affect system performance.
FactoryLink 6.6.0 / Application Editor Guide / 303
PowerVB Animation
Graphic object methods are used to affect a particular graphics object during run
time.
•
USING PROPERTIES AND METHODS IN POWERVB
•
Graphic Object Methods
•
•
GraphicObject.Reset
GraphicObject.Reset is a subroutine that returns a graphics object to its original
state as it was drawn in the Application Editor. This undoes the effects of moving
and rotating an object.
Sample Code:
‘move the box back to its starting position
Box.reset
GraphicObject.HasAnimation
GraphicObject.HasAnimation is an integer function used to show if a given
graphics object has a certain type of animation. The return value is true
(non-zero) if the object has the type of animation passed as the argument to this
function.
Use pre-defined constants as the argument to this function, such as
• FL_PAINT
• FL_BAR
• FL_SYMBOL
• FL_INPUT_TEXT
• FL_OUTPUT_TEXT
• FL_BUTTON
• FL_CHART
• FL_LEGEND
• FL_PEN
• FL_POWERVB
Sample Code:
‘Don’t try to set the ActionValue property of this
‘object unless it has button animation. Otherwise,
‘a run time error will occur.
if this.hasanimation (FL_BUTTON) then
this.actionvalue = “ALOG”
end if
304 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Drawing/Window Object Properties
D RAWING /W INDOW O BJECT P ROPERTIES
22
This section details when to use a drawing or window property in PowerVB code.
Because drawing objects cannot be selected as an object on the screen like a
graphic object, a predefined variable called drawing is used to access the properties
of the drawing the PowerVB code is attached to. These properties are specific to a
drawing within one window and do not affect the same drawing when it is loaded
in other windows.
The drawing variable is not available for code in PowerVB libraries; however,
subroutines in PowerVB libraries can have a drawing variable passed to them as in
the following example:
Sub ChangeColor (d as DrawingObject)
d.BackColor = RED
End Sub
The window variable is also not available for code in PowerVB libraries except
when explicitly passed as an argument, as shown in the following example.
Sub FormatWindowTitle (W as Window Object)
w.Title = “FactoryLink” & w.Title
End Sub
Drawing.BackColor
Drawing.BackColor is a read/write integer property used to set or retrieve the
background color of a drawing. The color value limits are 0 to 63 as in the
Application Editor and they work like the color values for graphic object color
properties.
Sample Code:
‘set the drawing’s background to white
Drawing.backcolor = WHITE
FactoryLink 6.6.0 / Application Editor Guide / 305
PowerVB Animation
Drawing Object Variable
•
USING PROPERTIES AND METHODS IN POWERVB
•
Drawing/Window Object Properties
•
•
Window Object Variable
The predefined variable window is used to access the properties of the window
PowerVB code is attached to, because window objects cannot be selected as an
object on the screen like a graphic object.
The window variable is not available for code in PowerVB libraries except when
explicitly passed as an argument, as in the following example:
Sub FormatWindowTitle (w as Window Object)
w.Title = “FactoryLink” & w.Title
End Sub
Window.Title
Window.Title is a read/write string property used to set or retrieve the text in the
title bar of the window.
Sample Code:
‘Change the title of the FL_MAIN window to “Main Window”
‘if this subroutine is running on a graphic object in a
‘drawing in the FL_MAIN window.
if Window.title = “FL_MAIN” then
Window.title = “Main Window”
end if
306 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Miscellaneous Statements
M ISCELLANEOUS STATEMENTS
22
Critical/EndCritical
Normally, FactoryLink allows several active event routines to run concurrently.
Refer to “Multi-threading” on page 359 for more information. Critical/EndCritical
is used to give one event subroutine the right to run uninterrupted by any other
event routines. For example, one line from one event routine might run, followed
by one line from a different routine, and so on unless the Critical statement is in
effect.
When a Critical statement is issued in PowerVB code, only the statements from
the current event routine runs. Lines from other event routines will not run until
the EndCritical statement in the code is reached or until the event routine ends.
An EndCritical statement must be issued for every Critical statement in the
subroutine or lines from other event routines will not run until the event routine
ends.
Critical/EndCritical applies only to other PowerVB routines; other FactoryLink
tasks or applications are not affected.
FactoryLink 6.6.0 / Application Editor Guide / 307
PowerVB Animation
Miscellaneous statements are not attached to variables but are used in PowerVB
code to perform global actions.
•
USING PROPERTIES AND METHODS IN POWERVB
•
Miscellaneous Statements
•
•
Sample Code:
sub drawing_object_SomeTagEvent
dim I as Integer
‘We want this section of code to run, and we don’t want
‘any other PowerVB code running while this code runs.
Critical
For I = 1 to 100
SomeTag = I * 1000
Next I
‘Now we want other PowerVB code to run
EndCritical
‘Again, only this part of the code should run
Critical
set_another_tag
‘call subroutine defined below
For I = 1 to 1000
SomeOtherTag = I ** 2
‘I squared
Next I
‘Issuing the following EndCritical statement will NOT let
‘other PowerVB code run, because the set_another_tag
‘subroutine contains a Critical statement.
EndCritical
End Sub
‘The event is over; exclusive running ends.
Sub set_another_tag
Critical
Another_Tag.Value = 25
‘No End Critical to match the Critical
End Sub
308 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Miscellaneous Statements
LockRTDB/UnlockRTDB
An UnlockRTDB statement must be issued for every LockRTDB statement in the
subroutine or the RTDB will be locked until the event routine ends.
Sample Code:
LockRTDB
Some_Tag = 20
UnlockRTDB
FactoryLink 6.6.0 / Application Editor Guide / 309
22
PowerVB Animation
Normally, FactoryLink allows several different tasks to read and write tag values
to the RTDB at the same time. Use LockRTDB/UnlockRTDB statements to give
one event routine exclusive access to the RTDB. When the LockRTDB statement
is issued in PowerVB code, the routine used to issue the statement has exclusive
access to the RTDB. Execution of other PowerVB code is suspended inside
LockRTDB/UnlockRTDB statements (same as Critical/EndCritical). Other tasks
and other animation in Run-Time Graphics cannot read or write tags. This event
routine has exclusive access to tags until the UnlockRTDB statement is reached
or until the event routine ends.
•
USING PROPERTIES AND METHODS IN POWERVB
•
Public Variables
•
•
P UBLIC VARIABLES
Public variables, also referred to as global variables, are variables available to all
PowerVB scripts in an application. It is a good idea to avoid the use of public
variables. Private variables together with access subroutines and functions
usually suffice.
Sample Code:
Public SetVal As Integer
PowerVB Variables and FactoryLink Tag Types
PowerVB has several variable types that can represent the value property of
certain FactoryLink tag types.
Table 22-0
PowerVB Variable Types
FactoryLink Tag Types
String
Message
Boolean
Digital
Integer
Analog
Long
LongAnalog
Double
Float
310 / FactoryLink 6.6.0 / Application Editor Guide
USING PROPERTIES AND METHODS IN POWERVB
Private Variables
P RIVATE VARIABLES
22
Sample Code:
private mbtn as graphicobject
private mact as graphicobject
private mact2 as graphicobject
private mx as graphicobject
private my as graphicobject
sub mouse_rectangle1_DrawLoad
set mbtn = Drawing.Child(“txtMouseButton”)
set mact = Drawing.Child(“txtMouseAction”)
set mact2 = Drawing.Child(“txtMouseAction2”)
set mx = Drawing.Child(“txtMouseX”)
set my = Drawing.Child(“txtMouseY”)
mbtn.text
= "
"
mact.text
= "
"
mact2.text
= "
"
mx.text
= "
"
my.text
= "
"
drawing.c(“txtScrollValue”).text = “52”
end sub
If the same variable name is used privately in multiple scripts, those variables are
completely independent. If a script has a private variable with a name used in
other scripts as a public variable, those variables are completely independent, and
the script with the private variable cannot access the public variable with the
same name.
Both public and private variables must be declared before they are referenced.
Refer to the PowerVB Language Reference Guide for more information on
declaring variables.
FactoryLink 6.6.0 / Application Editor Guide / 311
PowerVB Animation
Private variables are variables assigned exclusively within a graphic object or
library script. Declare private variables in the beginning of the routine, as shown
in the following subroutine:
•
USING PROPERTIES AND METHODS IN POWERVB
•
Private Variables
•
•
312 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 23
Rotating Objects
23
FactoryLink allows rotation of graphic objects during development time or run
time. Run-time rotation can occur on the following types of graphic objects:
• Primitive objects
• Composites
• Sub-objects of composites
Text or objects containing text cannot be rotated. The following types of objects
cannot be rotated and are considered illegal objects:
•
Text objects
•
Legend objects
•
Objects with bar animation
•
Objects with chart animation
•
Objects with symbol animation
•
Composite objects containing one or more of the above objects
Definitions
Primitive
Objects
Composite
Sub-objects
A single drawn object such as a polygon, line, box, ellipse, arc,
parabola, or spline.
A container of primitive objects and/or other composites.
Either primitive objects or other composites inside a composite
object.
Original
Orientation
The initial orientation of the object before rotation, translation, or
scaling.
Current
Orientation
The orientation of an object or composite at the present time.
Rotation Angle
Pivot Point
The degree of rotation of an object relative to its current
orientation.
The central point an object or composite is rotated about.
FactoryLink 6.6.0 / Application Editor Guide / 313
PowerVB Animation
O VERVIEW
•
ROTATING OBJECTS
•
GraphicObject.Rotate
•
•
Legal Rotation
Object
A primitive object or composite not one of the illegal rotation
objects previously listed.
Illegal Rotation
Object
Any object not a legal rotation object. The objects in this list.
G RAPHIC O BJECT .R OTATE
The syntax for rotating an object at run time is as follows:
objectname.rotate x, y, degrees
where:
x
Horizontal center of rotation
y
Vertical center of rotation
degrees
Rotation amount
Specifying a positive value for degrees results in clockwise rotation; a negative
value for degrees results in counter-clockwise rotation.
Rotation is cumulative, not absolute, which means a value of 30 for degrees does
not necessarily rotate the object to 30 degrees. If the object has been rotated
previously, this rotates the object an additional 30 degrees clockwise.
If a rotation amount greater than 360 degrees is given, it is divided by 360 and the
remainder is used. For example, rotation amounts of 10 degrees and 370 degrees
have the same result. To use an absolute value for rotation, use the Reset method
prior to rotate. The following example illustrates how a line could be used as an
analog meter:
sub Drawing_Object_tempchange
’ Set this object back to original rotation
\Meter.Reset
’ Rotate this object to the degree value in
‘the tag temp_value
\Meter.Rotate x_pivot, y_pivot, temp_value
end sub
314 / FactoryLink 6.6.0 / Application Editor Guide
ROTATING OBJECTS
Implementing Rotation in PowerVB
I MPLEMENTING R OTATION
IN
P OWER VB
23
Perform the following steps to implement rotation in PowerVB:
2 Select the object.
3 Open the PowerVB animation editor.
4 Enter the necessary PowerVB code to rotate the object. The following example
rotates the graphic object 180 degrees clockwise in 20-degree increments and then
back to the original orientation:
Private x_pivot As Integer, y_pivot As Integer
sub Drawing_Object_DrawLoad
’ Determine the center of the object
x_pivot = this.left + (this.width / 2)
y_pivot = this.bottom + (this.height / 2)
end sub
sub Drawing_Object_Click(Button As Integer, X As Long,_
Y As Long)
dim i as Integer
‘Rotate 180 degrees clockwise at 20 degree increment
For i = 1 to 9
this.rotate x_pivot, y_pivot, 20
Next i
‘Rotate 180 degrees counter-clockwise in 20 degree increment
For i = 1 to 9
this.rotate x_pivot, y_pivot, -20
Next i
end sub
The smoothness of object rotation depends on the rotation angle and the system
hardware. A small rotation angle makes the rotation appear smooth but may be
slower and more processor intensive.
5 Choose File>Validate to test the script. A message displays if the script is
executable.
FactoryLink 6.6.0 / Application Editor Guide / 315
PowerVB Animation
1 Create an object in the Application Editor.
•
ROTATING OBJECTS
•
Implementing Rotation in PowerVB
•
•
6 Choose File>Save to save the script.
7 Run the application to test the animation. An error message is displayed if the
object, sub-object, or composite is not legal for rotation.
The bounding box changes sizes for an object as it is rotated. This could make the
object rotate and move around on the screen simultaneously. To prevent this,
calculate the pivot point once as in the following DrawLoad event example instead
of in the event that triggers the rotation.
Sample Code:
‘Use this code –
Private x_pivot As Integer, y_pivot As Integer
sub Drawing_Object_DrawLoad
x_pivot = this.left + (this.width / 2)
y_pivot = this.bottom + (this.height / 2)
end sub
sub Drawing_Object_Click(Button As Integer, X As Long, Y_
As Long)
this.rotate x_pivot, y_pivot, 20
end sub
‘Instead of this –
sub Drawing_Object_Click(Button As Integer, X As Long, Y_
As Long)
x_pivot = this.left + (this.width / 2)
y_pivot = this.bottom + (this.height / 2)
this.rotate x_pivot, y_pivot, 20
end sub
316 / FactoryLink 6.6.0 / Application Editor Guide
ROTATING OBJECTS
Implementing Rotation in PowerVB
Calculate the rotation point of an object based on another object. For example, to
create a clock, draw a circle for the clock face and a line for a second hand and
rotate the second hand about the center of the clock face:
sub Drawing_Object_DrawLoad
’ Determine the center of the circle Clockface
x_pivot = \ClockFace.left + (\ClockFace.width / 2)
y_pivot = \ClockFace.bottom + (\ClockFace.height / 2)
end sub
sub Drawing_Object_onesecondevent
this.rotate x_pivot, y_pivot, 6
end sub
Composite Object Rotation
Composite graphic objects can be rotated only if all of their child objects are legal
rotation objects.
Sub-object Rotation
PowerVB subroutines can be attached to sub-objects inside a composite or inside
another sub-object. Multiple rotations utilizing objects, sub-objects, and
composites can occur in any order.
Rotating large or complex objects might have adverse affects on system
performance.
RedrawOn/RedrawOff
Use RedrawOff/RedrawOn statements to make object movement appear smoother
if several objects are being rotated. Refer to “RedrawOn and RedrawOff” on page
292 for more information.
FactoryLink 6.6.0 / Application Editor Guide / 317
PowerVB Animation
Private x_pivot As Integer, y_pivot As Integer
23
•
ROTATING OBJECTS
•
Development Rotation
•
•
D EVELOPMENT R OTATION
Objects can be rotated in 90-degree clockwise increments during development
time in the Application Editor.
Perform the following steps to rotate an object during development time:
1 Create an object, sub-object, or composite in the Application Editor or open an
existing object.
2 Select the object, sub-object, or composite to be rotated.
3 Rotate the selected object using one of the following methods:
• Press Ctrl-R
• Choose Edit>Rotate
• Click on the rotate icon on the toolbar
If the selected object is a legal rotation object, it rotates clockwise by 90 degrees;
otherwise, an error message displays. To rotate an object more than 90 degrees,
repeat this step until the object is rotated to the desired orientation.
The pivot point for development rotation is the center of the object bounding box.
318 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 24
Event sub procedures are the backbone of any PowerVB application; however,
PowerVB also allows you to create sub procedures and functions. These
user-defined sub procedures and functions must be called from an event procedure
to get executed. This chapter outlines the syntax and provides examples of
user-defined sub procedures and functions.
S UB P ROCEDURES
The following sub procedure takes a Single and a GraphicObject as parameters. It
examines the Single parameter and sets the graphic object color:
Sub SetColor (Temperature As RTDBObject, Gobject as GraphicObject)
Select Case Temperature.Value
Case 0 to 100
Gobject.FillColor = GREEN
Case 101 to 200
Gobject.FillColor = BLUE
Case 201 to 300
Gobject.FillColor = YELLOW
End Select
End Sub
The syntax to call this sub procedure is
Call SetColor(temp,\STATUSCIRCLE)
or
SetColor temp,\STATUSCIRCLE
The variables must have the same type as the procedure definition.
The sub procedure must be declared if the sub procedure is called before it has
been defined. The declaration for the preceding sub procedure is
Declare Sub SetColor(X as RTDBObject, Y as GraphicObject)
FactoryLink 6.6.0 / Application Editor Guide / 319
24
PowerVB Animation
PowerVB User-Defined
Sub Procedures and
Functions
•
POWERVB USER-DEFINED SUB PROCEDURES AND FUNCTIONS
•
Functions
•
•
F UNCTIONS
A function generally does not execute operations on your data. It returns a value
based on the data without changing the data.
After creating a function, it is used like a built-in PowerVB function. Functions
you create are called user-defined functions. User-defined functions, like
procedures, allow you to create functions that operate according to the needs of
the application but which can be used throughout the code just like built-in
functions.
For example, in a point-of-sale application, a script can compute a standard
discount based on price. Any item priced under ten dollars is not discounted,
anything priced between ten and twenty dollars is discounted ten percent, items
priced between twenty and fifty dollars are discounted fifteen percent, and
anything priced over fifty dollars is discounted twenty-five percent. The function
could be as follows:
Function ComputeDiscountedPrice (FullPrice
if FullPrice < 10.00 then
ComputeDiscountedPrice = FullPrice
elseif FullPrice < 20.00 then
ComputeDiscountedPrice = FullPrice
elseif FullPrice < 50.00 then
ComputeDiscountedPrice = FullPrice
else
ComputeDiscountedPrice = FullPrice
endif
end Function
As Currency) As Currency
* .9
* .85
* .75
To compute a discounted price, use the function with an assignment statement,
such as:
Price = ComputeDiscountedPrice (FullPrice)
A value can be returned from a function by assigning the variable that holds the
value to the name of the function (as previously shown). It is not necessary to
declare the function name as a variable because this has already been done in the
function declaration.
The end of the function declaration indicates the function’s return-type. The
example above returns a Currency value. If a return-type is not specified, the
function returns a Variant value. If this value is assigned to a variable, it is
converted to the type of the variable.
320 / FactoryLink 6.6.0 / Application Editor Guide
POWERVB USER-DEFINED SUB PROCEDURES AND FUNCTIONS
Functions
Most functions have parameters because they need some data to evaluate. Unlike
sub procedures, function parameters must be placed in parentheses when calling
the function. A function can also read the data it needs from a form, for example:
24
Function ComputeDiscountedPrice () As Currency
dim FullPrice As Currency
FullPrice = Val(frmMain.txtFullPrice.Text)
if FullPrice < 10.00 then
ComputeDiscountedPrice = FullPrice
elseif FullPrice < 20.00 then
ComputeDiscountedPrice = FullPrice * .9
elseif FullPrice < 50.00 then
ComputeDiscountedPrice = FullPrice * .85
else
ComputeDiscountedPrice = FullPrice * .75
endif
end Function
PowerVB Animation
The original example, which receives data as a parameter, can be used from any
form and re-used in other applications. Because this example ties the function to
the form to read the data it is not as flexible as the original example which gets
the data as a parameter. This example could be used with a form called frmMain,
which must contain a text box called txtFullPrice.
Of course, to use the function from any form in the application, you must create
the function in a code module rather than in a form’s general code section.
However, if you are certain the function will only be called from one form, you can
create the function in that form’s code window.
For a complete listing of the built-in functions available with PowerVB, refer to
the PowerVB Language Reference Guide.
FactoryLink 6.6.0 / Application Editor Guide / 321
•
POWERVB USER-DEFINED SUB PROCEDURES AND FUNCTIONS
•
Functions
•
•
322 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 25
P OWER VB L IBRARIES
A PowerVB Library, comparable to a module in Microsoft Visual Basic®, is used to
store PowerVB functions and/or subroutines that may be called from a PowerVB
script attached to any graphic object within the application. Libraries are used to
store simple calculations and basic subroutines that are used many times
throughout several applications. Library scripts can also contain their own
private variables.
Library routines are loaded at run-time when the application starts. Libraries are
accessible from any script on any object on any drawing; however, drawings are
not directly accessible from a library.
As with drawings, libraries can be exported from one application and imported
into another. To open an existing PowerVB library not created in the current
application, it must first be imported — choose File>Import and then choose file
type Exported Libraries (*.plx).
FactoryLink 6.6.0 / Application Editor Guide / 323
25
PowerVB Animation
Creating PowerVB
Libraries and
Templates
•
CREATING POWERVB LIBRARIES AND TEMPLATES
•
PowerVB Libraries
•
•
Creating a PowerVB Library
The following procedure outlines how to create a PowerVB library. Refer to the
other PowerVB chapters and to the PowerVB Language Reference Guide for more
specific information on syntax, commands, and variables.
1 Choose File>Open PowerVB Library from the Application Editor to display a window
with the names of all accessible libraries. The Open PowerVB Library dialog
displays.
324 / FactoryLink 6.6.0 / Application Editor Guide
CREATING POWERVB LIBRARIES AND TEMPLATES
PowerVB Libraries
2 Enter the name of the new library and choose Open to display the PowerVB
25
library editor.
PowerVB Animation
3 Enter the PowerVB variables, subroutines, or functions to be included in the
library.
Unlike event routines, beginning and ending statements for functions and
subroutines must be manually entered in libraries. Verify each statement has a
matching end statement.
For example, to implement a function to convert Fahrenheit temperatures to
Celsius in a library, enter the following code:
Function FtoC (Fdegrees as Integer) As Integer
‘Convert Fahrenheit to Celsius
FtoC = (Fdegrees - 32) * 5/9
End Function
FactoryLink 6.6.0 / Application Editor Guide / 325
•
CREATING POWERVB LIBRARIES AND TEMPLATES
•
PowerVB Libraries
•
•
4 Choose File>Validate from the PowerVB library editor. A message displays if a
syntax error is detected.
5 Choose File>Save.
Using the PowerVB Library Editor
The PowerVB library editor works very much like the PowerVB Animation Editor.
The main differences are in the options on the menu bar. The File Menu has an
extra option and the Event menu does not exist because event routines cannot be
defined in a PowerVB library.
An additional option in the File menu is Save As. Also, the Save option works
differently. Since a PowerVB library is held in a separate file, Save writes the
PowerVB code to the file as opposed to putting the code into a drawing when
editing graphic object PowerVB animation. The Save As option brings up a File
Save dialog similar to the one used for exporting text from the PowerVB editor. A
separate copy of a PowerVB library can be created under a new name using this
option.
Calling a Library Function or Subroutine
To use a library function or subroutine in an object’s event routine, first declare it
in the object script outside of an event subroutine; then it can be used anywhere in
the object code. The function or subroutine must be declared in each script it is
referenced in.
The only difference between a function and a subroutine is a function returns a
value and a subroutine does not. Both functions and subroutines can pass
arguments when the function or subroutine is called. See the PowerVB Language
Reference Guide for more information on defining and calling functions and
subroutines.
326 / FactoryLink 6.6.0 / Application Editor Guide
CREATING POWERVB LIBRARIES AND TEMPLATES
PowerVB Libraries
For example, if the following function and subroutine are in an existing library,
25
Function FtoC (Fdegrees As Integer) As Integer
PowerVB Animation
’ Convert fahrenheit to celsius
FtoC = (Fdegrees - 32) * 5/9
End Function
Sub SetAlarmTrigger
‘ Set a digital tag that has been configured as
‘ an alarm trigger
AlarmTrig.Force 1
End Sub
they could be called from an object script as follows:
Declare Function FtoC(FDegrees As Integer) As Integer
Declare Sub SetAlarmTrigger ( )
sub drawing_object_Click(Button As Integer, X As_
Long, Y As Long)
\txtCelsiusTemp.text = str$(FtoC(intFahrenheitTemp))
If \txtCelsiusTemp.text > 100 then
SetAlarmTrigger
End If
end sub
FactoryLink 6.6.0 / Application Editor Guide / 327
•
CREATING POWERVB LIBRARIES AND TEMPLATES
•
PowerVB Templates
•
•
P OWER VB TEMPLATES
When creating PowerVB code for an object in a Power Pack, templates can be used
as placeholders for specific values provided when the object is pasted into a
drawing. Common code can also be set up for use as a template. This is helpful
when attaching code to an object that will be used in several different applications
because the code can be copied and pasted with the object.
Templates are applicable in PowerVB code or in a tag event trigger list. The
format for a template variable in PowerVB is the same as with other types of
animation ({variablename}).
Template Variables
As with other types of animation, the same template variable can be used multiple
times within an object animation. For example, if the template variable {alarmtag}
is used in paint animation, it can also be used in a tag event trigger list.
Note: Template variables cannot be used in PowerVB libraries.
Template Variables in Tag Event Definitions
When defining a tag event, specify one or more template variables in the tag list
instead of tags. When the object code is saved, you are prompted to define the
template variables. When the object containing the tag event is pasted, you are
prompted to enter values for the template variables. If values entered for the
template variables are not valid tags, they are ignored.
Template variables in PowerVB Code
Sample Code:
sub Drawing_Object_Click(Button As Integer, X As Long,_ Y As Long)
this.fillcolor = {newcolor}
end sub
If a template variable is specified in PowerVB code, you are prompted to define
the template variables when the code is saved.
When an object containing the code is pasted, you are prompted to enter values for
the template variables.
Template variables in PowerVB code are always displayed as variable names.
Choose Animation>Template to view the values of template variables.
The maximum length of a template variable name is 30 characters.
328 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 26
Hierarchical Graphic
Object Naming
Since graphic objects can be combined to create new objects, all objects in the
Application Editor are part of a hierarchical graphic object naming system. Each
object has an assigned ID and name.
An object is a parent, child, or sibling, depending on its relationship to other
objects. Definitions of these three types of objects are
Parent
Child
Siblings
A composite object.
An object that is part of a composite; sub-object; a composite
object.
Objects at the same hierarchical level.
Object names do not change unless the object is pasted into a drawing that has a
top-level object with the same name as the object in the paste buffer or unless the
user changes the name in the Application Editor (CTRL-N).
O BJECT N AMES
As discussed earlier, FactoryLink assigns objects with a default name in the form
of hxxxx where the x’s are a number assigned to the object. Object names can be
changed using the Attributes>Object Name menu or by pressing CTRL+N and
entering the new object name. FactoryLink changes an object name if it is pasted
into another drawing that has an object by the same name at the same level. The
object IDs, as mentioned earlier, cannot be changed.
An understanding of the Object Name and Object ID is important because an
Object Name can be used in the body of the PowerVB code while the Object ID is
used to generate.
FactoryLink 6.6.0 / Application Editor Guide / 329
PowerVB Animation
O VERVIEW
26
•
HIERARCHICAL GRAPHIC OBJECT NAMING
•
Graphical Object Hierarchy
•
•
Naming Objects in the Application Editor
Specify the following information to name an object in the Application Editor:
1 Create an object in the Application Editor or open an existing drawing containing
the object to be named.
2 Select the object to be named.
3 Choose Attributes>Object Name.
4 Name the object and click on OK to accept the new name.
This is the object’s ID.
G RAPHICAL O BJECT H IERARCHY
All the graphic objects in a drawing form an object hierarchy with the drawing at
the top of the hierarchy and the rest of the objects falling somewhere below the
top; therefore, all objects have a parent. Objects contained in a composite object
have the composite as a parent; objects that are not members of a composite have
the drawing as their parent. All references to an object depend upon where the
code using the reference resides in the hierarchy as well.
The MS-DOS file structure uses a similar hierarchy with the root directory being
at the top and all other files falling somewhere below. All files have a parent
directory, either the root directory or a sub directory. If you think of directories as
composite files, it is easy to see how referring to a graphical object is similar to
referring to a file in DOS.
330 / FactoryLink 6.6.0 / Application Editor Guide
HIERARCHICAL GRAPHIC OBJECT NAMING
Referencing Graphic Objects in PowerVB Scripts
R EFERENCING G RAPHIC O BJECTS
IN
P OWER VB S CRIPTS
Refer to an object in the context of the current object (object this script is attached
to) or in its context as a descendant of the drawing top level when referencing it in
a PowerVB script. The following diagram illustrates this concept.
Drawing
Object1
Object2
Object3
ObjectA ObjectB ObjectC ObjectD ObjectA ObjectB
• Object2 is a parent to ObjectC and ObjectD.
• ObjectC and ObjectD are child objects of Object2.
• Object1, Object2, and Object3 are siblings. ObjectA and ObjectB are siblings,
but ObjectA is not a sibling to Object1.
All objects are descendants of the drawing. Object1, Object2, and Object3 are
composite objects each with two sub-objects. Both Object1 and Object3 have child
objects named ObjectA and ObjectB (names of sub-objects must be unique only to
the parent object, not the drawing).
If ObjectC were a composite object, it would be a parent relative to its child objects
but a child relative to Object2.
Syntax
Syntax is important when referencing an object in PowerVB code because it tells
PowerVB the path to the object. The correct syntax for referencing objects is:
• .. — move one level up the hierarchy
• \ — separator for object names
FactoryLink 6.6.0 / Application Editor Guide / 331
PowerVB Animation
Implicit Referencing
26
•
HIERARCHICAL GRAPHIC OBJECT NAMING
•
Referencing Graphic Objects in PowerVB Scripts
•
•
The following code samples illustrate changing the fillcolor property of an object
from another object code in the context of the previous diagram. The same syntax
is applicable to read or write other object properties.
Code in Object1:
‘Declare an object variable for a sibling
dim g as GraphicObject
set g=..\Object2
‘Declare an object variable for a child
dim g as GraphicObject
set g=ObjectA
‘Declare an object variable for a child of a sibling
dim g as GraphicObject
set g=..\Object2\ObjectC
‘Reference a property of a child
ObjectA.FillColor=20
‘Reference a property of a top-level object (child of
‘a drawing)
\Object3.FillColor=20
‘Reference a property of a parent
...FillColor=20
‘Reference a property of a child of a sibling
..\Object2\ObjectC.FillColor=20
Code in ObjectA (sub-object of Object1):
‘Declare an object variable for a sibling
dim g as Graphic Object
set g=..\ObjectB
‘Declare an object variable for a parent
dim g as GraphicObject
set g=..
‘Reference a property of a parent (Object1)
...FillColor=20
It is better to use the keyword this instead of the specific object name if referencing
the current object in a script.
332 / FactoryLink 6.6.0 / Application Editor Guide
HIERARCHICAL GRAPHIC OBJECT NAMING
Referencing Graphic Objects in PowerVB Scripts
Explicit Referencing
Sample Code:
‘In a script for a composite object that has child
‘objects Object1, Object2, Object3, Object4, and
‘Object5
dim i as Integer
For i = 1 to 5
' Change child object fillcolors
this.c("Object" & trim(str$(i))).fillcolor = i
Next i
FactoryLink 6.6.0 / Application Editor Guide / 333
26
PowerVB Animation
This alternate method of referencing objects requires more typing than the
previous method but provides the ability to use string variables to specify object
names. Since the string variables can be generated in code, any errors in object
names are not detected until run time.
•
HIERARCHICAL GRAPHIC OBJECT NAMING
•
Referencing Graphic Objects in PowerVB Scripts
•
•
Syntax for Explicit Referencing Method:
.
P (or Parent)
C (or Child)
Separator for parent/child references
Move one level up the hierarchy (note that the object name is not
specified for the parent since an object only has one parent)
Move one level down the hierarchy (note that the object name
must be specified for the child since an object could have several
children)
Code in Object1:
drawing.c("Object2").c("ObjectC").FillColor = BLUE
this.c("ObjectA").fillcolor = BLUE
Code in ObjectA (sub-object of Object1):
this.p.Fillcolor = BLUE
’change fillcolor of Object1
drawing.c("Object3").c("ObjectB").Fillcolor = BLUE
‘same as
..\..\Object3\ObjectB.Fillcolor = BLUE
Graphic object references must begin with drawing or this or some explicit graphic
object variable when using the alternate method.
334 / FactoryLink 6.6.0 / Application Editor Guide
HIERARCHICAL GRAPHIC OBJECT NAMING
Referencing Graphic Objects in PowerVB Scripts
The following table includes examples of correct hierarchical object naming in
PowerVB.
Object Hierarchical Syntax
dim g as GraphicObject
set g = ..\shadow
Comment to Explain Hierarchy
‘This has a sibling named
‘shadow.
myComp\ell3.FillColor = 21
‘This is a composite, with a
‘composite child named myComp.
‘myComp has a child named ell3.
J% = ..\..\c1\c2\b3.Height
‘This has a composite parent
‘who has a composite sibling
‘named c1. c1 has a composite
‘child named c2, and c2 has a
‘child named b3.
\topComp\twirly.reset
‘topComp is a top-level
‘composite, with a child named
‘twirly.
kiddo.rotate 6000 7000 15
‘this is a composite, with a
‘child named kiddo.
\TopObj or ..\brother cannot be used in PowerVB libraries; however, graphic objects
and drawing objects can be passed into library routines and used with the explicit
method using .parent and .child. For example, the following PowerVB library
subroutine could manipulate a child object of the given drawing:
Sub MakeObjectRed (dwg as DrawingObject, name as string)
dwg.child(name).fillcolor = RED
End Sub
This library function is called from an object’s script with the following:
MakeObjectRed (drawing, “TopLevelObject”)
FactoryLink 6.6.0 / Application Editor Guide / 335
PowerVB Animation
Table 26-0 Hierarchical Object Names
26
•
HIERARCHICAL GRAPHIC OBJECT NAMING
•
Performance Considerations
•
•
P ERFORMANCE C ONSIDERATIONS
Hierarchical graphic object names must be bound to objects on the drawing at run
time. This binding takes some time. Knowing this, performance of some
operations can be improved, as illustrated in the following example:
‘Slower
for i% = 1 to 500
\obj1\obj2\obj3.left = \obj1\obj2\obj3.left + 10
next i%
‘Faster
dim obj as GraphicObject
set obj = \obj1\obj2\obj3
for i% = 1 to 500
obj.left = obj.left + 10
next i%
336 / FactoryLink 6.6.0 / Application Editor Guide
HIERARCHICAL GRAPHIC OBJECT NAMING
Object IDs
O BJECT ID S
26
Finding an Object
Within a Script
Search for either ID in an event name, object name, or any other text using the
text searching capabilities in the PowerVB animation editor.
Note: Remember that object IDs are only used in event routine
names. All other references to objects are by their names.
Within a Cross Reference
The cross-reference list is used only for finding references to tags (RTDB
elements). Search for the object ID, not its name, to find where tags are used in
PowerVB tag event trigger lists or PowerVB code.
Within a Drawing
Choose Edit>Find in the Application Editor to display a list of all object IDs and go
to a specific object based on its ID. Use Find by Name to find the first object having
a given name and then use Find Next to find other objects on the drawing with the
same name.
Note: PowerVB does not allow you to change an object ID.
FactoryLink 6.6.0 / Application Editor Guide / 337
PowerVB Animation
Each object is assigned an ID when it is created. Object IDs are unique within a
drawing and you cannot change them. Unlike object names, new object IDs are
always assigned when an object is pasted. Event subroutine names in the pasted
object are automatically updated with the new object ID. Object IDs are used in
the names instead of object names to keep event routines names unique
throughout a drawing. This is the only place PowerVB uses object IDs.
•
HIERARCHICAL GRAPHIC OBJECT NAMING
•
Object IDs
•
•
338 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 27
Debugging a PowerVB
Script
Two ways to review PowerVB code in printed form are
• Use the Document PowerVB menu option in the Application Editor
• Print a single script or part of a single script
D OCUMENT P OWER VB
The Document PowerVB command writes a text file to show the PowerVB code for
all objects in a drawing. Choose File>Document PowerVB in the Application Editor
to create a text file listing the following information:
• All of the objects in the current drawing that have PowerVB animation defined
• The event subroutines defined for each object
• Trigger tags for tag events
• Other types of animation defined for each object
• All of the variables and/or tags referenced in each object code
• Listing of code by object with line numbers
This text file is named drawingname.src and is saved in the FLAPP\USER\DRW
directory. A window is displayed to confirm the name and location of the file.
Note: The Document PowerVB report is export only—it cannot
be edited and imported back into an application.
FactoryLink 6.6.0 / Application Editor Guide / 339
PowerVB Animation
R EVIEWING P RINTED P OWER VB C ODE
27
•
DEBUGGING A POWERVB SCRIPT
•
Printing a Single Script or Part of a Single Script
•
•
The Document PowerVB report does not include routines in libraries. Choose
File>Export on the PowerVB animation editor after opening the library to create a
listing of the code in a library.
Highlight the desired code and choose File>Export in the PowerVB animation
editor to create a text file listing all or part of the code in an object.
The Document PowerVB report and exported code listings are in ASCII text
format and can be viewed and printed from any text editor.
P RINTING
A
S INGLE S CRIPT
OR
P ART
OF A
S INGLE S CRIPT
1 Select the text to be printed.
2 Choose File>Export to export the file to a text file with a name you specify.
3 Open the file through a text editor.
4 Print the code.
O THER D EBUGGING M ETHODS
Several tools are available to assist with resolving problems in PowerVB code:
• Error message box
• Handling run-time errors with the On Error statement
• Using Print statements
340 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Error Message Box
E RROR M ESSAGE B OX
27
Sample Code:
Global Setting1, Setting2 As Integer
sub Drawing_Object_Click(Button As Integer, X As Long, Y As Long)
If Setting1 > 50 then
Setting2 = 100
End If
MsgBox “Setting1: “ & str$(Setting1) & “Setting2: “ &_ str$(Setting2)
end sub
Message boxes are system-modal. When a message box displays, other
FactoryLink tasks, including run-time graphics, are suspended until the message
box is dismissed. Be careful when using message boxes in applications that run
unattended.
Message boxes are only available on Windows NT, Windows 95, and OS/2
platforms. Refer to the PowerVB Language Reference Guide for more information
on the Msgbox statement.
Variations on this method include:
• Writing this data to the Window.Title instead of a message box
• Writing this data to a message tag and adding this tag to a Watch List in
Run-Time Monitor
• Creating a temporary text field on a drawing and write status information in
the text field
FactoryLink 6.6.0 / Application Editor Guide / 341
PowerVB Animation
Use a message box to show the values of variables at run time. Be sure to remove
or comment out any message boxes added for debugging purposes before
implementing the application.
•
DEBUGGING A POWERVB SCRIPT
•
On Error Statement at Run Time
•
•
O N E RROR S TATEMENT
AT
R UN TIME
Trap run-time errors using the On Error and Resume BASIC statements. The
following example shows the basics of using these statements:
Sub SomeDrawing_SomeObjectID_Click(Button As Integer, X_
As Long, Y As Long)
On Error Goto Error_Handler_Section
’ regular code goes here
Exit Sub
Error_Handler_Section:
’Handle the error however you like. You can "Resume Next"
‘to continue working or "Exit Sub" to stop the event or do
‘something else...
End Sub
Refer to the PowerVB Language Reference Guide for a detailed explanation of
run-time error trapping with the On Error and Resume statements.
If run-time errors are not trapped in code with the On Error statement, PowerVB
detects these errors. When PowerVB detects a run-time error, it stops the event
routine the error occurred in and displays a message box listing the details of the
error. This message box is modal. Unless someone is monitoring the application, it
could wait a long time for a response to this message box. So, by trapping these
errors yourself, you control whether the event routine continues or not. You also
control where error information is logged so users of the application are not
presented with cryptic error information they do not understand. The application
is not hung up waiting for you to respond to the error.
342 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Using Print Statements
U SING P RINT STATEMENTS
27
The Print statement in the PowerVB version of BASIC prints to a file named
vbdebug.log. Use the Print statement to provide primitive debugging capabilities
for a FactoryLink application and for putting Print statements in an application
that prints information at run time about the current state of the application.
Using the BASIC Print Statement
The syntax of the Print statement is
Print [[{Spc(n) | Tab(n)}][expressionlist][{; | ,}]]
Output from the Print statement is sent to the vbdebug.log file.
Table 27-0 Data Output Formats
Data Type
String
Description
Printed in its literal form, with no enclosing quotes.
Any numeric type Printed with an initial space reserved for the sign. If the
number is positive, a space is left before the digits of the
number. If the number is negative, a negative sign is
printed before the digits of the number. Also, a space is
printed after each number.
Boolean
Printed as True or False.
Date
Printed using the short date format. If either the date or
time component is missing, only the provided portion is
printed. This is consistent with the general date format
used by the Format and Format$ functions.
Empty
Nothing is printed.
Null
Prints Null.
User-defined
errors
Printed as Error <code>, where <code> is the value of the
user-defined error. The word Error is not translated.
FactoryLink 6.6.0 / Application Editor Guide / 343
PowerVB Animation
Overview
•
DEBUGGING A POWERVB SCRIPT
•
Using Print Statements
•
•
Each expression in expressionlist is separated with either a comma or a semicolon.
A comma means the next expression is output in the next print zone. A semicolon
means the next expression is output immediately after the current expression.
Print zones are defined every 14 spaces.
If the last expression in the list is not followed by a comma or a semicolon, a
carriage return is printed to the file. The next Print statement outputs
information on the next line of the file.
If the last expression ends with a semicolon, no carriage return is printed. The
next Print statement outputs information immediately following the expression
on the same line of the file.
If the last expression in the list ends with a comma, the next Print statement
outputs information at the start of the next print zone on the current line.
The Tab and Spc functions provide additional control over the column position.
The Tab function moves the output position to the specified column. The Spc
function outputs the specified number of spaces. Refer to the PowerVB Language
Reference Guide for more information on the Print, Tab, and Spc functions.
344 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Using Print Statements
Examples of Print Statements and the Output Generated
Statement:
Print “Hello”; “world”
Output:
Helloworld
Statement:
Print “Hello”, “world”
Output:
Hello
world
Statement:
Print “The value of i=”;i%,”The value of s=”;s$
Output:
The value of i= 10
The value of s=This is a test.
FactoryLink 6.6.0 / Application Editor Guide / 345
27
PowerVB Animation
The following examples illustrate the output for the vbdebug.log file for several
different print statements in PowerVB code:
•
DEBUGGING A POWERVB SCRIPT
•
Using Print Statements
•
•
Statement:
Print i%,,s$
Output
20
This is a test too.
Statement:
Print i%; Spc(10); s$
Output:
30
Testing...
Statement:
Print i%; Tab(30); s$
Print i%; Tab(10); j%; Tab(30); s$
Output:
50
50
PowerVB
500
PowerVB
Statement:
Print i%; s$,
Print 67;
Print "Goodbye"
Output:
-1001 computer
346 / FactoryLink 6.6.0 / Application Editor Guide
67 Goodbye
DEBUGGING A POWERVB SCRIPT
Using Print Statements
Print Statements with Multiple Running Events
For example, suppose object box1 has the following event routine triggered by
changes in the A_SEC tag:
sub Drawing_1001_ASecChanged
print “ABCDEFG”
end sub
Also, suppose object box2 has the following event routine also triggered by
A_SEC.
sub Drawing_1003_ASecChanged
print “TUVWXYZ”
end sub
If both of these event routines run at the same time, the output to vbdebug.log
could be
ABCDEFG
TUVWXYZ
or it could be
TUVWXYZ
ABCDEFG
but it could not be this
ABCTUVDEFWGXYZ
FactoryLink 6.6.0 / Application Editor Guide / 347
27
PowerVB Animation
PowerVB code for two or more PowerVB-animated graphic objects can run at the
same time. For example, suppose two box objects on a drawing both have tag
events triggered by the same tag. When the tag value changes, the tag
subroutines for both boxes start running at approximately the same time. This
has an impact on the Print statement. If two or more PowerVB subroutines
execute a Print statement at about the same time, the output from the Print
statements are not normally intermingled.
•
DEBUGGING A POWERVB SCRIPT
•
Using Print Statements
•
•
In one circumstance the Print statement output from two or more routines can
intermingle on the same line in vbdebug.log: when one or more of the Print
statements ends with a comma or semicolon that tells PowerVB to start printing
the output of the next Print statement on the same line.
For example, if you change the previous box1’s tag event code to the following:
sub Drawing_1001_ASecChanged
’ end the following Print statement with a semicolon so the
’ next print statement prints on the same line
print "ABCDEFG(";
print “)HIJKLMNOP”
end sub
the output to vbdebug.log could be
ABCDEFG()HIJKLMNOP
TUVWXYZ
or it could be
TUVWXYZ
ABCDEFG()HIJKLMNOP
or it could be
ABCDEFG(TUVWXYZ
)HIJKLMNOP
The output from the two Print statements running at the same time can only
intermingle at the position where the comma or semicolon occurs. For example,
the output from the previous sample code could not be
ABCDEFG()HIJKTUVWXYZLMNOP
because the two Print statements in box1 tag event code are separated between
ABCDEFG and HIJKLMNOP.
348 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Using Print Statements
sub Drawing_1001_ASecChanged
’ end the following Print statement with a semicolon so the
’ next print statement prints on the same line.
By
’ enclosing the two Print statements in
’ Critical/EndCritical statements,
’ no intermingling of output can occur.
Critical
print “ABCDEFG”;
print “HIJKLMNOP”
EndCritical
end sub
no intermingling can occur. The output from this tag event routine’s Print
statements would always occur on the same line with no other Print statement
output between these statements’ output. Recall that the Critical and EndCritical
statements tell PowerVB that the code between them must be allowed to run
without being interrupted by code from any other event routines.
FactoryLink 6.6.0 / Application Editor Guide / 349
27
PowerVB Animation
Use Critical and EndCritical statements to prevent intermingling and still use
Print statements ending with a comma or semicolon. For example, if you wrap
box1 tag event Print statements from the previous example with Critical and
EndCritical statements as follows,
•
DEBUGGING A POWERVB SCRIPT
•
Using Print Statements
•
•
Header Information In Debug Output File
Every time FactoryLink application executes its first Print statement, header
information is appended to the vbdebug.log file. This information shows where
each separate run of the application occurs. The information written in each
header section includes a row of asterisks to visually separate output from
different application runs and the date and time. For example, a header section
might look like the following:
output from previous run of FactoryLink application
****************************************************************
Logging session started: Sun Jan 14 13:09:38 1996
output from new run of FactoryLink application
Location of Debug Output File
As stated earlier, the output from the Print statements goes to a file named
vbdebug.log. The location path of this file is
{FLAPP}\{FLNAME}\{FLDOMAIN}\{FLUSER}\log\vbdebug.log
The {FL...} portions of this path are environment variables defined for every
FactoryLink application. For example, suppose a FactoryLink application is in
directory C:\ECS\APPS, the FLAPP value. Suppose the values of FLNAME,
FLDOMAIN, and FLUSER are FLAPP1, USER, and JOHN, respectively. In this
case, the full path to the vbdebug.log file is
C:\ecs\apps\flapp1\user\john\log\vbdebug.log
If a different user named SALLY used the same application, thus changing
FLUSER to SALLY, this user’s vbdebug.log file would be in the following path:
C:\ecs\apps\flapp1\user\sally\log\vbdebug.log
Including the domain FLDOMAIN in the path allows different vbdebug.log files for
graph to be running in different domains. Including the user name FLUSER in
the path lets different users of the same application have different vbdebug.log
files.
350 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Using Print Statements
Disabling Debug Output
Once the PowerVB code in the application is debugged, the Print statement
output may no longer need to go to the vbdebug.log file. PowerVB has a way to
turn off the output of Print statements so they can remain in the code and
dormant debugging is not necessary. Two global tags are defined for every
FactoryLink application. Their names are VBLOGDISABLE_S and
VBLOGDISABLE_U. Their default values are zero. When VBLOGDISABLE_S is
set to one, Print statement output for graph running in the SHARED domain is
disabled. Nothing will go to the vbdebug.log file. When graph is running in the
USER domain, setting VBLOGDISABLE_U to 1 disables Print statement output
to vbdebug.log. For example, suppose the following code is executed by graph
running in the USER domain:
VBLOGDISABLE_U.Value = 0 ’turn on output
Print “Line 1"
VBLOGDISABLE_U.Value = 1 'turn off output
Print “Line 2"
VBLOGDISABLE_U.Value = 0 'turn on output
Print “Line 3"
The output from this PowerVB code to vbdebug.log is
Line 1
Line 3
FactoryLink 6.6.0 / Application Editor Guide / 351
27
PowerVB Animation
If one of the environment variables used to create the path to the vbdebug.log file
does not exist, trying to use the Print statement in PowerVB code causes a
run-time error. The exception to this rule is if the FLUSER environment variable
is not defined, a default value of shared is used in its place.
•
DEBUGGING A POWERVB SCRIPT
•
Using Print Statements
•
•
The Print statement that tries to output Line 2 is disabled because the tag
VBLOGDISABLE_U has the value 1 when the Print statement executes.
After debugging, set the default value of these two tags in the Application Editor
or Configuration Manager to 1 so the Print statements are ignored.
Note: When graph is running in the USER domain, changing
the value of tag VBLOGDISABLE_S has no impact. Likewise,
changing the value of tag VBLOGDISABLE_U when graph is
running in the SHARED domain has no effect. Remember to
change the correct tag to turn off Print statement output for the
domain graph is running in. To be safe, set both tags to 1 to
make sure Print statement output is disabled for any domain.
Examples of the Print statement used with objects unique to FactoryLink include:
• RTDBObject:
• GraphicObject:
• DrawingObject:
• WindowObject:
Refer to Chapter 22, “Using Properties and Methods in PowerVB,” for more
information on PowerVB variables and FactoryLink tag types.
352 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Using LogView to Display Debug Output
U SING L OG VIEW
TO
D ISPLAY D EBUG O UTPUT
Overview
Any text editor can be used to view a vbdebug.log file; however, LogView is
designed specially for this task. It offers the following advantages over most text
editors:
• The view of the vbdebug.log file is periodically updated to show any new output
from Print statements in a running FactoryLink 6.6.0 application.
• LogView has the ability to view files of any size.
• The GUI interface for LogView is user friendly.
• LogView is a file viewer and not an editor, so it is impossible to accidentally
overwrite information in the vbdebug.log file.
• LogView is available on all platforms FactoryLink 6.6.0 runs on and operates
the same on each of these platforms.
Starting LogView
LogView can be started using the GUI method appropriate to the operating
system you are using.
Windows NT
Double-click the LogView icon in the FactoryLink program group
in Program Manager
Windows 95
Select the LogView icon from the FactoryLink section of the
Programs section of the Start menu
OS/2
Double-click the LogView icon in the FactoryLink folder
LogView can also be launched from the command line by entering the following
command at the command line:
logview [filename(s)] [-refresh nnn]
The optional filename(s) part of the command identifies one or more files to select.
The optional -refresh nnn part of the command lets you define the refresh rate to
use. The refresh rate is described further below.
FactoryLink 6.6.0 / Application Editor Guide / 353
27
PowerVB Animation
LogView provides a convenient means for viewing the vbdebug.log files created in
PowerVB.
•
DEBUGGING A POWERVB SCRIPT
•
Using LogView to Display Debug Output
•
•
When you start-up LogView, the first window you see identifies LogView and
displays copyright information followed by LogView’s main window.
This window has a menu bar and toolbar for selecting performance commands. It
has a files area in the middle with horizontal and vertical scroll bars to display
icons for the files selected for viewing. The menus on the main window and their
options are detailed on the following pages.
File Menu
Use the File menu to open a file in LogView and to exit LogView.
Open
Exit
Brings up the Open File dialog to open a file for viewing.
Exits the LogView application.
354 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Using LogView to Display Debug Output
Options Menu
Full Path Name
Displays the full name of the file icons shown in the LogView
main window files area.
Help Menu
The Help menu option About LogView re-displays the window giving copyright and
version information for the LogView application.
Selecting a File to View
1 Choose File>Open in the main LogView window to display the Open File dialog.
2 Select a file for viewing from the Open File dialog. Usually, you select the
vbdebug.log file in the appropriate directory, but you are not limited to viewing
vbdebug.log. Any text file can be viewed with LogView. The Open File dialog looks
very similar to the Import and Export dialogs in the PowerVB animation editor.
Refer to Chapter 18, “PowerVB Editor,” for descriptions of each menu item.
If you select a file with the Open File dialog and click on Open, an icon for the file
displays in the main LogView window’s file area. You can open several files using
the Open File dialog, which puts several icons in the files area of the LogView main
window.
FactoryLink 6.6.0 / Application Editor Guide / 355
27
PowerVB Animation
The Options menu allows you to change the name of the file icons to the full path
name or the file name. A check mark is displayed next to Full Path Name when it is
enabled.
•
DEBUGGING A POWERVB SCRIPT
•
Using LogView to Display Debug Output
•
•
Using the Full Path Names Option When Viewing File Icons
If several files are opened and have the same name but reside in different
directories, the names of their icons are the same, which can be confusing. If you
select Full Path Name from the Options menu, the full paths of the files display
under their icons as in the following example.
This lets you see exactly which file is represented by each icon. Choosing
Options>Full Path Name again changes the icon names back to the basic name and
extension.
Viewing a File
Once one or more file icons are in the main window files area, double click an icon
and view the file contents. The sections of this window are detailed in the
following paragraphs.
Title Bar
This has the text LOGVIEW: filename in it where filename is the full name of the file
being viewed.
356 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Using LogView to Display Debug Output
Menu and Toolbar
The following commands are available on the menu and toolbar:
Help
If automatic refreshing is off indicated by a clock on the toolbar
button, this menu option turns it on. If the button has a stop sign
on it, automatic refreshing is enabled. When you click on the
button, its appearance changes to the clock image to indicate
automatic refreshing is disabled. Clicking on the button again
changes it back to a stop sign to indicate automatic refreshing is
enabled.
About LogView — displays the window showing copyright
information for the LogView application.
File Contents Area
Displays the contents of the file being viewed. A vertical scroll bar lets you scroll
to lines in other parts of the file. A horizontal scroll bar lets you scroll sideways to
see more of a line when lines in a file are longer than the contents area. Select and
copy lines in the file to the clipboard so they can be pasted into another
application.
Status Area
Tells the number of the first line selected in the viewer and the total number of
lines in the file being viewed. If you have not selected any lines in the file, the first
number is zero.
Refresh Rate
Adjusts how often the viewer file information is refreshed. This rate is specified in
seconds with a valid range of 1 to 100 seconds.
To use the Refresh Rate section of the window, drag the rate indicator to the left or
right to decrease or increase the rate or press the left and right arrows. If you click
on the left or right arrow once, the refresh rate decreases or increases by one
second.
If you click on the left or right arrow with the left mouse button and hold the
button down, the refresh rate constantly decreases or increases until you release
the button or reach an end of the valid range.
FactoryLink 6.6.0 / Application Editor Guide / 357
PowerVB Animation
Refresh
27
•
DEBUGGING A POWERVB SCRIPT
•
Using LogView to Display Debug Output
•
•
Heart Beat Indicator
This section of the viewer window updates the color of the bars periodically to
show the LogView viewer window is not locked up. Like a heart beat monitor, this
section shows the application is running correctly. The Heart Beat indicator stops
if automatic file refreshing is disabled. It does not restart until automatic
refreshing is enabled again.
Refresh Rate and Updating Viewer Window’s File Contents Area
If you are viewing the contents of the vbdebug.log file while the FactoryLink
application is running, Print statements might still be changing the file. So,
LogView has an automatic refresh ability — the ability to periodically refresh its
view of the file contents. In other words, it periodically rereads the file contents
and displays them in the file contents area of the viewer window. Without this
ability, you will have to close and reopen the file every time you want to see
changes in it.
Control the rate LogView refreshes at by using the Refresh Rate section of the
viewer window and/or specifying a refresh rate on the command line when you
start LogView. The default refresh rate is 10 seconds meaning LogView checks for
changes in the file every ten seconds. The refresh rate can change from 1 second to
100 seconds.
When automatic refreshing is turned on and the viewer window detects the file
has changed, it re-reads the contents of the file and forces you to view the last
section of the file. This is where the changes are in a vbdebug.log file. Turn off
automatic refreshing by pressing the stop sign button on the viewer window
toolbar. Turn off automatic refreshing to scroll up in the file contents and not be
forced to the bottom of the file when changes are detected in the file. Turn
automatic refreshing back on by clicking the toolbar button again. When
automatic refreshing is off, the button contains a picture of a clock to let you know.
358 / FactoryLink 6.6.0 / Application Editor Guide
DEBUGGING A POWERVB SCRIPT
Troubleshooting
TROUBLESHOOTING
27
Case Sensitivity Issues
Code executes verbatim at run time. Watch for spacing. Note that PowerVB is not
case-sensitive except for object names in explicit declarations.
Reserved Words
All statement and function names in the PowerVB Command Reference as well as
the properties and methods described here are considered reserved words. These
words cannot be used as variable names in PowerVB code.
PowerVB Code Attached to Sub-Objects
Care must be taken when using PowerVB on the sub-objects of a composite object.
When a mouse event occurs, only the top-most object that responds to mouse
events are notified of the event. For example, if a composite object has a child that
responds to mouse down events and the child has a child that responds to them as
well, the grandchild never receives any mouse down events.
Multi-threading
Multi-threading is when PowerVB lets more than one event routine execute at the
same time. This is different from Visual Basic where only one event routine
executes at a time. Allowing multi-threading makes PowerVB more flexible but
also makes coding more complicated in several ways.
Do not rely on a specific execution order for events on different objects in a
drawing. Even if you create object A in the Application Editor before you create
object B, this does not mean object A’s DrawLoad event runs before object B’s
DrawLoad event. Even if drawing X loads before drawing Y, you cannot be sure
that DrawLoad events for objects on drawing X execute before those on drawing Y.
To ensure a certain execution order for statements in DrawLoad events, put all
the statements in one DrawLoad event on one object.
FactoryLink 6.6.0 / Application Editor Guide / 359
PowerVB Animation
The following paragraphs outline troubleshooting tips for programming code in
PowerVB.
•
DEBUGGING A POWERVB SCRIPT
•
Troubleshooting
•
•
Just as multiple events for different objects can run at the same time, multiple
events for a single object can run at the same time with some restrictions. All tag
events for an object can run at the same time; however, all other types of events
(drawing, mouse — commonly referred to as GUI events) occur one at a time in
the order they are detected.
Endless Loops
Watch for endless loops. A FactoryLink application will not shut down until all
active event routines end. So, an application could be frozen until you forcibly
terminate it using whatever method the operating system provides. The same
problem can occur when you try to unload a drawing from memory. The
application waits for the PowerVB event routines running on that drawing to end
before closing the drawing.
For example, the following code creates an endless loop (since A_SEC is a counter
for the number of seconds since the last minute, its value is always less than 61):
While A_SEC.value < 61
‘A bad thing
x = x + 1
Wend
Execution Order at Run Time
A drawing does not unload until all PowerVB scripts in all of its objects terminate.
Multiple DrawLoad event procedures can exist in multiple objects. If multiple
DrawLoad events exist for a drawing, they are executed in the order the objects
are saved in the .g file. If the execution order of the DrawLoad code is important,
put all of the DrawLoad code in a single object. It then executes sequentially as
expected.
360 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Security
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
361
•
•
6.6.0
•
Part V
•
•
•
•
•
Chapter 28
Graphic Object
Security Overview
As you set up applications in FactoryLink, you may want to control who has
access to the functions within the application. For example, you may want to
ensure a particular part of your application is not available to all users.
FactoryLink’s Security feature allows you to restrict access so unauthorized users
cannot access certain functions, while authorized users are granted access to
these functions.
In FactoryLink, security focuses on graphic input objects—that is, when you
create a FactoryLink graphic object, you can enter a specific security class for the
graphic object. If a user does not have access to the specified security class, the
user cannot access the graphic object.
28
Security can be assigned to each of the three input object types:
• Buttons
• Function keys
These objects have one thing in common—they are objects an operator uses to
interact with an application.
In addition, Security allows you to determine the type of user required to access a
graphic object or application screen and the type of feedback displayed if a user is
not authorized to access it. It also allows you to record information about who is
accessing—or attempting to access—the application.
To control application security, you must be familiar with the following:
• The concepts of being an application administrator, being an application user,
and using security classes
• The FLADMIN function, which allows the administrator to set up application
security
• The Security options available from the Application menu within the
Application Editor
• How to plan Security for your application
FactoryLink 6.6.0 / Application Editor Guide / 363
Security
• Text input fields
•
GRAPHIC OBJECT SECURITY OVERVIEW
•
•
•
This chapter introduces you to the concepts you must understand to configure
Security for your applications.
364 / FactoryLink 6.6.0 / Application Editor Guide
GRAPHIC OBJECT SECURITY OVERVIEW
Key Concepts
K EY C ONCEPTS
To understand how FactoryLink’s Security features work, you need to understand
the following basic concepts:
• Application administrator
• Application user
• Security class
Application Administrator
The application administrator is responsible for establishing and maintaining
FactoryLink Security for an application. The application administrator
• Creates and maintains records for all application users
• Creates and maintains records of all security classes
28
By controlling who can access the system (application users) and what type of
access the users have (security classes), the application administrator plays the
key role in maintaining security within a FactoryLink application.
Application User
A application user is anyone authorized to access FactoryLink screens. The
application administrator establishes who is an application user by creating a
security record for each user. This security record includes:
• The user’s name
• The user’s password
• The security classes the user can access
If at run-time a user tries to access a graphic object assigned to a security class,
the system verifies the user has access to this security class. If the user does not
have access to the security class, the user cannot access the graphic object. In this
way, FactoryLink controls who can access the different parts of the application.
Before a user can access any security class, the user must log in (by entering a
user name and password).
FactoryLink 6.6.0 / Application Editor Guide / 365
Security
To ensure only the application administrator can access security information, the
administrative part of the security function (called FLADMIN) is
password-protected. The administrator can modify the administrator password as
needed.
•
GRAPHIC OBJECT SECURITY OVERVIEW
•
Key Concepts
•
•
Users can be assigned to multiple security classes. For example, an employee
might be assigned to only one security class to limit the employee’s access to the
application. At the same time, a supervisor might be assigned to all available
security classes, so the supervisor can access all features within the application.
Security Class
A security class is defined by the application administrator. Each input graphic
object can be assigned to one security class. Each application user then can be
granted access to any or all security classes.
A class may be created:
• For a particular kind of operation
• To control a single machine
• To access a particular screen or set of screens
• To control any other aspect of your application security
The precise meaning of each security class is determined by the needs of the
application. Since users can be assigned to any set of classes, you can use this
approach to create a hierarchical security scheme, where users with higher access
have access to the same classes as users who have lower access. Or, if desired, you
can tailor security so each user has access only to an appropriate set of classes.
You can even set up a hierarchical structure and allow deviations to the hierarchy
as needed.
In a simple scenario, an application administrator may decide to create two
classes of Security: one class named Operator and another class named
Supervisor. When the application is created, the application developer assigns
input graphic objects to a particular security class. For example, a particular
menu button may be assigned to the Operator security class while a specific text
input field might be assigned to the Supervisor security class. When the
application runs, only those users who have access to the security class associated
with the object can access the object.
The application administrator can create up to 32 security classes.
Note: You need a development license with Application Editor
to assign security classes. You need a run-time license to
associate users with security classes.
366 / FactoryLink 6.6.0 / Application Editor Guide
GRAPHIC OBJECT SECURITY OVERVIEW
FLADMIN
FLADMIN
FLADMIN is the FactoryLink function that allows the application administrator
to set up application security. FLADMIN provides options that allow you to
• Define security classes
• Define application users
• Specify the type of password to be used for the application
• Change the application administrator password
FLADMIN can be accessed from the Application Editor, from the FLADMIN icon,
or from the command line. Refer to Chapter 29, “Configuring Security Using
FLADMIN,” in this manual to see how to access FLADMIN and use its options.
Note: You must first run the Application Editor before you run
FLADMIN for the first time.
28
Security
FactoryLink 6.6.0 / Application Editor Guide / 367
•
GRAPHIC OBJECT SECURITY OVERVIEW
•
Security Options
•
•
S ECURITY O PTIONS
Along with the Security functions available within FLADMIN, FactoryLink also
provides some Security options that can be accessed from the Application Editor.
These Security options allow you to
• Define login options for your application
• Define error messages that display after a failed security login
• Define login messages
• Log security events within your application
These Security options are available from the Application menu within the
Application Editor. Refer to Chapter 30, “Setting up Security Options,” in this
manual to see how to use these options.
368 / FactoryLink 6.6.0 / Application Editor Guide
GRAPHIC OBJECT SECURITY OVERVIEW
Planning Security for your Application
P LANNING S ECURITY
FOR YOUR
A PPLICATION
To configure Security for your application, you must develop a plan to ensure your
application provides the proper level of security. Specifically, you need to
• Decide how authorized users will log in and out
• Determine object security requirements
Deciding How Authorized Users Will Log in and Out
Users need to be able to log in to show that they have the proper Security access to
use anything in an application that is Security-protected. Users can log in three
ways:
• You can assign keys on the keyboard as hot-keys for Security. When the user
presses the key or key combination defined as the hot-key, a login dialog box
displays, prompting the user to log in. These hot-keys are used to log in any
time from any part of the running application.
28
• A login dialog box can be assigned to the object. When the user tries to access
the object, the system displays a dialog box prompting the user to log in.
• A trigger tag can be defined to log in a user and password, specified in the name
You also need to set up a logout process to prevent authorized access to objects or
actions that have Security attached. The logout process can be defined as follows:
• As with logging in, users can use hot-keys to log out. If you assign hot-keys, you
can optionally include a dialog box that will confirm that the user really wants
to log out.
• You can configure logout to occur after a certain amount of time has passed.
This prevents unauthorized access to the application if a user forgets to log out.
• A trigger tag can be defined to log out the current user.
If desired, you can use a combination of the above logout procedures—for example,
by setting up hot-keys for normal logout but also configuring automatic logout in
case users forget to logout.
FactoryLink 6.6.0 / Application Editor Guide / 369
Security
tag and the password tag, when triggered. Refer to “Setting up Security
Options” on page 387 for more information about trigger tags.
•
GRAPHIC OBJECT SECURITY OVERVIEW
•
Planning Security for your Application
•
•
Determining Object Security Requirements
After you have determined how login and logout will occur, you need to identify
which objects need to have Security added. This step allows you to identify the
windows (screens) you may want to disable through buttons, and the keys or fields
you want to disable.
To determine your object Security requirements, you need to
• Plan your Security classes
• Determine actions that will occur if unauthorized access occurs
Planning Security Classes
As discussed earlier, security classes are a key to specifying who has access to a
particular object. Remember the following key points about security classes:
• An object can only have one security class assigned to it
• All users that have access to the object must be a member of the security class.
• Up to 32 security classes may be defined in an application
Also, remember that FactoryLink security classes provide great flexibility in
allowing users to have common security classes assigned or completely unique
security privileges. Instead of using a strict hierarchical structure (for example,
where Level 1 users get access to all functions and Level 10 users get access to
only a few functions), FactoryLink allows you to tailor security to meet your
application needs.
Determining Access Error Actions and Logging
Once Security is added to an object, the authorized security class is assigned. The
next question is what happens if an unauthorized user tries to access the object.
FactoryLink provides security attributes that allow you to determine this. You can
also keep a log of unauthorized access attempts, if desired.
FactoryLink security attributes fall into two categories:
• Class Logging—Allows you to specify if you want to log attempts to access a
graphic object (failed or successful accesses).
• Access Error Action—Allows you to determine what will happen when an
access attempt fails. You can choose to provide a dialog box, a prompt, a beep,
or no action.
Remember you can combine Class Logging and Access Error Action options to
provide the type of security information you want.
370 / FactoryLink 6.6.0 / Application Editor Guide
GRAPHIC OBJECT SECURITY OVERVIEW
Implementing Security in your Application
I MPLEMENTING S ECURITY
IN YOUR
A PPLICATION
When you are ready to set up Security for your application, you may want to use
the following steps to guide you:
Note: The Security options are available from the Application
menu within the Application Editor. Specific steps for using the
Security options are provided in Chapter 29, “Configuring
Security Using FLADMIN,” and Chapter 30, “Setting up
Security Options.”
1 Select Assign Users and Classes from the Application menu in the Application
Editor.
• Change the Administrator Password for Security
• Set the Password Verification Type (local or system)
28
2 Create and define application classes.
• Assign access error action
• Assign class logging
Security
3 Create and define application users.
• Set up user passwords
• Assign class(es) to users
4 Set up login/logout options.
• Optionally, define login hot-keys (if using hot-keys for login)
• Optionally, define the user Name tag, Password tag, and Trigger tag for logging
in
For example, the Name tag, Password tag, and Trigger tag allows users with
touch screens to log in the system.
• Optionally, define Logout hot-keys and indicate whether to confirm logout with
a dialog
• Optionally, define the logout Trigger tag
• Optionally, define the window and drawing to return to upon logout, thus
preventing unauthorized access to drawings. If nothing is specified, the window
and drawing the user logs out from remain active.
• Change the contents of the files that contain the text if you want to change the
text used in either login or error dialog boxes.
FactoryLink 6.6.0 / Application Editor Guide / 371
•
GRAPHIC OBJECT SECURITY OVERVIEW
•
Implementing Security in your Application
•
•
5 Set up the event logging configuration.
• Select the events to log, including user login/logout and system
start-up/shutdown.
• Define the Mailbox tag, optional Disable tag, and Database Alias.Logging Table
if you are logging any of the above events.
6 Assign Security to objects.
Note: When developing Security for an application, you may
want to disable the Security function while you are developing
the application (using the Disable Security option available
from the FLADMIN menu). Otherwise, you will need to
constantly sign in to each object as you create your application.
Once you complete your application, enable Security (using the
Enable Security option on the FLADMIN menu) and test the
application to ensure you implemented Security correctly.
372 / FactoryLink 6.6.0 / Application Editor Guide
GRAPHIC OBJECT SECURITY OVERVIEW
Security and Stacked Buttons
S ECURITY
AND
STACKED B UTTONS
Stacked buttons are multiple button objects stacked on top of each other to
perform specific tasks within your application. Before you begin adding Security
to stacked buttons within your application, you need to consider how Security
affects operation of the stacked buttons.
Consider the following information related to Security and stacked buttons:
• Avoid adding security to stacked buttons within an application. If stacked
buttons contain different security classes, the buttons may not operate properly
(if the user login fails for some buttons in the stack but not for other buttons in
the stack).
• Do not add security to stacked buttons that include momentary action buttons.
The momentary action button may begin to operate properly but then stop
operation when the security login displays.
• Ensure all buttons in the stack have the same security class if you must have
28
security on stacked buttons. Also, use classes that do not require display of a
login or error dialog.
Security
FactoryLink 6.6.0 / Application Editor Guide / 373
•
GRAPHIC OBJECT SECURITY OVERVIEW
•
Security and Stacked Buttons
•
•
374 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 29
Configuring Security
Using FLADMIN
The FLADMIN function allows the application administrator to set up application
security. Through FLADMIN, the administrator can
• Define security classes
• Define application users
• Set the password type for the application
• Set the administrator password
This chapter describes how to access FLADMIN and configure each of these
FLADMIN options.
29
Security
FactoryLink 6.6.0 / Application Editor Guide / 375
•
CONFIGURING SECURITY USING FLADMIN
•
Accessing FLADMIN
•
•
A CCESSING FLADMIN
You must access FactoryLink’s FLADMIN function to set up security. You can
access FLADMIN in any of three ways:
• Select Assign Users/Classes from the Application menu within the Application
Editor
• Select the FLADMIN icon
• Enter FLADMIN from the command line
The FLADMIN menu displays when you access FLADMIN.
The FLADMIN menu allows you to choose the Security option you want to
perform.
In this chapter, the first method shown—accessing FLADMIN from the
Application Editor—is used. Remember you can use either of the other two
methods, as desired.
376 / FactoryLink 6.6.0 / Application Editor Guide
CONFIGURING SECURITY USING FLADMIN
Defining a Security Class
D EFINING
A
S ECURITY C LASS
The application administrator must set up the security classes that control
security within the FactoryLink application. Each graphic object to be secured
must be assigned to a security class. The Application Classes option within
FLADMIN allows you to set up your security classes.
Perform the following to define a security class:
1 Choose Assign Users/Classes from the Application menu of the Application Editor.
The system asks you to enter your administrator password.
29
Security
The default administrator password is Password. Passwords are not
case-sensitive.
Note: Remember: you can also access FLADMIN by selecting
the FLADMIN icon or by entering FLADMIN from the
command line.
FactoryLink 6.6.0 / Application Editor Guide / 377
•
CONFIGURING SECURITY USING FLADMIN
•
Defining a Security Class
•
•
2 Enter your administrator password and click on OK to display the FLADMIN
menu.
3 Click on Application Classes to display the Application Security Classes dialog.
378 / FactoryLink 6.6.0 / Application Editor Guide
CONFIGURING SECURITY USING FLADMIN
Defining a Security Class
4 Enter the new security class name, and click on New to display the Security Class
Attributes dialog.
29
Log Access
Failure
Click this button if you want the system to keep a record of every
failed attempt to access a graphic object within this security
class. If a user attempts to use an input object with this class and
does not have correct privilege, the system writes a message to
the Historian mailbox (if configured) and last event tag.
Log User
Action
Click this button if you want the system to log successful
attempts to access a graphic object within this security class. If a
user attempts to use an input object with this class and has the
correct privilege, the system writes message to the Historian
mailbox (if configured) and last event tag.
Error Dialog
Click on this button if you want the user to receive an error dialog
when failing to access a graphic object.
Login Prompt
Click on this button if you want the user to receive a login prompt
when failing to access a graphic object.
FactoryLink 6.6.0 / Application Editor Guide / 379
Security
5 Provide the following information for the Security Class Attributes dialog:
•
CONFIGURING SECURITY USING FLADMIN
•
Defining a User
•
•
Beep
Click on this button if you want the system to beep when the user
fails to access a graphic object.
None
Click on this button if you don’t want to provide any feedback
when the user fails to access a graphic object.
6 Click on OK when you finish entering information to create the security class and
display the Application Security Classes dialog.
D EFINING
A
U SER
The application administrator sets up security records for each authorized
application user. These records are set up using an option within FLADMIN.
Complete the following instructions to set up a security record and define an
application user.
1 Choose Assign Users/Classes from the Application menu of the Application Editor.
The system asks you to enter your administrator password.
2 Enter your administrator password and click on OK to display the FLADMIN
menu.
3 Click on Application Users to display the Application Users dialog.
380 / FactoryLink 6.6.0 / Application Editor Guide
CONFIGURING SECURITY USING FLADMIN
Defining a User
4 Click on New to display the New Application User dialog.
29
User Name
Enter the name of the user you want to create.
User names can be up to 32 characters, but certain operating
systems may only support a limited number of characters as a
user name. Thus, user names should normally be limited to eight
characters, including spaces.
Valid Entry: Alphanumeric string of up to 32 characters
Description
Enter the user’s full name (up to 32 characters, optional).
Valid Entry: Alphanumeric string of up to 32 characters
Auto Logout (in
minutes):
Enter the number of minutes the system will sit idle before the
user is automatically logged out. The system automatically logs
out the user if the user does not select an input object within this
time period.
If you enter 0 or leave this field blank, the user will not be logged
out automatically.
Valid Entry: 0-99
FactoryLink 6.6.0 / Application Editor Guide / 381
Security
5 Specify the following information in the New Application User dialog.
•
CONFIGURING SECURITY USING FLADMIN
•
Defining a User
•
•
Modify Password
Click in this box if you want to modify the user’s password.
This field is not available if you have selected System Password
Verification as the Password Verification type. Refer to “Setting
the Password Type” on page 383 for more information.
New:
If you choose to modify the user’s password, enter the new
password here.
The system saves the password with case preserved, but
FactoryLink ignores case. Certain operating systems may use
case-sensitive passwords.
This field is not available if you have selected System Password
Verification as the Password Verification type. Refer to “Setting
the Password Type” on page 383 for more information.
Valid Entry: Alphanumeric string of up to 32 characters
Confirm:
If you choose to modify the user’s password, enter the new
password again here. This field is used to verify your input in the
New field.
Valid Entry: Alphanumeric string of up to 32 characters
Available Class(es)
Lists the available security classes so you can specify the security
class (or classes) you want to assign to the user. Highlight the
security class you want to assign and click on the forward arrow
button to move the class to the Assigned Class(es) list box. You
can also use the ALL forward arrow to move all security classes to
the Assigned Class(es) list box.
Assigned
Class(es)
Shows the security class(es) you have assigned to the user. If you
want to delete the user’s access to one of these security classes,
highlight the security class and click on the backward arrow
button to move the class back to the Available Class(es) box. You
can also use the ALL backward arrow to delete all security
classes from this list box and move them back to the Available
Class(es) box.
6 Click on OK when you finish entering information. The user record is created, and
the Application Users dialog displays.
382 / FactoryLink 6.6.0 / Application Editor Guide
CONFIGURING SECURITY USING FLADMIN
Setting the Password Type
S ETTING
THE
P ASSWORD TYPE
The Password Verification Type option allows the application administrator to
change the password verification type from local (internal FactoryLink
verification) to system (platform system dependent). System password verification
may be allowed depending on the operating system you are using.
This option is not user-specific but is applicable to the entire FactoryLink
application. For example, if you choose system password verification, all users are
subject to system password verification to access FactoryLink graphic objects.
Complete the following instructions to set the password verification type:
1 Choose Assign Users/Classes from the Application menu of the Application Editor.
The system asks you to enter your administrator password.
2 Enter your administrator password and click on OK to display the FLADMIN
menu.
29
3 Click on Password Verification Type to display the Password Verification Type dialog.
Security
4 Complete the following to fill out the Password Verification Type dialog.
Local Password
Verification
Click on this button if you want Security to recognize the user’s
FactoryLink password.
System Password
Verification
Click on this button if you want Security to recognize the user’s
system password. This option may be used if your operating
system allows use of a system password.
5 Click OK when you finish entering information to display the FLADMIN.
FactoryLink 6.6.0 / Application Editor Guide / 383
•
CONFIGURING SECURITY USING FLADMIN
•
Setting the Administrator Password
•
•
S ETTING
THE
A DMINISTRATOR P ASSWORD
The application administrator must enter a application administrator password to
access the FLADMIN features. This password ensures only the application
administrator can access system security features, such as defining users and
setting up security classes.
The default administrator password is Password. As an administrator, you must
change this password as soon as possible to prevent unauthorized system access.
Complete the following instructions to change your administrator password:
1 Choose Assign Users/Classes from the Application menu of the Application Editor.
The system asks you to enter your administrator password.
2 Enter your administrator password and click on OK to display the FLADMIN
menu.
3 Click on Administrator Password to display the Administrator Password dialog.
4 Complete the following information to fill out the Administrator Password dialog.
Old password
New
password
Enter your current administrator password.
Enter the new administrator password you want to use. A valid
password is a string of alphanumeric characters with no
embedded spaces.
Valid Entry: Alphanumeric string of 6 to 32 characters
384 / FactoryLink 6.6.0 / Application Editor Guide
CONFIGURING SECURITY USING FLADMIN
Setting the Administrator Password
Confirm
password
Enter the new administrator password again that you want to
use to confirm the new password. This field is used to verify your
input in the New Password field.
Valid Entry: Alphanumeric string of up to 32 characters
5 Click on OK When you finish entering information to save the new password and
display the FLADMIN menu.
29
Security
FactoryLink 6.6.0 / Application Editor Guide / 385
•
CONFIGURING SECURITY USING FLADMIN
•
Setting the Administrator Password
•
•
386 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
Chapter 30
Setting up Security
Options
Along with the FLADMIN options, FactoryLink also provides some security
options available from the Application menu within the Application Editor. These
Security options allow you to control how security works within your application.
You can use these options to
• Set the login options
• Define error messages
• Define login messages
30
• Log security events
This chapter describes how you can configure these Security options.
Security
FactoryLink 6.6.0 / Application Editor Guide / 387
•
SETTING UP SECURITY OPTIONS
•
Using Keywords
•
•
U SING K EYWORDS
The usefulness of security dialogs and logging text can be extended with key
words. These keywords are translated to text values at run-time.
Security keywords can be used in these locations:
Login and error dialogs (titles and dialog text, including prompts)
Input object log messages
Predefined events
Keywords have the form %KEYWORD, where KEYWORD is one of the following:
USER, VAL, OLD, CLASS, ACTION, DATE, and TIME.
Keyword ................Meaning
USER.....................Current logged in operator name
VAL.........................Tag value (meaningful only for input objects. If the operation
changes the tag, VAL is the value after the operation)
OLD.........................Tag value-like VAL, but the value of the tag before the
operation
CLASS.....................Object’s security class-meaningful only for input objects
ACTION..................Action performed on object
DATE.......................Current date
TIME........................Current time
Additionally, any system environment variable can be represented using %(ENV),
where ENV is the environment variable name.
ACTION will be ON, OFF, TOGGLE, SET, ADD, SUB, FILE, QUIT, TOP, DRAW,
ENABLE, PAN, ZOOM, CHANGE, STOP, DRWTOP, MOM ON, or MOM OFF.
Events are logged to the Security Event Log in these columns:
TMSTMAP................-Time of event
OPERNAME.............-Current operator name
EVNTYPE.................-Event type
EVNTMSG..................-Event message
Event codes are:
FAILTEXT.................-Failed to update text object*
UPDTEXT..................-Updated text object*
UPDINP.....................-Updated input object*
RTGSTART................-Graphics task starting
RTGSTOP...................-Graphics task shutting down
SECVIOL...................-Operator failed to log in*
388 / FactoryLink 6.6.0 / Application Editor Guide
SETTING UP SECURITY OPTIONS
Using Keywords
SECLOGOUT.................-Operator logged out
SECLOGIN.....................-Operator logged in
FAILLOGIN.......................-Operator attempted to log in, but failed*
*-includes the object’s log message as the event message
**-uses the operator name in the login attempt as the current operator
30
Security
FactoryLink 6.6.0 / Application Editor Guide / 389
•
SETTING UP SECURITY OPTIONS
•
Setting Security Login Options
•
•
S ETTING S ECURITY L OGIN O PTIONS
FactoryLink’s Security options allow you to control how users log in and log out of
the security system. These options are controlled through the Login Options
dialog.
You can use Login Options to
• Allow users to login and/or logout via a hotkey combination
• Allow users to login and/or logout automatically via a tag trigger
• Display a particular window after the user logs out
Complete the following instructions to configure your security login options.
1 Choose Security Options from the Application menu of the Application Editor.
2 Choose Login Options to display the Login Options dialog.
390 / FactoryLink 6.6.0 / Application Editor Guide
SETTING UP SECURITY OPTIONS
Setting Security Login Options
3 Specify the following information:
Login Hotkey
Specify a keystroke combination the user can use to begin the
security login process. This keystroke will be active no matter
what graphics screen is currently displayed. If you choose a login
hotkey, the user can press the hotkey combination and then
complete a dialog to login to the application.
If you want to permit use of a hotkey to allow security login,
select a key from the drop-down list and then press ALT, CTRL,
and/or SHIFT as needed to specify the hotkey combination.
The hotkey login method works independently from the tag
trigger login method. Specify one or both methods, as desired.
Name Tag
Used in conjunction with the Password Tag and Trigger fields to
allow automatic login based on a tag trigger. Enter the name of
the tag that contains the user name. See Trigger field for more
information.
30
Valid Entry: Standard tag name
Valid Data Type: message
Password Tag
Valid Entry: Standard tag name
Valid Data Type: message
Trigger
Used in conjunction with the Name Tag and Password Tag fields to
allow automatic login based on a tag trigger. Enter the name of
the tag used to trigger the login process. When the value of this
tag changes to 1, the user/password specified in the Name Tag and
Password Tag is used to log in a new user. After the login attempt
is complete, the Name Tag and Password Tag are cleared.
The tag trigger login method works independent from the hotkey
login method. Specify one or both methods, as desired.
Valid Entry: Standard tag name
Valid Data Type: digital
Logout Hotkey
Specify a keystroke combination the user can use to log out.
If you want to permit use of a hotkey to allow logout, select a key
from the drop-down list and then press ALT, CTRL, and/or SHIFT
as needed to specify the hotkey combination.
FactoryLink 6.6.0 / Application Editor Guide / 391
Security
Used in conjunction with the Name Tag and Trigger fields to allow
automatic login based on a tag trigger. Enter the name of the tag
that contains the user password. See Trigger field for more
information.
•
SETTING UP SECURITY OPTIONS
•
Setting Security Login Options
•
•
A confirmation message displays if the Confirm Logout box is
checked.
The hotkey logout method works independent from the tag
trigger logout method. Specify one or both methods, as desired.
Trigger
Enter the name of the tag used to log out the user. When the
value of this tag changes to 1, the user will be logged out without
a confirmation.
The tag trigger logout method works independent from the
hotkey logout method. Specify one or both methods, as desired.
Valid Entry: Standard tag name
Valid Data Type: digital
Home Display
Enter the name of the window you want displayed when the user
logs out. When the user logs out (either voluntarily or by timing
out), this window becomes the top window, and the drawing is
loaded, if necessary.
If this field is blank, the current display does not change when
the user logs out.
Valid Entry: WINDOW:DISPLAY
4 Click on OK when you finish entering information. The login/logout options you
specified are saved, and the Application Editor displays.
392 / FactoryLink 6.6.0 / Application Editor Guide
SETTING UP SECURITY OPTIONS
Defining Error Messages
D EFINING E RROR M ESSAGES
The Error Dialog option allows you to control the error message that will display
after a failed security login. The error message will display on five lines; this
option allows you to specify the content of each line.
Complete the following instructions to specify the Error Dialog message.
1 Choose Security Options from the Application menu of the Application Editor.
2 Choose Error Dialog to display the Error Dialog.
30
Security
3 Specify the following information:
Lines 1-5
Enter the format line for each line in the graph.txt file that
corresponds to the line you want to display in the error message.
Graph.txt is the standard FactoryLink graphics translation file in
FLINK\msg\graph.txt. Create an application graphics translation
file in FLAPP\msg\graph.txt by copying all of the lines begin with
SERLINEx or SLGLINEx from the FLINK file. The lines that
begin with SERLINE1 - SERLINE5 define the error dialog. The
translated line can contain up to three format specifiers.
Line 1 represents the first line of the error message, Line 2
represents the second line of the error message, etc.
Optional Value
Tag 1
Enter the name of the first tag used to insert some information
into the appropriate line of the error message.
Valid Entry: Standard tag name
FactoryLink 6.6.0 / Application Editor Guide / 393
•
SETTING UP SECURITY OPTIONS
•
Defining Error Messages
•
•
Optional Value
Tag 2
Enter the name of the second tag used to insert some information
into the appropriate line of the error message.
Valid Entry: Standard tag name
Optional Value
Tag 3
Enter the name of the third tag used to insert some information
into the appropriate line of the error message.
Valid Entry: Standard tag name
4 Click on OK when you finish entering information. The error dialog options you
specified are saved, and the Application Editor displays.
394 / FactoryLink 6.6.0 / Application Editor Guide
SETTING UP SECURITY OPTIONS
Defining Login Messages
D EFINING L OGIN M ESSAGES
The Login Dialog option allows you to control the message that displays during a
user login attempt. The message displays on five lines; this option allows you to
specify the content of each line.
Complete the following instructions to specify the Login Dialog message:
1 Choose Security Options from the Application menu of the Application Editor.
2 Choose Login Dialog to display the Login Dialog.
30
Security
3 Specify the following information:
Lines 1-5
Enter the format line for each line in the graph.txt file that
corresponds to the line you want to display in the login message.
Graph.txt is the standard FactoryLink graphics translation file in
FLINK\msg\graph.txt. Create an application graphics translation
file in FLAPP\msg\graph.txt by copying all of the lines begin with
SERLINEx or SLGLINEx from the FLINK file. The lines which
begin with SLGLINE1 - SLGINE5 define the login dialog. The
translated line can contain up to three format specifiers.
Line 1 represents the first line of the login message, Line 2
represents the second line of the login message, etc.
Optional Value
Tag 1
Enter the name of the first tag used to insert some information
into the appropriate line of the login message.
Valid Entry: Standard tag name
FactoryLink 6.6.0 / Application Editor Guide / 395
•
SETTING UP SECURITY OPTIONS
•
Defining Login Messages
•
•
Optional Value
Tag 2
Enter the name of the second tag used to insert some information
into the appropriate line of the login message.
Valid Entry: Standard tag name
Optional Value
Tag 3
Enter the name of the third tag used to insert some information
into the appropriate line of the login message.
Valid Entry: Standard tag name
4 Click on OK when you finish entering information. The login dialog options you
specified are saved, and the Application Editor displays.
396 / FactoryLink 6.6.0 / Application Editor Guide
SETTING UP SECURITY OPTIONS
Logging Security Events
L OGGING S ECURITY E VENTS
The Event Log Config option allows you to control what security-related events
can be recorded in a Historian file. You can use this option to specify the system
events you want to record and the Historian file that will store the log records.
Complete the following instructions to set the security logging options:
1 Choose Security Options from the Application menu of the Application Editor.
2 Choose Event Log Config to display the Security Event Logging Configuration dialog.
30
Security
3 Specify the following information:
User Login
User Logout
Click this box if you want to record all user login events.
Click this box if you want to record all user logout events.
System Startup
Click this box if you want to record when the Run-Time Graphics
task is started.
System Shutdown
Click this box if you want to record when the Run-Time Graphics
task encounters a shutdown request.
FactoryLink 6.6.0 / Application Editor Guide / 397
•
SETTING UP SECURITY OPTIONS
•
Logging Security Events
•
•
Historian Mailbox
Enter the name of the Historian mailbox where you want to store
the log records. If you do not enter a mailbox in this field, event
logging is disabled.
Valid Entry: Standard tag name
Valid Data Type: mailbox
*Disable
Enter the tag name or numerical constant used to enable or
disable event logging. If this tag has a FALSE value (0 or not
defined), event logging is written to the Historian. If this tag has
a TRUE value (any value other than 0), event logging is not
written to the Historian. If no tag is defined and a Historian
mailbox is identified, event logging is always written to the
Historian.
Valid Entry: Standard tag name or numeric constant
Valid Data Type: digital
Event log Table
Enter the name of the Alias.Table used within the Historian
mailbox to store the event logging information. This table
corresponds to an entry in the Historian Mailbox Information
panel for the selected mailbox.
4 Click on OK when you finish entering information. The event logging options you
specified are saved, and the Application Editor displays.
398 / FactoryLink 6.6.0 / Application Editor Guide
•
•
•
•
DXF Converter
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
399
•
•
6.6.0
•
Part VI
•
•
•
•
•
Chapter 31
Converting and
Importing DXF Files
FactoryLink allows you use AutoCAD drawings in your FactoryLink application.
The DXF Converter is used to convert original AutoCAC drawings into a .gx file
(an ASCII text-based file) that FactoryLink can import. FactoryLink does not
directly import DXF drawing files. After conversion, you can import the .gx file
into your FactoryLink application.
You can edit an imported drawing just as you would any other FactoryLink
drawing.
This chapter contains information about the following topics:
• Conversion Considerations
• Installing the FactoryLink DXF Converter
• Converting Colors, Fonts, and Line Styles
• Converting a Drawing
• Conversion Defaults
• Customizing the Conversion Settings
• Creating and Using a Translate File
• Troubleshooting and Error Messages
31
DXF Converter
FactoryLink 6.6.0 / Application Editor Guide / 401
•
CONVERTING AND IMPORTING DXF FILES
•
Conversion Considerations
•
•
C ONVERSION C ONSIDERATIONS
Most AutoCAD drawings appear just as you drew them after you convert and
import them into FactoryLink. Use the default conversion settings discussed in
the section “Using the Default Conversion Settings” on page 405, or you can
customize how the Converter converts colors, fonts, and so on as discussed in the
section “Customizing the Conversion Settings” on page 408.
Keep the following limitations in mind when you prepare to convert an AutoCAD
drawing to use in FactoryLink:
• Only AutoCAD files through Version 12 are converted. If AutoCAD 12 cannot
import and open your drawing, the Converter cannot convert it.
• DXF drawings created with products other than AutoCAD, Generic CADD, and
AutoSketch may not convert properly.
• Set the viewport before exporting the DXF file from AutoCAD.
• Extended entity data is not converted.
• Lines less than one pixel are converted to one pixel.
• Only solid fills are converted. Hatch patterns, for example, are not converted.
• Objects that were mirrored (flipped over) or rotated in the original AutoCAD
drawing might be misplaced in the converted drawing.
• Drawings with nested inserts are not converted.
• Dimensions on drawings are not converted.
• Symbol files cannot be converted unless the text version of the file exists.
• Text less than one pixel in height is not converted.
• Layers are flattened so all objects are placed on a single layer.
Installing the FactoryLink DXF Converter in Windows
Refer to the Windows NT and Windows 95 Installation Guide for details on adding
supplemental tasks. After you install the Converter, complete the following steps
to add the icon to the FactoryLink program group:
1 Double click the FactoryLink program group icon to open the FactoryLink
program group.
2 Open the File menu and select New to open the New Program Object dialog.
3 Select Program Item and click on OK.
4 Type the description DXF Converter to label the icon. Press Tab.
402 / FactoryLink 6.6.0 / Application Editor Guide
CONVERTING AND IMPORTING DXF FILES
Converting a Drawing
5 Type the path and file name of the Converter utility. The utility filename is
dxfwrap.exe and resides in /{FLINK}/BIN. For example: c:\flwin\bin\dxfwrap.exe.
6 Click on OK. The Converter icon displays in the FactoryLink program group.
7 Double click the DXF Converter icon to start the Converter.
C ONVERTING
A
D RAWING
Convert drawings from DXF format so you can import them into FactoryLink
using FactoryLink’s .gx format.
To convert a drawing:
1 Double click the DXF Converter icon in the FactoryLink program group to open
the DXF Converter.
31
3 Select the files in the File area you want to convert. To deselect a file, click on it
again.
4 Type the translate path and filename in the Translate file box to customize the
conversion settings. See the section “Creating a Translate File” on page 408 for
more details about using translate files to customize conversion settings. Leave
this box blank to use the default settings.
FactoryLink 6.6.0 / Application Editor Guide / 403
DXF Converter
2 Change to the drive and directory of the AutoCAD drawing you want to convert.
•
CONVERTING AND IMPORTING DXF FILES
•
Converting a Drawing
•
•
5 Click on Convert to convert the selected files and place them in the current
directory. For example, in the previous screen, the converted files are placed in the
c:\acad directory.
If errors occur during the conversion of any of the files, the Converter creates a
separate error file for each drawing that caused a conversion error. See
“Conversion Errors” on page 411 for more information.
To import a drawing into your FactoryLink application:
1 Double click Graphics Editor in the Configuration Manager Main Menu to open
the Graphics/Animation editor (if necessary).
2 Open the File menu and select Import to open the Import dialog.
3 Select Exported Drawings as the file type.
4 Change to the drive and directory of the converted drawings.
5 Select the files in the File area you want to convert. To deselect a file, click on it
again.
6 Click Import to import the drawings into your application.
404 / FactoryLink 6.6.0 / Application Editor Guide
CONVERTING AND IMPORTING DXF FILES
Using the Default Conversion Settings
U SING
THE
D EFAULT C ONVERSION S ETTINGS
FactoryLink maintains the original AutoCAD file drawing characteristics
whenever possible. For example, the color red converts to red and solid lines stay
solid.
FactoryLink substitutes the closest available style if it cannot reproduce a style
found in the original drawing. For example, the AutoCAD color light red converts
to the FactoryLink color orange-red, and AutoCAD’s phantom line style converts
to dash-dot.
Use a translate file to change the conversion settings for graphics and text. See
the section “Customizing the Conversion Settings” on page 408 for more
information about customizing the conversion settings.
Conversion Defaults
The conversion defaults are shown in the charts below. The default screen width
and height is 1023 x 767 pixels.
Text Conversions
FactoryLink converts text into non-text graphic elements, such as lines and arcs
unless you use customize the conversion settings (see “Customizing the
Conversion Settings” on page 408).
31
DXF Converter
FactoryLink 6.6.0 / Application Editor Guide / 405
•
CONVERTING AND IMPORTING DXF FILES
•
Using the Default Conversion Settings
•
•
Color Conversions
The following table shows the default conversions for AutoCAD colors. Each
program uses numbers to designate colors. For example, the Converter changes
AutoCAD’s color number 6 (magenta) to FactoryLink’s color number 20 (magenta).
Table 31-0 Default Conversions for AutoCAD colors
AutoCAD color number and
description
FactoryLink color number and
description
1
Red
0
Red
2
Yellow
4
Yellow
3
Green
8
Green
4
Cyan
12
Cyan
5
Blue
16
Blue
6
Magenta
20
Magenta
7
White
63
White
8
Black or Gray
48
Black
9
Light Red
1
Orange-Red
10
Brown
26
Brown
11
Light Green
7
Pale Green
13
Light Blue
13
Light Blue
15
Light Gray
59
Light Gray
If you want to see exactly how AutoCAD colors convert, use the FactoryLink color
palette. For example, AutoCAD color 11, light green, converts to FactoryLink’s
color number 7, light green. Compare FactoryLink’s color 7 in the color palette to
your original AutoCAD drawing to be sure the conversion is acceptable. Although
basic color conversions are usually very close to the original, there may be some
differences—especially with non-primary colors.
406 / FactoryLink 6.6.0 / Application Editor Guide
CONVERTING AND IMPORTING DXF FILES
Using the Default Conversion Settings
View the FactoryLink color palette in most Graphics Editor Attributes dialogs
where color is one of the attributes. For example, open the Attributes menu and
choose Fill. The Fill Attributes dialog opens with the FactoryLink color palette
displayed twice.
0-7
8-15
16-23
24-31
32-39
40-47
48-55
56-63
The FactoryLink color palette contains 64 colors. The
colors are numbered beginning with zero (red) at the
upper left corner, and ending with 63 (white) at the
lower right corner.
Line Conversions
The following table shows the default conversions for AutoCAD line styles.
Table 31-0
FactoryLink line style:
Continuous (any thickness)
Solid
Border, Border2, BorderX2
DashDot
Center, Center2, CenterX2
DashDot
Dashdot, Dashdot2, DashdotX2
DashDot
Dashed, Dashed2, DashedX2
Dash
Divide, Divide2, DivideX2
DashDot
Dot, Dot2, DotX2
Dot
Hidden, Hidden2, HiddenX2
Dash
Phantom, Phantom2, PhantomX2
DashDot
FactoryLink 6.6.0 / Application Editor Guide / 407
31
DXF Converter
AutoCAD line style:
•
CONVERTING AND IMPORTING DXF FILES
•
Customizing the Conversion Settings
•
•
C USTOMIZING
THE
C ONVERSION S ETTINGS
Specify how FactoryLink converts some or all of the drawing and text styles in an
AutoCAD drawing. For example, specify that green converts to white.
Create a standard (ASCII) text file to customize the conversion settings, called a
translate file, that contains the customizations. Then, whenever you want to use
those, enter the translate file filename in the Translate file area of the
FactoryLink DXF Import dialog.
Creating a Translate File
A translate file contains a collection of conversion customizations. Create a
translate file using any (ASCII) text editor. Also, give the file any name and
extension.
A translate file can contain up to four sections corresponding to the four types of
styles that can be customized: font, color, screen, and lines. The sections can be
organized in any order and you only need to include the ones that you want to
customize, the rest use the defaults.
Use the translate file to convert fonts whenever possible. It speeds the conversion,
and the final text quality is usually superior.
The following is an example of a translate file:
FONT
Helv,txt,20;
Helv,complex,10;
Times,romans,20;
Courier,monotext,20
COLOR
48,7;
63,8;
SCREEN
1023,767;
LINES
solid,hidden;
dash,phantom;
408 / FactoryLink 6.6.0 / Application Editor Guide
Start the font section with the word “FONT” and enter the
conversion instructions on the next lines. The format for conversion
instructions is:
FactoryLink FONT,AUTOCAD FONT,HEIGHT;
Height is the maximum height of the text to convert. Text above this
height is converted to line segments and arcs.
Start the color section with the word “COLOR”. The format is:
FactoryLink COLOR,AUTOCAD COLOR;
See the tables on pages 406 and 407 for color numbers.
Start the screen section with the word “SCREEN”. It defines the
display screen’s width and height in pixels. The format is:
SCREEN HEIGHT,SCREEN WIDTH;
The Lines section begins with the word “LINES”. The format is:
FactoryLink LINE STYLE,AUTOCAD LINE STYLE;
See the table on page 407 for a list of line styles.
CONVERTING AND IMPORTING DXF FILES
Customizing the Conversion Settings
Translate File Guidelines
Use the following guidelines when you create a translate file:
• Do not insert blank line spaces between sections or after the last section.
• The FactoryLink font is case-sensitive. Be sure to type it using the original
capitalization of the font. For example, Courier, not COURIER or courier. Use
the Font Attributes dialog box to view the correct case and spelling.
• The section names (FONT, COLOR, SCREEN, and LINES), AutoCad fonts, and
AutoCad lines are not case-sensitive.
• Type the FactoryLink font using the original spacing of the font. For example,
Times New Roman, not TimesNewRoman.
To create a translate file:
1 Open a text editor.
2 Type the sections and styles you want to translate. Use the example on the
previous page as a guide. Be sure to spell the section heading correctly and end
each style conversion with a semi-colon (;).
Enter several conversions on one line, instead of using a different line for each (do
not use spaces). For example:
Helv,txt,20;Helv,complex,10;Times,romans,20;
Table 31-0 Standard AutoCAD Fonts
Standard AutoCAD Fonts
italicc
gothice
symap
monotxt
italict
gothicg
synath
romans
scripts
gothici
symeteo
romand
scriptc
cyrillic
symusic
romanc
greeks
cyriltlc
complex
romant
greekc
syastro
FactoryLink 6.6.0 / Application Editor Guide / 409
31
DXF Converter
txt
•
CONVERTING AND IMPORTING DXF FILES
•
Customizing the Conversion Settings
•
•
3 Save the translate file as an ASCII text file. Use any filename and extension. For
example, CUSTOM.XLT
If you do not specify a method for converting fonts in a translate file, they are
converted and imported as graphics.
Using the Translate File
The custom conversions you set up in a translate file are only used when you
specify the file in the DXF Converter dialog.
Type the full pathname of the
translate file if you want to use it to
specify how AutoCAD styles are
converted to
FactoryLink styles.
If you only type the translate file filename, the Converter uses the current path
shown in the Directory box. If you leave the Translate file box blank, the
Converter uses the default conversion settings. The DXF Converter uses the
translate file for all of the DXF files you highlighted.
410 / FactoryLink 6.6.0 / Application Editor Guide
CONVERTING AND IMPORTING DXF FILES
Troubleshooting
TROUBLESHOOTING
Conversion Errors
Errors can occur during a file conversion if there is a discrepancy in the DXF file
format, such as missing information, or if the DXF file contains unknown data
elements. If errors occur, the DXF Converter creates a file that contains the
conversion errors. The name of the file is filename.err where filename is the name of
the DXF file being converted.
The error file is located in the same directory as the original DXF file and gives
the DXF filename, FactoryLink filename, and error message for each error.
Possible error messages and their descriptions below.
Open an error file in an ASCII text editor to view it.
Error Messages
One or more of the following error messages display in the error file if there is a
conversion error.
Abnormal End of File Encountered
Cause:
The DXF file ends abnormally.
Action:
Save the file again in AutoCAD; then try to convert it.
Cannot Find DXF File
Cause:
The DXF file indicated could not be found.
Action:
Be sure the path and filename are correct.
31
Cannot Find Response File
The response file indicated could not be found.
Action:
Correct the name of the file.
Could Not Find Blocks Section
Cause:
The Blocks section of a DXF file is missing.
Action:
No action is necessary.
FactoryLink 6.6.0 / Application Editor Guide / 411
DXF Converter
Cause:
•
CONVERTING AND IMPORTING DXF FILES
•
Troubleshooting
•
•
Could Not Find Entities Section
Cause:
The Entities section of a DXF file is missing.
Action:
The file is corrupt and cannot be converted.
Could Not Find Header Section of DXF File
Cause:
The Header section of the DXF file is missing.
Action:
No action is necessary; the DXF Converter uses the default
values.
Could Not Find Table Section of DXF File
Cause:
The Table section of DXF file is missing.
Action:
No action is necessary; the DXF Converter uses the default table
values.
Could Not Open File
Cause:
The DXF Converter could not open a file. The path may not exist
or the filename may be wrong.
Action:
Correct the name of the file.
Memory Allocation Error
Cause:
The system ran out of memory while trying to convert the DXF
file.
Action:
Close any unnecessary windows or programs. Add more memory
to the system if this error persists.
No APPID Table Found
Cause:
The APPID table of the DXF file is missing.
Action:
No action is necessary. This is an information message only.
No DIMSTYLE Table Found
Cause:
The Dimension Style table of the DXF file is missing.
Action:
No action is necessary. This is an information message only.
No LAYER Table Found
Cause:
The Layer table of the DXF file is missing.
Action:
No action is necessary. This is an information message only.
412 / FactoryLink 6.6.0 / Application Editor Guide
CONVERTING AND IMPORTING DXF FILES
Troubleshooting
No LTYPE Table Found
Cause:
The Line Style table of the DXF file is missing.
Action:
No action is necessary. This is an information message only.
No STYLE Table Found
Cause:
The Style table in the DXF file is missing.
Action:
No action is necessary. This is an information message only.
No VIEW Table Found
Cause:
The View table of the DXF File is missing.
Action:
No action is necessary. This is an information message only.
No VPORT Table Found
Cause:
Viewport table of the DXF file is missing.
Action:
No action is necessary. This is an information message only.
No UCS Table Found
Cause:
The User Coordinate System Table of the DXF file is missing.
Action:
No action is necessary. This is an information message only.
Unknown Entity Encountered
Cause:
An unknown AutoCAD drawing entity was encountered. The
DXF Converter ignores the entity.
Action:
Contact Customer Support.
31
Unknown Group Code Encountered
An unknown AutoCAD drawing group code was encountered.
Action:
The DXF Converter ignores the group code, but the conversion
might be corrupted. Contact Customer Support.
Unknown Table Type Encountered
Cause:
An unknown AutoCAD table was encountered.
Action:
The DXF Converter ignores the table, but the conversion might
be corrupted. Contact Customer Support.
FactoryLink 6.6.0 / Application Editor Guide / 413
DXF Converter
Cause:
•
CONVERTING AND IMPORTING DXF FILES
•
Troubleshooting
•
•
414 / FactoryLink 6.6.0 / Application Editor Guide
6.6.0
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Part VII
Error Messages
415
•
•
•
•
Chapter 32
Application Editor
Messages
If any problems are encountered by the Application Editor during run time, an
error message is displayed in the Run-Time Manager screen next to the name of
the Application Editor task.
This chapter lists all messages that can occur during run time, describes their
possible causes, and provides corrective actions.
Can’t locate options key
Cause:
The option key may not be installed, or the license may not be
enabled.
Action:
Check to ensure the key is installed. Run the KEYINST and
FLKEYVAL utilities to make sure that the license is enabled.
Can’t open FL.OPT file
Cause:
The FL.OPT file has become corrupt or has been deleted, or the
FLINK environment variable is not set.
Action:
Check the value of the FLINK environment variable. Check to
see that the FL.OPT file exists in the directory /FLINK/OPT.
Can’t read options key
Cause:
The option key file FL.OPT has become corrupt.
Action:
Copy the file FLNEW.OPT from the install diskette to the file
FL.OPT in the directory /FLINK/OPT.
Cause:
You made changes to a drawing and are trying to close the
drawing or exit the Application Editor without saving the
changes.
Action:
Choose Save to close the drawing or exit the Editor and save the
changes. Choose Discard to close the drawing or exit the Editor
without saving the changes. Choose Cancel to cancel the close or
exit and remain in the current drawing.
FactoryLink 6.6.0 / Application Editor Guide / 417
Error Messages
Drawing has unsaved changes
32
•
APPLICATION EDITOR MESSAGES
•
•
•
Error deleting file.
File not part of current application.
Cause:
You attempted to delete a file not part of the current application.
The Application Editor can only delete files that are part of the
current application.
Action:
Exit the Application Editor and delete the file from the operating
system prompt or from a file management utility to delete a
graphic file that is not part of the current application.
Error importing file.
Cannot delete open drawing
drawing file_name
Cause:
You tried to import an open file.
Action:
Close the open file and retry the import operation.
Error importing file.
Error opening file file_name for xref update
Cause:
There may not be enough free disk space to delete both a file and
its cross-reference. The file was successfully deleted, but not the
cross-reference.
Action:
Delete unneeded files to free up disk space.
Flags must be vbru
Cause:
A flag of other than v, b, r, or u was found in the .AC file.
Action:
Delete the invalid flag.
Grace period has expired. Software must be registered
Cause:
FactoryLink was installed without registering it within the 10
day grace period.
Action:
Run FLKEYVAL and follow the instructions for registration.
Missing KEY file
Cause:
The system cannot find the KEY file /FLINK/KEY/XXX.KEY.
Action:
Enter the correct key file name in .AC or create the required key
file.
418 / FactoryLink 6.6.0 / Application Editor Guide
APPLICATION EDITOR MESSAGES
No RAM for options key
Cause:
There is not enough memory to read the options key.
Action:
Close any unnecessary windows or programs.
Object name
Object must have a name.
Cause:
You have assigned a blank name to an object. The object does not
have a name.
Action:
Assign a unique name to the object.
Out of RAM
Cause:
Not enough memory is available.
Action:
Close any unnecessary windows or programs. If this occurs often,
add memory to the system.
Run-time only license. Development option not installed.
Cause:
A task may not be loaded and/or configured because it is not in
the option key.
Action:
Check the master and option key contents by typing UKEY -l.
Software has not been enabled
Cause:
An error has occurred with the f1.key file in the opt directory.
Action:
Run KEYINST and if an invalid or archaic agreement is found,
re-enter the configuration information.
Action:
Run FLKEYVAL and follow the instructions for registration.
Cause:
Your keyboard cannot use the keyboard combination you
selected.
Action:
None. Do not use the selected keyboard combination.
FactoryLink 6.6.0 / Application Editor Guide / 419
Error Messages
Warning: Name: Copy Ctrl + Ins, Class XmPushButtonGadget, Illegal mnemonics
character; Could not convert X KEYSYM to a keycode.
32
•
APPLICATION EDITOR MESSAGES
•
•
•
420 / FactoryLink 6.6.0 / Application Editor Guide
Index
A
accessing
FLADMIN 376
administrator password 384
Administrator Password dialog 384
advanced alarm definitions 93
alarm definitions
advanced 93
general 90
group 95
Alarm Definitions tab 95
Alarm Groups sub-tab 95
ALG - Alt graph 231
animating
objects 141
animation
assigning a pen to a trend chart 167
bar objects 184
beep 229
button object 175
drawing level 141, 227
dynamic attributes 144
function keys 230
input fields 152
legend 170
object level 141, 145
output fields 158
paint objects 181
real-time only chart object 164
static attributes 144
symbol object as a value 190
templates 195
testing 146
types 145
Animation menu
Beep 229
Function Key 230
application administrator 365
Application Editor 36
animating a legend 170
animating button objects 175
animating objects 141
assigning a pen to a trend chart 167
bar animation 181
Bar Animation dialog 184
Button Animation dialog 175
Chart Animation dialog 164
color palette 147
combining template objects 202
converting and importing DXF files 401
Define Template Variable dialog 198
displaying template configuration 202
drawing-level animation 227
FLADMIN 367
graphic object security 363
graphic objects 32
Input Text Animation dialog 153
Legend Animation dialog 170
object animation 32
object attributes 32, 144
Index I-421
Output Text Animation dialog 159
overview 31
paint animation 181
Paint Animation dialog 181
Power Packs 195
real-time trend chart 163
referencing objects 32
Security 375
security 363
security class 366
security classes 377
Security options 390
simulating object rotation 193
starting 34
Symbol Animation dialog 190
symbol objects 189
template animation 195
template objects 198
template variables 197
testing animation 146
unresolved template variables 203
Application Editor Window 35
Application Security Classes dialog 378
application user 365
Application Users dialog 380
arrays 74
as explicit variables 280
implicit 277
AutoCAD 401
default conversion settings 405
B
Bar Animation dialog 184
bar objects 184
Basic Alarm sub-tab 90
beep animation 229
I-422 FactoryLink 6.6.0
Beep Animation dialog 229
bi-directional bars 185
blink rate
animation
blink rate 150
BRK - Break 231
BSP - Backspace 231
BT1 - Button 1 231
BT2 - Button 2 231
BT3 - Button 3 231
BTB - Back Tab (Shift plus Tab) 231
Button Animation dialog 175
button object animation 175
C
calling functions/libraries 326
Chart Animation dialog 164
chart object
animation 164
class, security 366
CLK - Caps Lock 231
color palette 126, 147, 407
color/analog value table 147
combining
template objects 202
configuring run-time windows 61
Connecting objects 116
conversion settings, AutoCAD 405
converting
DXF drawing 403
DXF files 401, 402
creating
libraries, PowerVB 324
rotation scripts 315
template objects 198
creating a tag 69
creating run-time windows 62
customizing
conversion settings 408
D
DALOG definitions 97
data-poing logging definitions 97
deadband definitions 99
debugging methods 340
debugging scripts 339
Define Template Variable dialog 198
defining
login messages (Security) 395
security class 377
Security error messages 393
tag events, PowerVB 254
template variables 197
users (Security) 380
DEL - Delete 231
deleting a drawing file 43
development rotation 318
device communications
configuring, testing, troubleshooting 19
device interface 102
display scale
changing 57
selecting whole 57
toggling between 58
viewing run-time size 57
displaying template configuration 202
document PowerVB 339
drawing file
associating with a view window 58
changing display scale 57
closing 44
controlling the grid 52
controlling the view 51
deleting 43
new 40
opening 39
overview 37
printing 44
saving 41
saving with new name 41
saving with original name 41
setting the default window size 59
sharing between applications 45
working with multiple 38
zoom on object or area 56
drawing grid
controlling 52
drawing level animation 141
Drawing Routines menu 259
drawing-level animation 227
drawings
"drawing" variable 305
drawing events 259
object properties 305
duplicating template objects 200
DWN - Down arrow 231
DXF
installing FactoryLink converter (Windows) 402
DXF file conversion 411
DXF files
conversion considerations 402
converter (Windows) 402
converting a drawing 403
customizing conversion settings 408
error messages 411
overview 401
troubleshooting 411
Index I-423
dynamic attributes 144
E
Edit Window Selection dialog 62
editing a tag 69
element arrays 74
working with 76
ENT - Enter 231
Error Dialog dialog 393
error messages
defining (in Security) 393
DXF file conversion 411
ESC - Escape 231
Event Logging Configuration dialog 397
events
Drawing Routines menu 259
mouse events 263
RTDB Events 271
text events 269
text input routines menu 269
exiting 36
explicit variables 278, 284
arrays 280
Export dialog 46
exporting files 46
F
files
exporting 46
importing 48
FLADMIN 367
accessing 376
FLADMIN menu 376
Frame Window Selection dialog 57
function key animation 230
functions, calling in PowerVB 326
I-424 FactoryLink 6.6.0
G
general alarm definitions 90
graphic object security
See security 363
GraphicObject.Rotate 303, 314
graphics
calculating movement 255
development rotation 318
naming 329
object methods 303
referencing in 331
rotating 303
grid lines 52
Grid/Snap Options dialog 52
group alarm definitions 95
H
Hierarchical Graphic Object Naming 329
HME - Home 231
I
implicit variables 275, 284
implicit variables, arrays as 277
Import dialog 48
importing
DXF files 401
importing files 48
input fields 152
Input Text Animation dialog 153
INS - Insert 231
installing
FactoryLink DXF converter (Windows)
402
L
O
legend animation 170
Legend Animation dialog 170
LFT - Left arrow 231
libraries
creating 324
PowerVB 323
line conversions 407
logging
Security events
Security
logging events 397
Logging tab 97
Login Dialog dialog 395
login messages 395
login options 390
Login Options dialog 390
LogView 353
object
rotation 193
object level animation 141, 145
objects
"drawing" variable 305
"this" variable 292
animating 141
animation 32
animation types 145
attributes 32, 144
calculating 255
development rotation 318
graphic elements 32
graphic methods 303
graphic properties 292
naming 329
referencing 32
referencing in scripts 331
rotating 303, 313
RTDB object properties 289
window object 306
one-dimensional arrays 75
opening drawing files 39
options, security 368
output fields 158
Output Text Animation dialog 159
M
methods
debugging 340
rotating graphic objects 303
using in 289
miscellaneous PowerVB statements 307
mouse events 263
Mouse Routines menu 264
moving graphic objects 255
multi-dimensional arrays 75
N
naming, 329
New Application User dialog 381
NL - Enter 231
NUL - No key 231
P
Paint Animation dialog 181
paint objects 181
Password Verification Type dialog 383
Pen dialog
Application Editor
Pen dialog 168
pens
Index I-425
assigning to a trend chart 167
PGN - Page Down or Pg Dn 231
Power Packs
overview 195
PowerVB
"drawing" 305
"this" variable 292
arrays as explicit variables 280
arrays as implicit variables 277
calculating object movement 255
calling library functions 326
comments in a script 254
creating a library 324
creating a rotation script 315
creating a script 251
debugging methods 340
debugging scripts 339
defining tag events 254
development rotation 318
document command 339
drawing events 259
drawing object properties 305
explicit variables 278
explicit vs. implicit variables 284
graphic object properties 292
graphic object 303
implicit variables 275
implicit 284
libraries 323
LogView 353
Menus 239
Drawing Routines menu 259
Edit menu 246
Event menu 248
File menu 240
Help menu 249
I-426 FactoryLink 6.6.0
Mouse Routines menu 264
Search menu 247
text input routines menu 269
methods 289
methods, graphic objects 303
miscellaneous statements 307
mouse events 263
object naming 329
overview 235
private variables 311
properties 289
graphic objects 292
properties, drawing 305
properties, window object 305
public variables 310
RedrawOff 292
RedrawOn 292
referencing objects 331
rotating objects 303
rotation 313
RTDB events 271
RTDB object properties 289
template variables 328
templates 323, 328
text events 269
troubleshooting 359
variables 275
public 310
variables, private 311
variables, window object 306
window events 259
window object properties 305
window object variables 306
Print Screen Animation dialog 228
printing a drawing file 44
printing scripts to debug files 339
private variables 311
properties
drawing object 305
RedrawOff 292
RedrawOn 292
RTDB object 289
using in PowerVB 289
window object 305
properties, graphic 292
PSE - Pause 231
public variables 310
PUP - Page Up or Pg Up 231
R
RedrawOff 292
RedrawOn 292
referencing objects 32
Resizing an object 134
RGT - Right arrow 231
rotating graphic 303
rotating objects 313
rotation scripts 315
rotation, development 318
RTDB events 271
run-time windows
configuring 61
creating 62
defining window size 65
setting the top window 66
S
Scale/Deadband tab 99
scaling definitions 99
scaling/deadband definitions 99
scripts
adding comments 254
creating 251
debugging 339
document PowerVB 339
libraries 323
printing to debug file 339
referencing objects 331
templates 328
te 323
scripts, rotation 315
Security
administrator password 384
defining a user 380
defining classes 377
defining error messages 393
defining login messages 395
login options 390
options 387
overview
FLADMIN
overview 375
security 363
application administrator duties 365
applications
user 365
class 366
concepts 365
FLADMIN 367
options 368
Security Class Attributes dialog 379
Select Function Key dialog 230
setting
administrator password (Security) 384
Security options 387
simple template item 80
simulating object rotation 193
starting Application Editor
Index I-427
using command line 35
using Configuration Manager 34
using icon 34
using start menu 34
static attributes 144
sub-routines
debugging 339
sub-routines, calling in 326
Symbol Animation dialog 190
symbol objects 190
SYS - SysRq 231
T
Tab 231
Tag Definition dialog 68, 69
tag dictionary 82
Tag Dictionary dialog 69
tag events
defining in PowerVB 254
tag parameters 71
tag persistence definitions 88
tags
creating 69
cross referencing 83
defining element arrays 74
definitions 85
deleting 83
dictionary 82
editing 69, 83
new 83
parameters 71
persistence definitions 88
referencing arrays 74
template animation
overview 195
template configuration 202
I-428 FactoryLink 6.6.0
Template dialog 200
template objects 198
combining 202
duplicating 200
template variables 197
unresolved variables 203
template variables, PowerVB 328
templates
full template items 79
PowerVB 323, 328
simple item 80
working with 79
testing
animation 146
text events 269
text input routines menu 269
this variable 292
translate file 408
troubleshooting 411
troubleshooting, PowerVB 359
U
uni-directional bars 185
unresolved template variables 203
UP - Up arrow 231
V
variables
"drawing" 305
"this" 292
arrays as implicit 277
declaring in PowerVB 275
explicit 278
implicit 275
private 311
template variables 328
window objects 306
variables, public 310
View Window Selection dialog 65
W
Window Attributes dialog 62
Window Management Control panel 66
windows
events 259
object variables 306
object 305
working with templates 79
X
X Position
horizontal location of object 182, 186, 191
Z
zoom
object or area 56
Index I-429
Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Download PDF

advertisement