T306-04 Calculations - RevE
T306-04 Calculations - RevE
Chapter 4 Calculations
TABLE OF CONTENTS
Chapter 4 - 1
T306-04 Calculations - RevE.doc
4.1.1 Objectives
On completion of this chapter you will be able to:
Create and configure Calculations
Schedule Calculations
4.1.2 Legend
> Indicates when you go from one menu to a sub-menu
Italic Indicates object and file names
“ “ Indicates dialog box buttons, tabs, menus etc.
Bold Indicates important topics
Indicates start/explanation of student activity
Chapter 4 - 2
System 800xA Training
4.2 Overview
Calculations Services is used to configure and schedule calculations that are applied to
real-time database objects, including both softpoints and actual process points.
Calculations may also be applied to object types allowing the calculation to be re-used
each time a new object is instantiated from the object type. Calculations also have the
ability to update/insert a historically stored value into a numeric log.
Calculations can be triggered by changes to the inputs, or be scheduled to execute
cyclically or at a given date and time. A calculation aspect may be applied to any
aspect object such as a unit, vessel, pump, or softpoint. Inputs can be any aspect object
property, and outputs can be any writable point in the system. Input/output definitions
can be made relative to the object for which the calculation is defined. Data quality
and alarm generation are supported. Calculation logic is written in VBScript. The
ability to write a timestamp to a softpoint or a log is provided to align calculations
along with the inputs so they have the same timestamp for retrieval. Administrative
rights are required to add, configure, or modify calculations.
Input No. 1
Input No. 2
Calculation Output No. 1
Input No. 4
Input No. 4
Chapter 4 - 3
T306-04 Calculations - RevE.doc
The following calculation example finds the average value for up to four input
variables and writes the average to the output.
Chapter 4 - 4
System 800xA Training
O
I U
N T
Scripting
P P
U U
T T
S S
Standard Libraries
Data Transformation
to Non ABB data
Custom Libraries destination
(3rd party systems)
Chapter 4 - 5
T306-04 Calculations - RevE.doc
In this example, the Calculations are created as aspects of objects in the Control
Structure.
The user interface for Calculations Services is comprised of aspect views that are
accessed via the Plant Explorer. The following aspect views are provided:
Special Configuration for configuration of global parameters on the
Configuration Server level. In the Service Structure, The “Special
Configuration” tab on the Service Provider Definition aspect, supports
configuration of OPC update rate, scan rate for cyclic schedules, and cyclic offset
to stagger the start of cyclically scheduled calculations
Chapter 4 - 6
System 800xA Training
Chapter 4 - 7
T306-04 Calculations - RevE.doc
Chapter 4 - 8
System 800xA Training
Chapter 4 - 9
T306-04 Calculations - RevE.doc
In the Object Type Structure, A calculation added to an object type can be reused
each time an object is created from the object type. To do this, specify that the
calculation be copied when a new object is created.
Chapter 4 - 10
System 800xA Training
Use the <object name> type definition aspect and check “copy to all instances” option
for the new calculation aspect. This aspect will be added in all new instances
Chapter 4 - 11
T306-04 Calculations - RevE.doc
In the Edit window you can write the VB code. “If” statement example
Chapter 4 - 12
System 800xA Training
Variable Grid
The variable grid, is used to map calculation input and output variables to their
respective OPC tags. In addition to specifying the OPC data points for the variables,
use this map to specify:
Whether to use the online data point value or a configured offline value.
Whether to trigger the execution of the calculation when an input variable
changes.
Do not use analog variables to trigger the execution of a calculation.
The Variable grid consists of the following:
Chapter 4 - 13
T306-04 Calculations - RevE.doc
Writing VB Script
Calculation logic is written in VBScript. Use the edit window in the middle part of the
Calculation Editor to write the VBScript. Any capabilities within VBScript or COM
technologies can be used to manipulate data. External functions and libraries may also
be used. “If” statement example
Chapter 4 - 14
System 800xA Training
4.3.3 Toolbar
The tool bar provides access to Calculation Editor Functions
NOTE! The Calculation Editor View does not prompt the user
when exiting and changes are pending. Use Save button
before leaving the display or pin the aspect.
Notes Icon
Saving changes completely replaces the original calculation. To preserve the original,
make a second copy to edit
Run Calculation on the client (offline). The calculation must be saved before it is run.
Chapter 4 - 15
T306-04 Calculations - RevE.doc
4.3.4 Debugging
Tracing may be enabled when the Update Status is set to True. When tracing is
enabled, trace statements in the VBScript are processed, and the results are displayed
in the trace window. Enable or disable tracing via the editor’s context menu, or
programmatically within the VBScript.
The trace can be fine tuned by keying on one or more specific variables. The syntax is:
debug.trace <argument>. Use any argument that VBScript can convert to a string,
for example: debug.trace input1.quality. An error occurs when using an argument
which cannot be converted to a string. The example below shows how to enter a text
string in the trace window, and then append a variable property. The text string must
be entered in double quotation marks, and the variable.property specification must use
the & prefix to append it to the text string.
Chapter 4 - 16
System 800xA Training
Chapter 4 - 17
T306-04 Calculations - RevE.doc
Chapter 4 - 18
System 800xA Training
Use the Calculation Status Viewer to select the group of calculations to be modified
Chapter 4 - 19
T306-04 Calculations - RevE.doc
Select the Master Calculation (C3) and choose the property to be cloned (Tracing
Enabled).
Chapter 4 - 20
System 800xA Training
Chapter 4 - 21
T306-04 Calculations - RevE.doc
Chapter 4 - 22