You are on page 1of 19

Proficy iFIX

Understanding Global Objects

Objectives
y Define to Global Objects.
y Use Global Variables.
y Create Global Tables.
y Use Global Forms and Procedures.
Understanding Global Objects

14 - 2 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

Overview
Thus far, objects have been discussed within a document-based context, most commonly
with regard to Pictures and Dynamo Sets. Every object is described or has functionality
enabled by a set of properties. These objects are very useful, but their scope is limited to the
document of which they are a part.
Global objects provide a means of extending the scope of objects to any document in the
Workspace. Global objects and their properties can be accessed universally for use in
defining animations, providing common forms and displaying system-wide data. Generally,
these objects are data objects and have no visible graphic component.
User Globals reside in a unique area and provide a means for developers and users to
create, store and link to common objects and properties. Plug-and-Solve Globals are
reserved separately for third-party software providers to use with their plug-in applications.
User Globals can be found in the System Tree and browsed in the Expression Builder.

Figure 14-1. Global Objects in the User Globals area.

Figure 14-2. Global Objects in the Expression Builder


.

GFS-154B GE Fanuc Automation Americas Training Services 14 - 3


Understanding Global Objects

User Globals
User Globals are stored in a single document. The User.FXG file is
found in the project PIC path and can be copied to other iFIX
projects for re-use. Like Pictures and Dynamo Sets, this document
can hold a variety of different object types, as well as VBA forms
and scripts. Global Key Macros can also be built for use anywhere
in the Workspace and these are stored in the User Globals file.
The main interface for Global object access and creation is the
System Tree. From here a user can access a right-mouse menu to
edit the contents of the User Globals.
Save will commit all changes permanently to the User.FXG file. The
Find and Replace and Property Window choices behave exactly
Figure 14-3. User Globals
like their normal object counterparts. right-mouse menu.

Global Variables
Variables are useful tools for storing information used by many different areas of iFIX. The
variable itself is invisible and can only be seen in the System Tree. However, variables can
be used as data sources for DataLinks and other animations as well as VBA scripts. For
example, variables can be used to hold the names of the Current and Previous displays.
These names can then be used to assist with navigation.
Variables receive their data from VBA scripting or via other data sources assigned through
the Expression Builder (such as tags).
Creating Global Variables is relatively easy. The User right-click menu in the System Tree
offers a Create Variable choice that requires manual configuration. The Workspace Toolbox
also provides a button to add variables with a friendly interface.

Text data.
Integer data.

Figure 14-4. SimpleGlobal variable (left) or Global using a data source (right).

14 - 4 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

Variables must be given a unique name and must be assigned a data type (eg. String, Float,
Boolean, etc.). This will provide the necessary format for the data before it is passed along to
its destination. Note that a Local Variable can be created as well. These variables will be
deposited in the current Workspace document and will be restricted to the same document
scope as normal objects.

Assignment with Expression Editor


Global Variables are commonly used with DataLinks to display information. In these cases
the Global Variable acts as data source, much like a tag. As such, it can be defined using the
Expression Builder.

Globals SERVER.

Global Variable Property.

Global Variable Object.

Server.Object.Property

Figure 14-5. Browsing the Expression Builder to configure a Datalink to use a Global Variable .

GFS-154B GE Fanuc Automation Americas Training Services 14 - 5


Understanding Global Objects

Global Threshold Tables


Global Threshold Tables are useful tools for mapping two disparate data types against each
other, instead of just passing a value straight through. For instance, a developer can create
a universal threshold that maps numbers (integers) to colors. This is commonly done in
association with color animations on process equipment and alarm states.
There are five main data types that can be used as sources and destinations:
1. Boolean. (True or False).
2. Integer.
3. Float. (Real numbers).
4. String. (Text).
5. Color. (Destination only).
The main benefit of creating a global threshold table is that it can be shared amongst
numerous “child” objects. These objects will automatically inherit changes, edits or additions
to the Global Threshold table without any need for reconfiguration. This is an important way
to implement project standards and save time in development and maintenance.
Creating Global Threshold tables can only be done from the System Tree. The right-click
menu allows a developer to Create Threshold. A custom Threshold dialog will appear to
allow the user to map the values at various levels.

Figure 14-6. Custom Lookup Table examples

The Source Property Type refers to the incoming data from the data source (eg. a tag
current value) whereas Objects Property Type indicates what the value will be mapped to
before being passed to the destination. Exact match is very good for two-state tables for
color, visibility and text strings. Range Comparison is much better for analog tag ranges.
Entries can be edited in-place or through a mini-dialog that can be opened by double-
clicking on the target cell.

14 - 6 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

Note that there is no obvious way to change a Threshold


table name. A user can accomplish this by opening the
Property Window and then using the System Tree to select
the Threshold. From there the Name property is easily
edited in the Property Window.

Figure 14-7. Rename a Threshold Table.


Assignment with Expression Editor
Much like Global Variables, Global Threshold tables are commonly used with DataLinks to
display information. However, they also play an important part in object animations for
color and visibility. In both cases links are defined using the Expression Builder. The
Animations module will show this in more detail.

Globals SERVER.

Globals Threshold Object.

Server.Object. There is no need


for the property to be specified.

Figure 14-8. Linking to a Global Threshold table with the Expression Editor.

GFS-154B GE Fanuc Automation Americas Training Services 14 - 7


Understanding Global Objects

Global Key Macros


Global Key Macros can be added from the System Tree right mouse menu, or from the Key
Macro Editor itself. These macros obey the same rules as normal key macros, but are
recognized anywhere in the Workspace at run-time, even if there are no pictures open.

Global Key Macro area.

Global document.

Figure 14-9. Global Key Macros.

When exiting the Key Macro Editor, the developer


is prompted to Save the User.FXG file. This can be
set to automatically save whenever there are
changes.
Note that the User Global icon in the System Tree
is altered to indicate there are Global Key Macros.

Figure 14-10. Global Key Macros - save.

14 - 8 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

Global Procedures and Forms


Global Procedures and Forms are an effective means of distributing functionality throughout
the Workspace without duplicating effort. Scripts are written once in the User VBA project
and, similarly, Forms are developed and deposited in the same project. Instead of recreating
these components in each document that requires them, the developer can call the
procedure or launch the form directly from the User Globals document. This will be covered
in more detail in the VBA module.

Figure 14-11. Global Navigation form.

Figure 14-12. Global Alarm Area form.

GFS-154B GE Fanuc Automation Americas Training Services 14 - 9


Understanding Global Objects

Lab Exercises
Lab Objectives: At the end of these exercises, the student will be able to:
y Create Global Variables to track current alarm area, chart groups and current and
previous picture names.
y Create Global Threshold tables for two state equipment and multi-state tanks. Also
create string thresholds for tank level descriptions.
y Create a Global Key Macro to control the Alarm Horn.
When you are finished with these exercises, answer the Summary Questions at the end of
the module.

Lab Exercise 1: Create Global Variables


Introduction
We are going to create Global Variables to assist with the management of navigation, as
well as alarm and trend display. These variables will be used in the Lab Exercises of
subsequent modules.

1. Ensure the Workspace is open and in Configure mode, and that at least one picture is
open.

2. Use the Toolbox Variable icon to create a new Global Variable to store the name of
the currently open process display. Name the variable varCurrentPicture

a. Define the Variable Type as String.


b. Make it a Global Variable.

14 - 10 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

3. Inspect the new variable in the System Tree by expanding the Globals folder and then
the User document.

4. Using the toolbox button, add three more Global Variables with the following properties:
Variable Name Data Type Variable Type
varPreviousPicture String Global
varChartGroup String Global
varAlarmArea String Global

5. When finished, right-click the User document and select Save. This will save all your
changes to the User.FXG document, whether they are variables, thresholds, key macros,
forms or scripts.

6. Inspect your collection of Global variables.

GFS-154B GE Fanuc Automation Americas Training Services 14 - 11


Understanding Global Objects

Lab Exercise 2: Create Global Thresholds


Introduction
We are going to create three Global Threshold tables to assist with the management of color
and text animations on a variety of process equipment. These Threshold tables will be used
in the Lab Exercises of subsequent modules.

1. Right-click the User document in the System Tree and select Create Threshold Table.
The Custom Lookup Table dialog will appear.

2. We will start with a very simple threshold table for animating the status of two-state
equipment. This table will convert integers into colors.
a. Source Property Type: Integer.
b. Objects Property Type: Color.
Since we are working with only two states we will use Exact Match. The color table will
simplify as a result.

3. Using the Delete Row button,


reduce the number of rows to two
(2). Double-click the cell of the first
row.

4. Set the Input to the Open State = 0.

14 - 12 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

5. Map the zero state to the color


red by double-clicking on the
color block and making the
appropriate color selection. Click
OK to close the Select Color
dialog. Click OK to close the New
Level dialog. The first row should
be properly configured now.
Whenever the value from a tag is
0, the color of an associated
animation will be Red (stopped).

6. Double-click the second row. Set


the Input to 1 and the color to
Green. Click OK twice to move on.

7. Your Custom Lookup Table should


resemble this one.

Red.

Green.

8. Click OK to close the dialog. Inspect the new Threshold


table in the System Tree. Note that the new Threshold
table is using a generic name. Press the F4 key to open
the Property Window. (Find and highlight the new
Threshold table if the Property Window focuses on
another object). The Property Window will display the
Threshold properties, including the Name. Change the
Name from Threshold to RedGreen. We will be using this
Threshold table to set animations for the status of valves,
motors, pumps and mixers.

GFS-154B GE Fanuc Automation Americas Training Services 14 - 13


Understanding Global Objects

9. Using the right-click menu, create another Threshold table. This one will be used to
assign color indication to tank levels. Since we are using analog values with our tank
levels, we will be using Float as the Source Property Type and Color as the Objects
Property Type. We will use a Range Comparison. Use the following figure and table as a
guide.

Low High Color


0.00 1.00 Red
1.00 2.50 Cyan
2.50 7.50 Blue
7.50 9.00 Cyan
9.00 10.00 Red

When finished, click OK to add


the Threshold to the Globals
document. Use the Property
Window to rename it
LevelColor.

10. Using the right-click menu, create another Threshold table. This one will be used to
assign text descriptions for the current tank levels. Since we are using analog values
with our tank levels, we will be using Float as the Source Property Type and String as
the Objects Property Type. We will use a Range Comparison. Use the following figure
and table as a guide.

Low High String


0.00 1.00 Level Very Low
1.00 2.50 Level Low
2.50 7.50 Level Normal
7.50 9.00 Level High
9.00 10.00 Level Very High

When finished, click OK to


add the Threshold to the
Globals document. Use the
Property Window to rename
it LevelString.

14 - 14 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

11. Inspect the Globals folder in the System Tree. It should resemble the figure below.
Right–click the User document and select Save.

GFS-154B GE Fanuc Automation Americas Training Services 14 - 15


Understanding Global Objects

Lab Exercise 3: Create a Global Key Macro.


Introduction
We are going to create a Global Key Macro to provide the operators with a keystroke
sequence to toggle the Alarm Horn for audible alarm signals.

1. Right-click the User document and select KeyMacros Æ Add.

2. The Key Macro Editor will open already set to add Key Macros
to the User Globals document. Set the Key Macro as such:
a. Key Combination: CTRL-H.
b. Action: Alarm Horn.

3. The Alarm Horn expert will appear. Select


Prompt for horn status in run mode. Click OK
to return to the Key Macro Editor. It should look
like the figure below…

14 - 16 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

4. Click OK and close the Key Macro Editor. Save the User.FXG document on your way out.

5. Switch to Run mode and use the CTRL-H keystroke.


6. The Alarm Horn causes the PC to emit loud beeps when there are unacknowledged
alarms present. We have a lot of those, but as yet no way to acknowledge them. Feel
free to experiment with the Alarm Horn Prompt, but be aware that it can be LOUD and
annoying to others. Test it for a short period only before disabling it again.

7. Switch to configure mode.

-- End of Exercises --

GFS-154B GE Fanuc Automation Americas Training Services 14 - 17


Understanding Global Objects

Review Questions
1. Where are Global variables, Thresholds, Procedures, Forms and Key Macros stored?

2. How does a developer Save Globals?

3. What syntax is required for displaying data from Global Variables?

4. What are three data types that can be used in Global Threshold Tables?

5. How are key macros assigned to the User Globals area?

Electronic Books Research


6. What does the FactoryGlobals page contain?

14 - 18 GE Fanuc Automation Americas Training Services GFS-154B


Understanding Global Objects

Review
Now that you have completed this module, you should be able to:
y Define to Global Objects.
y Use Global Variables.
y Create Global Tables.
y Use Global Procedures.

GFS-154B GE Fanuc Automation Americas Training Services 14 - 19

You might also like