![]() |
Enterprise
RTView®
User Guide |
Global Functions and Variables It is possible to specify global functions and variables that will be available to objects in any display. Global functions and variables are defined in Global Definition files that are read by the Display Builder, Display Viewer, Display Server, Data Server and Historian. One instance of each global variable and function exists for each client in all deployments. Depending on how you will be using your function or variable, you may want to define them locally or in an include display file instead. Use a global function or variable when
Global functions are updated even if currently open displays do not use those results, therefore avoid defining functions globally unless the results are commonly required information. If you have a function that will only be used in a few displays, you may get better performance using a local or include file function. Use a local function or variable when
Use a function or variable from an include file when
To view global function or variable data, you must create a Global Definition file and then configure Application Options to read that file. Creating a Global Definition File
Creating a Reusable
Global Definition File To give an example, let us say that your production data is broken down by Plant, Units Completed and Units in Production. Instead of manually creating a function to sort each column in your table, you could create a single global function named Sort (in a Global Definition file named SortFunc.rtv) and reuse it as a template for the others. In the Application Options dialog, select the
Globals tab and separately add the following files and corresponding
substitutions: You can also include variables in your Reusable Global Definition file. If the SortFunc.rtv file in the example above had a Public local variable named $fname, the $fname variable would show up in your Variable dialogs three times: $fname.completed, $fname.inProd, and $fname.plant. NOTE: In this example we created a function named
getSortCol that is intended to be used only as an input to the
Sort.$fname function and should not be defined as a global function. When
the function getSortCol was created the Public option was not
selected, which prevents the function from appearing in the Attach to Function
data dialog in any files except the global function definition file.
Adding a Global Definition File to
Application Options
Viewing Global Data
|
|
|
|
|
|
|
|