Professional Documents
Culture Documents
Aedit
Aedit
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Application Editor Guide
All other brand or product names are trademarks or registered trademarks of their respective holders.
Application Editor in the Application Editor Application Editor in this book
Table of Contents
•
•
•
•
Application Editor
Part V Security
27 Graphic Object Security Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Application Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Application User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Security Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
FLADMIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Part I
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Application Editor
Basics
15
Application Editor Basics in the Application Ed- Application Editor Basics in this book
itor Guide
Table of Contents
•
•
•
•
Application Editor
Basics
Application Editor
Basics
•
•
•
•
The Application Editor
Overview 1
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.
This chapter describes the concepts you must understand to use the Application
Editor. The following topics will be covered:
• Graphic elements as objects.
• How to open and exit the Application Editor.
• Managing your drawing files.
• Controlling how your screens work during runtime.
Text lines, such as the one in the illustration, are separate objects. Each object
falls into one of the following:
• 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 above is composed
of one simple object, the octagon, and one composite object, the two rectangles.
An object’s 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.
PO W ER P AC KS AND P OW ER D RA G O NS
1
Drawings containing objects animated as templates and placed in a library of
drawings are collectively known as Power Packs. You create and animate the
Application Editor
objects once and place them in Power Packs for repeated use. These drawings,
known as Power DrgOns, are then used to create applications quickly and easily.
The also help standardize the application’s appearance.
Basics
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.
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. For a complete description of the supplied Power Packs and their
associated Power DragOns refer to the FactoryLink Release Notes.
The template animation allows you to animate an object with variables. In normal
graphics drawing, when you duplicate an object, 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.
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.
Application Editor
APPEDIT
Basics
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 objects name.
• Animation includes commands for specifying animation that will be included in
the drawing during runtime.
• Application includes commands for specifying application attributes.
• Windows includes commands to specifying the tiling or cascading of open
drawing files and a list of the open drawings to allow you to easily switch to
another open drawing.
• Help includes menu and application help.
Instructions for how to use these commands are described throughout this
manual.
Application Editor
1 Choose File>Exit. The Application Editor closes.
CAUTION
Basics
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 If there are any files that were modified since the last save, the Warning! dialog is
displayed.
•
•
•
•
Working With Drawing
Files 2
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.
CAUTION
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.
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.
Application Editor
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.
Basics
Opening an existing drawing file
Perform the following steps to open an existing drawing file.
2 Select the drawing from the list displayed below the File Name: field. The drawing
name you select will be displayed in the File Name: field.
Note
Double-clicking on the drawing name in the list will also open the
file directly.
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.
3 Click the OK button to complete opening the newly created drawing file. The
screen will be displayed 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.
Application Editor
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
Basics
different name. If you have made changes to the drawing prior to
duplicating it, the original drawing remains unchanged when you
use Save As.
1 Choose File>Save. The file that existed before you made modifications is
overwritten.
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.
You can only work in one domain at a time; therefore, if you want to change
domains you will have to 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 will add the .g extension for you.
Application Editor
1 Choose File>Delete to display the Delete File dialog.
Basics
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.
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.
1 Choose File>Print Screen. The drawing file is sent to the default printer configured
by the operating system.
Perform the following steps to close a drawing file. Only the active (frontmost
drawing is closed with this action.
2 When you close a drawing that has been modified but not saved the Application
Editor displays a Warning! dialog.
•
•
•
•
Sharing Drawings
Between Applications 3
Application Editor
Basics
You share drawings between applications or domains by exporting them from one
application or domain and importing them into another.
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.
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. 3
To select a different domain choose it from the Domains: field.
Application Editor
You may select multiple files for exporting by selecting more than one file name.
Basics
Graphics only Exports only the graphics of the drawing. Animation and
configuration details are not included.
Graphics + Exports the drawing graphics with the included animation. You
animation cannot import animation if it has not been saved with the export.
Graphics + all Exports the drawing graphics with the included animation and
configuration configuration settings such as alarms, scaling, I/O, etc.
4 Click the OK button to complete the export. Clicking on the Cancel button cancels
the export.
CAUTION
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.
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).
To select a different file type, press the down arrow from the scroll box in the File
Type: field.
Application Editor
Before replacing Warns if existing files will be overwritten.
files
Basics
Before creating Indicates when new tag names will be added. (This is especially
tags helpful if you are using FactoryLink Lite which only allows a
total of 1024 application defined tags.)
When tag definition Indicates these elements have already been defined with different
is different type, domain, length, or dimensions.
When tag usage is Indicates these elements have already been defined with a
different different configuration, such as alarms, I/O, etc.
7 Click on the Import button to complete the import. Clicking on the Cancel button
cancels the import.
•
•
•
•
Controlling Your View
of the Drawing 4
Application Editor
Basics
This chapter describes how to control the view of your drawing. You can control
the following features.
• How the grid is displayed
• How much of an object or area is viewed
• The display scale in which the drawing is shown
• Default actual size window for all drawings in editing session
Perform the following steps to turn on the Grid and define how it displays.
Grid Allows you to turn on the grid and to define how it is displayed.
Snap Allows you to turn on the Snap option and define the snap
tolerance.
Logical Displays the width and height of the screen in drawing units. The
Coordinate System default is 1024 for the width and 768 for the height. Do not
change these values.
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.
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.
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: Is the number of grids that are 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.
Vertical Grids: Is the number of grids that are 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
...
48 lines displayed
(768 ÷ 48 = 16).
47 752
48 768
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 Is the number of snap points within a grid box that an object will
Points/Horizontal snap to as it is moved left or right.
Grid:
Snap Is the number of snap points within a grid box that an object will
Points/Vertical snap to as it is moved up or down. Grids: field.
Grid:
Snap Point set at 2 Snap Point set at 4
(default)
1
1
2
3
2
4
1 2 1 2 3 4
Application Editor
items to be snapped individually and applying the snap command.
Basics
1 Select the objects you want to snap.
2 Choose Edit>Snap. This snaps the four corner’s of the object’ bounding box to the
nearest snap points.
Zooming on Object
Perform the following steps to magnify an object or group of objects in the
drawing.
3 Choose View>Zoom on Object again and the objects will be magnified again. Objects
can be magnified until they fill the entire drawing window. They will not be
magnified out of view.
Zooming on Area
Perform the following steps to zoom on an area in the drawing.
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.
Application Editor
decisions for the drawing.
Depending on the size of your drawing window, the drawing may not necessarily
Basics
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.
1 Make sure you have a window defined where the drawing will be displayed. Refer
to “Configuring Run-Time Windows” on page 5-53,” for details.
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.
Runtime window
size
If you draw outside the run-time window size, the objects in this area will not
display at run time.
Resizing the actual size window during development does not change the size of
the drawing at run time. 4
If you view the drawing at actual size and then save it, the association with this
Application Editor
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.
Basics
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.
• Pressing the F7 function key
• Selecting View>Toggle View
You can set this program argument starting the Application Editor from the
command line using the following command.
appedit -w actualsize_window
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 or the
Program Manager, you cannot set a default actual size window.
•
•
•
•
Configuring Run-Time
Windows 5
Application Editor
Basics
At run time, drawings are displayed in windows. The window controls how the
drawing is displayed; that is, 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.
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.
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.
4 Select the Size Border check box to specify whether or not to display a sizing border
around the window. The sizing border allows you to resize the window at run 5
time. If the sizing border is present, the cursor changes to a double-sided arrow
when it crosses the window’s border.
Application Editor
If you do not specify a sizing border, you cannot adjust the size of the window
using the cursor at run time.
Basics
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.
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.
9 Enter the name of the digital tag whose value enables this window in the Window
Enable Control field. When the tag’s 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 must be in the SHARED domain.
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 Configuration dialog, click 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.
13 Enter data for any tags displayed. Refer to the field description where the tag
name was defined for details on valid data types.
14 If you want to change the size and position of the window, refer to the “Defining
Window Size and Placement” on page 5-57 for details. 5
Application Editor
Perform the following steps to change the size and position of a window.
Basics
1 Choose Animation from the Application Editor menu bar.
3 Select a domain from the Domain list. Any previously created windows in the
selected domain are displayed in the Window: field.
6 Using the mouse or arrow keys, size the blank window to the desired size and
move it to the desired location.
•
•
•
•
Tag Definition Dialog
6
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. There is usually a variety of information 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 which are accessed by FactoryLink when it is running an
application. When creating an application in the Application Editor, this
information can be automatically input to the appropriate tables when assigning a
tag name to a new data element or modifying an existing tag through the Tag
Definition dialog.
This chapter describes how to configure tag names and associated data element
information using the Tag Definition dialog.
Subtab
Tab Header
Creating a Tag
6
The Tag Definition dialog is displayed in the following situations:
• When creating a new data element, if you assign a tag name that has not yet
Application Editor
been defined on the animation screen, and press OK.
• When a template item for which a tag has not yet been defined is pasted into a
screen. Refer to the section “Working with Templates” for more information on
Basics
pasting template items.
Editing a Tag
If a tag needs to be edited after it is created, the Tag Definition dialog can be
accessed in the following ways:
• When a tagged field is chosen during development, press CTRL + T.
• When Application>Tag Dictionary is chosen from the Application Editor Menu
Bar, the Tag Dictionary dialog will display. Choose the desired tag and click on
the Edit button. The Tag Definition dialog for the tag will be displayed. Refer to
the section “The Tag Dictionary” for more information about using the Tag
Dictionary.
To edit the information for an existing tag, click on the Edit button on the upper
right side of the General tab for the tag.
Apply button
Edit button
When all editing to information for the tag has been completed, click on the OK
button at the bottom of the dialog to save all the options.
T AG P ARAM ETER S
6
When developing a FactoryLink application, each data element stored in the
real-time database must be assigned a logical name, called a tag name. This tag
Application Editor
name is used by FactoryLink to reference the element during run time. A tag
name may stand for a single element or an array (group) of elements. Refer to
“Tag Persistence Definitions” for a description of when to use arrays. When
Basics
assigning a tag name, the following guidelines apply:
• 1-32 characters long, plus array delimiters of up to 16 characters.
• Valid characters are A-Z, 0-9, _, @, $, ., :.
• Tag cannot start with 0-9.
• No embedded spaces.
All data elements belong in either the shared or user domain, depending upon
whether, at run-time, they will be used by multiple users or a single individual.
Tags created in the Application Editor will default to the shared domain
configuration. Once a tag is created as a shared tag and referenced in the shared
domain, the domain for the tag cannot be changed. If the tag is 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.
The following pages contain a description of all the possible tabs. Note 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.
When all desired tag options have been defined, click on the OK button at the
bottom of the dialog to save all the options.
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.
There should be 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 made 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, and 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, the tag can be created as tagname[0][0]...,
and the actual number of elements can be specified at a later time.
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.
Application Editor
identifier consisting of the tagname 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
Basics
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]
Application Editor
To increase or decrease the number of elements in the array, access the Tag
Definition dialog for the tag. If the tag has already been created, click on the Edit
button on the right side of the Basic sub-tab of the General tab. Make any
Basics
necessary changes to the Array Dimensions field, and click on the Apply button.
Apply Button
Edit Button
Note
The information contained on the General tab must be the same for all elements
of an array. Other information pertaining to the tag, such as logging, etc. can be
configured for all elements of an array, or differently for specific array elements.
To configure information for the tag, click on the desired tab.
OK Button
Use the arrows on the right side of the Array Subscript field to scroll through the
array elements. When the desired array element is displayed, enter any necessary
information or make any changes. Click on the OK button at the bottom of the
dialog, or click on a different tab.
A window will be displayed 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 to only the specific array element you are configuring, click on
Cancel. The information will be saved for that array element only.
When viewing the tag dictionary, array tags will only be displayed once as
tagname[0][0].... To access any individual element of the array, choose the tag, click
on the Edit button, and proceed as described above to access an individual array.
Application Editor
variable for the object. When the object is duplicated, a prompt will ask for
definitions for the variable animation features.
Basics
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
15-197
When you have finished defining the animation for the tag, and the OK button is
clicked, a pop-up window will appear, asking for the prompt string to be displayed
when this template item is pasted.
When an object containing simple template items is pasted into a screen, a dialog
is displayed, prompting you to enter the values for all the simple template items. 6
Application Editor
Tag name prompt
appears when object
Basics
is pasted
Only the template name and a field in which to enter the values is displayed.
If the object being pasted contains both full and simple template items, two
dialogs will be displayed. The first will prompt for values for the full template
items; the second will prompt for values for the simple template items.
If in the Tag Definition dialog you enter a template name already defined from an
animation dialog, it will assume 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 will treat these items as two different templates.
Up Arrow
Function buttons
Slider bar
Down arrow
The slider bar will scroll through the tags. One hundred tags are displayed 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 tag.
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 the ENTER key 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 the
ENTER key on the keyboard. That portion of the list will be displayed, and the
desired tag can be chosen.
For help about the Tag Dictionary, click on the Help button.
Application Editor
entered.
Editing a Tag
Basics
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 the Edit button. The Tag
Definition dialog for the tag will be displayed, 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 the Delete button.
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 the Xref button. The
cross-reference list for the tag will be displayed:
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:
Record/Obj. Name The record number assigned to the item in a table, or the object
number assigned when animating the object.
CT Domain The domain (shared or user) in which the tag is referenced.
Tag Dimensions The dimensions of the tag if it is an array.
Task Name The name of the task (GRAPH, EDI, DISTALAOG, etc.) which
uses the information in the referenced tag.
B ASIC T AG D E FINITIO NS
6
When the Tag Definition dialog is displayed, the Basic sub-tab of the General tag
definition tab is displayed as the top layer. This dialog is used to enter
Application Editor
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, the message length should be specified.
Basics
General selected
Basic selected
The fields on this sub-tab define general information about the tag:
Description Enter a description of up to 80 characters that defines the
purpose of the tag.
Type Choose the format for the data that will be 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 is a binary data type. Its value can be a 0 or 1.
Analog is a 16-bit, signed integer. Its value can range
between negative and positive 32,768.
Floating-point is an IEE double precision number with 31 places
to the right of the decimal.
Follow Domain Choose this box to use the persistence settings defined for the
Persistence domain. The default configuration is no persistence configured for 6
either domain. Refer to the Persistence in the Core Tasks
Configuration Guide to define persistence for an entire domain.
Application Editor
Note that persistence for the domain must be configured for this
option to work.
To define tag-specific persistence parameters, use the persistence
Basics
sub-tab to define the tag-specific parameters. Refer to “Tag
Persistence Definitions” for more details on defining tag-specific
persistence.
If no persistence option is chosen for this tag, the value will not be
saved for restoration after an unexpected shutdown.
When the Persistence sub-tab is chosen from the General tag definition tab, the
following dialog is displayed:
General selected
general selected
Persistence selected
Save Controls how often the element’s value is saved to a disk file. This
can be one or both of the following. If both options are chosen, the 6
element’s value is saved based on a time trigger and when it
changes.
Application Editor
On Time Saves the tag value based on a time trigger.
On Exception Saves the tag value based on a change in the data
Basics
stored in the tag.
Restoring Controls whether the element’s change status flag is set to on or
off when restoring the saved value to the element.
Status On The element’s change status flag is set to on when
restoring the saved value.
Status Off The element’s change status flag is set to off when
restoring the saved value.
Alarms selected
Basic selected
For any configured alarms, the condition, limit and group will be displayed. To
change this information, highlight the desired alarm and modify the attributes
using the Condition Attributes box at the bottom of the screen. To create a new
alarm, enter information for the alarm in the Condition Attributes box:
Condition Choose the condition under which the alarm tag type or alarm ID
will be checked. 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.
Application Editor
or floating-point element is greater than or equal
to the value specified by the limit.
Basics
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 has been
determined to be 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 that the operator
could take steps to prevent the temperature from ever reaching a
dangerous level. In all 3 of these 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 in which the
alarm resides 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 for which the alarm will remain active.
To add an alarm to the list of configured alarms, specify the alarm condition
attributes, then click on the Add button.
For those items which are preceded by an asterisk (*), either a value or a tag name
can be entered in the field. If a tagname is entered in one of these items that 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 will be displayed.
To clear all alarms for a tag, press the Clear button in the upper right corner of the
tab. To add an alarm to the list of configured alarms, click on the Add button.
Application Editor
chosen from the Alarm Definitions Tab, the Advanced Alarm sub-tab is displayed:
Basics
Alarms selected
Advanced selected
If use of the advanced alarm functions is desired, enter the following information:
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 appears after the group alarm text. This message
text can be enhanced with up to 4 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 will be 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.
If a tagname is entered for Variable, Hide tag or Time-stamp tag that has not been
used before, a Tag Definition dialog for the new tag will be displayed when you click
on OK or move to another tab.
Application Editor
chosen from the Alarm Definitions tab, the following is displayed:
Basics
Alarms selected
Alarm Groups
selected
Click on the ADD button in the upper right hand corner of the tab to create a new
alarm group. If you are updating existing alarm groups, click on the UPDATE
button to save modifications to the record.
Application Editor
element to be recorded. If two asterisks (**) appear in front of the word Logging on
the tab, it indicates there is configuration information on the tab. Data Point
Logger comes with 5 preconfigured tables to which data can be written, or the
Basics
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.
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 the Data-Point Logging in the Data Logging Configuration Guide for a
detailed description of how Data-Point Logging functions.
Log On Trigger If the tag data is to be recorded to the database table when a
trigger occurs, enter the name of the trigger tag to be used in this 6
field. If the tagname entered has not been used before, when you
click on Apply or OK or move to another tab, a Tag Definition
Application Editor
dialog for the new tag will be displayed.
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
Basics
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.
where x is the raw value, m is the multiplier, b is a constant and y is the result.
If two asterisks (**) appear in front of the word Scale/Deadb on the tab, it indicates
there is configuration information on the tab.
When the Scale/Deadband tab is chosen from the Tag definition dialog, the
following is displayed:
When raw and scaled ranges are specified as a value, the system will
automatically create and define the following tags associated with the tag
tagname:
• tagname.raw
• tagname.eumin 6
• tagname.eumax
Application Editor
• tagname.rawmin
• tagname.rawmax
• tagname.dead
Basics
• tagname.lock
For a scaled tag configured in the Application Editor, the value 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 Scaling & Deadbanding in the Core Tasks Configuration Guide for a more
information on the Scaling and Deadbanding function.
If a tagname is entered in one of these items that has not been used before, when
you click on OK or move to another tab, a Tag Definition dialog for the new tag will
be displayed.
D EVICE IN TERFAC E
6
The Device Interface tabs all refer to protocol-specific tasks for external devices
that could be providing data to FactoryLink. Tabs will only be displayed for the
Application Editor
protocol-specific modules that have been 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
Basics
device must be entered. Choose the tab for that device, and a dialog similar to the
one below is displayed. The actual fields will vary, depending on the type of
protocol module that is used. For detailed information on each type of external
device, refer to the FactoryLink ECS Device Interface Guide.
Part II
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Screen Construction
95
Screen Construction in the Application Editor Screen Construction in this book
Guide
Table of Contents
•
•
•
•
Screen Construction
7 Drawing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
The Drawing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Selecting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Undo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Drawing Simple Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Drawing a Straight Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Drawing a Curved Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Drawing a Square or Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Drawing a Polygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Drawing a Circle or Oval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Drawing an Arc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Drawing a Parabola . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Drawing a Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Adding Text to a Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Creating Composite Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Combining Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Connecting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Separating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
•
•
•
•
Drawing Objects
This chapter includes instructions for drawing each of components used to develop
user-interface screens. The following topics will be covered:
• 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.
Screen Construction
The Menus
The Draw, Attributes, and Edit menus are the primary menus used when first
developing your screens. The Draw menu includes 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 objects name. The Edits menu
includes commands for selecting and editing objects.
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 indentifies the tools used for drawing
and selecting objects.
Select
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, to name a few. 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 will become an arrow.
To select a single object, place the cursor inside the object and click the left mouse
button. Eight solid blocks or handles appear around the object, indicating it is
selected. An additional handle appears in the middle of the object. This handle is
used for moving the object.
7
Move Handle
Screen Construction
Selection
Handles
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 appear around
the group.
Drag a border
around the objects Selection
to be selected 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
You select individual sub-objects contained within the composite object without
ungrouping the composite by choosing Edit>Select Subobject from the Edit menu.
Perform the following steps to select subobjects comprising a composite object.
1 Select a composite object. Composite select handles appear 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 appear around the
selected subobject.
Optionally, you choose Edit>Select Subobject and then click on the subobject to
select it.
If the selected subobject is a simple object, its handles are solid. If the selected
subobject is another composite, its handles are hollow. You can repeat this
procedure to go a layer deeper until there are no more composite objects to select.
As you select different subobjects within the composite, the selection handles
relocate to the selected subobject.
Undo
To reverse the last action performed in the active drawing, choose Edit>Undo.
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 7
displayed next to the Undo option when you access the Edit menu.
Screen Construction
The Undo option does not undo any element names created with the last action.
The element names remain in the object list.
If the last action performed cannot be reversed, the Undo option is displayed gray
and cannot be selected.
TextString
You must select each object individually to perform an action on it, such as to
move it.
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.
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.
7
Screen Construction
5 Repeat Step 4 until the curve is the desired shape.
6 Press the right mouse button to end drawing of the curved line.
2 Place the cursor where you want the rectangle or square to start and press the left
mouse button.
D RAW IN G A P O LYGO N
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.
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.
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.
Screen Construction
D RAW ING AN A RC
1 Choose Draw>Arc.
2 Place the cursor where you want the arc to start and press the left mouse button.
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.
7 Release the mouse button. The sides of the wedge disappear leaving an arc in the
drawing area.
D RAW IN G A P AR ABO LA
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.
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.
1 Choose Draw>Legend.
2 Place the cursor where you want the legend to appear and click the left mouse
button.
Screen Construction
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.
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.
1 Choose Draw>Text.
2 Place the cursor where you want the text to appear and click the left mouse
button. A text bar is displayed.
You can 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 will change based on its point locations.
Combining Objects
The combining method groups two or more objects as a composite object, retaining
their original shape and position. You can combine objects in one of two ways:
using the Edit menu or from the toolbar. This section describes how to combine 7
objects using the Edit menu.
Screen Construction
Perform the following procedure to combine objects.
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.
You can connect objects in one of two ways: through the Edit menu or from the
toolbar. Perform the following procedure to connect objects.
2 Choose Edit>Connect.
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 101
for details.
2 Choose Edit>Separate.
The name, attributes and animation for each individual object are preserved, but
the composite object name is discarded. Note that 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 that were defined for it.
7
Screen Construction
•
•
•
•
Editing Objects
Once an object is selected, you can perform many actions upon it. This chapter
describes how to perform these actions.
• Setting object attributes
• Copying an object
• Pasting an object
• Deleting an object
• Aligning an object
• Moving an object to front or back 8
• Reshaping an object
Screen Construction
• Moving the placement of an object
• Rotating an object
• Resizing an object
• Resizing text
• Reversing last action
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 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 indentifies the tools used for editing
and selecting objects.
Attributes
Line X X X X
Arc X X X X
8
Screen Construction
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
The rest of the chapter describes how to set or change these attributes for objects
included in your drawings.
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.
4 Choose OK to save the line attributes. Any chosen lines and any new lines drawn
acquire these attributes.
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>Fillto display the Fill Attributes dialog. The Sample field shows the
current settings. This field changes when you make a new selection.
3 Select a fill style from the Style palette. This can be one of the following. Screen Construction
Solid Fills objects with the color chosen in the Foreground color palette.
Any background color chosen is ignored.
Transparent Makes objects transparent so only the object’s outline is visible.
The color used is the color chosen for displaying lines.
Hatch Fills objects with a pattern of lines or dots (depending on the
platform) in the foreground and background colors chosen.
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 Chose OK to save the attributes. Any chosen objects and any new objects drawn
acquire these attributes.
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
2 Choose Attribute>Text to display the Text Attributes dialog. The current settings
Screen Construction
show in the Preview box at the bottom of this box.
4 Choose OK to save the attributes. Any chosen objects and any new objects drawn
acquire these attributes.
Screen Construction
Cutting an Object
This section describes how to cut objects. Perform the following procedure to cut
objects.
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.
2 Choose Edit>Cut.
The name, attributes and animation for each individual object are preserved with
the object.
Pasting an Object
This section describes how to paste objects that have been copied or cut. Perform
the following procedure to paste objects.
3 Position the cursor in the 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 will remain in paste mode until a different function is
chosen. Repeated clicks of the left mouse button will result in additional pastes
Deleting an Object
This section describes how to delete objects. Perform the following procedure to
delete objects.
2 Choose Edit>Delete. The objects are removed from the drawing area.
Screen Construction
Moving an Object
When you select an object, eight handles appear 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
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.
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 equidistantly so they have an equal amount of space
between them. Perform the following steps to align objects.
Alignment 8
Optionas
Screen Construction
Equidistant
Spacing
Options
Sizing
Options
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
horizontal Equidistant vertical (column) spacing
(row) 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
Note
If you use the vertical Space option with text objects whose bounding
boxes are larger than the text, then 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.
Screen Construction
Screen Construction
2 Choose Edit>Snap. This snaps the four corners of the object’s bounding box to the
nearest grid points. The object is resized to fit in its bounding box.
Reshaping an Object
This section describes how to reshape an object.
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 When the shape is satisfactory, choose the Select mode to cancel the Reshape
mode.
Resizing an Object
When you select an object, eight handles appear 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.
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.
You can stretch text until it reaches its maximum font size. Once you reach a
font’s maximum size, further stretching only increases the size of the text’s
bounding box. The text remains at its maximum size.
8
Stretching a text bounding box beyond the text’s maximum font size affects the
Screen Construction
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 runtime, or when
FactoryLink resizes a drawing to fit inside its runtime window.
Before After
To fix this problem, press F8 or choose Recalc Text Clip from the Edit menu. This
recalculates the text’s bounding box so that all the text is displayed.
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.
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 will be moved in front of
or behind all other objects.
Renaming an Object
When objects are drawn, there are given a numerical object name. Perform the
following steps to assign your own name to an object.
2 Choose Object Name from the Attributes menu. The Object Name panel is
displayed.
4 Choose OK.
1 Choose Find from the Edit menu. The Select Object Name dialog box is displayed,
listing all of the top-level objects in the active drawing.
8
2 Select an object name from the list or enter an object name in the Find Object
Screen Construction
field.
Click OK. The object with that name is surrounded by handles, indicating its
location.
Part III
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Object Animation
137
Object Animation in the Application Editor Object Animation in this book
Guide
Table of Contents
•
•
•
•
Object Animation
•
•
•
•
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 ECS
graphic objects.
• Drawing level—Animation is defined for the drawing. You can apply the 9
following types of animation to a drawing.
• Print screen—Prints the contents of a drawing window.
• Beep—Produces an audible beep.
Object Animation
• 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.
The Menus
The Animation menu is the primary menu used foranimating 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 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 indentifies the tools used for animating
and selecting objects.
Select
Button Legend
Test
To prevent this from happening, insert the -o1 flag in the Program Arguments field
for the Application Editor 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.
Object Animation
1 Enter a tag name referencing an element in the appropriate optional field during
animation.
2 Configure another task, such as Math and 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 Application Editor 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 are displayed after a screen is redrawn.
• If you do not set the -t flag, the dynamic attributes are displayed after a screen
is redrawn.
Animation
Object
Input Out
Lgnd Paint Bar Chart Sym Button PwrVB
Text Text
Line X X X X X
Arc X X X X X
Parabola X X X X X
Box X X X X X X
Ellipse X X X X X
Polygon X X X X X
Spline X X X X X
Text X X X X X X X
Legend X X
When you open a drawing and open the Animation menu without an object
selected, a check mark is displayed next to the animation characteristic selected 9
for the drawing.
When you select an animated object and open the Animation menu, a check mark
is displayed next to each animation characteristic selected for the object. The Object Animation
animation also shows as a check mark on the toolbar.
1 Choose Animation>Test to display all static and animated objects in its window. If
desired, resize the window in which the drawing is displayed.
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 is displayed
indicating the action taken and tag name associated with the button or function
key.
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 is displayed, it demonstrates that the button or function key
performs as animated.
5 To end the test at any time, choose Test again to return to the drawing mode.
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.
Analog Analog
Color Color
Value Value 9
0 Red 1 Orange-Red
Analog Analog
Color Color
Value Value
20 Magenta 21 Pink
22 Coral 23 Firebrick
44 Red-Violet 45 Plum
Analog Analog
Color Color
Value Value
Object Animation
•
•
•
•
Animating
Input/Output Fields
This chapter describes how to animate text objects as input or output fields.
10
Object Animation
At run time:
• Press Tab to move through the fields alphabetically according to the input text’s
object name.
• 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 is displayed
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.
1 Choose Draw>Text.
2 Place the cursor where you want the text to be displayed and click the left mouse
button. A text bar is displayed.
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]
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.
6 Choose Animate>Input Text to display the Input Text Animation dialog. The name of
the object selected is displayed in the title.
10
Object Animation
The actions ON, OFF, TGL (toggle), ENB (enable), MON (momentary on), MOF 10
(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 Object Animation
text is entered in the input field, the tag is set to ON.
Options> Choose this option if you want to use the field as both an input
Background text and an output text field. If this option is not selected, the
updates field can only be used to enter text.
Color Controls Defines the text foreground and background colors and blink rate
of the text field.
10
Object Animation
1 Choose Draw>Text.
2 Place the cursor where you want the text displayed and click the left mouse
button. A text bar is displayed.
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 as 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.
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.
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.
10
Object Animation
•
•
•
•
Creating a Real-time
Trend 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 Trending in the Data Reporting Configuration Guide
for details for specific details on animating charts to show trending data from a
relational database. Refer to the PowerSPC Configuration Guide for details 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.
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
Object Animation
Trending performance is affected if the chart object is 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.
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.
5 Assign a pen to the chart. Refer to “Assigning a Pen for the Chart” on page 167 for
details.
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’s 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.
1 Choose Edit Pens from the Chart Animation dialog to display the Select Pen dialog.
2 To create a new pen, type the name of the pen object to be defined in the Pens
field. To edit a previously defined pen, select a pen from the pen list.
11
Object Animation
4 Define the data to trend. One pen can trend one data element. 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.
Max Tag Optionally 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.
Min Tag Optionally 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.
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 at which the pen color changes. This can either
be a number or the name of a tag that contains the limit value. If
you use a tag, you can dynamically change the limit at run time.
Line Style Select the style of line drawn by the pen.
Marker Style Select the graphical symbol to display at each plotted point.
Symbols are the same color as the pen with which they are
associated.
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. In
an event chart, gaps occur when you forcibly create them.
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.
5 Choose OK to save the information. This returns you to the Chart Animation dialog. 11
6 Choose OK to save the information.
7 Animate the legend using the information provided in “Animating a Legend” on Object Animation
page 170.
1 Select the legend object you want to animate. Verify no other objects overlap the
legend object.
1 2 3 4 5
Major divisions
Number of Minor Enter the number of minor divisions for the trend chart legend.
Divisions 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. To
change the number of minor divisions, configure
an input animation or other task that writes to
this tag.
Format Enter the formatting characteristics for the legend’s 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, and so on
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
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.
11
4 Choose OK when you have completed entering all the information on this panel to
save the data and return to the legend object.
Object Animation
•
•
•
•
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.
12
3 Fill out this panel. Provide the following information to animate the object.
Mouse Click or Select the mouse button or keystroke that activates the button. Object Animation
Key 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.
For example, if you choose F1, you can 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.
Alt, Ctrl and Shift 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.
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 panel.
You can use this action to open a new drawing in a
specified window. Define the name of the drawing
to display in the Value field and the name of the
window to use in the Destination Tag field.
ADD Adds the value of the Value or Tag field to the
real-time database element referenced by the
Destination Tag field on this panel.
SUB Subtracts the value of the Value or Tag field from
the real-time database element referenced by the
Destination Tag field on this panel.
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 ontext formatting.
DRW Opens a drawing and places it in the current
12
window.
MON Sets digital tag to ON when mouse is placed over Object Animation
object with left mouse button depressed. Sets tag
to OFF when the button is released.
MOF Sets digital tag to OFF when mouse is placed over
object with left mouse button depressed. Sets tag
to OFF when the button is released.
NUL No action is taken.
12
Object Animation
•
•
•
•
Paint and Bar
Animation
13
Object Animation
3 Specify the following information.
Tag Enter a name to reference the element that affects the object’s
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
13
Object Animation
Direction Direction the color moves when the value of the tag specified in
the Tag field of this panel 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.
< the Min. value not colored < the anchor moves in a
point negative
direction
(toward the
Min. value)
> the Min. value colored to the = the anchor is a single line at
and value of the Tag point the anchor
< the Max. value field element point
Bidirectional Enter the value from which the color in a bi-directional bar
Anchor Point grows. The anchor point has no effect on uni-directional bars.
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
13
Object Animation
•
•
•
•
Animating an Object as
a Symbol
You can use either of two methods to display symbols at run time.
• Method 1—Erases the existing symbol by redrawing the symbol’s background
(the part of the screen behind the symbol) then draws the new symbol.
Because Application Editor 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 Application Editor 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 Application Editor
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 14
use Method 2.
Object Animation
4 Click OK to save the information after you complete the Symbol Animation dialog.
PowerVB can also be used to rotate an object during run time. Refer to PowerVB
Animation in this guide for more information.
1 Draw one symbol for each incremental position of the object’s 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.
2 Draw a bounding box to locate the object on the drawing. The object in the
SYMBOLS.G file is sized to this object.
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.
14
Object Animation
•
•
•
•
Working With Power
Packs
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 can 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 box 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.
Object Animation
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.
5 The name of the variable you are defining is displayed in the Variable field.
7 Choose OK. If you entered a template variable in a field that expects a tag name,
the Tag Definition dialog is displayed.
8 If you want to define this fields now, enter data for any tags that appear. Specify
the following for each tag.
• Domain
• Element type
• Dimension (if an element array)
• Default value
• Description
If you want to define these fields when you paste the object, choose Cancel.
15
Object Animation
3 Choose Edit>Paste. Place the cursor where the object is to be pasted and press the
mouse button. The Template dialog is displayed.
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.
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.
After you click OK, if FactoryLink generates a new element, 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 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
The Template Variables option applies globally to all drawings; therefore, you do
not need to open a drawing to set this option.
If the prompts differ (you entered different prompts for the same variable in
different objects), the Application Editor displays an error in the Variable Conflict
dialog box.
The Application Editor displays the first prompt you entered for the displayed
variable. If you click 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
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.
15
Object Animation
1 To locate the object in the drawing, use the Find command on the Edit menu,
entering the object name given in the Animation error dialog.
2 Choose Animation>Template.
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 drawing, then at run
time, the system will not load the drawing containing the unresolved variables.
Instead, the system displays the following message:
To resolve the variables, open the drawing in the Application Editor and perform
an animation test. The Application Editor displays an error message indicating
the object name with the unresolved variable. Follow the steps above for resolving
variables.
15
Object Animation
•
•
•
•
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
The Function Key command on the Animation menu allows you 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
For example, you can use the name of the element specified in a Math and Logic
procedure that sets the element’s value to 1 when a particular process value is
reached, thereby causing the computer to beep.
Object Animation
2 Choose Animation>Function Key to display the Select Function Key dialog listing all
defined function keys. If none are defined, the box is blank.
Keystroke Keystroke
Description Description
options options
Keystroke Keystroke
Description Description
options options
16
Object Animation
Part IV
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
PowerVB Animation
213
PowerVB Animation in the Application Editor PowerVB Animation in this book
guide
Guide
Table of Contents
•
•
•
•
PowerVB Animation
PowerVB Animation
GraphicObject.BackgroundUpdate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
GraphicObject.ActionValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Graphic Object Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
GraphicObject.Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
GraphicObject.Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
GraphicObject.HasAnimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Drawing/Window Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Drawing Object Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Drawing.BackColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Window Object Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Window.Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Miscellaneous Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Critical/EndCritical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
LockRTDB/UnlockRTDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Public Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
PowerVB Variables and FactoryLink Tag Types . . . . . . . . . . . . . . . . . 291
Private Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
PowerVB Animation
PowerVB Code Attached to Sub-Objects . . . . . . . . . . . . . . . . . . . . . . . . 342
Multi-threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Endless Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Execution Order at Run Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
GuideCore
•
•
•
•
Chapter 17
PowerVB Overview 17
PowerVB Animation
PowerVB allows Microsoft Visual Basic® -compatible animation scripts to be
attached to FactoryLink graphic objects. Scripts can incorporate drawing events,
mouse events, text events, and RTDB change events. PowerVB’s event
capabilities make it possible to manipulate objects in many ways during run time.
These events may manipulate any of the following four types of
FactoryLink-specific basic objects.
• Tags (RTDB elements)
• Graphic objects
• Windows
• Drawings
PowerVB can be used to configure graphic animation because routines that act on
a particular graphic object can be attached to that object. Script subroutines may
be created to call other subroutines or functions. The operations for each object
are triggered by various events during run time.
Complex reusable graphic objects can be created using PowerVB on Power Packs.
Refer to “Working with Power Objects and Power Packs” on page 9-139 in this
manual for information on Power DragOns.
•
•
•
•
PowerVB Editor
18
PowerVB Animation
This section 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.
F ILE M ENU
Use the File menu to validate and save a script, to import or export information,
to delete PowerVB animation from a graphic object, and to close the PowerVB
animation editor.
Export Allows you to export either the selected text in this object’s script
or the entire script to a text file. This is useful for printing the 18
script or attaching the script to another object.
PowerVB Animation
Refer to “Using the Import and Export Dialog” on page 18-226 for
a description of fields in the Export dialog.
Delete Deletes all of the PowerVB animation for this object. A message
window is displayed to verify the script should be deleted.
Close 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.
Menubar
Files Area
History Menu
18
The History menu is used to change to a specific path. The top section, above the
horizontal line, is the recent files list. The bottom section is the marked directories
PowerVB Animation
list.
Recent Files List Marks recently selected directory paths. Choose a path in this list
to change the chosen path.
Marked Shows directory paths that have been marked with the Mark
Directories List option under the Special menu. Choose a path in this list to
change the chosen path.
Special Menu
This 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 Changes the current path to the home path. For example, on
Windows NT a user’s home path is defined in the environment
variables HOMEDRIVE and HOMEPATH. This is the path
holding the user’s log-in script and other information.
Mark Adds the current path to the marked directories list under the
History menu.
Unmark Removes the current path from the marked directories list under
the History menu.
This menu is used to change the order of the files and directories shown in the file
area of the dialog.
Volumes Menu
This 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.
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.
PowerVB Animation
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.
This 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. Chosing Open or Save also
achieves this result.
Cancel Button
This button is in the lower-right corner of the dialog and is used to cancel the
import or export operation. When this button is pressed, no text is imported or
exported.
PowerVB Animation
Choose the following options from the Search menu.
Find Finds the first occurrence of the designated text in this object’s
script. If the text is found, the cursor moves to the location. A
beep sounds if no matching text can be found. The Find option
operates only the animation or library script being edited.
Find Next Finds the next occurrence of the designated text in the object’s
script. If no other occurrence exists beyond the current location of
the cursor in the editor, a beep sounds.
PowerVB’s Search options search the script from the current location of the cursor
to the end of the code. To ensure the entire script is searched, move the cursor to
the beginning of the script before using these options.
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.
Tag Routines Displays a list of defined tag events. Specific tag subroutine
events are discussed in the “RTDB Events” on page 20-259. 18
Define Tag Event Allows you to define tag events. Tag events trigger an event
PowerVB Animation
during run time based on the value of one or more tags changing.
Object Properties Displays a list of the properties available for the object whose
script is being edited. 18
PowerVB Animation
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
are displayed. If the text \Rectangle is selected and the drawing
has a top-level object named Rectangle, then Rectangle’s
PowerVB properties are displayed.
•
•
•
•
Attaching a Script to
an Object 19
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’s script.
Specific information about each of the events, variables used in their subroutines,
and examples of PowerVB code for specific events follow this procedure.
3 Choose Attributes>Object Name. Name the object and click 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 25, “Hierarchical Graphic Object Naming” for
more information on naming objects.
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 are
displayed in the PowerVB animation editor window. The beginning statement will
be Sub <drawing>_<object id>_<event>. The ending statement will always be End
Sub.
6 Add the necessary PowerVB code in the PowerVB animation editor window.
Typically this code opens FactoryLink properties. Information on each type of 19
PowerVB event follows this procedure.
PowerVB Animation
Troubleshooting
Tip: 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.
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. This is important
because both the PowerVB code and the object must be saved for proper execution
of the object’s script.
Note
11 Debug the script if necessary. Refer to Chapter 26, “Debugging a PowerVB Script”
for information on debugging PowerVB code.
D EFINING T AG E VENTS
19
Tags are used to trigger certain FactoryLink or custom-created events at run time
when one or more tag value change.
PowerVB Animation
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.
4 Click Add, or press return, to add the tag to the trigger list.
5 Click OK to accept the new tag event information. The beginning and ending
statements for the subroutine are created 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.
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. Its name is displayed in the Event Name field.
To rename the tag event, click Rename. A message box is displayed, prompting for
a new name. Once a new name has been entered, the tag event’s code in the
animation editor changes to use the new name.
Adding a Tag
19
To add a tag to the tag list for the tag event, enter the tag’s name in the entry field
above the Add button. Click Add. The tag will be inserted into the list.
PowerVB Animation
Removing a Tag
To remove a tag from the tag list for the tag event, select the tag in the tag list or
click Remove to delete the tag from the list.
5 Once a tag event has been altered in the Define Tag Event window, click OK to
apply the changes to the code in the editor or press Cancel to discard the changes.
Note
Once the tag event has been altered, the PowerVB editor’s script
must still be saved to make the change permanent.
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. Its name is displayed in the Event Name field.
4 Click Delete to remove this tag event. The event, as well as all the code in its
subroutine, will be deleted.
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:
PowerVB Animation
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.
Coordinates for an object are defined with the Left and Bottom properties.
FactoryLink coordinates are numbered from the bottom-left corner. The
bottom-left corner of a drawing will be 0,0, and the numbers will 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 in
which the drawing is displayed.
•
•
•
•
PowerVB Events
20
PowerVB Animation
D RAW IN G /WI NDO W E VENTS
Drawing/Window events can be used 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
DrawUnload
This 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.
DrawLoad
This 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.
Example: In this example, the ceramic injection drawing’s title will be changed
with the code that follows.
Example Code:
sub mouse_g1006_DrawLoad
20
PowerVB Animation
old_title = window.title ‘save window’s previous
‘title
window.title = “Mouse Events” ‘change window’s title
WinLostFocus
This event occurs when a window loses input focus or is no longer the top window.
Example Code:
sub misc1_g1020_WinLostFocus
this.text = “Window Lost Focus”
end sub
WinGotFocu
This event occurs when a window receives input focus or becomes the top window.
Example Code:
sub misc1_g1001_WinGotFocus
this.text = “Window Got Focus”
end sub
Tip
For non-rectangular objects, mouse events are captured within the bounding box
of the object (defined as an imaginary rectangle enclosing the object).
The Button As Integer argument defines which button was pressed, released or
clicked to cause an event. The value of Button can be checked against the
pre-defined constants as in the following example:
The X As Long and Y As Long arguments define the horizontal and vertical
coordinates of the mouse at the time the event occurred.
PowerVB Animation
MouseMove (x as long, y as long)
Example 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
This event occurs when a mouse button is released. This event occurs even if the
mouse cursor is moved off the object before the button is released.
Example 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
PowerVB Animation
Tip – Dragging an Object
Use the MouseDown and MouseUp 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.
Troubleshooting
This event occurs when the mouse stops being over an object.
Example Code:
The 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.
Example Code:
Click (button as integer, x as long, y as long)
'Force tag 'ThisTag' to 1
ThisTag.Force 1
end sub
PowerVB Animation
Example 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
ObjectA
ObjectB
If both ObjectA and ObjectB have Click events and you click on ObjectB, ObjectB’s
Click routine will run but not ObjectA’s. 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.
EnterKey
This event occurs when the enter key is pressed if the contents of the edit field
have not been written to the RTDB.
Example Code:
sub Drawing_Object_EnterKey
' Change the contents of this field to uppercase
This.Text = UCase(This.Text)
end sub
LostFocus
20
This event occurs when a text object loses keyboard focus.
PowerVB Animation
Example Code:
sub Drawing_Object_LostFocus
‘Indicate that this field no longer has focus by changing
‘text to black
This.Textcolor = BLACK
end sub
GotFocus
This 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, the user clicks on the field or tabs to the field.
Example Code:
sub Drawing_Object_GotFocus
‘Indicate that this field has focus by
‘changing text to red
This.Textcolor = RED
end sub
Example Code:
sub Drawing_Object_Change
‘Update the window title with the contents of this
‘text object
Window.Title = This.Text
end sub
RTDB E VEN TS
20
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
PowerVB Animation
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.
The combination of all of the tag events for an object can have a maximum of 50
different tags in the trigger lists.
sub concurr_box_SecondChanged
Print “...A_SEC is now...” & CStr(A_SEC.Value)
end sub
•
•
•
•
Using Variables to
Declare PowerVB 21
Objects
PowerVB Animation
Declare an object for RTDB and graphics objects in PowerVB code in one of
following two ways.
• Implicit
• Explicit
Sub Somedwg_someobj_DrawLoad
dim I% as integer
‘set I equal to the current second value
I% = A_SEC.Value
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.
Sub somedwg_someobj_DrawLoad
Dim A_SEC As Integer, I As Integer
Troubleshooting
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 to which the script is
attached, PowerVB detects that PumpMotor is an RTDB element and uses it as
such.
Avoid using variable names that are the same as tag names because this makes
the PowerVB script difficult to debug and maintain.
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.
PowerVB Animation
dot property suffixes. Use the tag properties with tag arrays.
The following code illustrates illegal uses of tag arrays as implicit variables.
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 like the following example.
For example, the following code sets all the RTDB elements in the given array to
the given value. 21
Sub SetRTDBObjs (names () as string, new_value as long)
PowerVB Animation
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
When using the RTDBObjectValue function, use the same case as when the RTDB
object was defined.
For example, the code below refers to the same tag value because PowerVB is not
case-sensitive regarding variable names.
x = thistag.value
y = THISTAG.value
Unlike implicit array references, use brackets to indicate array subroutines when
defining a tag array element explicitly with the RTDBObjectValue function.
Example Code:
'These two sets of code have the same result
PowerVB Animation
Example 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
The .parent and .child methods of graphic objects can also link explicit graphic
object variables with actual graphic objects.
Refer to Chapter 25, “Hierarchical Graphic Object Naming,” for more information
on parent and child graphic object relationships.
PowerVB Animation
Verify you are using the Set statement when using explicit variables.
Example Code:
dim tag as RTDBObject
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.
Example Code:
Sub SomeDrawing_SomeObjectID_SomeEvent
Dim Tag As RTDBObject
Sub SomeDrawing_SomeObjectID_SomeEvent
Dim Tag As RTDBObject
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.
•
•
•
•
Using Properties and
Methods in PowerVB 22
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.
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.
RTDBObject.Type
RTDBObject.Type is a read-only integer property that tells the type of the RTDB
element. This type can be compared to one of the following constants.
• FL_DIGITAL
• FL_ANALOG
• FL_LONGANA
• FL_FLOAT
• FL_MESSAGE
Example Code:
sub DisplayType (Name as string)
dim obj as RTDBObject
dim typ as string
msgbox “The RTDB element” & Name & “ is a “ & typ &
“RTDB element”
end sub
RTDBObject.Active
22
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
PowerVB Animation
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.
Example 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’s
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.
Example Code:
‘turn the motor on by forcing its RTDB element to 1
Motor.Force 1
Example Code:
GraphicObject.Type
22
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:
PowerVB Animation
• FL_DRAWING
• FL_BOX
• FL_ELLIPSE
• FL_POLYGON
• FL_TEXT
• FL_COMPOSITE
• FL_LEGEND
• FL_LINE
• FL_PARABOLA
Example 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 property that defines the left position of
the object along the x axis. Use this property to move an object along the x axis.
Example Code:
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.
Example Code:
Moving the bottom outside this range can make the object invisible.
GraphicObject.Width
GraphicObject.Width is a read/write long property that defines the width of an
object. Use this property to make an object narrower or wider.
Example Code:
GraphicObject.Height
GraphicObject.Height is a read/write long property that defines the height of an
object. Use this property to make a graphic object shorter or taller.
Example Code:
Text within an object must remain proportional. Changing the width or height of
a text object can change the font size and the other dimension (height or width) of
the object.
GraphicObject.Text
22
GraphicObject.Text is a read/write string property that holds the text contained in
a text object. This property is only valid for text object variables. One use of this
PowerVB Animation
property is to read the unprocessed text in a text object that has input animation
attached.
Example Code:
GraphicObject.Font
GraphicObject.Font is a read/write string property 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 the user’s system.
Example Code:
‘Change to Courier New font
InputFld.font = “Courier New”
GraphicObject.Bold
GraphicObject.Bold is a read/write integer string property. When this property’s
value is true (non-zero), the text is bold. If the property’s value is false, the text is
not bold. This property is valid only for text object variables.
if Txt.bold then
Txt.bold = False ‘bold off
else
Txt.bold = True ‘bold on
end if
GraphicObject.Italic
GraphicObject.Italic is a read/write integer property that italicizes text if the
property value is true (non-zero). If the value is false, the text is not italicized.
This property is valid only for text object variables.
Example Code:
GraphicObject.Underline
GraphicObject.Underline is a read/write integer property. If the property value is
true, the text is underlined. This property is valid for only text object variables.
Example Code:
GraphicObject.LineColor
22
GraphicObject.LineColor is a read/write integer property used to set or retrieve
the line color of a graphics object.
PowerVB Animation
Example 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.
Example Code:
‘Make the fill color white for the composite and all its
‘child objects
Comp.fillcolor = WHITE
GraphicObject.BackColor
GraphicObject.BackColor is a read/write integer property used to set or retrieve
the background color of a graphics object.
Example Code:
‘Make the background color black
Box.backcolor = BLACK
GraphicObject.TextColor
22
GraphicObject.TextColor is a read/write integer property used to set or retrieve
the text color for a graphics object. This property is valid only for text object
PowerVB Animation
variables.
Example Code:
‘If this script is attached to a text object, change the
‘object’s text color
GraphicObject.Name
GraphicObject.Name is a read-only string property used to retrieve the basic
name of a graphic object.
Example Code:
Example Code:
‘Toggle background update setting
if InputFld.BackgroundUpdate then
InputFld.BackgroundUpdate = false
else
InputFld.BackgroundUpdate = true
end if
GraphicObject.ActionValue
GraphicObject.ActionValue is a read/write string property used to set or retrieve
the value field for objects with button animation.
Example Code:
‘If an object has button animation with action set to
DRW,
‘the actionvalue property can be changed to load
different
PowerVB Animation
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.
Example 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)
Note
Example 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.
Example Code:
‘Don’t try to set the ActionValue property of this
‘object unless it has button animation. Otherwise,
‘a run time error will occur.
PowerVB Animation
Drawing Object Variable
Because drawing objects cannot be declared explicitly like RTDB and graphics
object variables, a predefined variable called drawing is used to access the
properties of the drawing to which the PowerVB code is attached. 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.
The drawing object can also be stored but this may be dangerous unless
invalidated upon drawing unload, as shown in the following example.
private sdrawing as DrawingObject
sub save drawing (x as DrawingObject)
set sdrawing = x
end sub
Example Code:
The window variable is not available for code in PowerVB libraries except when
explicitly passed as an argument as in this example.
Window.Title
22
Window.Title is a read/write string property used to set or retrieve the text in the
title bar of the window.
PowerVB Animation
Example 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.
Critical/EndCritical
Normally, FactoryLink allows several active event routines to run concurrently.
Refer to “Multi-threading” on page 26-342 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 was 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.
Example Code:
sub drawing_object_SomeTagEvent
22
PowerVB Animation
dim I as Integer
Sub set_another_tag
Critical
Another_Tag.Value = 25
‘No End Critical to match the Critical
End Sub
Example Code:
LockRTDB
Some_Tag = 20
UnlockRTDB
PowerVB Animation
variables. Private variables together with access subroutines and functions can
usually suffice.
Example Code:
String Message
Boolean Digital
Integer Analog
Long LongAnalog
Double Float
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 that is 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 PowerVB Language Reference Guide for more information on declaring 22
variables.
PowerVB Animation
•
•
•
•
Rotating Objects
23
PowerVB Animation
OVE RVIEW
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 A single drawn object such as a polygon, line, box, ellipse, arc,
Objects parabola, or spline.
Composite A container of primitive objects and/or other composites.
Sub-objects Either primitive objects or other composites inside a composite
object.
Original The initial orientation of the object before rotation, translation, or
Orientation scaling.
Current The orientation of an object or composite at the present time.
Orientation
Rotation Angle The degree of rotation of an object relative to its current
orientation.
Pivot Point The central point about which an object or composite is rotated.
PowerVB Animation
objectname.rotate x, y, #ofdegrees
where:
• x - horizontal center of rotation
• y - vertical center of rotation
• degrees - rotation amount
Specifying a positive value for angle results in clockwise rotation; a negative value
for angle results in counter-clockwise rotation.
Rotation is cumulative, not absolute, which means a value of 30 for angle 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
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.
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
The smoothness of an object’s 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.
PowerVB Animation
7 Run the application to test the animation. If the object, sub-object, or composite is
not legal for rotation, an error message is displayed.
Keep in mind that 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.
Example Code:
sub Drawing_Object_DrawLoad
x_pivot = this.left + (this.width / 2)
y_pivot = this.bottom + (this.height / 2)
end sub
‘Instead of this –
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
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.
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
22-274 for more information.
PowerVB Animation
during development time.
The pivot point for development rotation is the center of the object’s bounding box.
•
•
•
•
Creating PowerVB
Libraries and 24
Templates
PowerVB Animation
PO W ER VB L IBRA RIES
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).
1 Choose File>Open PowerVB Library from the Application Editor. A window with the
names of all accessible libraries is displayed. The Open PowerVB Library dialog is
displayed.
2 Enter the name of the new library and choose Open to display the PowerVB
library editor. 24
PowerVB Animation
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.
5 Choose File>Save.
The File Menu has one extra option — 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.
Using this option, a separate copy of a PowerVB library can be created under a
new name.
PowerVB Animation
in the object’s code. The function or subroutine must be declared in each script in
which it is referenced.
PO W ER VB T EM PLA TES
24
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
PowerVB Animation
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 will 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’s 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
When defining a tag event, specify one or more template variables in the tag list
instead of tags. When the object’s code is saved, the user is prompted to define the
template variables. When the object containing the tag event is pasted, the user is
prompted to enter values for the template variables. If values entered for the
template variables are not valid tags, they will be ignored.
Example Code:
sub Drawing_Object_Click(Button As Integer, X As Long,_
Y As Long)
this.fillcolor = {newcolor}
end sub
When an object containing the code is pasted, the user is prompted to enter values
for the template variables.
•
•
•
•
Hierarchical Graphic
Object Naming 25
PowerVB Animation
OVE RVIEW
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 a name.
Object names will 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).
OB JE CT N A MES
Assign an object name for any object that will be copied and pasted into another
drawing or application. For example, a dial that has been created in the
Application Editor might contain objects named as follows:
Dial
DialFace
Objects are referred to by their IDs except in PowerVB code. It is a good idea to
rename objects to reflect their usage. For example, it is easier to reference object
txtInputName than h1234.
PowerVB Animation
2 Select the object to be named.
Implicit Referencing
When referencing an object in a PowerVB script, refer to it in the context of the
current object (object this script is attached to) or in its context as a descendant of
the drawing’s top level. The following diagram illustrates this concept.
Drawing
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 was a composite object, it would be a parent relative to its child objects
but a child relative to Object2.
Syntax
The code samples below illustrate changing the fillcolor property of an object from
another object’s code in the context of the diagram on the previous page. The 25
same syntax is applicable to read or write other object properties.
PowerVB Animation
Code in Object1:
‘Declare an object variable for a sibling
dim g as GraphicObject
set g=..\Object2
A child object name must always follow an instance of the backslash character (\).
If referencing the current object in a script, it is better to use the keyword this
instead of the specific object name.
Explicit Referencing
This alternate method of referencing objects requires more typing than the above
method but provides the ability to use string variables to specify object names.
Since the string variables can be built up in code, any errors in object names are
not detected until run time.
Example 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
PowerVB Animation
specified for the parent since an object only has one parent)
• C (or Child) - 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
drawing.c("Object3").c("ObjectB").Fillcolor = BLUE
‘same as
..\..\Object3\ObjectB.Fillcolor = BLUE
When using the alternate method, graphic object references must begin with
drawing or this or some explicit graphic object variable.
PowerVB Animation
Knowing this, performance of some operations can be improved, as illustrated in
the example below.
‘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%
Finding an Object
Within a Script
Using the text searching capabilities in the PowerVB animation editor, search for
either ID in an event name, object name, or any other text. Remember that object
IDs are only used in event routine names. All other references to objects are by
their names.
The cross-reference list is used only for finding references to tags (RTDB
elements). To find where tags are used in PowerVB tag event trigger lists or
PowerVB code, search for the object’s ID, not its name.
Within a Drawing
ChooseEdit>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 that have
the same name.
Note
•
•
•
•
Debugging a PowerVB
Script 26
PowerVB Animation
PR INTING P OW E R VB C O DE
There are two ways to review PowerVB code in printed form:
• Use the Document PowerVB menu option in the Application Editor.
• Print a single script or part of a single script.
D OC UME NT P O WE R VB
The Document PowerVB command writes a text file to show the PowerVB code for
all objects in a drawing. ChooseFile> 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’s code
• Listing of code by object with line numbers
Note
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.
2 ChooseFile> Export. The file is exported to a text file with a name specified by the
user.
ERR OR M ESSA GE B OX
26
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
PowerVB Animation
implementing the application.
Example Code:
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.
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
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 can control whether the event routine can continue or not.
You can also control where error information is logged so users of the application
are not presented with cryptic error information they do not understand and so
the application is not hung up waiting for a user to respond to the error.
PowerVB Animation
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.
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.
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.
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.
PowerVB Animation
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.
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 PowerVB
50 500 PowerVB
26
Statement:
PowerVB Animation
Print i%; s$,
Print 67;
Print "Goodbye"
Output:
-1001 computer 67 Goodbye
For example, suppose object box1 had the following event routine triggered by
changes in the A_SEC tag.
sub Drawing_1001_ASecChanged
print “ABCDEFG”
end sub
Also, suppose object box2 had the following event routine also triggered by
A_SEC.
sub Drawing_1003_ASecChanged
print “TUVWXYZ”
end sub
ABCDEFG
TUVWXYZ
or it could be:
TUVWXYZ
ABCDEFG
ABCTUVDEFWGXYZ
There is one circumstance in which Print statement output from two or more
routines can intermingle on the same line in vbdebug.log. This is when one or
more of the Print statements ends with a comma or semicolon which tells
PowerVB to start printing the output of the next Print statement on the same
line.
For example, if we changed box1’s tag event code from above 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
ABCDEFG()HIJKLMNOP
TUVWXYZ
or it could be:
26
TUVWXYZ
PowerVB Animation
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 sample code above could not be
ABCDEFG()HIJKTUVWXYZLMNOP
because the two Print statements in box1’s tag event code are separated between
ABCDEFG and HIJKLMNOP.
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
then 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.
PowerVB Animation
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 this:
***************************************************************
*
Logging session started: Sun Jan 14 13:09:38 1996
output from new run of FactoryLink application
The {FL...} portions of this path are environment variables defined for every
FactoryLink application. For example, suppose a FactoryLink application was in
directory C:\ECS\APPS, the FLAPP value. Suppose the values of FLNAME,
FLDOMAIN, and FLUSER were FLAPP1, USER, and JOHN, respectively. In
this case, the full path to the vbdebug.log file would be:
C:\ecs\apps\flapp1\user\john\log\vbdebug.log
If a different user named SALLY used the same application, thus changing
FLUSER to SALLY, then 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.
Line 1
Line 3
The Print statement that tried to output Line 2 would be disabled because the tag
VBLOGDISABLE_U had the value one at the time the Print statement was
executed.
After debugging, set the default value of these two tags in the Application Editor
or Configuration Manager to one so the Print statements will be ignored. 26
PowerVB Animation
Note
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.
Overview
Any text editor can be used to view a vbdebug.log file. However, LogView was
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 ECS 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 ECS 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 — select the LogView icon from the FactoryLink section of the
Programs section of the Start menu.
• Windows 95 — double-click the LogView icon in the FactoryLink program group
in Program Manager.
• OS/2 — double-click the LogView icon in the FactoryLink folder.
LogView can also be launched from the command line. To do so, enter the
following command at the command line:
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.
When you start-up LogView, the first window you see identifies LogView and
displays copyright information followed by LogView’s main window. 26
PowerVB Animation
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 that are 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 Brings up the Open File dialog to open a file for viewing.
Exit Exits the LogView application.
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.
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.
2 Select a file for viewing from the Open File dialog. Usually, you will 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 press the Open button, an icon for
the file is displayed in the main LogView window’s file area. You can open several
files using the Open File dialog which will put several icons in the files area of
LogView’s main window.
Using the Full Path Names Option When Viewing File Icons
26
If several files are opened and have the same name but reside in different
directories, the names of their icons will be the same which can be confusing. If
PowerVB Animation
you select Full Path Name from the Options menu, the files’ full paths will be
displayed 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 will change the icons’ names back to the basic name
and extension.
Viewing a File
Once one or more file icons are in the main window’s files area, double-click an
icon and view the file’s contents. The sections of this window are detailed in the
following paragraphs.
Title Ba
Has the text LOGVIEW: filename in it where filename is the full name of the file
being viewed.
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 wider 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’s 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 press the left or
right arrow with the left mouse button and hold the button down, the refresh rate
will constantly decrease or increase until you release the button or reach an end of
the valid range.
PowerVB Animation
this section shows the application is running correctly. If automatic file refreshing
is disabled, the “Heart Beat” indicator will stop. It will not restart until automatic
refreshing is again enabled.
Control the rate at which LogView refreshes 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 will check
for changes in the file every ten seconds. The refresh rate can change from 1
second or up to 100 seconds.
When automatic refreshing is turned on and the viewer window detects that 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 would be in a vbdebug.log file. Turn
off automatic refreshing by pressing the stop sign button on the viewer window’s
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.
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.
Multi-threading
When PowerVB lets more than one event routine execute at the same time, this is
called multi-threading. This is different from Visual Basic, where only one event
routine at a time can execute. Allowing multi-threading makes PowerVB more
flexible but also makes coding more complicated in several ways.
Just as multiple events for different objects can run at the same time, multiple
events for a single object can be running at the same time with some restrictions. 26
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
PowerVB Animation
time in the order they were detected.
Endless Loops
Watch for endless loops. A FactoryLink application will not shut down until all
event routines that are running 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 will wait for the PowerVB event routines running on that drawing to
end before closing the drawing.
For example, the following code would be an endless loop. (Since A_SEC is a
counter for the number of seconds since the last minute, its value will always be
less than 61.).
While A_SEC.value < 61 ‘A bad thing
x = x + 1
Wend
Part V
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Security
345
Security in the Application Editor Guide Security in this book
Table of Contents
•
•
•
•
Security
•
•
•
•
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.
Security
• Text input fields
• Function keys.
These objects have one thing in common—they are objects an operator will use 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.
K EY C O NC EPTS
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.
27
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.
To ensure that only the application administrator can access security information,
Security
the administrative part of the security function (called FLADMIN) is
password-protected. The administrator can modify the administrator password
as needed.
Application User
A application user is simply 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.
Before a user can access any security class, the user must log in (by entering a
user name and password).
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.
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 that 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.
Note
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. To see how to access FLADMIN and use its options,
refer to Chapter 28, “Configuring Security Using FLADMIN,” in this manual.
Note
27
Before you run FLADMIN for the first time, you must first run the
Application Editor.
Security
These Security options are available from the Application menu within the
Application Editor. To see how to use these options, refer to Chapter 29, “Setting
up Security Options,” in this manual.
To prevent authorized access to objects or actions that have Security attached, you
Security
also need to set up a logout process. 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.
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.
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.
Once Security is added to an object, the authorized security class will be assigned.
The next question is what action will occur if an unauthorized user tries to access
the object. FactoryLink provides security attributes that allow you to determine
what will occur when unauthorized users try to access the object. You can even
keep a log of unauthorized access attempts, if desired.
Remember that you can combine Class Logging and Access Error Action options to
provide the type of security information you want.
Note
1 From the Application menu in the Application Editor, select Assign Users and
Classes.
27
• Change the Administrator Password for Security.
• Set the Password Verification Type (local or system).
Security
• Assign access error action
• Assign class logging.
Note
Security
•
•
•
•
Configuring Security
Using FLADMIN
This chapter describes how to access FLADMIN and configure each of these
FLADMIN options. 28
Security
The FLADMIN menu allows you to choose the Security option you want to
perform.
In this chapter, the first method shown above—accessing FLADMIN from the
Application Editor—is used. Remember that you can use either of the other two
methods, as desired.
1 Choose Assign Users/Classes from the Application menu of the Application Editor.
The system asks you to enter your administrator password.
28
Security
The default administrator password is “Password.” Passwords are not
case-sensitive.
Note
4 Enter the new security class name, and click on New. The Security Class
Attributes dialog is displayed.
28
Security
5 Fill out the Security Class Attributes dialog. Provide the following information.
Log Access Click this button if you want the system to keep a record of every
Failure 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 will write a message to
the Historian mailbox (if configured) and last event tag.
Log User Click this button if you want the system to log successful
Action 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 will write a 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.
Beep Click on this button if you want the system to “beep” when the
user fails to access a graphic object.
6 When you finish entering information, click OK. The security class is created, and
the Application Security Classes dialog is displayed.
D EFINING A U SE R
The application administrator sets up security records for each authorized
application user. These records are set up using an option within FLADMIN.
Follow the instructions below 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. The FLADMIN menu is
displayed.
28
Security
5 Fill out the New Application User dialog. Provide the following information.
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 Enter the number of minutes that the system will sit idle before
minutes): the user is automatically logged out. The system will
automatically log 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
Modify Password Click in this box if you want to modify the user’s password.
Security
security class you want to assign and click 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 Shows the security class(es) you have assigned to the user. If you
Class(es) want to delete the user’s access to one of these security classes,
highlight the security class and click 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 When you finish entering information, click OK. The user record is created, and
the Application Users dialog is displayed.
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. The FLADMIN menu is
displayed.
4 Fill out the Password Verification Type dialog. Provide the following information.
Local Password Click this button if you want Security to recognize the user’s
Verification FactoryLink password.
System Password Click this button if you want Security to recognize the user’s
Verification system password. This option may be used if your operating
system allows use of a system password.
5 When you finish entering information, click OK. The FLADMIN menu is
displayed.
28
Security
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. The FLADMIN menu is
displayed.
4 Fill out the Administrator Password dialog. Provide the following information.
Old password Enter your current administrator password.
New Enter the new administrator password you want to use. A valid
password password is a string of alphanumeric characters with no
embedded spaces.
5 When you finish entering information, click OK to save the new password. The
FLADMIN menu is displayed.
28
Security
•
•
•
•
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 will work within your
application.
This chapter describes how you can configure these Security options.
Security
1 Choose Security Options from the Application menu of the Application Editor.
Security
password.
Valid Entry: standard element 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 that will be used to trigger the login process. When the
value of this tag changes to 1, the security login process will
begin.
The tag trigger login method works independent from the hotkey
login method. You can specify one or both methods, as desired.
Valid Entry: standard element 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 click ALT, CTRL, and/or SHIFT
as needed to specify the hotkey combination.
A confirmation message will be displayed if the Confirm Logout
box is checked.
4 When you finish entering information, click OK. The login/logout options you
specified are saved, and the Application Editor is displayed.
1 Choose Security Options from the Application menu of the Application Editor.
29
Security
3 Specify the following information:
Lines 1-5 For each line, enter the format 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. You can create an application graphics
translation file in FLAPP\msg\graph.txt. You can then
customize this file to produce appropriate translations. 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 Enter the name of the first tag that will be used to insert some
Tag 1 information into the appropriate line of the error message.
Valid Entry: standard element tag name
4 When you finish entering information, click OK. The error dialog options you
specified are saved, and the Application Editor is displayed.
D EFINING L OG IN M E SSAG ES
The Login Dialog option allows you to control the message that will display during
a user login attempt. The message will display on five lines; this option allows you
to specify the content of each line.
1 Choose Security Options from the Application menu of the Application Editor.
29
Security
3 Specify the following information:
Lines 1-5 For each line, enter the format 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. You can create an application graphics
translation file in FLAPP\msg\graph.txt. You can then
customize this file to produce appropriate translations. 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 Enter the name of the first tag that will be used to insert some
Tag 1 information into the appropriate line of the login message.
Valid Entry: standard element tag name
4 When you finish entering information, click OK. The login dialog options you
specified are saved, and the Application Editor is displayed.
1 Choose Security Options from the Application menu of the Application Editor.
2 Choose Event Log Config. The Event Logging Configuration dialog is displayed.
29
Security
3 Specify the following information:
User Login Click this box if you want to record all user login events.
User Logout 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.
4 When you finish entering information, click OK. The event logging options you
specified are saved, and the Application Editor is displayed.
Part VI
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
DXF Converter
383
DXF Converter in the Application Editor Guide DXF Converter in this book
Table of Contents
•
•
•
•
DXF Converter
•
•
•
•
Converting and
Importing DXF Files
You can edit an imported drawing just as you would any other FactoryLink
drawing.
30
DXF Converter
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 that all objects are placed on a single layer.
2 Open the File menu and select New. The New Program Object dialog opens.
4 Type the description “DXF Converter” to label the icon. Press Tab.
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 OK. The Converter icon appears in the FactoryLink program group.
30
DXF Converter
To convert a drawing:
1 Double-click the DXF Converter icon in the FactoryLink program group to open
the DXF Converter.
2 Change to the drive and directory of the AutoCAD drawing you want to convert.
3 Click to select the files you want to convert in the File area. To deselect a file, click
it again.
4 To customize the conversion settings, type the translate path and filename in the
Translate file box. See the section “Creating a Translate File” on page 395 for
more about using translate files to customize conversion settings. Leave this box
blank to use the default settings.
5 Click Convert. The selected files are converted and placed in the current directory.
For example, in the screen above, the converted files are placed in the c:\acad
directory.
If there were errors during the conversion of any of the files, the Converter creates
a separate error file for each drawing that caused a conversion error. See page
30399 for more information.
2 Open the File menu and select Import. The Import dialog box opens.
5 In the Files area, click to select the files you want to convert. To deselect a file,
click it again.
DXF Converter
You can use a translate file to change the conversion settings for graphics and
text. See the section “Customizing the Conversion Settings” for more 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 pages 395-396).
Color Conversions
The following table shows the default conversions for AutoCAD colors. Each
program uses numbers to designate colors. For example, the Converter converts
AutoCAD’s color number 6 (magenta) to FactoryLink’s color number 20
(magenta).
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
10 Brown 26 Brown
If you want to see exactly how AutoCAD colors will convert, use the FactoryLink
color palette. For example, AutoCAD color 11, light green, converts to
FactoryLink’s color number 7, light green. You can compare FactoryLink’s color 7
in the color palette to your original AutoCAD drawing to be sure that 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.
You can view the FactoryLink color palette in most Graphics Editor Attributes
dialog boxes where color is one of the attributes. For example, open the Attributes 30
DXF Converter
Line Conversions
The following table shows the default conversions for AutoCAD line styles:
Table 30-2
To customize the conversion settings, create a standard (ASCII) text file, called a
translate file, that contains the customizations. Then, whenever you want to use
those customizations, enter the translate file’s filename in the Translate file area
of the FactoryLink DXF Import dialog box.
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.
Tip
30
DXF Converter
Start the font section with the word “FONT” and enter the conversion
FONT instructions on the next lines. The format for conversion instructions is:
Helv,txt,20; FactoryLink FONT,AUTOCAD FONT,HEIGHT;
Helv,complex,10; Height is the maximum height of the text to convert. Text above this height
is converted to line segments and arcs.
Times,romans,20;
Courier,monotext,20 Start the color section with the word “COLOR”. The format is:
COLOR FactoryLink COLOR,AUTOCAD COLOR;
See the tables on pages 392 and 394 for color numbers.
48,7;
63,8; Start the screen section with the word “SCREEN”. It defines the display
SCREEN screen’s width and height in pixels. The format is:
SCREEN HEIGHT,SCREEN WIDTH;
1023,767;
LINES The Lines section begins with the word “LINES”. The format is:
solid,hidden; FactoryLink LINE STYLE,AUTOCAD LINE STYLE;
See the table on page 394 for a list of line styles.
dash,phantom;
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 (;).
Tip
Helv,txt,20;Helv,complex,10;Times,romans,20;
3 Save the translate file as an ASCII text file. You can use any filename and
extension. For example, CUSTOM.XLT 30
If you do not specify a method for converting fonts in a translate file, they are
converted and imported as graphics.
DXF Converter
If you only type the translate file’s 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 that you highlighted.
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 are listed below.
Error Messages
If there is a conversion error, one or more of the following error messages appear
in the error file.
Part VII
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Error Messages
403
Chapter 31
•
•
•
•
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.
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 31
Cause: Not enough memory is available.
Action: Close any unnecessary windows or programs. If this occurs often, Error Messages
add memory to the system.