Custom Algorithm Block
Custom Algorithm Block
While this information is presented in good faith and believed to be accurate, Honeywell disclaims
the implied warranties of merchantability and fitness for a particular purpose and makes no express
warranties except as may be stated in its written agreement with and for its customers.
In no event is Honeywell liable to anyone for any indirect, special or consequential damages. The
information and specifications in this document are subject to change without notice.
Honeywell International
Process Solutions
2500 West Union Hills Drive
Phoenix, AZ 85027
1-800 343-0228
ii Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
About this document
This document describes how to plan, develop, debug, deploy, and troubleshoot Custom
Algorithm Blocks and Custom Data Blocks.
Release information
Document name Document ID Release Publication
number date
Custom Algorithm Block and Custom Data Block EX25-210 210 10/04
User's Guide - EX25
References
The following list identifies all documents that may be sources of reference for material discussed
in this publication.
Document title
iii Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contacts
Contacts
World Wide Web
The following Honeywell web sites may be of interest to Industry Solution customers.
Corporate http://www.honeywell.com
International http://content.honeywell.com/global/
Telephone
Contact us by telephone at the numbers listed below.
iv Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Symbol definitions
Symbol definitions
The following table lists those symbols used in this document to denote certain conditions.
Symbol Definition
R210 Custom Algorithm Block and Custom Data Block User's Guide v
10/04 Honeywell
6 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
INTRODUCTION ...................................................................................23
Overview ................................................................................................................... 23
Abstract ................................................................................................................................23
Who should use this guide ...................................................................................................23
Terms and acronyms ...........................................................................................................23
Prerequisite knowledge ........................................................................................................23
What are Custom Algorithm Blocks? .................................................................... 24
Overview ..............................................................................................................................24
CAB creation ........................................................................................................................24
CAB functionality..................................................................................................................24
What is a Custom Data Block? ............................................................................... 25
Overview ..............................................................................................................................25
Creating a CDB ....................................................................................................................25
Getting started tutorial ............................................................................................ 26
Overview of the tutorial ........................................................................................................26
System requirements ...........................................................................................................26
Description of the tutorial example .......................................................................................27
Create a CAB type ...............................................................................................................28
Instantiate the CAB type in a control strategy ......................................................................36
Create a CDB type ...............................................................................................................46
Instantiate the CDB type ......................................................................................................49
Additional examples .............................................................................................................54
7 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
8 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
CAB CONFIGURATION......................................................................109
Create a new CAB type.......................................................................................... 109
CAB development environment overview...........................................................................109
Layout of the development environment ............................................................................109
Honeywell additions to MSVS ............................................................................................112
Honeywell files ...................................................................................................................112
MSVS .NET 2003 resources ..............................................................................................112
R210 Custom Algorithm Block and Custom Data Block User's Guide 9
10/04 Honeywell
Contents
10 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
R210 Custom Algorithm Block and Custom Data Block User's Guide 11
10/04 Honeywell
Contents
12 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
R210 Custom Algorithm Block and Custom Data Block User's Guide 13
10/04 Honeywell
Contents
14 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
Overview ............................................................................................................................286
Where to find information ...................................................................................................287
Main tab of a CAB block property form ..............................................................................287
Main tab of a CDB block property form ..............................................................................288
Value CDPs tab for CAB and CDB.....................................................................................288
Parameter References tab .................................................................................................289
Source tab..........................................................................................................................289
Alarms tab ..........................................................................................................................291
R210 Custom Algorithm Block and Custom Data Block User's Guide 15
10/04 Honeywell
Contents
16 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
WriteStatus.........................................................................................................................363
Parameter reference list class............................................................................................364
CABMath class...................................................................................................................367
Examples of CABMath functions usage .............................................................................372
FDP classes .......................................................................................................................372
Base class..........................................................................................................................373
Predefined CDP variables ..................................................................................................373
Predefined parameter reference variables .........................................................................373
Predefined parameter reference list ...................................................................................373
Predefined FDPs and subroutines .....................................................................................374
Fixed definition parameter PROGSTSDESC .....................................................................374
Fixed definition parameter CABCOMMAND.......................................................................376
Fixed definition parameter CABSTATE ..............................................................................376
Restricted FDP PERIOD ....................................................................................................377
Restricted FDP PROCSPECEXEC ....................................................................................377
Subroutine Send() ..............................................................................................................378
Subroutine Abort()..............................................................................................................379
Property Restart()...............................................................................................................380
APIs supplied from VB.NET to CAB..................................................................... 381
Some constructs of interest................................................................................................381
Private and public access types In CAB programs.............................................................381
R210 Custom Algorithm Block and Custom Data Block User's Guide 17
10/04 Honeywell
Contents
Tables
Table 1 Relationship of subsystems that support CAB and CDB ..................................57
Table 2 Platform support for block types .......................................................................60
Table 3 Custom Algorithm Blocks in build-time environment ........................................65
Table 4 Custom Algorithm Blocks in run-time environment ...........................................66
Table 5 Agents supporting CABs in build-time and run-time environments ..................67
Table 6 Custom Data Blocks in build-time and run-time environments .........................75
Table 7 Agents supporting CDBs in build-time and run-time environments ..................76
Table 8 Comparisons of Experion and TPS architectures .............................................79
Table 9 Configuration limits for CAB types and instances .............................................85
Table 10 Configuration limits for CDB types and instances...........................................86
Table 11 Memory requirements for small, medium, and large CABs ............................87
Table 12 ACE memory usages after two years for medium-sized CABs ......................89
Table 13 Build Commands...........................................................................................114
Table 14 Types of saves for CAB ................................................................................116
Table 15 PDE Information links for Value CDPs..........................................................122
Table 16 Access levels in Experion .............................................................................124
Table 17 Access locks for CDPs..................................................................................125
Table 18 PDE information link for FDPs ......................................................................126
Table 19 PDE Information link for PRefs .....................................................................127
Table 20 PDE information link for symbol attributes ....................................................129
Table 21 PDE information link for form layout .............................................................129
Table 22 Summary of FDPs common with native blocks.............................................131
Table 23 Summary of CAB FDPs not common with native blocks ..............................132
Table 24 Configuration limits for CAB types and instances .........................................138
Table 25 Data types for CDPs and parameter references...........................................146
Table 26 Data type names in Experion and VB.NET...................................................150
Table 27 Custom Data Parameter initialization in Custom Algorithm Blocks ..............152
Table 28 Integrity considerations for read versus write ...............................................159
Table 29 Implicit data type conversion for PRef reads (part 1)....................................165
Table 30 Implicit data type conversion for PRef reads (part 2)....................................166
Table 31 Implicit data type conversion for PRef writes (part 1) ...................................167
Table 32 Implicit data type conversion for PRef writes (part 2) ...................................168
Table 33 Fail-safe values .............................................................................................169
Table 34 Insertion points for RegCtl points..................................................................176
Table 35 Insertion points for Data ACQ point ..............................................................177
Table 36 Insertion point configuration procedure.........................................................177
Table 37 Converting CAB instances ............................................................................187
Table 38 Verify CAB instance version .........................................................................188
Table 39 Types of saves for CDB ................................................................................197
Table 40 PDE information links for Value CDPs..........................................................200
Table 41 Access levels in Experion .............................................................................203
18 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
R210 Custom Algorithm Block and Custom Data Block User's Guide 19
10/04 Honeywell
Contents
Figures
Figure 1 Block types, block instances, and block templates..........................................62
Figure 2 The MSVS development environment for CAB .............................................110
Figure 3 Source code window......................................................................................110
Figure 4 Source code tab with GUID ...........................................................................112
Figure 5 Specify Library and CAB Names ...................................................................113
Figure 6 CAB Type Locking Flags ...............................................................................117
Figure 7 Value CDPs Tab ............................................................................................121
Figure 8 Value CDPs configuration form .....................................................................122
Figure 9 Fixed (FDP) tab..............................................................................................126
Figure 10 FDP configuration form ................................................................................126
Figure 11 Parameter references tab ............................................................................126
Figure 12 Parameter references configuration form ....................................................127
Figure 13 Parameter reference assignment ................................................................128
Figure 14 Access cut, copy, and paste options ...........................................................130
Figure 15 Value CDPs tab with descriptions showing .................................................172
Figure 16 Value CDPs tab with parameters showing ..................................................172
Figure 17 Parameter References tab...........................................................................174
Figure 18 Parameter Reference tab configured...........................................................175
Figure 19 Saving modified CAB types .........................................................................185
Figure 20 Specify library and CDB name.....................................................................196
Figure 21 The Parameter Definition Editor ..................................................................197
Figure 22 Value CDPs tab ...........................................................................................200
Figure 23 Value CDPs configuration form ...................................................................200
Figure 24 Access cut, copy, and paste options ...........................................................207
Figure 25 Value CDPs tab with descriptions showing .................................................210
Figure 26 Value CDPs tab with parameters showing ..................................................210
20 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Contents
R210 Custom Algorithm Block and Custom Data Block User's Guide 21
10/04 Honeywell
Contents
22 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Overview
Abstract
This document provides information on how you define, configure, deploy, and
troubleshoot Custom Algorithm Block (CAB) and Custom Data Block (CDB) control
blocks.
Prerequisite knowledge
• You should be familiar with the basic principles of control systems.
• You should be familiar with the architecture and functionality of Experion Process
Knowledge System (PKS).
• You should have a good working knowledge of Experion Control Builder.
• If you will be developing control algorithms for Custom Algorithm Blocks, you will
need to be adept at using the Microsoft Visual Basic .NET programming language.
23 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
What are Custom Algorithm Blocks?
CAB creation
CABs are created within CB. You must purchase a CAB Developer license from
Honeywell in order to activate the CAB development features. These features include
Microsoft Visual Studio .NET 2003, which is combined with the Parameter Definition
Editor to provide the project development environment that is used to develop CAB types
and that allows implementation of custom parameters and algorithms.
The process of creating a CAB type requires fluency with a programming language
(VB.NET in the current release).
CAB functionality
With CAB Developer, you can define the block type itself, including the custom data
parameters, parameter references, and the control algorithm. With ACE R210 and later,
you can create instances of your custom block types. You can also create block
templates, which are an optional intermediate construct in between the type and the
instance. Templates might be useful to you in certain situations. Templates are covered in
the section “Role of block types, instances, and templates.”
A control strategy can include combinations of native blocks and custom blocks.
REFERENCE - INTERNAL
For more information on CAB functionality, refer to “CAB functional overview.”
24 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
What is a Custom Data Block?
Creating a CDB
CDBs are created in CB. You do not need a license—CDB is a standard feature. You do
not require skill with VB.NET, as CDB does not support an algorithm.
REFERENCE - INTERNAL
For more information on CDB functionality, refer to “CDB functional overview.”
R210 Custom Algorithm Block and Custom Data Block User's Guide 25
10/04 Honeywell
Introduction
Getting started tutorial
System requirements
Depending on your familiarity with the subject and your needs, you can skip the tutorial,
read it, or follow the steps and build the examples on your system. If you choose to build
the example, you should have an Experion system that includes a Server, a Station with
Control Builder (with CAB Developer support), and an Application Control Environment
(ACE) node. The ACE node must have a CEE configured. I/O is not required, as the
examples do not perform I/O. The tutorial assumes that ACE/CEE have already been
activated.
26 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
ATTENTION
Control Builder familiarity is assumed.
The tutorial consists of a CAB example and a CDB example. In the CAB example, you
will perform the following tasks:
• Create a custom library called CABLIB and create a CAB type called CABDEMO in
the library.
• Configure a custom parameter called FLOW and write a simple, one-line VB.NET
program that adds a constant to the value of FLOW.
• Build and save the project.
• Create a new Control Module (CM) and create instances of your CAB and a
NUMERIC function block in the CM.
• Wire the output of the CAB to the input of the NUMERIC function block, and wire
the output of the NUMERIC to the input of the CAB, forming a simple loop.
• Load the CM to the CEE and activate it.
• Monitor execution of the strategy and observe the value of FLOW increasing.
In the CDB example, you will perform the following steps:
• Create a custom library called CDBLIB and create a CDB type called CDBDEMO in
the library.
• Configure Custom Data Parameters of various types.
• Save the type to the ERDB.
• Create a new CM and create an instance of your CDB in the CM.
• Load the CM to the CEE and activate it.
R210 Custom Algorithm Block and Custom Data Block User's Guide 27
10/04 Honeywell
Introduction
Getting started tutorial
28 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
1 Open Control Builder with the two tree views open, upper displaying the
project view and lower displaying the library view.
R210 Custom Algorithm Block and Custom Data Block User's Guide 29
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
2 Create a new CAB type by choosing File > New > Type > Custom Algorithm
Block.
3 Enter CABLIB as the new Custom Library Name and enter CABDEMO as the
name of the new CAB type.
Click OK.
30 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
4 The CAB Development Environment opens. The Custom Algorithm Block
splash screen appears briefly.
R210 Custom Algorithm Block and Custom Data Block User's Guide 31
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
5 The Parameter Definition Editor (PDE) opens with the Value CDPs tab
exposed. This is where custom data parameters (value CDPs) are defined.
Enter the following data as shown.
32 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
7 Click the CABlock.vb* tab to expose the VB source code window. Note that
several lines of code already exist. Add your line of code after the comment
line that begins “TODO:…” as shown. Note that Microsoft IntelliSense provides
dropdown lists to assist you as you code. Your line of code is:
Me.FLOW.Value += 3.1
8 Click the Build Solution button to compile and link your code.
R210 Custom Algorithm Block and Custom Data Block User's Guide 33
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
9 Verify that there were no errors.
10 Click the indicated button to save the CAB type to the ERDB.
11 Click the “X” in the upper right corner to close the Microsoft Development
Environment window.
34 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
12 The Custom Library and CAB appear in the CB Library window.
R210 Custom Algorithm Block and Custom Data Block User's Guide 35
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
1 In CB, select the Project view and create a new Control Module by choosing:
File > New > Control Module.
36 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
2 From the Library tree view, drag and drop your CAB type (CABDEMO) and a
NUMERIC (under UTILITY) function block into the Project chart.
This process creates an instance of your CAB type and an instance of the
NUMERIC type.
3 Double-click on your CAB instance to bring up its properties form. Click on the
Value CDPs tab and your custom parameter will be displayed. If you had
other custom parameters, they would be displayed in a list.
R210 Custom Algorithm Block and Custom Data Block User's Guide 37
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
4 Select the Block Pins tab. In the Parameters list, select FLOW, your custom
parameter.
5 Using the CB pin addition functionality, add an input pin on the left side of the
CAB and an output pin on the bottom of the CAB. Adding the input pin is
illustrated below.
38 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
6 The completed block is shown below.
Change the Actual Value from NaN to 2.2 and click OK.
R210 Custom Algorithm Block and Custom Data Block User's Guide 39
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
8 Select the Block Pins tab. In the same manner as Steps 4-6 above, select the
PV parameter, and add an input pin to the left side of the block. When you
have finished and closed the NUMERIC property form, the CM Project chart
appears as shown below.
40 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
9 Click the Wire tool button shown below.
Click once on the NUMERIC PV input pin and then click again on the CAB
FLOW output pin, wiring them together. See the illustration below.
10 In the same manner, wire the PV output pin of the NUMERIC to the FLOW
input pin of the CAB. The result appears as follows:
R210 Custom Algorithm Block and Custom Data Block User's Guide 41
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
11 Click the “X” button in the upper right corner of the Project chart to close the
window. Click Yes when asked if you want to save changes to the Project.
Select your Control Module. It will be under the Unassigned node in the
Project tree view.
42 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
13 Click the Assign button on the CB toolbar.
14 When the Assignment screen appears, be sure that your new CM is selected
in the Available Modules list and that the ACE CEE that you want to load it to
is selected in the Assign To list, and then click Assign.
R210 Custom Algorithm Block and Custom Data Block User's Guide 43
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
15 Click Close. Your CM now appears under the CEE node in the Project tree.
.
16 Click the Load button to load the CM.
44 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
18 Double-click the CM to open the chart window.
R210 Custom Algorithm Block and Custom Data Block User's Guide 45
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
1 Open Control Builder with the two tree views open, upper displaying the
Project view and lower displaying the Library view.
46 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
2 Create a new CDB type by choosing File > New > Type > Custom Data
Block.
3 Enter CDBLIB as the new Custom Library Name and enter CDBDEMO as the
name of the new CDB type.
Click OK.
R210 Custom Algorithm Block and Custom Data Block User's Guide 47
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
4 Enter the values as shown in the figure below. These values are also listed in
Table 55 Value CDP definitions in POSTEMPCDB, which may be easier to
read.
5 Click the “X” in the right upper corner to close the PDE.
6 The Custom Library and CDB type appear in the CB Library window.
48 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
1 In CB, select the project view and create a new Control Module by choosing:
File > New > Control Module.
R210 Custom Algorithm Block and Custom Data Block User's Guide 49
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
2 From the Library tree view, drag and drop your CDB type (CDBDEMO) into the
Project chart.
3 Double-click on the CDB instance to open its properties form. Select the Value
CDPs tab. Your custom data parameters will be displayed in a list.
50 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
5 Click the “X” button in the upper right corner of the Project chart to close the
window. Click Yes when prompted to save data.
Select the Control Module. It will be under the Unassigned node in the Project
tree.
R210 Custom Algorithm Block and Custom Data Block User's Guide 51
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
7 Click the Assign button on the CB toolbar.
8 When the Assignment screen appears, be sure that your new CM is selected
in the Available Modules list and the CEE that you want to assign it to is
selected in the Assign To list, and then click Assign.
52 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Introduction
Getting started tutorial
Step Action
9 Click Close. Your CM now appears under the CEE node in the Project tree.
11 Click the Monitor tab. Select the CDB in the tree view.
R210 Custom Algorithm Block and Custom Data Block User's Guide 53
10/04 Honeywell
Introduction
Getting started tutorial
Step Action
12 Choose Controller > Activate > Selected Item(s).
13 Click Yes to confirm. The CDB values are now available for other blocks and
can be viewed.
Additional examples
There are more advanced examples of CAB and CDB usage in the example scenarios
section of this guide.
54 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
Purpose, use, and value of the system
CAB overview
One of your options for implementing a control strategy is to use instances of “native”
blocks. These are block types that are built in, or predefined, in Experion Control Builder
(CB). You can “customize” these native blocks by values you assign to certain
configuration parameters, but you cannot alter the basic structure of the block—the data
elements and the control algorithm.
Creating control strategies this way is efficient, as it requires only the work of creating
instances, configuring parameter values, binding the instances to other blocks, to an
execution environment, and to I/O. Many control strategies can be implemented very
efficiently with these native blocks. In some cases, however, you might find that you
cannot easily solve a control problem using native block types. When these cases arise,
you can use CAB functionality to create a new custom block type with a custom
algorithm, custom data parameters, and parameter references.
The process of creating a CAB type requires an understanding of system capabilities and
tools beyond those used for block instance creation and editing. Not least of these is the
understanding of a programming language.
After a CAB type has been created and saved within the Experion ERDB, it has a look
and feel equivalent to that of a native block type. It shows up within the library view of
CB under the name of a user assigned library. It can be instantiated on the project side of
CB by dragging from the library view to a control module chart. Once instantiated, the
instances can be configured through a parameter driven properties form. They can be
assigned and loaded as components of their parent control module. They can be
monitored from the monitor side of CB.
The fully qualified name for a CAB type consists of the concatenation of the library
name with the block type name. This means that different CAB types can be given the
same name within different libraries.
User interaction to create CAB templates is analogous to that of native block types. Thus,
an engineer can start with a CAB type and make a template directly from it. CAB
parameters can be declared "template-defining" in the same fashion as native block
parameters.
55 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
Purpose, use, and value of the system
CDB overview
A CDB is a control block that stores data whose type and structure are defined by the
user. CDB types are similar to CAB types in that they allow the creation of a custom type
that can be instantiated multiple times. They differ in that while they support the
definition of custom data parameters, they do not support the definition of parameter
references and they do not support the definition of an algorithm.
CDB types are simpler to create than CAB types, as they are created in the PDE and do
not require programming tools or the use of MSVS. They appear within the CB in a
library view and are dragged into control modules to create instances.
In all other respects, CDBs are analogous to CABs. They support associated properties
forms and can be designed to support loadable configuration parameters. They can be
used to create templates. Once instantiated, CDBs are configured, assigned, loaded, and
monitored in a fashion completely analogous to that of CABs and native blocks.
As with CAB types, the fully qualified name for a CDB type consists of the
concatenation of the library name with the block type name. This means that different
CDB types can be given the same name within different libraries.
56 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
Purpose, use, and value of the system
• CAB has a certain amount of .NET overhead because of its capability to support an
algorithm, and you do not need the algorithm feature.
Relationships of subsystems
The following table indicates the relationships of the major subsystems that support CAB
and CDB. In this table, read a row from left to right. For example, "Microsoft Visual
Studio .NET presents data content of ERDB" and "Engineering Repository Database
hosts Block Type, Block Template, and Block Instance."
Table 1 Relationship of subsystems that support CAB and CDB
R210 Custom Algorithm Block and Custom Data Block User's Guide 57
10/04 Honeywell
CAB and CDB purpose
Purpose, use, and value of the system
Description of subsystems
The relevance of each subsystem is as follows.
• Engineering Repository Database—ERDB forms the persistent storage for all non-
run-time information related to blocks.
• Block Type—Native block types are formed from parameter definitions and
associated information. This is true for CAB and CDB types as well but the
definitions can be created and edited. The information that comprises the full
definition of a block type is somewhat distributed, with parts residing in both the
build-time and run-time environments. Within the user view, an abstraction is
presented that makes block types appear as a unified entity.
• Block Instance—Block instances are data sets. In the build environment (held by
ERDB), instances consist largely of configuration data. In the run-time environment
(held by CEE), they consist of both configuration and run-time data. Block instances
always rely on an associated block type. Block instances, like block types, are
presented to users as an abstraction that unifies the distributed parts that make up the
complete entity.
• Block Template—Block templates are data sets holding configuration data. They
are used to reduce engineering effort in the maintenance of block instances and have
similarities to both block types and block instances. Block templates exist only in the
build-time environment. Like block instances, block templates always rely on an
associated block type. Templates are supported for CAB and CDB types as well as
standard block types.
• CEE—CEE is the repository for most information of the run-time environment. This
includes both instance information and type information. For native blocks, CEE
holds the type information in an unchangeable form. For CDBs and CABs, both
instance and type information are loadable. For CABs, the type information includes
both parameter definitions and algorithm (program) definition. Block templates play
no role within CEE.
58 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
Purpose, use, and value of the system
• MS Visual Studio .Net 2003—CAB types are edited with MS Visual Studio .Net
2003. This applies to both the parameter definitions of the block and the algorithm.
• Experion Server—The Experion PKS Server plays a vital role in presenting blocks
within the operational view. It holds large portions of run-time data including alarm
and history databases. It also uses system communication services to transport run-
time data from CEE block instances to operator displays. CB provides block
definition information to Experion PKS Server to enable display of operational
information.
• Experion Station—The Experion Station presents the final operator view of run-
time data. This includes alarm summary display, event journal display, detailed
displays, group display, and graphical displays. Experion Station relies on
communication with Experion Server, and, in some cases, with CEE to access run-
time data.
Within Experion Station and Experion Server, blocks are treated equivalently,
regardless of whether they are native blocks, CABs, or CDBs.
This guide does not give particular attention to CABs and CDBs within Station and
Server, as their behavior is equivalent to that of native blocks.
R210 Custom Algorithm Block and Custom Data Block User's Guide 59
10/04 Honeywell
CAB and CDB purpose
Purpose, use, and value of the system
C200 Yes No No
SCE-C200 Yes No No
Note 1— The first release of SIM-ACE supports most CAB functionality. However, this
excludes bulk data access for dynamic simulation data. Dynamic simulation data is used
for freeze, backup, and replay in dynamic simulation applications.
60 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
Purpose, use, and value of the system
R210 Custom Algorithm Block and Custom Data Block User's Guide 61
10/04 Honeywell
CAB and CDB purpose
Purpose, use, and value of the system
must change, the change can be introduced at the parent template and automatically
propagated to the off-process child instances within the project side of the ERDB.
To clarify the distinction between block types, block instances, and block templates, refer
to the figure below.
Figure 1 Block types, block instances, and block templates
In the diagram, a single type is shown called "Type." Type has instances and templates
that descend from it. The direct descendants are Instance 1 and Template 1. Instance 2
and Instance 3 are indirect descendants of Type through Template 1. In general, it is
possible to have no templates between an instance and its type or to have multiple
templates between an instance and its type. To further illustrate consider the following
examples.
In this example, FC101.PID1 is analogous to Instance 1 with PID in the role of Type.
62 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
Purpose, use, and value of the system
• Template Creation From Type—Later, the engineer decides that something similar
to FC101 would serve as a good starting point for other flow controllers. The
engineer creates a template CM and gives it the name "FC." The engineer inserts a
PID into FC and calls it "PID1." The engineer assigns some of the parameters of
FC.PID1 to be "template defining."
• Instance Creation From Template—Later still, the engineer decides to create some
new flow controller instances. To save work, the engineer doesn't start from the types,
CM and PID. Instead, the engineer starts from the template, FC. The engineer creates
an instance of FC called FC102. By so doing, the engineer implicitly creates the
instance FC102.PID1. The engineer also creates an instance of FC called FC103. By
so doing, the engineer implicitly creates the block instance FC103.PID1. FC102 and
FC103 acquire their structure from the parent template FC. FC102.PID1 and
FC103.PID1 acquire template-defining data from the parent template from FC.PID1.
R210 Custom Algorithm Block and Custom Data Block User's Guide 63
10/04 Honeywell
CAB and CDB purpose
CAB functional overview
64 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
CAB functional overview
Opens MSVS
Microsoft Visual Studio Hosts PDE Window and Source Code Window
.NET (MSVS)
Presents data contents of ERDB
CAB Properties Form Edits data of CAB Instance – Project and CAB
Instance – Monitor
R210 Custom Algorithm Block and Custom Data Block User's Guide 65
10/04 Honeywell
CAB and CDB purpose
CAB functional overview
Control Module Chart – Shows symbol and data of CAB Instance - Monitor
Monitor
Shows Control Module - EE
66 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
CAB functional overview
Engineering Build-time Provides persistent storage for all block types and
Repository DB block instances.
Control Builder Build-time and Central agent that manages view and edit of block
run-time instances.
R210 Custom Algorithm Block and Custom Data Block User's Guide 67
10/04 Honeywell
CAB and CDB purpose
CAB functional overview
Source code Build-time Edit window through which Control Engineer (CE)
window creates and edits the source code program that is the
CAB algorithm.
Development folder Build-time Cache area used to hold block type definitions during
edit sessions.
CAB Type Build-time and Logical union of the parameters and algorithm that
run-time define the CAB.
68 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
CAB functional overview
Library Tree Build-time View hosted by CB that shows libraries and the block
type they hold.
Project Tree Build-time View hosted by CB that shows block instances held
on the project side of ERDB.
R210 Custom Algorithm Block and Custom Data Block User's Guide 69
10/04 Honeywell
CAB and CDB purpose
CAB functional overview
Monitor Tree Build-time and View hosted by CB that shows block instances held
run-time on the monitor side of ERDB.
CAB Properties Build-time and One of the chief displays used to view and
Form run-time manipulates CAB data.
70 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
CAB functional overview
CEE Block Run-time Form showing data associated with the CEE as a
Properties Form whole.
CAB Library Run-time CAB Types Info tab on CEE Block Properties Form
Directory Form that shows CAB instances loaded to a CEE.
ACE platform Run-time Platform that hosts CEEs capable of supporting CABs.
R210 Custom Algorithm Block and Custom Data Block User's Guide 71
10/04 Honeywell
CAB and CDB purpose
CAB functional overview
72 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
CAB functional overview
of the block. Since block scope variables are visible only within the CAB program,
their use is a matter private to the CE who creates the CAB type. For more
information on block scope variables, see the section “Define block scope variables.”
• Local variables—These variables are declared within the Execute() subroutine that
is included in the skeleton code framework supplied by Honeywell. The Execute()
subroutine is where you insert your custom algorithm code. Values of local variables
are not persistent from one block execution to the next. For more information on
Local Variables, see the section “Define local variables.”
R210 Custom Algorithm Block and Custom Data Block User's Guide 73
10/04 Honeywell
CAB and CDB purpose
CDB functional overview
74 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
CDB functional overview
CDB Properties Form Edits data of CDB Instance – Project and CDB
Instance – Monitor
R210 Custom Algorithm Block and Custom Data Block User's Guide 75
10/04 Honeywell
CAB and CDB purpose
CDB functional overview
System agents relevant to CDBs are generally a subset of those relevant to CABs. Agents
common to the two categories generally have the same meaning and usage in each case.
However, there are some differences that are highlighted in the table below.
Table 7 Agents supporting CDBs in build-time and run-time environments
Agent Description
Control Builder CB hosts all services for creation and edit of CDB types.
Control Builder plays largely the same role for CDBs that it does for
CABs. One difference is that MSVS plays no role in the creation
and edit of CDB types. Thus, Control Builder does not open MSVS
in order to start edit sessions for CDB types.
Parameter For CDB types, the Parameter Definition Editor window is hosted
Definition Editor directly within Control Builder.
Window
For CAB types there is an advantage to hosting the Parameter
Definition Editor window within MSVS. This allows an integrated
application to be the seat of both the data complement and
algorithm complement that make up a CAB type. Since there is no
algorithm in CDB types, it is most natural for the CE to edit the type
in the same application where the CE edits the instance.
Custom Library CDB Types are grouped by custom libraries in the same fashion as
CAB types.
CDB Instance - As with CABs, CDB instances are held on the project side of the
Project ERDB when they are being created or edited.
CDB Instance – CDB Instances are held on the monitor side of the ERDB after they
Monitor have been loaded and reside in an EE.
76 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB purpose
CDB functional overview
Agent Description
CDB Properties As with CABs, there is a CDB properties form that is defined by the
Form CDB type.
This form can be used to edit the project side instance or the
monitor side instance. It can be used to view CDB type data in the
Library. It can be used to display view-only parameters as well as
configuration parameters. It can be viewed from within CB or from
within Station displays via Experion chart visualization.
CDB Instance – CDB instances within an EE form the repositories for actual run-
EE time data.
CDB Library CDB Types Info tab on CEE Block Properties Form that shows
Directory Form CDB instances loaded to a CEE.
The forms displays (1) the label “Instantiated CDB Types” followed
by the number of CDB types that have a least one instantiation, (2)
the label “Max Instantiated CDB Types” followed by the maximum
number of CDB types that can be instantiated at any one time, and
(3) a grid box showing the friendly name of each instantiated CDB
type and the number of instances of each instantiated type.
R210 Custom Algorithm Block and Custom Data Block User's Guide 77
10/04 Honeywell
CAB and CDB purpose
CDB functional overview
78 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system planning and design
System architecture
Control Builder (CB) DEB or TPS Builder Tools for building control
strategies.
Custom Data Block (CDB) Custom Data Segments Provides custom data
(CDS) storage.
R210 Custom Algorithm Block and Custom Data Block User's Guide 79
10/04 Honeywell
CAB and CDB system planning and design
System architecture
System requirements
• Minimum CAB Developer Requirements—The CAB product requires the
following to allow users to develop CABs:
− Control Builder
− Experion Server
− CAB Developer license and components
− Microsoft's Visual Studio .Net 2003 (included within the CAB-Developer
package)
• Highly Recommended—SIM-ACE node for off-process CAB debug in conjunction
with MSVS debugger (see “Off-process debugging”)
• Minimum CAB User Requirements—The CAB product requires the following to
allow a CAB to be loaded to an ACE CEE and executed within an ACE CEE:
− Control Builder
− ACE (hardware and software with latest ACE CEE version that supports the
CDB and CAB function)
− Experion Server
− CAB runtime components (included with the ACE Base licensing)
• Minimum TPS Interoperability Requirements
− The most current TPN Release (currently R65x)
− Control Builder
− ACE (with latest ACE CEE version that supports the CAB and CDB function)
− Experion Server
− CAB runtime components (included with the ACE Base licensing)
80 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system planning and design
System architecture
R210 Custom Algorithm Block and Custom Data Block User's Guide 81
10/04 Honeywell
CAB and CDB system planning and design
Computers and network infrastructure
ATTENTION
ACE hardware must have at least two gigabytes of memory.
CBs that have the integrated MSVS application open for CAB development cannot
exceed the number of licenses.
R210 Custom Algorithm Block and Custom Data Block User's Guide 83
10/04 Honeywell
CAB and CDB system planning and design
Computers and network infrastructure
• CDB Run Time—For the run-time environment, CDBs require the following
software or firmware
− Experion ACE—ACE includes enablers for the load and execution of CDB
types and CDB instances. CDBs are not a separately licensable option, and
therefore run-time enablers are included with every ACE.
− Microsoft Windows OS— For specific OS requirements, refer to the SCN
and/or Spec and Tech that is applicable to the release.
TIP
Refer to “Resource management” in this guide for methods of monitoring CPU
utilization.
84 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system planning and design
Computers and network infrastructure
Total CAB 1000 2000 This limit is enforced. CAB infrastructure (ACE
instances loader) prevents the total number of CAB
across all instances from exceeding 2000.
types
Notes:
1. An instantiated CAB type is one that has one or more instances defined against it within
the CEE.
2. This policy allows users to trade off available memory so that the instance count for
specific types can go somewhat in excess of 100.
3. You can have 400 CAB instantiated types and 400 CDB instantiated types. These limits
are independent of each other and these limits are both enforced.
R210 Custom Algorithm Block and Custom Data Block User's Guide 85
10/04 Honeywell
CAB and CDB system planning and design
Computers and network infrastructure
Notes:
1. An instantiated CDB type is one that has one or more instances defined against it within
the CEE.
2. You can have 400 CAB instantiated types and 400 CDB instantiated types. These limits
are independent of each other and these limits are both enforced.
86 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system planning and design
Computers and network infrastructure
CEE Memory Pool: This memory is a part of the CEE executable, and is managed
by the CEE. The size of this memory in current CEEs is 32MB.
Small 20 1 10 73 31
Medium 100 15 50 74 61
CAB type memory comes from unrecoverable OS memory. We will discuss the use of
unrecoverable OS memory in the topic “Determine ACE shutdown horizon.” From the
table above, we can see that CAB type memory size does not vary dramatically between
small and large CAB types. Much of the size of a CAB type is taken up by the built-in
CAB functionality, rather than the user-developed code or parameter definitions.
R210 Custom Algorithm Block and Custom Data Block User's Guide 87
10/04 Honeywell
CAB and CDB system planning and design
Computers and network infrastructure
CAB instance memory comes from recoverable OS memory. From the table, we can see
that the CAB instance memory size is tied to both the number of lines of code, and the
number of parameters.
In addition to the OS memory, each CAB instance also consumes about 3KB of
recoverable CEE memory pool memory. The exact size of this consumed memory is
variable, but is usually close enough to 3KB that 3KB is a good rule of thumb for
planning purposes. With 32MB of CEE memory pool memory available for CAB and
native block instance memory, this is rarely the driver for planning decisions.
CDBs use recoverable CEE memory pool memory. A medium size CDB will consume
approximately 1.5KB of this memory. A medium size CDB is defined as containing 15
CDPs, of which two are arrays, as follows:
• Five 32 character STRING
• Four scalar FLOAT64
• Four scalar BOOLEAN
• One 20-element FLOAT64 array
• One 20-element BOOLEAN array
88 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system planning and design
Computers and network infrastructure
Table 12 ACE memory usages after two years for medium-sized CABs
Total instantiated CAB Types reloaded in ACE 400 types x 30 reloads 12000 x 74 = 888,000
during debug sessions. = 12000 (See Note 1)
Total instantiated CAB Types reloaded in ACE 400 types x 3 reloads 2400 x 74 = 177,600
during maintenance cycle. x 2 years = 2400
Note 1—If you are using SIM-ACE for debug, the memory consumed during reloads of types is
reclaimed when you shut down the SIM-ACE and therefore should not be included in the total
memory figure.
TIP
Refer to “Resource management” in this guide for methods of monitoring
memory utilization.
ATTENTION
Refer to “ACE shutdown procedure for reclaiming CAB memory” for the
procedure to reclaim memory.
ATTENTION
Honeywell strongly advocates the use of SIM-ACE for debug because of the
security advantage and the ability to use the MSVS debugger. However, if you
do choose to debug on ACE and then use the same ACE for production, you
should do a shutdown before going on line, thereby reclaiming memory.
R210 Custom Algorithm Block and Custom Data Block User's Guide 89
10/04 Honeywell
CAB and CDB system planning and design
Security policy
Security policy
User access
User access to build tools for creating CAB and CDB types is controlled by the same
security policies that govern access to CB. Basic access to CB is controlled by logon
password. A developer license is required to access CAB development tools within CB.
Refer to “CAB Developer license” for additional information.
User access to CAB instances and CDB instances is controlled by the same security
policies that govern access to native blocks.
90 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
Control strategy
Determine that CAB and CDB are needed
You must determine if CAB and/or CDB are appropriate for your control requirements.
The topics in the section “Purpose, use, and value of the system” will be helpful in
making these decisions.
Develop strategies
Assuming you determine that CAB and/or CDB represent the most effective architecture
to solve some of your control requirements, you must develop, at least at a conceptual
level, the strategies that you will use to implement the solutions. We suggest that you
review the example scenarios section of this guide. The example scenarios section
presents a number of examples of the application of CAB and CDB to typical control
scenarios.
At an early stage, you will begin to formulate your strategies, including the CMs, CABs,
CDBs, CDPs, PRefs, and native blocks that you will be using in each strategy. Consider
organizing your CDPs and Prefs in Excel spreadsheets using the same format as the PDE
forms. Then you can cut and paste your parameters from the spreadsheets directly into
the PDE when you are ready to create your CABs or CDBs.
The material in this type planning and design section should be viewed as an outline, or
checklist, of the planning steps and design decisions that you should make prior to actual
implementation of strategies involving CAB and CDB. You undoubtedly have site
practices in place that address many of these items; however, CAB, CDB, and CDPs
present some new features that require special consideration.
Configuration planning
Configuration planning steps
The following are some configuration planning considerations:
• Configuration planning for CAB and CDB is similar to planning for native blocks.
Because of the added functionality, however, CAB and CDB have some special
planning needs.
• Plan the roles and responsibilities of users. This should address the issue of multiple
developers working on the same or multiple parts of a CAB application. It should also
address the responsibilities of individuals involved in deployment and monitoring of
strategies that involve CABs.
91 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
Configuration planning
• You should review your security practices with CAB in mind. See “Security policy”
for information on security issues.
• Determine if templates can be used to reduce development effort, especially if you
have multiple equipments that are similar. See “Role of block types, instances, and
templates” for information about templates.
• With CAB, custom data and algorithm are user-defined. This increases the likelihood
of “tweaking” to improve performance or reliability, or to add features. The problem
of revision control of instances is therefore magnified. You will need to develop and
adopt an appropriate strategy for managing types and instances. (Note that version
control (QVCS) is not supported for CAB or CDB types.)
• Your strategy for managing types and instances can take advantage of the Search
tool (formerly known as the Relationship Browser) that is included in Experion. The
tool is accessed from Configuration Studio. For more information, see “
92 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
Configuration planning
R210 Custom Algorithm Block and Custom Data Block User's Guide 93
10/04 Honeywell
CAB and CDB type planning and design
CAB configuration choices
94 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
CAB configuration choices
TIP
In order to display parameter reference values, you must assign the parameter
reference values to a CDP value that can be displayed on the faceplate or as
a pin.
• Make decisions about when to use custom data parameters and when to use
parameter references. Parameter references are recommended if the CAB is to be
used as an insertion point algorithm (see “Do not use graphical connections”).
Parameter references do not support whole array access whereas CDPs do. When
using parameter references, user code should check status after the read or write
operation. Parameter reference functionality supports PRef lists. This is a programmer
convenience, and its use does not affect performance. Parameter references are
defined as aliases in the type definition, and actual reference target names are
assigned in the property forms of the instances. CDPs are connected by graphical
connections (wires and parameter connectors). You can define the pins that are
exposed on the block symbols when you define the type in the PDE. (There is one
caveat, however. If you later edit a CAB type and change symbol attributes, these
changes will not automatically propagate to instances.) You can also define these
exposed pins for each instance in the block properties form.
• Consider how you will make configuration changes in the run-time environment.
This is done through the block properties forms. See “Properties forms specific to
CAB and CDB” for information on the relevant forms. Be aware that you can
customize these forms in the PDE when you define the block type. You can rename
tabs, define custom tabs, and organize how information is displayed on the tabs. For
example, you could set up separate tabs for references to parameters in different
controllers, or you could separate reads and writes on different tabs. See “Specify
form layout” for information including a link to detailed information in the
Parameter Definition Editor Reference.
• Consider how you will monitor the operation of your CAB by itself and in the
overall control strategy. This could involve exposing certain critical parameters on the
faceplate. It could involve displaying certain parameters on a custom schematic. In
the latter case, your planning would include the resources and schedule impact of
creating the schematic.
R210 Custom Algorithm Block and Custom Data Block User's Guide 95
10/04 Honeywell
CAB and CDB type planning and design
CAB configuration choices
analysis could result in a specification for coding the CAB. This specification could, in
turn, be part of an overall specification for the strategy of which the CAB is a part.
As part of the planning of the CAB program, consider any special provisions that will
help during the debug process. For example, perhaps you could use local variables that
capture interim calculations or status values or other internal data so that they can be
easily viewed in the debugger. Similarly, you can define CDPs that could be used to
display internal data on the faceplate or in the debugger. Also consider using the Send()
subroutine to forward information to the message display of Experion Station (see “On-
process debugging”). Consider using SIM-ACE for debugging to take advantage of the
powerful MSVS debugging functionality. For more information on using SIM-ACE, see
“Debug with SIM-ACE.”
96 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
CAB configuration choices
R210 Custom Algorithm Block and Custom Data Block User's Guide 97
10/04 Honeywell
CAB and CDB type planning and design
CAB configuration choices
CAB states
A CAB instance can be in one of five states at any given time (see “CAB instance
states”). The CAB transitions from one state to another in response to system events,
program actions, or manual commands. The state is reflected in the CABSTATE
parameter. See “Fixed definition parameter CABSTATE” for an example of how to use
the CABSTATE FDP in a your program. See “Fixed definition parameter
CABCOMMAND” for an example of how you can use the CABCOMMAND FDP to
alter the CAB state.
For other related information, review the sections “Startup and shutdown” and
“Enumeration RestartEnum.”
CAB notifications
There are four CAB-specific notifications. All are alarms. A brief summary follows. For
more detailed information, refer to “CAB alarms.”
• CAB State Terminated—Indicates that CAB execution was terminated because
execution exceeded the time allowed. This alarm can have its priority and severity
configured independently for each instance. You could determine these options in
advance as part of your planning activity.
• CAB State Exception—This alarm can have its priority and severity configured
independently for each instance. You could determine these options in advance as
part of your planning activity.
• Read Error—This alarm is associated with parameter reference reads. This alarm
can have its priority and severity configured independently for each instance. In
addition, you must enable this alarm in the PDE when you define the type. It cannot
be enabled in the instance. Your advanced planning should consider these options.
• Write Error— This alarm is associated with parameter reference writes. This alarm
can have its priority and severity configured independently for each instance. In
addition, you must enable this alarm in the PDE when you define the type. It cannot
be enabled in the instance. Your advanced planning should consider these options.
98 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
CAB configuration choices
CAB constraints
The following are constraints in the initial release (R210):
• CABs cannot access Experion history, PHD history, or general OPC history data
access servers.
• CAB execution is constrained to 250 milliseconds. Background (distributed)
execution is not available. CAB infrastructure provides an FDP (CABEXECTIMER)
that can be used to determine CAB execution time. It also provides two FDPs
(CABPRFRDTIM and CABPRFWRTIM) that can be used to monitor the time
outside of CAB user code consumed by processing PRef reads and writes. See “Use
performance monitoring FDPs.”
• CABs cannot use the file access features of Visual Basic. There are other VB
functions that are not allowed. The function limiter in CAB will catch code that is not
allowed and display an error message. See “Summary of fault handling.”
• Parameter references do not support whole array access.
• CABs do not support dynamic indirection or dynamic re-referencing (a configuration
reference is fixed in this instance).
• Other CABs cannot share subroutines and functions without copying and pasting
into each program.
• CAB does not have a data type for enumerations. You have two choices with respect
to enumerations:
− You can use the TYPECONVERT function block to convert parameters of type
enumeration to parameters of type integer and work with the ordinal values
within the CAB program. For information about the TYPECONVERT function
block, see "TYPECONVERT Block" in the Control Builder Components
Theory.
− You can use parameter references, which will do an implicit type conversion.
See “Implicit type conversion with CAB parameter references.”
CAB API
The CAB Application Programming Interface (API) is a collection of interface elements
provided by Honeywell that allows the CAB developer to access and use the functions
and features of the CAB infrastructure. This interface includes classes, class members,
data types, enumerations, subroutines, properties, and functions in support of FDPs,
CDPs, PRefs, and custom math features. It also includes features in support of
controlling and monitoring CAB initialization and execution.
R210 Custom Algorithm Block and Custom Data Block User's Guide 99
10/04 Honeywell
CAB and CDB type planning and design
Design the Custom Algorithm Block
Your application programmers need to become familiar with this functionality prior to
beginning implementation of CABs. The CAB API is covered in the section “reference”
of this guide, which includes examples of usage. Other examples are found throughout
this guide, including the section that contains example scenarios.
100 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
Design the Custom Algorithm Block
• List PRefs.
• Define default values for FDPs where applicable.
• Define values for symbol attributes (see “Specify symbol attributes”).
• Define form layout (see “Specify form layout”).
• Define the control algorithm(s) and outline the code that will be used for
implementation. Consider using pseudo code and/or prototyping selected routines in
order to verify design concept. Refer to “Code CAB algorithm” for more information.
• Develop a strategy for debug. See “Test and debug the CAB.” Develop test
specifications as appropriate.
• Develop a security policy. Refer to “Security policy” for information. The following
are some suggestions for items to consider in your security policy:
− Determine the individuals who will have access to the CAB development tools
(administrators and developers) and assign passwords as appropriate.
− Similarly, determine the individuals who will have run-time access at the
Engineer, Supervisor, and Operator access levels, and assign passwords as
appropriate.
− Plan ahead of time the access lock and access level attribute values that you will
assign to individual CDPs as your CAB types are defined.
− Develop a policy with regard to debug activity, especially on-process
debugging.
− Develop a policy for managing types and instances including requirements for
testing and distributing new or modified block types and instances.
R210 Custom Algorithm Block and Custom Data Block User's Guide 101
10/04 Honeywell
CAB and CDB type planning and design
Design the Custom Algorithm Block
102 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
CDB configuration choices
R210 Custom Algorithm Block and Custom Data Block User's Guide 103
10/04 Honeywell
CAB and CDB type planning and design
CDB configuration choices
created in the PDE. Otherwise, you will need to do this in the property form for each
instance. (There is one caveat, however. If you later edit a CDB type and change
symbol attributes, these changes will not automatically propagate to instances.)
• Consider how you will make configuration changes in the run-time environment.
This is done through the block properties forms. See “Properties forms specific to
CAB and CDB” for information on the relevant forms. Be aware that you can
customize these forms in the PDE when you define the block type. You can rename
tabs, define custom tabs, and organize how information is displayed on the tabs. See
“Specify form layout” for information including a link to detailed information in the
Parameter Definition Editor Reference.
CDB constraints
CDBs have the following constraints:
• CDBs do not support parameter references.
• CDBs do not support a control algorithm.
• CDB does not have a data type for enumerations. You can use the TYPECONVERT
function block to convert parameters of type enumeration to parameters of type
integer and work with the ordinal values.
104 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB type planning and design
Design the Custom Data Block
R210 Custom Algorithm Block and Custom Data Block User's Guide 105
10/04 Honeywell
CAB and CDB type planning and design
Design the Custom Data Block
106 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB installation and upgrade
Hardware installation and upgrade
Where to find information
For hardware requirements, refer to the Software Change Notice (SCN) and/or the
Specifications and Technical Data (Spec and Tech) that is applicable to the release.
Licensing considerations
CAB has a two-tiered licensing scheme that is based on the Client/Developer style of
licensing. The two licenses that make up CAB licensing are CAB Developer and ACE
Base. The CAB Developer license allows users to build programs using Microsoft
Visual Studio .NET 2003 and Control Builder integrated with CAB tools. The users will
create custom programs using Microsoft Visual Basic .Net.
The developed CAB types can be run on ACE CEEs throughout a site and even in other
plants without the necessity of purchasing a special license. The ACE Base licensing is
included with ACE. To edit a CAB that is developed by another plant site, a CAB
Developer license is required to edit and recompile the code.
107 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB installation and upgrade
Software installation and upgrade
108 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a new CAB type
CAB development environment overview
The CAB development environment is launched from the Control Builder application. The
development environment provided by Honeywell for CAB creation is called the
Integrated Development Environment (IDE). This environment integrates the following
features into CB:
• Support for creation of new types for CABs, and for adding these new types to the CB
library.
• Support for instantiating the new types into CMs, and for loading them into the CEE.
• A customized version of Microsoft Visual Studio .NET 2003 (MSVS .NET) for
creating CAB algorithms.
• The Honeywell Parameter Definition Editor (PDE) for configuring custom data
parameters for CABs and CDBs and parameter references for CABs. For CABs, this
application opens within MSVS as a tab-selectable option.
ATTENTION
When you open the CAB development environment, a splash screen appears
briefly. You can minimize this screen, but if you close it, the development
environment will not open.
109 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a new CAB type
Note that in the IDE there are two tab-selected options available:
• Parameter Definition Editor—Where the parameters for your CAB are configured.
This window is selected in the figure above. When you open the IDE for creation of a
new CAB type, the PDE tab is active by default.
• CABlock.vb—Where the algorithm for your CAB is configured. When you open the
IDE for edit of an existing CAB type, the CABlock.vb tab is active by default.
When you select the CABlock.vb tab, or if you are opening an existing CAB type for edit,
the Source Code window appears as shown in the next figure.
110 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a new CAB type
R210 Custom Algorithm Block and Custom Data Block User's Guide 111
10/04 Honeywell
CAB configuration
Create a new CAB type
The GUID is used to ensure that each CAB and CDB type is globally unique across the
system, independent of the library and type name. The GUID from the type is propagated
to each instance and therefore ensures that an instance can be matched to its type, even if it
is exported to another system where another CAB exists with the same library/type name
but different algorithm.
Honeywell files
CAB infrastructure includes many critical files provided by Honeywell. Do not modify or
delete any files under: C:\Documents and Settings\All Users or under C:\Documents and
Settings\<login userid>.
112 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a new CAB type
R210 Custom Algorithm Block and Custom Data Block User's Guide 113
10/04 Honeywell
CAB configuration
Create a new CAB type
After specifying the Custom Library Name and the Block Type Name, you click OK. The
data entered is checked to ensure that only valid characters were entered and that the
maximum character count was not exceeded. If the data is valid, the IDE opens with the
Parameter Definition Editor window selected as previously shown in “Layout of the
development environment.”
114 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a new CAB type
Build Solution Saves all project files to local storage, and then builds
(compiles) the project.
R210 Custom Algorithm Block and Custom Data Block User's Guide 115
10/04 Honeywell
CAB configuration
Create a new CAB type
Save PDE Saves the PDE data to local storage. This option is only
Data available if you have made changes to PDE data. Note:
You must save any PDE changes prior to developing
code in order to have the changes recognized in
IntelliSense.
Save-Renew N/A Do not use this command unless prompted to do so. See
PDE Data “Save-Renew command” below.
Save to N/A Allows you to save another copy of the current block. You
ERDB As will be prompted for the desired Library and Block names.
If you keep the same Library name, you must enter a
different Block name. If you choose a new Library name,
the Block name can be the same as, or different from, the
name of the original block. After the save operation, the
block under edit in MSVS will be the new version.
116 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a new CAB type
Save-Renew command
Both CDPs and the PRefs parameters are identified within the system by the parameter
identification numbers that are invisible to users. Under certain unusual conditions, it may
become necessary for the system to regenerate these identification numbers in order to
continue with the current operation. If this should occur, you will be notified by an error
message that indicates that you need to execute the Save-Renew command. This command
requires that you select a new name for the block that you are saving. If you execute the
Save-Renew command, the parameter identification numbers within the system are
regenerated.
ATTENTION
A consequence of the Save-Renew command is that you will have to reload all
instances of the block. Alternatively, you can elect to cancel the operation that
you were doing when you received the error message indicating the need for
Save-Renew.
EDITLOCK— The Edit Lock flag is supported by all CAB types. When blank, it
indicates that the type is available for edit. When not blank, it contains the machine name
and user name of the person who is editing the type. Edit Lock prevents a type from
becoming corrupted by simultaneous edits. It is automatically set when the type is opened
for edit, and is automatically cleared when the edit session ends.
R210 Custom Algorithm Block and Custom Data Block User's Guide 117
10/04 Honeywell
CAB configuration
Create a new CAB type
When Edit Lock is set, the type can still be opened view-only by using the "View"
command. Attempts to save to the ERDB will not work when the type has been opened
view-only. Block instances can be created or loaded regardless of the state of Edit Lock.
Edit Lock gives no indication of the edit state between edit sessions. In order to prevent
others from modifying your type when it is not open for edit, there must be a site practice
for honoring reservations. To handle coordination of CAB types under development, a
recommended procedure is to include a term such as “development” or “test” as a part of
the name of a Custom Library to differentiate it from deployed libraries.
ATTENTION
In the unlikely occurrence that a PC crashes while an edit session is in
progress, the Edit Lock will be set. If this happens, the ERDB administration
tool, DBAdmin, must be used to clear Edit Lock. For information, see “Using
DBADMIN” in the Control Hardware Troubleshooting and Maintenance Guide.
INCOMPLETE— The Incomplete Lock flag is supported by all CAB types. When True
(checked), it indicates an inconsistency between the parameter definitions established
within PDE and the algorithm definition established within VB.NET source files.
Parameter definitions have been added or changed since the last successful build. To clear
the lock, you must successfully rebuild.
CAB types can be instantiated when Incomplete Lock is set (although there is no reason to
do so), but they cannot be loaded.
You can view the value of Incomplete Lock, as shown in Figure 6 above, by opening the
block properties form and selecting the Main tab.
118 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a new CAB type
type, and someone else opens a chart that contains an instance of that CAB or CDB type. If
you try to save the CAB or CDB type, you will get an error because the database record for
that CAB or CDB type is locked. The error message will indicate who has it locked and
will give you the option to cancel, or to continue the operation, which will leave the Edit
Lock set.
If you select Discard, your changes will be lost. It is important to emphasize that source
files saved within the development folder (local storage) are used as a temporary cache in
support of edit and build sessions. They are not maintained after an edit session has ended.
When an edit session is complete and MSVS is closed, ERDB is the only storage resource
for all data related to block types. "Save To ERDB" can be done at any time during the
MSVS edit session to preserve work done so far.
If you attempt to close Control Builder when you have a CAB type open for edit, you will
get the following error message:
R210 Custom Algorithm Block and Custom Data Block User's Guide 119
10/04 Honeywell
CAB configuration
Define CAB type parameters
CDP characteristics
Some characteristics of CDPs are:
• CDPs are directly analogous to the parameters of native CEE block types. However,
the name, data type, access lock, and other properties, are not predefined. You specify
them during the process of defining the block type. Attributes that can be specified for
CDPs are described in "Reviewing custom parameters tab (Value CDPs)" in the
Parameter Definition Editor Reference. Data types are described in this guide in the
section “Data types for CDPs and parameter references.”
• CDP values are persistent in the sense that they are maintained from creation until
deletion of the block instance. Their values are retained from one execution of the
block to the next.
120 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
• The data types available for the CAB CDPs are the same as those available for CDB
CDPs.
• CDP values can be changed by writes from within the block or from external blocks or
other agents within the PKS.
• CDPs can be viewed from several different displays within the PKS. CDP values can
be configured in the CAB properties form using the CB project side instance if their
Configuration load attributes were configured as LOAD in the PDE. CDP values can
be read and written on process from the CAB properties form using the CB monitor
side instance. Values can be read and written using chart visualization from the
Experion Station. They can also be read and written from custom displays.
One difference between native block parameters and CDPs is that the native block
parameters are only visible from outside of the block while the CDPs are visible from both
inside of and outside of the block. To illustrate this, suppose that you decide to create a
CDP called "FLOW" on a block type called "CONTROLLER." Then you make an
instance of CONTROLLER called "CONTROLLER1" within a CM instance called
"CM1." Then, the CDP called "FLOW" can be accessed externally under the name
"CM1.CONTROLLER1.FLOW." In addition, it can be accessed internally by the CAB
program under the name "FLOW.Value."
A portion of he Value CDPs configuration form (tab) is shown in the following figure.
R210 Custom Algorithm Block and Custom Data Block User's Guide 121
10/04 Honeywell
CAB configuration
Define CAB type parameters
Operations that you perform in the PDE are covered in the Parameter Definition Editor
Reference. The following table includes useful links for Value CDP information:
Table 15 PDE Information links for Value CDPs
Customizing the Value CDPs view (set of Reviewing PDE views for CAB and CDB
attributes that are displayed),
ATTENTION
It is strongly recommended that you avoid using VB reserved names in
parameter definitions. You can search VB on-line help for “Visual Basic
keywords.”
R210 Custom Algorithm Block and Custom Data Block User's Guide 123
10/04 Honeywell
CAB configuration
Define CAB type parameters
circumstances. In the case of CAB instances, the access level will be either Program or
Continuous Control depending on the value of fixed definition parameter
ACCESSLEVEL which is configured on the Fixed tab in PDE. In the case of human
initiated stores from CB monitoring displays or Station displays, the access level will be
Engineer, Supervisor or Operator depending on privileges associated with the user id.
Table 16 Access levels in Experion
Control Builder X
during load of
CM or SCM
Supervisory X
batch
application
SCM X
CAB instance X X
Supervisory X
control
application
Algorithm X
function block
Human being X X X
storing from
CB monitoring
display
Human being X X X
storing from
Station display
Access Locks are configured for each CDP on the Value CDPs tab in the PDE when the
block is created.
The following table lists possible values for CDP Access Lock and their meanings. Each
cell indicates whether stores with the indicated Access Level will be accepted by a CDP
that has been assigned the indicated Access Lock.
124 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
Access Level
View Only No No No No No No
AppDevOnly Yes No No No No No
As an example of how to interpret the above tables, consider a CDP defined with Access
Lock = Engineer. Suppose a human being with engineering privileges is logged on and
using a Station display. This user can store to the CDP. Users logged with only Supervisor
or Operator privileges and using the same display cannot store to the CDP. Supervisory
Batch or Continuous Control applications can store to the CDP, as can any CEE function
blocks that have the capability to initiate stores.
R210 Custom Algorithm Block and Custom Data Block User's Guide 125
10/04 Honeywell
CAB configuration
Define CAB type parameters
Operations that you perform in the PDE are covered in the Parameter Definition Editor
Reference. The following link leads to information on FDPs:
Table 18 PDE information link for FDPs
Configuring the default values for FDPs Reviewing Fixed Parameters tab
ATTENTION
Parameters that reside in the System Repository (SR) cannot be accessed
from CAB programs. CB will allow a parameter reference to refer to an SR-
resident parameter, but the runtime will not allow access to the parameter.
If you are in doubt about a given parameter, you can check its residency as
follows:
For CAB specific parameters, see “Detailed description Of CAB specific
FDPs” in this guide.
For other parameters, see the Control Builder Parameter Reference.
126 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
Operations that you perform in the PDE are covered in the Parameter Definition Editor
Reference. The following link leads to information on parameter references:
Table 19 PDE Information link for PRefs
R210 Custom Algorithm Block and Custom Data Block User's Guide 127
10/04 Honeywell
CAB configuration
Define CAB type parameters
The attributes specified for parameter references at type creation time guide built-in
behavior of the type at instance configuration time and at run time. They are not available
to user-written code. Attributes available to user code include "<PRef-name>.Value",
"<PRef-name>.ReadStatus", "<PRef-name>.WriteStatus" and others. For more
information, see the section “Parameter reference classes.”
128 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
ATTENTION
Any modifications you later make to symbol attributes will not propagate to
existing CAB instances if you choose a Save and answer Yes when prompted
to update instances. There are two ways to change Symbol Attributes in
existing instances. Symbol Attribute changes must be done for each instance
by deleting and re-adding the block to the CM, or making the change in the
block properties form on the project side and then loading to update the
monitor side.
Defining the layout of the properties form Reviewing Form Layout tab
R210 Custom Algorithm Block and Custom Data Block User's Guide 129
10/04 Honeywell
CAB configuration
Define CAB type parameters
If your block contains multiple parameters that are similar, you can copy a parameter and
paste it into multiple lines. The PDE will rename each parameter when you paste it, so that
you will probably want to change the names to suit your naming convention.
You can also copy one or more parameters and paste them into a separate block that is
open for edit. In this case, the PDE will not change the names.
130 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
CREATEDBY Identifies the user who did the first save of the instance or
template.
DATECREATED Gives the date of the first save of the instance or template.
MODIFIEDBY Identifies the user who did the most recent save of the instance
or template.
R210 Custom Algorithm Block and Custom Data Block User's Guide 131
10/04 Honeywell
CAB configuration
Define CAB type parameters
which the instance default can be changed at type creation time. The following FDPs are
not accessible from within a CAB program except for the BlockBase FDPs
CABCOMMAND, CABSTATE, PROGSTSDESC, PERIOD, and PROCSPECEXEC (see
“Predefined FDPs and subroutines”). These parameters that are accessible from within a
CAB program are marked with an asterisk in the following table.
132 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
EDITLOCK also
pertains to CDB.
R210 Custom Algorithm Block and Custom Data Block User's Guide 133
10/04 Honeywell
CAB configuration
Define CAB type parameters
INSMASTER Indicates whether or not Definition fixed. View only. The value is set
this block is being used to the name of the master
for insertion point block when the block is
processing. configured for insertion
point processing.
134 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
NOTE – PERIOD
appears in a CAB
program like an FDP
even though it is not a
fixed definition
parameter in the truest
sense of an FDP
definition. It is only
available to the user
code.
NOTE –
PROCSPECEXEC
appears in a CAB
program like an FDP
even though it is not a
fixed definition
parameter in the truest
sense of an FDP
definition. It is only
available to the user
code.
R210 Custom Algorithm Block and Custom Data Block User's Guide 135
10/04 Honeywell
CAB configuration
Define CAB type parameters
136 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Define CAB type parameters
R210 Custom Algorithm Block and Custom Data Block User's Guide 137
10/04 Honeywell
CAB configuration
Define CAB type parameters
FDPs 200 FDPs are defined by Honeywell and are not available for
definition by users, although users can read them and write
to some of them. Approximately 50 are currently used and
150 more are reserved for future use.
*Note: Array parameters count as one parameter no matter how many elements they
have.
138 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Code CAB algorithm
End Class
You enter your code statements into the code frame. The following kinds of statements can
be entered:
• Declarations of block scope variables are entered below declaration of class CAB and
above the line "Public Overrides Sub Execute()".
• Declarations of local variables are entered within subroutine Execute().
• Executable statements are entered within subroutine Execute() where the “TODO”
comment is.
• Private subroutines and functions are entered within the CAB class declaration, above
or below the declaration of Execute(). Subroutines can be added outside the class
definition, but if you do, you will not have access to all of the data that is inherited
from the original class. Depending on the subroutine, this might not be a problem.
R210 Custom Algorithm Block and Custom Data Block User's Guide 139
10/04 Honeywell
CAB configuration
Code CAB algorithm
Although parameter definitions and executable code are entered into different windows,
there is interplay between the two. The PDE definitions ultimately yield support code that
allows parameters to be used as variables within the Execute() subroutine. You do not need
to provide definitions other than those entered within PDE. However, you must save
parameter definitions before parameter names will be recognized within executable code.
Entering a complete type definition is typically an iterative process in which you shift back
and forth between PDE and the algorithm source window.
TIP
In your code, you must remember to add .Value to a CDP or parameter
reference when accessing its value—for example, accessing Me.FLOW.Value.
If you forget the .Value, you will get a build error similar to the following (this
example is for a CDP that is Float64).
For a parameter reference, the error message would be similar to the following
(this example is for a PRef that is Float64).
140 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Code CAB algorithm
In the terminology of VB.NET, block scope variables are "instance variables" of the class
that defines the block. For an example of block scope variables, see “Define the algorithm
for VLR_CALC.”
R210 Custom Algorithm Block and Custom Data Block User's Guide 141
10/04 Honeywell
CAB configuration
Code CAB algorithm
Execute() runs periodically when the CAB is instantiated within a CM configured to run
under process special scheduling. CM process special is a configuration option that allows
a trigger parameter to be set at runtime on the CM, causing any pre-fetch requests to be
issued and the subsequent execution to be scheduled.
142 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Code CAB algorithm
However, SCMs can work with CAB instances to augment their own function. There
several different ways that this can be accomplished:
• A CM containing a CAB could be triggered to do a process special execution by an
SCM.
• A CAB could be written to alter its execution pattern in response to one or more
values of its own CDPs. A partner SCM could be implemented to write the CAB CDPs
to trigger different kinds of processing.
• A CAB program could be written to alter its execution pattern in response to one or
more PRef values read from a partner SCM.
• A CAB instance could be configured to operate as an insertion program triggered by a
native block (the call master). Any changes of state an SCM might apply to the call
master would likely impact execution of the CAB program. For example, if the call
master were a PID, SCM writes to MODE would stop or start execution of the insertion
program.
It is also true that CAB instances can initiate communications that impact execution of
other CAB instances or SCMs.
• In general, any affect that an SCM can have on a CAB instance can also be triggered
by a different CAB instance. Thus, a CAB could trigger the process special function for
a CAB contained in a different CM, it could use CDPs and PRefs to affect the
execution pattern of another CAB, or it could write to parameters like MODE that
would impact the execution of a CAB insertion program.
• CAB instances can also impact the execution of SCMs in the same manner that SCMs
impact the execution of other SCMs. This is through writes to the SCM COMMAND
parameter.
• A CAB can control the execution of another CAB in a different CM There is a
Boolean parameter called Block Process Special (BPS) on a CM that a CAB can use to
cause the CM to run one time as a process special. Refer to CB documentation for more
information.
• Another technique whereby a CAB can control the execution of another CAB is by
activating and inactivating the host CM of the CAB to be controlled. This can be done
by writing a zero (inactivate) or one (activate) to the CM’s EXECSTATE parameter.
As an example, a CAB (CAB1) can monitor an event and activate the CM in which
another CAB (CAB2) resides. CAB2 can do the processing for the event, and can then
inactivate its own CM at the end of the special processing.
R210 Custom Algorithm Block and Custom Data Block User's Guide 143
10/04 Honeywell
CAB configuration
Code CAB algorithm
144 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Code CAB algorithm
When addresses are assigned to PRefs at configuration time, it is not required that an entry
be supplied for every reference defined by the block. Undefined or null valued PRefs are
accepted without error at time of load. However, if READERROPT and WRITEERROPT
are specified as Event (see “FDPs specific to CAB” for a description of READERROPT
and WRITEERROPT), an event is reported if a null reference is used at run time. Allowing
null PRefs enables greater flexibility in the creation of generic block types.
PRefs allow CAB programs to read and write external data but do not allow that external
data to be displayed as though it were a parameter on the block. When debugging, you
must view external data on the externally referenced block or you must create value CDPs
within the CAB and set their values to the parameter reference values to show the data
locally.
R210 Custom Algorithm Block and Custom Data Block User's Guide 145
10/04 Honeywell
CAB configuration
Code CAB algorithm
In most cases, there is no reason for a CAB design to use Continuous Control instead of
Program access level. Thus, when a CAB type is first created, the instance default for FDP
ACCESSLEVEL is automatically set to Program by PDE and left unchanged by you. You
would change ACCESSLEVEL to Continuous Control if the CAB type were designed for
use with legacy Honeywell control systems. You would also change ACCESSLEVEL to
Continuous Control if the CAB were to be used as an insertion point algorithm. For
comments on interfacing to legacy systems, see “Determine Continuous Control access.”
BOOLEAN Yes Yes BOOLEAN CDPs as used within CABs and CDBs
have a representation equivalent to that of CEE
parameters of flag type. False (Off) has value 0
while True (On) has value 1. The same is true for
BOOLEAN parameter references in CABs. Note
that for consistency with past characteristics of
MS VB 6.0, VB.NET represents True as –1 when
converted to integer. Despite this, all BOOLEAN
type parameters in Experion, including those of
CABs, represent True as 1.
146 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Code CAB algorithm
INT32 Yes Yes There is a single integer type supported for CDPs
and parameter references within both CABs and
CDBs. For CAB parameter references, implicit
conversion operations are supported between
INT32 and most other scalar types. Specific
properties of these conversions are described in
“Implicit type conversion with CAB parameter
references.”
R210 Custom Algorithm Block and Custom Data Block User's Guide 147
10/04 Honeywell
CAB configuration
Code CAB algorithm
148 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Code CAB algorithm
STRING Yes Yes String type CDPs are supported for both CDBs
and CABs. String type parameter references are
supported for CABs. String types can be up to 255
characters in length.
Note 1—There are several other integer data types beyond INT16 and INT32 supported
within the PKS. These are not explicitly listed here. INT32 is unique in being the only
integer data type supported for CDPs and parameter references.
CDPs can be indexed parameters (logical arrays) of dimension up to 2. When configuring
array parameter definitions within the PDE window, the data type is selected from one of
the scalar types listed above. That a CDP is indexed is specified by parameter attributes
distinct from the data type.
Parameter references cannot be indexed (logical arrays of references are not supported).
However, they can be used to refer to scalar elements of array parameters at fixed index.
R210 Custom Algorithm Block and Custom Data Block User's Guide 149
10/04 Honeywell
CAB configuration
CAB algorithm data definition
In the table above, it is important to understand that typing of CAB CDPs and CAB
parameter references is described in terms of the Experion type names. It is necessary to do
so as CDPs are part of the PKS namespace and parameter references point to parameters
that are part of that namespace. However, there is a one to one mapping between each of
the supported data types listed above and the VB.NET data type used within a program.
This is shown in the following table.
Table 26 Data type names in Experion and VB.NET
BOOLEAN Boolean
INT32 Int32
FLOAT64 Double
TIME DateTime
DELTATIME TimeSpan
TIMEOFDAY TimeSpan
STRING String
150 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm data definition
• None— No system event has occurred since the llast execution of the CAB
instance.There has not been a system event since the last execution of the CAB
instance.
• BlockLoad—The block is about to execute for the first time since creation within the
EE, or for the first time since reload.
• BlockActivate—The block had been inactive but is now about to execute for the first
time since going active. No load occurred while the block was inactive but the user
may have changed configuration data within the block through on-process displays.
• CABToNormal—The block has returned to Normal state from Dormant or
Terminated state.
If it happens that more than a single system event occurs while a CAB block is not
running, CAB infrastructure uses a priority scheme to decide which value to return when
Restart is accessed. This scheme insures that the CAB block is informed of the most severe
initialization condition. The priority is as follows.
BlockLoad > BlockActivate > CEEColdStart > CEEWarmStart > CABToNormal > None
R210 Custom Algorithm Block and Custom Data Block User's Guide 151
10/04 Honeywell
CAB configuration
CAB algorithm data definition
Default 1 Not When you design a block type, you can define the
Applicable instance default for the CDP. You can also declare
the CDP to be loadable. When an instance is created
within CB, the CDP will be initialized with the default
value.
Execute() 3 BlockLoad When the CM parent of a CAB is activated for the first
processing time following load, access to Restart within
Execute() will result in return of the value BlockLoad.
In response to this, code within Execute() can choose
to leave the loaded values of CDPs unchanged or it
can modify them.
152 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm data definition
R210 Custom Algorithm Block and Custom Data Block User's Guide 153
10/04 Honeywell
CAB configuration
CAB algorithm data definition
OUTPUT.Value = 0.0
For I = 0 To 9
OUTPUT.Value = OUTPUT.Value + SCALE.Value * INPUT(I).Value
Next I
While the syntax of CDP usage may appear unfamiliar at first (this is discussed in “CDP
classes”), it should be clear what the above code is doing. In the context of data access, the
following questions might arise.
• Suppose that another local block, CAB or native, tries to read parameter OUTPUT.
Could it get a value taken from the middle of the loop computation?
No. If a request to read OUTPUT arrives while the above code is executing, access to
the parameter is locked until the code finishes executing.
• Suppose another local block writes to each of the elements of INPUT. Could it happen
that the sum would get computed using values from two different execution cycles of
the block that writes to INPUT?
No. The loop above can never execute at the same time as another local block that
stores to the INPUT array. As long as the writing block writes all elements of INPUT
within one execution, the values are received as a consistent set.
• Suppose SCALE is written by another block. Could a new value of SCALE start to be
used in the middle of the loop?
No. If a write to SCALE occurs while the above code is executing, it does not take
effect until the code finishes executing the current cycle.
154 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm data definition
While the syntax of PRef usage may appear unfamiliar at first (this is discussed in
“Parameter reference classes”) it should be clear what the above code is doing.
In this example, data integrity issues can be reduced to considerations of whether each
input value is good and useable. There are multiple techniques for identifying the usability
of remote input data. These are discussed in “Parameter reference classes.”
The important point is that this example presents no issues of consistency across the group
of inputs. MEASIN1 through MEASIN3 are continuous process readings. So while you,
the CAB type designer, would need to consider the general timing properties of the remote
data access in this example, you would not need to be concerned about the order of data
retrieval. Nor would you need to be concerned about whether input values came from the
same execution of a remote block. With continuous process values, there is no inherent
ordering and, depending on the application, a fairly broad time interval can be considered
close enough to simultaneous.
Now, if the example is changed slightly to imagine that MEASIN1 through MEASIN3
were CDPs being pushed from one or more remote CEEs, then the same reasoning applies.
No consistency requirements apply to the set of inputs, so the only integrity consideration
is whether each value is good or bad.
R210 Custom Algorithm Block and Custom Data Block User's Guide 155
10/04 Honeywell
CAB configuration
CAB algorithm data definition
It is assumed that a program must generate a sum over a scaled input parameter that is
indexed. Also assume the following.
• The input array, called INPUT, is a custom parameter that is written by a single
remote block.
• The scale factor, SCALE, is a CDP that can be written by other blocks or by displays.
• The sum parameter, OUTPUT, is an output CDP that can be read by other blocks or
by displays.
OUTPUT.Value = 0.0
For I = 0 To 9
OUTPUT.Value = OUTPUT.Value + SCALE.Value * INPUT(I).Value
Next I
In this case, consistency issues might arise. It is possible that the array data would need to
be sampled from a single execution of the originating block. But, if each array element
were pushed individually, transport services could not be guaranteed to preserve order or
even to insure that the entire set of elements were received as a set between executions of
the consuming CAB instance. The array might be received in parts across multiple
executions of the consuming block.
A way to resolve this problem would be to implement the CM containing the receiving
CAB instance so that it receives the array INPUT through bulk array transport. Bulk array
transport is guaranteed to read the entire set of elements and to write them with no
intervening block executions. Also, since the array is transported as a unit, no issues arise
with respect to order.
This principle can be used fairly flexibly. For example, suppose that in the above example,
the INPUT array together with the scale factor, SCALE, had consistency requirements.
Then SCALE could be transported with the INPUT array by creating an array of 11
elements at the originating end and transporting that in bulk.
Bulk array transport could also be used to transport process value along with a quality
indicator. Generally, the data status or quality needs to come from the same execution of
the source block as the data value. If not, the quality indicator could say the data was good
when it was bad or vice versa. While quality indicators would generally be thought of as
being integer valued, there is nothing to prevent a floating-point number from being used
to represent quality. Thus, quality and value could be placed into a single array at the
originating end and transported as a unit.
156 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm data definition
Now consider a different example. Parameters MODE and SP of the PID block are related
and can be considered to have a consistency requirement. In general, MODE must have a
particular value in order for store of SP to be accepted by the target block.
When CAB writes MODE and SP to a local block, no particular design issues arise. As
long as MODE is written with the appropriate value first, SP will be accepted. However, if
the target block is remote, the write sequence will usually work but is not guaranteed to
always work. Peer-to-peer communication services are not guaranteed to maintain order of
delivery. Also, depending on the remote device which hosts the block, it may be necessary
for the receipt of MODE and the receipt of SP to be separated by an execution cycle at the
target.
A standard technique for addressing this problem is to write MODE and read it back before
writing SP. Once MODE goes to the target value, the SP write may proceed. This is shown
in the following example where WriteSP is assumed to be a local Boolean state variable
and SPTargetValue is the desired value for SP. Both MODE and SP are assumed to be
PRefs.
If WriteSP Then
If MODE.Value <> 1 Then
MODE.Value = 1
Else
SP.Value = SPTargetValue
WriteSP = False
End If
End If
R210 Custom Algorithm Block and Custom Data Block User's Guide 157
10/04 Honeywell
CAB configuration
CAB algorithm data definition
• If CAB is to receive data and the chosen design has CAB pull from an external block
via a PRef, then the CAB instance can always check status to see whether the data
transfer was successful. This is true regardless of whether the transfer operation is peer-
to-peer or is confined to a single CEE.
• If CAB is to send data and the chosen design has an external block pull from the CDP
of a CAB instance, then depending on its design, the external block might be able to
check status information on the data transfer. This is true regardless of whether the
transfer operation is peer-to-peer or is confined to a single CEE.
• If CAB is to send data and the chosen design has CAB push to an external block via a
PRef, then the CAB program can always be implemented to check the status of the
write operation. However, the program implementation depends on whether the
destination block is always in the same CEE as the CAB instance, or whether there will
be at least one case when the two will be in different CEEs. Response of the external
block to transfer failure depends on its design. In most cases it would hold last value.
• If CAB pushes to a local block, status is always available in the same execution cycle
where the push was performed. The program design to use the status is quite simple.
• If CAB pushes to a remote block, status is not available until an execution cycle
subsequent to the cycle where the push was performed. The program design to use the
status is more involved and requires the use of one or more state variables.
158 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm data definition
R210 Custom Algorithm Block and Custom Data Block User's Guide 159
10/04 Honeywell
CAB configuration
CAB algorithm data definition
160 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm data definition
• INF values are ordinal. Use of INF in any floating-point comparison produces results
consistent with comparison of finite values.
• INF values propagate through subsequent calculations. Thus, a finite value divided by
+INF or –INF will yield zero. A positive finite value multiplied by –INF will yield –
INF. +INF subtracted from any finite number will yield –INF.
• INF values can be identified through use of the IsInfinity() method and related
methods.
• Floating-point divide of zero by zero produces NaN with no exception being thrown.
• Assigning a NaN value from one floating-point variable to another does not cause an
exception.
• NaN values are non-ordinal. Use of NaN in any floating-point comparison produces
the value False. For example, the following comparisons will all return False:
(1.0 = NaN); (1.0 <> NaN); (1.0 > NaN); (1.0 < NaN); (NaN = NaN).
• NaN values propagate through subsequent calculations. Any calculation done with one
or more NaN values as input yields NaN as output.
• NaN values can be identified through use of the IsNan() method.
A NaN constant is available within the language implementation to allow variables to be
initialized to NaN.
When INF or NaN values are stored to external block parameters through parameter
references, the resulting behavior is determined by the design of the receiving block. Some
blocks might be designed to allow write of these values to specific parameters. Others
might be designed to reject such writes. If a CAB program attempts to write a NaN or INF
and the write is rejected, the program can learn of this from the returned data access status.
CAB infrastructure never throws exceptions when programs attempt to write floating-point
values to internal or external variables. If you wish to prevent NaN or INF values from
going out, you must write the program to test before storing.
R210 Custom Algorithm Block and Custom Data Block User's Guide 161
10/04 Honeywell
CAB configuration
CAB algorithm parameter references
162 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm parameter references
Legend
• "→" indicates "transferred to" or "converted to".
• The term "commensurate" indicates a data transfer in which range, precision and data
semantics are preserved.
• Terms "ordinal 0 or "ordinal 1" indicate the numeric value of an enumeration as
distinct from the name value of an enumeration.
• MINI32 = -2147483648. This is the minimum value that can be represented by an
INT32.
• MAXI32 = 2147483647. This is the maximum value that can be represented by an
INT32.
• MINI16 = -32768. This is the minimum value that can be represented by an INT16.
• MAXI16 = 32767. This is the maximum value that can be represented by an INT16.
• MINF32 = -2.86E38. This is roughly the minimum value that can be represented by a
FLOAT32.
• MAXF32 = 2.86E38. This is roughly the maximum value that can be represented by a
FLOAT32.
• MAXP32 = 16777215. This is the maximum integer value that can be represented
with full precision by a FLOAT32.
• "~x" indicates that the pre-existing value of x is preserved with some loss in precision.
In cases of floating point to integer conversion the fractional part is always handled by
rounding.
• .NETTO = .NET Time Origin. This is a 0 within the 64-bit .NET representation of
time. It corresponds to January 1, 0001, 12:00 AM.
• ExpTO = Experion Time Origin. This is 0 within the 64 bit Experion representation of
time. It corresponds to January 1, 1972, 12:00 AM.
In cases where the data read is out of range for the destination data type and must be
clamped, the parameter reference status property will indicate a range error. In cases where
the data read results in real or potential loss of precision there is no indication by the status
property. In cases where the data flow is outgoing (write via CAB parameter reference)
and data must be clamped, there is no indication by the status property.
R210 Custom Algorithm Block and Custom Data Block User's Guide 163
10/04 Honeywell
CAB configuration
CAB algorithm parameter references
164 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm parameter references
Note 1
There are several other integer data types beyond INT16 and INT32 supported within the
PKS. These are not explicitly listed here. INT32 is unique in being the only integer data
type supported for CDPs and parameter references. However, like INT16, implicit
conversion to and from INT32 is supported for other integer types.
R210 Custom Algorithm Block and Custom Data Block User's Guide 165
10/04 Honeywell
CAB configuration
CAB algorithm parameter references
166 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm parameter references
Note 1
There are several other integer data types beyond INT16 and INT32 supported within the
PKS. These are not explicitly listed here. INT32 is unique in being the only integer data
type supported for CDPs and parameter references. However, like INT16, implicit
conversion to and from INT32 is supported for other integer types.
R210 Custom Algorithm Block and Custom Data Block User's Guide 167
10/04 Honeywell
CAB configuration
CAB algorithm parameter references
INT16 Note 1 0 0 0 0
168 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
CAB algorithm parameter references
BOOLEAN False
INT32 0
FLOAT64 Nan
DELTATIME 0
TIMEOFDAY 12:00 AM
STRING ""
R210 Custom Algorithm Block and Custom Data Block User's Guide 169
10/04 Honeywell
CAB configuration
CAB algorithm parameter references
In the second case above, the CAB instance does not issue PRef writes. Therefore access
level does not enter the picture.
In the third case above, use of Program or Continuous Control access level in the CAB
design will have different effects. When Program is used, PM points receiving the write
react as though the CAB program is part of a sequence. The following applies:
• Regulatory points must have MODE = Auto for SP writes to be accepted.
• Regulatory points must have MODE = Man for OP writes to be accepted.
• AO points must have MODE = Man for OP writes to be accepted.
• Parameter MODEATTR at the target point must be Program in order for writes to
parameters SP, OP, MODE, RATIO or BIAS to be accepted.
When Continuous Control access level is used, PM points receiving the write react as
though the CAB program is supervisory continuous controller. The following applies:
• Regulatory points must have RCASOPT set to SPC or RSP and MODE set to Cas in
order for SP writes to be accepted.
• Regulatory points must have RCASOPT set to DDC or DDC RSP and MODE set to
Cas in order for OP writes to be accepted.
• AO points must have RCASOPT set to DDC and MODE set to Cas for OP writes to
be accepted.
• MODATTR does not condition acceptance of writes to parameters SP, OP or MODE.
170 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a CAB instance
TIP
The Value CDPs tab is present only if you configured value CDPs when you
defined the type. Similarly, the Parameter References tab is present only if
you configured parameter references when you defined the type.
TIP
You can create custom tabs and do other special properties form editing tasks
in the PDE. For more information, see "Reviewing general block type
functions" in the Parameter Definition Editor Reference.
R210 Custom Algorithm Block and Custom Data Block User's Guide 171
10/04 Honeywell
CAB configuration
Create a CAB instance
Figure 15 below shows the Value CDPs tab as it appears when the Show Parameter
Names option is unchecked. In this view, the Parameter description that you entered
when you created the type is listed for each CDP, along with its default value. Figure 16
shows the Value CDPs tab when the Show Parameter Names tab is checked. In this case,
the parameter name is listed rather than the parameter description.
Figure 15 Value CDPs tab with descriptions showing
172 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a CAB instance
The parameters that are listed on the form are the parameters that you configured when you
defined the CAB type in the IDE. The corresponding values shown for each parameter are
the default values that you assigned at that time (unless you subsequently changed the
default value for the instance, as described in the next paragraph).
If you were in the Project tree view when you opened the properties form, you can change
a default value on the form and new value will be saved to the ERDB when the form is
saved. It will then be saved to the CEE when the block is loaded, provided that the
parameter’s Configuration load attribute was set to LOAD when you created the type.
This change of a default value will apply only to the specific block instance, and will not
be reflected in other instances of the type, nor will it change the value in the type
definition.
If you opened the properties form from the Monitoring view, you can change a parameter
value, and when you click OK on the form, you will be prompted as to whether or not you
want to save the online value:
If you click Yes, the new value will be loaded to the CEE immediately. The change will
not be reflected in the ERDB, and the next time the block is loaded, the default value
stored in the ERDB will be loaded.
See also “Value CDPs tab for CAB and CDB.”
R210 Custom Algorithm Block and Custom Data Block User's Guide 173
10/04 Honeywell
CAB configuration
Create a CAB instance
As in the case of the Value CDPs tab, you have the option of viewing the parameter
names, or descriptions, depending on whether the Show Parameter Names option at the
bottom of the form is checked or unchecked (see “Configure Value CDPs tab” above). In
Figure 17 and Figure 18, the parameter names are displayed. These parameter names are
the alias names that you entered when you defined the block type in the IDE.
On this form, you configure the parameter references that will be used for this instance of
the CAB. Use the browse button at the right of each entry box to select the reference. You
can also enter the parameter reference directly, but it must be valid reference that is
configured on the system and saved in the database. Figure 18 shows a Parameter
Reference tab that is configured with parameter references.
174 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Create a CAB instance
R210 Custom Algorithm Block and Custom Data Block User's Guide 175
10/04 Honeywell
CAB configuration
Configure insertion points
Insertion Description
176 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Configure insertion points
Insertion Description
Configuration procedure
The following procedure is a summary of the general steps to configure an insertion point.
Refer to Control Builder documentation for additional information.
Table 36 Insertion point configuration procedure
Step Action
1 When you are defining the CAB type in the development environment, be sure
to configure the Access Level as Continuous Control. This is important.
2 Configure the RegCtl or DataAck instance and the insertion CAB instance in
the same CM and do a Save.
3 Open the properties form for the RegCtl or DataAck instance and select the
Insertion tab.
R210 Custom Algorithm Block and Custom Data Block User's Guide 177
10/04 Honeywell
CAB configuration
Configure insertion points
Step Action
4 Configure the number of insertions (NUMINSERT), the Insert Type, and the
name of the CAB (you can use the browser button to select the name, but do
not pick a parameter even though they are listed). The result will be similar to
the figure below:
5 Open the CAB properties form and configure values for any parameter
references that you have defined.
6 Verify that the insertion is configured correctly. Either of these methods will
work.
• With the CAB properties form open, select either the Configuration
Parameters or the Monitoring Parameters tab, select INSMASTER, and
click Add.
• With the RegCtl or DataAck properties form open, select the
Configuration Parameters tab, select INSBLOCK, and click Add.
7 Save, load, and activate the CM.
178 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Test and debug the CAB
Off-process debugging
You can debug CAB programs in an off-process mode. By doing so, you can utilize the
source level debug capabilities of the MSVS IDE. These capabilities include single step
execution, break points that can be set and viewed directly within the source code, and the
ability to examine internal variables during break.
To do source level debugging, start by creating a debug build of the CAB program. To do
this, build to the "debug target" within MSVS. This produces a build of the program that is
different from the normal "release target" build in that it contains additional information to
be used by the source level debugger.
The CAB infrastructure supports four parameters (EXCPTNLINENM,
EXCPTNMODULE, EXCPTNMSG, and EXCPTNTYPE) that can assist in debugging
code that is causing an exception. For information about these parameters, see “FDPs that
capture exception information.”
After building, save the debug build to ERDB and load an instance of the block to a SIM-
ACE. With the block instance loaded, attach the MSVS debugger to the SIM-ACE OS
process that is running the block instance. With the debugger attached, you can then set
break points and use other MSVS debugger capabilities. The MSVS online documentation
set includes information on the use of the MSVS debugger.
R210 Custom Algorithm Block and Custom Data Block User's Guide 179
10/04 Honeywell
CAB configuration
Test and debug the CAB
You can iterate through as many variations of the block type as needed to eliminate
defects, using the source level debugger to identify defects at each stage. When all defects
have been removed and off-process debug is considered complete, you should do a final
test of your CAB with a build to the "release target" and do a test run of the “release” built
CAB. Then save this final build to the ERDB.
To insure safety, source level debugging should only be used with an off-process SIM-
ACE. An alarm is generated if MDM service is running on an ACE node. This is the
service that allows breakpoints to be set, so it should be disabled on on-process ACE
nodes. For more information, see “Security policy.”
For further information on the use of SIM-ACE, see “Debug with SIM-ACE.”
On-process debugging
You can choose to use on-process debugging in addition to or instead of off-process
debugging. In some cases this may be convenient because it avoids the need to create
simulation strategies to support off-process debug.
The facilities available for on-process debugging are equivalent to the facilities available
for debugging instances of native block types like SCM, AUXCALC and REGCALC. You
use the monitoring capabilities of CB to view runtime values of CAB parameters and draw
conclusions about the correctness of the underlying code.
With CAB types, the definition of visible parameters is under your control. This means
that you can define parameters to make internal data visible, either permanently to form
characteristic attributes of the block, or temporarily to support debug. You can also use the
Send() subroutine to forward information to the message display of Experion Station. This
technique can be used to construct a trace of specific block data across successive
executions. Refer to “Subroutine Send()” for more information.
Troubleshooting information
The section on CAB and CDB troubleshooting and maintenance has information that will
help you troubleshoot CAB problems. Refer to the following topics:
• Troubleshooting approach
• CAB instance states
• CAB alarms
• Debug with SIM-ACE
• CAB fault handling
180 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Modify a CAB
Modify a CAB
Modify/Edit CAB type with MSVS
ATTENTION
When you open the CAB development environment, a splash screen appears
briefly. You can minimize this screen, but if you close it, the development
environment will not open.
You will frequently need to modify CAB types. Required changes might include algorithm
defect fixes, algorithm functional enhancement, addition of CDPs, modification to
attributes of existing CDPs, or deletion of CDPs. Whatever the reason, changes will
happen most often while the type is in development. Less frequently they will also happen
after a type has been deployed.
If you have already started an edit session and MSVS is open, you can immediately make
modifications. If you wish to open an existing type for edit, you must consider the lock
status as described in ”Block type locking flags.” If Edit Lock is set (that is, the type is
currently under edit by another engineer), you will see a message indicating that the block
cannot be edited.
To open the type, right-click on the block symbol within the library tree and choose Edit
Type. Alternatively, double-click on the CAB type, or choose the CAB type in the library,
then go to the Edit menu, and choose Type. When MSVS opens, the algorithm code
window will show the executable code for this type. To see the parameter definitions for
the type, go to the Parameter Definition Editor tab/window.
With MSVS open, edit the type as required, changing or adding parameter definitions and
executable statements as desired. When your editing session is complete, save PDE
changes, and build. Repeat edit, save, and build operations until all build errors are
eliminated.
After you have a clean build, you are ready to save to ERDB. When modifying a type, the
procedure of saving to ERDB can be different than it is when saving a newly created type.
This depends on the following:
• Whether instances already exist for the block type
• What kinds of changes have been made to the type
These issues are discussed in the next topic.
R210 Custom Algorithm Block and Custom Data Block User's Guide 181
10/04 Honeywell
CAB configuration
Modify a CAB
182 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Modify a CAB
Note that a procedure exists whereby you can verify that the version of a CAB program
running in CEE is the same as the version stored in ERDB. This is described in ”Verify
match of CAB program in ERDB.”
ATTENTION
If you are using the QVCS versioning system, refer to the topic “Special
considerations when using QVCS with CAB” for important information.
If you were saving a modified CAB type that was already on process, you would normally
select Cancel (Cancel is the default) because you would not wish to overwrite an on-
process CAB with one that is untested. Similarly, if you were debugging a new type but
wished to leave the old version in ERDB for a while longer, you would select Cancel. But
suppose that you are debugging and don't need to keep the old version of the type. You
select OK.
At this time, another condition comes into play. This condition is the nature of the changes
that have been made to the block type. For most changes, CB automatically converts all
existing instances to match the new block type. This is what would happen, for example, if
CDPs had been added to the type, parameter references had been added, or if any
algorithm changes had been made. However, under a specific set of conditions such as
R210 Custom Algorithm Block and Custom Data Block User's Guide 183
10/04 Honeywell
CAB configuration
Modify a CAB
deletion of a preexisting CDP, or changing the data type of a CDP, CB does not support
automatic conversion.
Suppose that you had modified CONTROLLER in such a way that a CDP was deleted. CB
would then respond to the save command as follows:
A "Save-As" dialog appears that gives the option of changing the name of the block type or
of canceling the save operation.
Faced with this dialog, you must now save the CONTROLLER to ERDB under a new
library or block name.
The fully qualified name for a CAB type consists of the library name concatenated with the
block type name. Thus, at this stage in the scenario, it is sufficient to change one or the
other. If the library name is left unchanged then the modified type goes into the preexisting
library under a new block type name. If the block type name is left unchanged then the new
block type goes into a different library under the old block type name.
To complete the scenario, suppose that you choose to leave the library name unchanged
and change the block type name to “CONTROLLERB.” You have now succeeded in
saving the modified version of "CONTROLLER" to the original library in ERDB, under
the new name "CONTROLLERB." What remains is to convert the preexisting instance,
CONTROLLER1, from an instance of CONTROLLER to an instance of
CONTROLLERB. The following section describes how to use the CB "Convert"
command.
Note that when save under a new name is done, the edit lock on the old type is
automatically cleared and a new lock is opened for the newly named type. The lock
remains active until you close MSVS for the new block type.
Figure 19 Saving modified CAB types” is a flow diagram that shows how various
conditions affect the save operation. This diagram covers the most usual scenarios but does
not necessarily cover every special case that might arise.
184 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Modify a CAB
R210 Custom Algorithm Block and Custom Data Block User's Guide 185
10/04 Honeywell
CAB configuration
Modify a CAB
186 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Modify a CAB
Step Action
1 Identify an in-service CAB instance that needs to be converted.
2 Decide whether the run-time instance contains any data that is not up to date in the
monitor side ERDB instance. If so, use the "Upload" command for the CM that contains
the CAB instance (right-click on the CM in the Monitor tree view and choose Upload).
3 Select the block instance to be converted in the project side chart view.
4 Right-click on the instance and choose Function Block Convert.
5 From the list that appears, select the new block type that should be assigned to the
instance.
6 Click Convert.
7 After the existing instance has been converted, you can inactivate, load and reactivate
the CM that contains the CAB instance.
Note that the convert function has fewer constraints than the Save to ERDB operation. For
example, you cannot Save to ERDB a block that has parameter deletions or data type changes if
there are existing instances of the block. These operations are permitted in the convert operation.
When a block instance is converted, the new type might have fewer parameters than the old
type, have more parameters than the original type, or have parameters with the same name but
different data type. These situations are handled as follows:
Parameters that have the same name and data type receive the value from the original instance.
• Parameters that have the same name but different data type are initialized to their
default values.
• Parameters present on the new block type but absent from the old are initialized to
their default values.
• Parameters absent from the new block type but present on the old are eliminated from
the new instance.
When converting instances, you might need to identify all instances of a block. See
“Discover CAB dependency relationships” for comments on locating instances of a type
using the Search functionality of Configuration Studio.k type.
R210 Custom Algorithm Block and Custom Data Block User's Guide 187
10/04 Honeywell
CAB configuration
Manage CABs
Manage CABs
Verify match of CAB program in ERDB
You can compare the values of parameter BLOCKTYPEID to verify that the version of a
CAB program running in a CEE is the same as the version stored within ERDB. Use the
following procedure:
Table 38 Verify CAB instance version
Step Action
1 Open the properties form for the CAB type defined within ERDB. This can be
done in one of two ways. Either open the form directly from the library tree, or
open the form for an instance of the CAB type within the project tree.
2 Read the value of BLOCKTYPEID from the form. This is a 36-character
numerical value.
3 Open the properties form for an instance of the CAB type within the monitoring
tree.
4 Read the value of BLOCKTYPEID from the form.
5 Compare the two values.
TIP
If you are interested in determining whether or not a specific code change is
loaded into a monitor side instance, you can compare the code displayed on
the Source tab of the monitor and project property forms.
188 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Manage CABs
Rename a CAB
You can rename a CAB type except under the following conditions:
• You cannot rename a CAB type that is open for edit.
• You cannot rename a CAB type, or change the library name, if the type has an
instance loaded to the monitor side.
There are no restrictions on renaming CAB instances.
REFERENCE - EXTERNAL
For more information about checkpoint and restore, see the section titled
“Using Checkpoint to Save and Restore Data” in the Control Building Guide.
R210 Custom Algorithm Block and Custom Data Block User's Guide 189
10/04 Honeywell
CAB configuration
Manage CABs
Export CAB
CABs can be exported from ERDB into a specified directory in the same manner that
native blocks are exported through the File > Export menu option. The procedures and the
user interface for doing so are covered in the Control Building Guide and are not
duplicated here. However, some important differences are highlighted here.
When you export native blocks, it is only the instance data that is extracted from ERDB. In
general, there is no need to extract native block types because they will already be defined
within the ERDB that is to receive the instances upon import. CAB types, however, are
different. When you export a CM that contains a CAB instance, you must also explicitly
export the CAB type into the same directory. This is because, in all likelihood, the
receiving ERDB will not already have a definition of the CAB type.
System services for export and import provide special handling for name collisions in CAB
types. A type name collision would occur if two engineers working with different ERDBs
had coincidentally chosen the same block name and the same library name for the type
they had created. Such a collision would not matter and would never be discovered unless
one engineer tried to import the block type into the ERDB used by the other. But if this did
happen, services associated with import would resolve the conflict by renaming the library.
To insure name collisions can be properly handled, export processing anticipates the
possibility of name change by supplying an internal identifier for associated types and
instances. This internal identifier is always unique and never changes. On import the
identifier can be used to properly match associated types and instances even when a type
name must change.
When you export a CAB, you must explicitly indicate both the requisite block types and
any requisite module instances. Types must always be selected explicitly. If instances are
exported without the associated types, any subsequent import operation will fail. CAB
types can be selected for export without any accompanying instances if the objective is
simply to transfer a program or toolkit from one ERDB to another.
When CAB types are exported, they always bring their library name with them. You may
choose whether to export the entire type content of the library or only a subset of the types.
Only those block types that have been explicitly selected are exported. To export an entire
library, you select all types contained within.
190 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Manage CABs
When a CAB type is exported, a directory structure is created. This directory structure is
used when importing. For more information on importing, see the next topic “Import
CAB.”
Import CAB
CABs can be imported from ERDB through the File > Import menu option. Block types
are imported first. Each fully qualified type name (library name with block type name) is
checked to determine if a duplicate exists within ERDB. If a duplicate is found, a
numerical suffix is automatically appended to the library name. After the name conflict is
resolved, the type is imported.
Status messages are reported during import to inform you if and when a library name
change occurs. Import messages are recorded in a log file called "IXP_log.txt" within the
directory:
"c:\Documents and Settings\All Users\Application Data\Honeywell\Experion PKS".
Following import, you have the opportunity to change the automatically generated names
if you desire.
When you import a CAB type, you must select the entire directory that the CAB type was
exported to. When CAB instances are imported, system services use both the type name
and the internal identifier to properly associate the instances with their types. If it is
discovered that the type associated with an instance has gone through a name change, the
instance's type name is changed to match and a status message is reported in file
IXP_log.txt.
ATTENTION
When a custom block type (CAB or CDB) is exported from one ERDB and
imported to another, the system that the type is imported to must be at an
Experion release level that is the same as or later than the release level of the
system that is being exported from.
R210 Custom Algorithm Block and Custom Data Block User's Guide 191
10/04 Honeywell
CAB configuration
Manage CABs
192 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB configuration
Manage CABs
1. If the system finds a library type whose library name and block name matches the
library name and block name associated with the type of the instance to be checked
out, the checkout (import) will be accepted with a warning message similar to the
following: “Import Warning for CM1.CAB1. BLOCKTYPEID checks for CAB
Block Type bypassed.” In this case, the BLOCKTYPEID of the checked out instance
will be changed to the BLOCKTYPEID of the type whose library and block names
match.
2. If the system cannot find a library type whose library name and block name matches
the library name and block name associated with the type of the instance to be
checked out, QVCS will display an error message and will reject the checkout
(import).
R210 Custom Algorithm Block and Custom Data Block User's Guide 193
10/04 Honeywell
CAB configuration
Manage CABs
194 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Create a new CDB type
CDB configuration
Create a new CDB type
CDB development environment
The CDB development environment is launched from the Control Builder application. The
development environment provided by Honeywell for CDB creation integrates the
following features into CB:
• Support for creation of new types for CDBs, and for adding these new types to the CB
library.
• Support for instantiating the new types into CMs, and for loading the type definitions
into the CEE.
• The Honeywell Parameter Definition Editor (PDE)—for configuration of custom data
parameters for CDBs.
R210 Custom Algorithm Block and Custom Data Block User's Guide 195
10/04 Honeywell
CDB configuration
Create a new CDB type
196 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Create a new CDB type
In this window, you enter your custom parameters (value CDPs). See “Define CDB custom
data parameters” for details on defining custom parameters.
Save Saves the PDE data to local storage and to the ERDB. This option is
only available if you have made changes.
Save As Do not use this command unless prompted to do so. See “Save As
Renew Renew command” below.
Save As Allows you to save another copy of the current block. You will be
prompted for the desired Library and Block names. If you keep the
same Library name, you must enter a different Block name. If you
choose a new Library name, the Block name can be the same as, or
different from, the name of the original block. After the save operation,
the block under edit in the PDE will be the new version.
R210 Custom Algorithm Block and Custom Data Block User's Guide 197
10/04 Honeywell
CDB configuration
Create a new CDB type
TIP
CDB types are different from CAB types in that there is not a separate
command to save to ERDB. The save commands in the table above save data
all the way through to the ERDB.
ATTENTION
A consequence of the Save As Renew command is that you will have to
reload all instances of the block. Alternatively, you may elect to cancel the
operation that you were doing when you received the error message indicating
the need for Save As Renew.
198 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Define CDB type parameters
CDP characteristics
Some characteristics of CDPs are:
• CDPs are directly analogous to the parameters of native block types. However, the
name, data type, access lock, and other properties, are not predefined. You specify
them during the process of defining the block type. Attributes that can be specified for
CDPs are described in "Reviewing custom parameters tab (Value CDPs)" in the
Parameter Definition Editor Reference. Data types are described in the section “Data
types for CDPs and parameter references” in this guide.
• Their values are persistent in the sense that they are maintained from creation until
deletion of the block instance. Their values are retained from one execution of the
block to the next.
• The data types available for the CDB CDPs are equivalent to those available for CAB CDPs.
• CDP values can be changed by writes from external blocks or other agents within the PKS.
However, since there is no program associated with a CDB, values are never changed as a
result of internal processing. Also, CDBs do not support parameter references.
R210 Custom Algorithm Block and Custom Data Block User's Guide 199
10/04 Honeywell
CDB configuration
Define CDB type parameters
• CDPs can be viewed from several different displays within the PKS. CDP values can
be configured in the CDB form using the CB project side instance. CDP values can be
read and written on process from the CDB form using the CB monitor side instance.
Values can be read and written using chart visualization from the Experion Station.
They can also be read and written from custom displays.
Operations that you perform in the PDE are covered in the Parameter Definition Editor
Reference. The following table includes useful links for Value CDP information:
Table 40 PDE information links for Value CDPs
Customizing the Value CDPs view (set of Reviewing PDE views for CAB and CDB
attributes that are displayed),
200 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Define CDB type parameters
R210 Custom Algorithm Block and Custom Data Block User's Guide 201
10/04 Honeywell
CDB configuration
Define CDB type parameters
202 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Define CDB type parameters
Control Builder X
during load of
CM or SCM
Supervisory X
batch
application
SCM X
CAB instance X X
Supervisory X
control
application
Algorithm X
function block
Human being X X X
storing from
CB monitoring
display
Human being X X X
storing from
Station display
Table 42 lists possible values for CDP Access Lock and their meanings. Each cell indicates
whether stores with the indicated Access Level will be accepted by a CDP that has been
assigned the indicated Access Lock.
R210 Custom Algorithm Block and Custom Data Block User's Guide 203
10/04 Honeywell
CDB configuration
Define CDB type parameters
Access level
View Only No No No No No No
Yes No No No No No
AppDevOnly
As an example of how to interpret the above tables, consider a CDP defined with Access
Lock = Engineer. Suppose a human being with engineering privileges is logged on and
using a Station display. This user can store to the CDP. Users logged with only Supervisor
or Operator privileges and using the same display cannot store to the CDP. Supervisory
Batch or Continuous Control applications can store to the CDP, as can any CEE function
blocks that have the capability to initiate stores.
204 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Define CDB type parameters
R210 Custom Algorithm Block and Custom Data Block User's Guide 205
10/04 Honeywell
CDB configuration
Define CDB type parameters
ATTENTION
Any modifications you later make to symbol attributes will not propagate to
existing CDB instances if you choose a Save and answer Yes when prompted
to update instances. There are two ways to change Symbol Attributes in
existing instances. Symbol Attribute changes must be done for each instance
by deleting and re-adding the block to the CM, or making the change in the
block properties form on the project side.
206 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Define CDB type parameters
Defining the layout of the properties form Reviewing Form Layout tab
If your block contains multiple parameters that are similar, you can copy a parameter and
paste it into multiple lines. The PDE will rename each parameter when you paste it, so that
you will probably want to change the names to suit your naming convention.
You can also copy one or more parameters and paste them into a separate block that is
open for edit. In this case, the PDE will not change the names.
R210 Custom Algorithm Block and Custom Data Block User's Guide 207
10/04 Honeywell
CDB configuration
Define CDB type parameters
208 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Create a CDB instance
Figure 25 below shows the Value CDPs tab as it appears when the Show Parameter
Names option is unchecked. In this view, the Parameter description that you entered
when you created the type is listed for each CDP, along with its default value. Figure 26
shows the Value CDPs tab when the Show Parameter Names tab is checked. In this case,
the parameter name is listed rather than the parameter description.
R210 Custom Algorithm Block and Custom Data Block User's Guide 209
10/04 Honeywell
CDB configuration
Create a CDB instance
The parameters that are listed on the form are the parameters that you configured when you
defined the CDB type in the PDE. The corresponding values shown for each parameter are
the default values that you assigned at that time (unless you subsequently changed the
default value for the instance, as described in the next paragraph).
If you were in the project tree view when you opened the properties form, you can change a
default value on the form and new value will be saved to the ERDB when the form is saved. It
will then be saved to the CEE when the block is loaded, provided that the parameter’s
Configuration load attribute was set to LOAD when you created the type. This change of a
default value will apply only to the specific block instance, and will not be reflected in other
instances of the type, nor will it change the value in the type definition.
If you opened the properties form from the monitor tree, you can change a parameter
value, and when you click OK on the form, you will be prompted as to whether or not you
want to save the online value:
210 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Test the Custom Data Block
If you click Yes, the new value will be loaded to the CEE immediately. The change will
not be reflected in the ERDB, and the next time the block is loaded, the default value
stored in the ERDB will be loaded.
R210 Custom Algorithm Block and Custom Data Block User's Guide 211
10/04 Honeywell
CDB configuration
Modify a Custom Data Block
The first option is used in development scenarios. During development, you are likely to
go through multiple cycles of changing CDB CDPs while debugging a strategy. It would
be very inconvenient to manually reassign type names at every pass through the cycle. To
avoid this, CB and CDB infrastructure allow modified types to be saved without name
changes. Existing instances are converted automatically on the project side subject to
constraints on the nature of changes that can be made.
When on-process CDB blocks must be modified, the second option is recommended. In
this case, you save the modified CDB type under a new name so that none of the on-
process blocks need be disturbed. Then you can convert the blocks one at time to the new
type, inactivate them, and reload them. The process of converting blocks can be carried on
over an extended period of time without risk.
When you use the second option, the CDB type used by the CEE instances is not
overwritten within ERDB. Both the old and new types remain until you have converted all
instances. After there are no remaining instances of the old type, you can delete it if
desired. You cannot delete it while there are remaining instances. As long as there is an
instance of the old CDB type within CEE or within ERDB, the old CDB type cannot be
deleted from ERDB.
Note that a procedure exists whereby you can verify that the version of a CDB running in
CEE is the same as the version stored in ERDB. This is described in “Verify match of
CDB version in ERDB.””
212 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Modify a Custom Data Block
R210 Custom Algorithm Block and Custom Data Block User's Guide 213
10/04 Honeywell
CDB configuration
Modify a Custom Data Block
ATTENTION
If you are using the QVCS versioning system, refer to “Special considerations
when using QVCS with CDB” for important information.
If you were saving a modified CDB type that was already on process, you would normally
choose Cancel (Cancel is the default) because you would not wish to overwrite an on-
process CDB with one that is untested. Similarly, if you were developing a new type but
wished to leave the old version in ERDB for a while longer, you would choose Cancel.
But suppose that you are still developing and don't need to keep the old version of the type.
You choose OK.
At this time, another condition comes into play. This condition is the nature of the changes
that have been made to the block type. For most changes, CB automatically converts all
existing instances to match the new block type. This is what would happen if CDPs had
been added to the type. However, under a specific set of conditions, such as deletion of a
preexisting CDP, or changing the data type of a CDP, CB does not support automatic
conversion.
Suppose that you had modified MYCDB in such a way that a CDP was deleted. CB would
then respond to the save command as follows:
A "Save-As" dialog appears that gives the option of changing the name of the block type or
of canceling the save operation.
Faced with this dialog, you must now save the MYCDB to ERDB under a new library or
block name.
The fully qualified name for a CDB type consists of the library name concatenated with the
block type name. Thus, at this stage in the scenario, it is sufficient to change one or the
other. If the library name is left unchanged then the modified type goes into the preexisting
library under a new block type name. If the block type name is left unchanged then the new
block type goes into a different library under the old block type name.
214 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Modify a Custom Data Block
To complete the scenario, suppose that you choose to leave the library name unchanged
and change the block type name to “MYCDBA.” You have now succeeded in saving the
modified version of "MYCDB " to the original library in ERDB, under the new name "
MYCDBA." What remains is to convert the preexisting instance, MYCDB1, from an
instance of MYCDB to an instance of MYCDBA. The section “Convert instances to
modified CDB type” describes how to use the CB "Convert" command.
Note that when save under a new name is done, the edit lock on the old type is
automatically cleared and a new lock is opened for the newly named type. The lock
remains active until you close the PDE for the new block type.
Figure 27 Saving Modified CDB Types” is a flow diagram that shows how various
conditions affect the save operation. This diagram covers the most usual scenarios but does
not necessarily cover every special case that might arise.
R210 Custom Algorithm Block and Custom Data Block User's Guide 215
10/04 Honeywell
CDB configuration
Modify a Custom Data Block
216 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Modify a Custom Data Block
Step Action
1 Identify an in-service CDB instance that needs to be converted.
2 Decide whether the run-time instance contains any data that is not up to date
in the monitor side ERDB instance. If so, use the "Upload" command for the
CM that contains the CDB instance (right-click on the CM in the Monitor tree
view and choose Upload).
3 Select the block instance to be converted in the project side chart view.
4 Right-click on the instance and choose Function Block Convert.
5 From the list that appears, select the new block type that should be assigned
to the instance.
6 Click Convert.
7 After the existing instance has been converted, you can inactivate, load and
reactivate the CM that contains the CDB instance.
R210 Custom Algorithm Block and Custom Data Block User's Guide 217
10/04 Honeywell
CDB configuration
Modify a Custom Data Block
Note that the convert function has fewer constraints than the Save to ERDB operation. For
example, you cannot Save to ERDB a block that has parameter deletions or data type
changes if there are existing instances of the block. These operations are permitted in the
convert operation.
When a block instance is converted, the new type might have fewer parameters than the
old type, have more parameters than the original type, or have parameters with the same
name but different data type. These situations are handled as follows:
• Parameters that have the same name and data type receive the value from the original
instance.
• Parameters that have the same name but different data type are initialized to their
default values.
• Parameters present on the new block type but absent from the old are initialized to
their default values.
• Parameters absent from the new block type but present on the old are eliminated from
the new instance.
When converting instances, you might need to identify all instances of a block type. See
“Discover CDB dependency relationships” for comments on locating instances of a type
using the Search tool in Configuration Studio.
218 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Modify a Custom Data Block
Step Action
1 Open the properties form for the CDB type defined within ERDB. This may be
done in one of two ways. Either open the form directly from the library tree, or
open the form for an instance of the CDB type within the project tree.
2 Read the value of BLOCKTYPEID from the form. This is a 36-character
numerical value.
3 Open the properties form for an instance of the CDB type within the monitoring
tree.
4 Read the value of BLOCKTYPEID from the form.
5 Compare the two values.
R210 Custom Algorithm Block and Custom Data Block User's Guide 219
10/04 Honeywell
CDB configuration
Modify a Custom Data Block
Rename a CDB
You can rename a CDB type except under the following conditions:
• You cannot rename a CDB type that is open for edit.
• You cannot rename a CDB type or change the library name if the type has an instance
loaded to the monitor side.
There are no restrictions on renaming CDB instances.
REFERENCE - EXTERNAL
For more information about checkpoint and restore, see the section titled
“Using Checkpoint to Save and Restore Data” in the Control Building Guide.
Export CDB
CDBs can be exported from ERDB into a specified directory in the same manner that
native blocks are exported through the File > Export menu option. The procedures and the
user interface for doing so covered in the Control Building Guide and are not duplicated
here. However, some important differences are highlighted here.
When you export native blocks, it is only the instance data that is extracted from ERDB. In
general, there is no need to extract native block types because they will already be defined
within the ERDB that is to receive the instances upon import. CDB types, however, are
different. When you export a CM that contains a CDB instance, you must also explicitly
export the CDB type into the same directory. This is because, in all likelihood, the
receiving ERDB will not already have a definition of the CDB type.
System services for export and import provide special handling for name collisions in CDB
types. A type name collision would occur if two engineers working with different ERDBs
had coincidentally chosen the same block name and the same library name for the type
they had created. Such a collision would not matter and would never be discovered unless
220 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Modify a Custom Data Block
one engineer tried to import the block type into the ERDB used by the other. But if this did
happen, services associated with import would resolve the conflict by renaming the library.
To insure name collisions can be properly handled, export processing anticipates the possibility of
name change by supplying an internal identifier for associated types and instances. This internal
identifier is always unique and never changes. On import the identifier can be used to properly
match associated types and instances even when a type name must change.
When you export a CDB, you must explicitly indicate both the requisite block types and
any requisite module instances. Types must always be selected explicitly. If instances are
exported without the associated types, any subsequent import operation will fail. CDB
types can be selected for export without any accompanying instances if the objective is
simply to transfer a program or toolkit from one ERDB to another.
When CDB types are exported, they always bring their library name with them. You can
choose whether to export the entire type content of the library or only a subset of the types.
Only those block types that have been explicitly selected are exported. To export an entire
library, you select all types contained within.
When a CDB type is exported, a directory structure is created. This directory structure is used
when importing. For more information on importing, see the next topic “Import CDB.”
Import CDB
CDBs can be imported from ERDB through the File > Import menu option. You must
select the strategies and block types for import. Block types are imported first. Each fully
qualified type name (library name with block type name) is checked to determine if a
duplicate exists within ERDB. If a duplicate is found, a numerical suffix is automatically
appended to the library name. After the name conflict is resolved, the type is imported.
Status messages are reported during import to inform you if and when a library name
change occurs. Import messages are recorded in a log file called "IXP_log.txt" within the
directory:
"c:\Documents and Settings\All Users\Application Data\Honeywell\Experion PKS".
Following import, you have the opportunity to change the automatically generated names
if you desire.
When you import a CDB type, you must select the entire directory that the CDB type was
exported to. When CDB instances are imported, system services use both the type name and the
internal identifier to properly associate the instances with their types. If it is discovered that the
type associated with an instance has gone through a name change, the instance's type name is
changed to match and a status message is reported in file IXP_log.txt.
R210 Custom Algorithm Block and Custom Data Block User's Guide 221
10/04 Honeywell
CDB configuration
Modify a Custom Data Block
222 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CDB configuration
Modify a Custom Data Block
1. If the system finds a library type whose library name and block name matches the
library name and block name associated with the type of the instance to be checked
out, the checkout (import) will be accepted with a warning message similar to the
following: “Import Warning for CM1.CDB1. BLOCKTYPEID checks for CDB
Block Type bypassed.” In this case, the BLOCKTYPEID of the checked out instance
will be changed to the BLOCKTYPEID of the type whose library and block names
match.
2. If the system cannot find a library type whose library name and block name matches
the library name and block name associated with the type of the instance to be
checked out, QVCS will display an error message and will reject the checkout
(import).
R210 Custom Algorithm Block and Custom Data Block User's Guide 223
10/04 Honeywell
CDB configuration
Modify a Custom Data Block
224 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Summary of example scenarios
Disclaimer
ATTENTION
The examples in this user guide are included solely for the purpose of
illustrating CAB and CDB functionality. They are not to be considered, in whole
or in part, as suitable for use in your control systems. Honeywell International
Inc. makes no representations or warranties, either expressed or implied, of
merchantability or fitness of these examples for any particular purpose. Under
no circumstances will Honeywell International Inc. be liable to any person or
business entity for any damages resulting from the use of any portion of the
material in these examples.
225 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
226 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
R210 Custom Algorithm Block and Custom Data Block User's Guide 227
10/04 Honeywell
CAB and CDB Example Scenarios
CAB insertion algorithm
To address this application, you will use the following block types.
Table 48 Block types in vapor-to-liquid ratio solution
Name Description
AICHANNEL Native block type. Has algorithm and data for one channel of
analog input.
PID Native block type. Does control loop computation and triggers
execution of the insertion point program at the right point in its
sequence.
VLR_CALC CAB type. Defines custom data and custom algorithm. Serves as
the insertion point program.
Control Module Native block type. One module serves as container for PID and
VLR_CALC instances. Other modules serve as containers for
AICHANNEL instances.
All except one of these block types is available as a standard algorithm (native block
type) within CB libraries. VLR_CALC is a CAB type that you create.
228 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
Note that by defining a parameter called "CP," you set up two kinds of name usage. One
usage is the external name references. These are always qualified by the independent
block name and dependent block name of the VLR_CALC instance as in
"VLRATIO.VLR_CALC1.CP". The other usage is the internal name references. These
are always qualified by a property name as in "CP.Value."
After definition of the value CDPs is complete, choose File > Save PDE Data (or click
the appropriate icon) in MSVS. This causes the definitions of CP and LAMBDA to be
saved in the development area. These definitions are now available for any algorithm
development to be done.
You can return to add or change value CDP definitions later. Each edit session must be
terminated with "Save PDE Data" or "Save All" before the algorithm source code
window can become aware of changes.
R210 Custom Algorithm Block and Custom Data Block User's Guide 229
10/04 Honeywell
CAB and CDB Example Scenarios
CAB insertion algorithm
The meaning of each attribute in the above table is described in “Define parameter
references.”
In VLR_CALC, all references except PVCALC are used for reading input values. The
PVCALC reference is used for writing the computed PV to the associated PID block
After parameter reference definitions are complete, command File > Save PDE Data or
File > Save All at MSVS. This causes the definitions of TOPT through PVCALC to be
saved in the development area. These definitions are now available for algorithm
development.
230 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
Private K As Double
R210 Custom Algorithm Block and Custom Data Block User's Guide 231
10/04 Honeywell
CAB and CDB Example Scenarios
CAB insertion algorithm
WV = DRAWFLOW.Value + W1
End Sub
End Class
• Imports Statements
Block types are declared as classes within VB.NET. The name of the class shown
here is "CABlock" and is the same for all CAB types. Within CB and CEE, different
CAB types are distinguished by their filenames and by internal identifiers rather than
by their class names. The name you declared at the time of File > New > Type >
Custom Algorithm Block is visible under the library tree in CB after the save to
ERDB.
• Inherits BlockBase
The Inherits statement indicates that the CAB type acquires attributes and
behaviors from the parent class called "BlockBase." BlockBase is automatically
generated by the CAB build-time software to capture the specifications of value
CDPs and parameter references that you entered in the PDE.
232 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
• Private K As Double
The program computes a persistent constant called K for use within the program. K is
a block scope variable as described in “Define block scope variables.” K is declared at
the scope of the class and is thus visible to any subroutine or function defined within
the class. K is not visible outside the VLR_CALC program.
CP and LAMBDA are predefined CDPs. Their values are accessed via the Value
property as indicated in “CDP classes.” TOPT, TRAYT, through PVCALC are
predefined PRefs. Their values are also accessed through the Value property as
described in “Parameter reference classes.”
The keyword "Overrides" indicates that Execute() has been defined within
BlockBase but the CE is providing her/his own definition here.
The program includes three variables, W1, WV, and Ratio, for use only within
subroutine Execute(). These are local variables of the subroutine. Their values last
only for the duration of subroutine processing. They are not visible outside the
VLR_CALC program.
• PRefList.Read()
Since PRefs are used in the Execute() subroutine CAB infrastructure needs to be told
to fetch the referenced data so that it will be available via the Value properties. This is
accomplished for all PRefs in Execute() with the single PRefList.Read() statement.
Alternatively, you could have issued a Read() call for each individual PRef. Using a
single statement for all is more convenient.
R210 Custom Algorithm Block and Custom Data Block User's Guide 233
10/04 Honeywell
CAB and CDB Example Scenarios
CAB insertion algorithm
• K = CP.Value / LAMBDA.Value
• WV = DRAWFLOW.Value + W1
Variables defined within the program differ from names defined within the PDE
window in that they are not used with a ".Value" property. Thus, the appearance of
WV and W1 in this expression. Unlike CP, DRAWFLOW is a parameter reference.
This means that using "DRAWFLOW.Value" in an expression actually references
data that has been fetched from a block outside the VLR_CALC block.
• PVCALC.Value = Ratio
After the desired ratio is calculated, it is stored to the PVCALC parameter reference.
In this example, PVCALC points to a PID block that serves as the insertion point call
driver. In general, PRefs can point to any block.
• PRefList.Write()
In order to transfer the data out through the output PRefs, the Write() subroutine must
be invoked, either once for each output PRef or once for all output PRefs using
PRefList.Write(). In this case there is only one output PRef so either method would
have been equally convenient. This program is written according to the prevailing
style using a single statement that handles any number of output references.
Note that the VLR_CALC block type is very simple and does not require user-defined
subroutines. In general, you can use whatever user-defined subroutines or functions you
need. However, they must be included directly within the main source file or they must
be included as separate source files within the same Visual Studio project. Also, any files
added to the project must be placed within the CAB source directory. If they are
preexisting files, they must be copied into the CAB source directory.
After you enter the program into the source code window, you save it into the
development area. To do this, invoke File > Save Selected Items or File > Save All.
After the source code has been saved, you can compile and link. To do this, invoke File
> Build > Build Solution. If the build operation generates compile errors, correct the
source code and repeat the build until all errors are eliminated.
234 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
Name Description
R210 Custom Algorithm Block and Custom Data Block User's Guide 235
10/04 Honeywell
CAB and CDB Example Scenarios
CAB insertion algorithm
Name Description
Configure VLR_CALC1
The process of configuring CAB instances is basically the same as configuring native
block instances. Double-clicking on the block symbol within the control chart accesses
the properties form. When the form comes up, values can be entered. The form can be
used to specify and load properties parameters but can also be used to display view only
parameters when monitoring.
The figure below shows the Value CDPs properties form for VLR_CALC1.
Figure 29 Value CDP configuration for VLR_CALC1
One behavior is worthy of note here. When type VLR_CALC was defined, both value
CDPs were declared to have Configuration Load attribute = LOAD. Because of this, they
would not be grayed out in the configuration VLR_CALC1 form. If either had been
declared with Configuration Load = NOLOAD, it would have been grayed out and would
not be alterable on the form.
The default values for CP and LAMBDA that were defined when VLR_CALC was
created can be changed now. Or, they can be left unchanged. The values that result from
configuration will be sent to CEE when VLR_CALC1 is loaded.
Type VLR_CALC also had parameter references defined when it was created. Because
of this, the configuration form has a Parameter Reference tab, which is shown in the next
figure. Note that in this figure, the parameter names are shown, as opposed to the
parameter descriptions. This is achieved by checking the Show Parameter Names option
on the form as shown below.
236 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
When the form first appears the Reference Address column is blank as shown above.
Each parameter reference that you declared within the definition of VLR_CALC now
requires an address to be entered. A pick list is used to generate each parameter address.
You can also type in the parameter address. After you have completed all entries, the
form would be as shown in the next figure.
R210 Custom Algorithm Block and Custom Data Block User's Guide 237
10/04 Honeywell
CAB and CDB Example Scenarios
CAB insertion algorithm
Based on this configuration, when a value is read from "TOPT.Value" within the
program of VLR_CALC1, the value of TI201.AI1.PV will be read. Similarly, when
"PVCALC.Value" is written to, parameter VLRATIO.VLR_CTL1.PV will be written.
VLR_CALC1 is used within VLRATIO as a block whose execution is stimulated by a
partner block that calls the Execute() subroutine at an appropriate step in its own
execution sequence. In this application, the partner block is VLR_CTL1. Since
VLR_CTL1 is to act as execution master, VLRATIO, the parent CM, must not trigger the
execution of VLR_CALC1. To arrange this, the system sets the INSERTION parameter
on VLR_CALC1 to indicate no execution by the parent CM. This happens when you
configure VLR_CALC1 as an insertion point algorithm on the execution master, PID
VLR_CTL1 (see the next topic). At the same time, the ORDERINCM parameter on the
inserted CAB block is changed to match the ORDERINCM setting of the calling master.
Note, however, that although a CAB configured as an insertion point adopts the
ORDERINCM of its master, if the configuration is changed such that the CAB is no
longer configured as an insertion point, its ORDERINCM value does not revert back to
the value that it was before the CAB was configured as an insertion point.
238 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CAB insertion algorithm
Configure VLR_CTL1
VLR_CTL1 is a PID instance and is configured like any other. However, the manner in
which insertion points are configured is functionality that is special for CAB.
PID supports multiple different points in its execution flow where a call-out to another
block can be inserted. These points are:
• Post-Input—CAB instance inserted after input processing
• Pre-Alg—CAB instance inserted prior to algorithm processing
• Ctl-Alg—CAB instance replaces built-in algorithm
• Post-Alg—CAB instance inserted after algorithm processing
• Post-CtlOut—CAB instance inserted after control output processing
For this example, assume that you choose to configure the PID instance so that the CAB
VLR_CALC1 is inserted into the PID VLR_CTL1 at the Post-Input insertion point.
The method for doing this is covered in Control Builder documentation, but the general
procedure is as follows. On the properties form for VLR_CTL1, you select the tab that
allows you to configure the insertion point. On this tab, there is a drop-down list box that
allows you to select the insertion point. You select “Post-Input.” There is also a text box
with a browser button that you use to browse to and select the CAB instance that you
wish to use for the insertion point algorithm. For more information on insertion point
configuration, see “Configure insertion points.”
R210 Custom Algorithm Block and Custom Data Block User's Guide 239
10/04 Honeywell
CAB and CDB Example Scenarios
CAB insertion algorithm
240 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Formulation of VLR_CALC without insertion point
R210 Custom Algorithm Block and Custom Data Block User's Guide 241
10/04 Honeywell
CAB and CDB Example Scenarios
Formulation of VLR_CALC without insertion point
VLR_DACQ1.ORDERINCM = 10
VLR_CALC1.ORDERINCM = 20
VLR_CTL1.ORDERINCM = 30
242 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
CDPs as Engineering Unit labels
R210 Custom Algorithm Block and Custom Data Block User's Guide 243
10/04 Honeywell
CAB and CDB Example Scenarios
CDPs as Engineering Unit labels
• You wish to create a custom block type that will be instantiated multiple times and
used in different ways. Each CDP can have different EUs depending on how the
block is instantiated.
As an example, consider the CAB type VLR_CALC described in “CAB insertion
algorithm.” Suppose you wish VLR_CALC to work with a fixed set of EUs for CP and
LAMBDA. To accomplish this, you can define CDPs as shown in the following table.
Table 53 Value CDP definitions for VLR_CALC with "EU Label" CDPs
In this example, you specified CPEU and LAMBDAEU to have ViewOnly access lock.
This means that the units are fixed with the type and every instance must specify CP and
LAMBDA values with those units. In other applications you might wish to specify an
Access Lock of Engineer. This would allow CPEU and LAMBDAEU to be specified as
part of instance configuration. However, in that case, it would also be necessary to design
the CAB algorithm to handle the appropriate EU scaling.
With CP, CPEU, LAMBDA and LAMBDAEU defined as shown in the table above, all
four parameters would be shown in properties form for a VLR_CALC instance, making
it clear which units are required. This same form would be visible as an operations
display through the chart visualization capability of CB and EPKS Server. If a custom
display was created to support VLR_CALC, the EU values for CP and LAMBDA could
be presented on the display along with the data values.
244 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
A CDB to hold sensor data
Name Description
AICHANNEL Native block type. Has algorithm and data for one channel of
analog input
DATAACQ Native block type. Does signal conditioning and alarming for one
analog input or other numeric value.
POSTEMPCDB Custom data block type. Holds data that characterizes temperature
at one position within one PFR zone.
R210 Custom Algorithm Block and Custom Data Block User's Guide 245
10/04 Honeywell
CAB and CDB Example Scenarios
A CDB to hold sensor data
After CDP definition is complete, execute the Save command at CB. This causes block
type POSTEMPCDB and its parameter definitions to be saved in ERDB.
POSTEMPCDB is now available for use. You can return to add, change or delete CDP
definitions later.
246 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
A CDB to hold sensor data
Name Description
Configure POSTEMP1.DATA1
The process of configuring CDB instances is the same as that of native or CAB instances.
Double-click on the block symbol in the control chart to open the properties form.
Block type POSTEMPCDB has five CDPs defined on it. Thus, when the form for
POSTEMP1.DATA1 opens, five parameters appear. This is shown below where it is
assumed that you have already made data entries for the fields that allow it.
Table 57 Value CDP configuration in POSTEMP1.DARA1
On the form, only the value CDP entries for ZONE, POSITION, and DESCR can be
modified. The description field that goes with each parameter indicates the meaning of
the parameter and is fixed at block type creation time.
The value CDP fields for TEMP and BAD cannot be modified because these parameters
were declared not configurable. This is indicated above with italics.
R210 Custom Algorithm Block and Custom Data Block User's Guide 247
10/04 Honeywell
CAB and CDB Example Scenarios
A CAB to calculate statistics over arrays
The DESCR parameter is a string parameter. This value can and should be defined at
instance configuration time. Note how it differs from the description field of CDPs.
When viewed from the monitor side at runtime, all five parameters show data read
directly from the CEE.
248 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
A CAB to calculate statistics over arrays
POSITION and TEMP are both array parameters. They are designed to connect directly
with parameters of the same name on an instance of block type ZONETEMPCDB, called
ZONETEMP1.
MAXTEMP, MAXPOS, MINTEMP, MINPOS and AVGTEMP are real valued statistics
parameters computed by looping over the TEMP array. The access lock of these
parameters is declared to be VIEWONLY. This means that external agents cannot write
to these parameters, but program ZONESTATSCAB can.
MAXPOS and MINPOS give, respectively, the position of maximum and minimum
temperature within the zone. They are computed by looping over data received in
POSITION and TEMP.
Block type ZONESTATSCAB has value CDP definitions but no parameter reference
definitions. The output parameters provided by ZONESTATSCAB (MAXTEMP,
MAXPOS, MINTEMP, MINPOS, AVGTEMP) are collected asynchronously by
displays. Thus, they can only be supported by value CDPs.
The inputs needed by ZONESTATSCAB require bulk array transport from the source.
This is not supported by CAB parameter references. Thus, value CDPs POSITION and
TEMP are used to bring in array data from a process-connected controller. The
connectivity to source data is accomplished through the use of CM graphical connections
rather than CAB parameter references.
R210 Custom Algorithm Block and Custom Data Block User's Guide 249
10/04 Honeywell
CAB and CDB Example Scenarios
A CAB to calculate statistics over arrays
SetOutputsToBad()
AVGTEMP.Value = 0.0
For I = 0 To 4
If IsNaN(TEMP(I).Value) Or IsNaN(POSITION(I).Value) Then
SetOutputsToBad()
Exit For
Else
AVGTEMP.Value = AVGTEMP.Value + TEMP(I).Value
If IsNaN(MAXTEMP.Value) Or MAXTEMP.Value < _
TEMP(I).Value Then
MAXTEMP.Value = TEMP(I).Value
MAXPOS.Value = POSITION(I).Value
End If
If Not (MINTEMP.Value <= TEMP(I).Value) Then
MINTEMP.Value = TEMP(I).Value
MINPOS.Value = POSITION(I).Value
End If
End If
Next I
AVGTEMP.Value = AVGTEMP.Value / 5
End Sub
Dim I As Integer
250 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
A CAB to calculate statistics over arrays
For I = 0 To 4
POSITION(I).Value = NaN
TEMP(I).Value = NaN
Next I
End Sub
Sub SetOutputsToBad()
MAXTEMP.Value = NaN : MAXPOS.Value = NaN
MINTEMP.Value = NaN : MINPOS.Value = NaN
AVGTEMP.Value = NaN
End Sub
End Class
R210 Custom Algorithm Block and Custom Data Block User's Guide 251
10/04 Honeywell
CAB and CDB Example Scenarios
A CAB to calculate statistics over arrays
At runtime, the values of TEMP and POSITION are used internally within
ZONESTATS1.ALG1 for computing the statistics parameters as indicated in the
algorithm above.
Note that CM hierarchies are well suited to the logical representation of a PFR control
application such as described in this and preceding sections. For example, a top level CM
could be used to model the entire PFR. It could hold multiple CMs each representing a
zone. The zone CMs could hold each of the temperature–position CMs. However, the use
of CM hierarchies in control applications is not specific to CAB or CDB functionality
and is not described in detail within this document.
252 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Array and scalar variables in CAB
Example variables
The variables used in this example are as follows. These names were chosen to signify
the type of variable rather than the meaning of the variable within an application.
• LclSclrVar - Local Scalar Variable
Declared explicitly within the Execute() subroutine of the user's source code.
• LclArrVar - Local Array Variable
Declared explicitly within the Execute() subroutine of the user's source code.
• BlkScpSclrVar - Block Scope Scalar Variable
Declared explicitly within the CAB class outside the scope of any subroutine.
• BlkScpArrVar - Block Scope Array Variable.
Declared explicitly within the CAB class outside the scope of any subroutine.
• SCLRCDP - SCaLar value CDP
R210 Custom Algorithm Block and Custom Data Block User's Guide 253
10/04 Honeywell
CAB and CDB Example Scenarios
Array and scalar variables in CAB
PDE definitions
PDE definitions for the value CDPs and parameter references could be as shown below.
In this example, it is assumed that you wish to create parameter ARRCDP as a one-
dimensional array with a base index different from the default. To do so, you must
expose more attributes than are presented within the default view of PDE (refer to the
Parameter Definition Editor Reference for information). The table below shows all
supported CDP attributes. This table is displayed in a vertical format rather than the
normal horizontal format so that it fits on the page.
254 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Array and scalar variables in CAB
Parameter name
The minimum and maximum values for SCLRCDP and ARRCDP correspond to the
maximum finite magnitudes for a FLOAT64. These values are defaulted by PDE. You
can narrow the range if you desire. In accordance with the Data Owner Principle, range
limits are checked whenever an external agent makes a store into a CAB instance. They
are not checked for writes by the CAB program itself.
R210 Custom Algorithm Block and Custom Data Block User's Guide 255
10/04 Honeywell
CAB and CDB Example Scenarios
Array and scalar variables in CAB
Instance configuration
Instance configuration for the value CDPs could be as follows. Note that although the
table shows all elements of ARRCDP(), the properties form would show the array in
scrollable form.
Table 61 Value CDP configuration
256 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Array and scalar variables in CAB
Program
The following program uses the variables defined above. The algorithm is not intended to
be useful— it is intended to demonstrate the variable syntax. Note that whereas the
indices for BlkScpArrVar and LclArrVar are in the range 0 to 9, the index for ARRCDP
is in the range 1 to 10.
R210 Custom Algorithm Block and Custom Data Block User's Guide 257
10/04 Honeywell
CAB and CDB Example Scenarios
Array and scalar variables in CAB
For LclSclrVar = 0 To 9
LclArrVar(LclSclrVar) = _
BlkScpArrVar(LclSclrVar) * SCLRPREFSCLR.Value
ARRCDP(LclSclrVar + 1).Value = _
LclArrVar(LclSclrVar) * SCLRPREFFXD.Value
Next LclSclrVar
End Sub
BlkScpSclrVar = 0
For LclSclrVar = 0 To 9
BlkScpArrVar(LclSclrVar) = LclSclrVar / SCLRCDP.Value
BlkScpSclrVar = BlkScpSclrVar + BlkScpArrVar(LclSclrVar)
Next LclSclrVar
End Sub
End Class
258 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Initializing in response to system events
PDE definitions
Assume that you decided not to use PRefs in the solution to this problem. CDP
definitions are shown below:
Table 63 Value CDP definitions
R210 Custom Algorithm Block and Custom Data Block User's Guide 259
10/04 Honeywell
CAB and CDB Example Scenarios
Initializing in response to system events
HISTORY is a one-dimensional array CDP. You decided to leave its index lower bound
at the default of 0 as this is natural with a wrapping buffer.
Program
'Imports for the standard Honeywell supplied namespaces
Imports Honeywell.CAB.SysCommon
Imports Honeywell.CAB.SysBase
Imports Honeywell.CAB.BlockBase
Imports Honeywell.CAB.Math
End Sub
Case CEEWarmStart
PVIN.Value = NaN
' Assume most of the history is valid but insert some Nan
' values so the operator can see there is a discontinuity.
For i = LASTINDEX.Value + 1 To LASTINDEX.Value + 3
HISTORY(i Mod 64).Value = NaN
Next i
LASTINDEX.Value = ((LASTINDEX.Value + 3) Mod 64)
Case Else
' This is where we end up for Restart of BlockLoad,
260 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Example using data type TIME
End Select
End Sub
End Class
R210 Custom Algorithm Block and Custom Data Block User's Guide 261
10/04 Honeywell
CAB and CDB Example Scenarios
Example using data type TIME
Although EPKS transports TIME values as universal time, they are always displayed as
local time. Thus a supervisor can verify timely execution of a SHIFTCALC instance by
examining LASTRUNTIME on an operational display. The display will show the time of
last calculation as local time.
262 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Example using data type TIMEOFDAY
End Sub
End Class
Note that in the code above the internal subroutine DoShiftCalculations() is declared with
VB.NET access type Private. This is not strictly necessary. But it is recommended as it
accurately documents the way in which the subroutine can be used. Subroutines in CAB
types can only be used internally to the type.
264 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Example using data type TIMEOFDAY
End Sub
R210 Custom Algorithm Block and Custom Data Block User's Guide 265
10/04 Honeywell
CAB and CDB Example Scenarios
Example using data type DELTATIME
End Sub
End Class
Note that in the code above the internal subroutine DoCalculations() is declared with
VB.NET access type Private. This is not strictly necessary. But it is recommended as it
accurately documents the way in which the subroutine can be used. Subroutines in CAB
types can only be used internal to the type.
266 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Example using data type DELTATIME
R210 Custom Algorithm Block and Custom Data Block User's Guide 267
10/04 Honeywell
CAB and CDB Example Scenarios
Example using data type DELTATIME
If STOPTIMING.Value Then
STARTTIMING.Value = False
STOPTIMING.Value = False
Running = False
End If
If STARTTIMING.Value Then
STARTTIMING.Value = False
Running = True
TARGETTIME.Value = Now.UtcNow.Add(TIMEOUT.Value)
TARGETTIME.Value = TARGETTIME.Value.Add(TIMEOUT.Value)
End If
End Sub
End Class
Note that in the code above the internal subroutine HandleTimeOut() is declared with
VB.NET access type Private. This is not strictly necessary. But it is recommended as it
accurately documents the way in which the subroutine can be used. Subroutines in CAB
types can only be used internal to the type.
268 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of data access status in CAB
R210 Custom Algorithm Block and Custom Data Block User's Guide 269
10/04 Honeywell
CAB and CDB Example Scenarios
Use of data access status in CAB
270 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of data access status in CAB
Imports CAB.CommandEnum
Imports CAB.DeviceCommandEnum
Imports CAB.DeviceStatusEnum
R210 Custom Algorithm Block and Custom Data Block User's Guide 271
10/04 Honeywell
CAB and CDB Example Scenarios
Use of data access status in CAB
Case Stop_
DEVICECMD.Value = DeviceStop
DEVICECMD.Write()
CommandState = Stop_
Case Run
DEVICECMD.Value = DeviceRun
DEVICECMD.Write()
CommandState = Run
Case Else
' Operator error, ignore
OPERCMD.Value = NoCommand
End Select
End Sub
End Class
272 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
"Imports CAB.CommandEnum".
• There is a member called “Stop_” in the CommandEnum enumeration. The name
"Stop" would have been more natural but could not be used because it collides with a
VB.NET keyword.
• There is no apparent reason to expose the value of CommandState to the outside
world. Thus, it is defined as a block scope variable rather than a CDP.
• The program checks for bad values of OPERCMD within the Select statement. If
found, it simply over-writes them.
• The program uses the built-in PROGSTSDESC parameter to publish any problems it
discovers.
• The program uses the Abort() subroutine to force an exception and event when a
problem is discovered.
R210 Custom Algorithm Block and Custom Data Block User's Guide 273
10/04 Honeywell
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
SETMODE also supports the operation of taking CMs out of the automatic operating
mode.
274 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
R210 Custom Algorithm Block and Custom Data Block User's Guide 275
10/04 Honeywell
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
Enum CMExecStateEnum
Inactive = 0 : Active = 1
End Enum
Enum RCModeAttrEnum
Operator = 1 : Program = 2
End Enum
Enum RCModeEnum
RCManual = 0 : RCAutomatic = 1
End Enum
Enum MyRequestEnum
NoRequest = 0 : ControlManual = 1 : ControlAutomatic = 2
End Enum
Enum MyResponseEnum
Pending = 0 : Succeeded = 1 : Failed = 2
End Enum
276 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
Enum MyStateEnum
NoAction = 0 : DoWrite = 1 : DoCheck = 2
End Enum
Class CMRefClass
Public IsNull As Boolean
Public ExecState As Int32PRef
Public ModeAttr As Int32PRef
Public Mode As Int32PRef
End Class
State = NoAction
ModeTarget = RCManual
REQUEST.Value = NoRequest
RESPONSE.Value = Succeeded
IllegalNullRef = False
' For each CMRef assign the PRefs and check for consistency.
' If inconsistency is found, flag bad configuration.
If Not SetUpCMRef(0, EXECSTATE1, MODEATTR1, MODE1) Then
IllegalNullRef = True : Exit Sub
End If
If Not SetUpCMRef(1, EXECSTATE2, MODEATTR2, MODE2) Then
IllegalNullRef = True: Exit Sub
End If
R210 Custom Algorithm Block and Custom Data Block User's Guide 277
10/04 Honeywell
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
End If
End Sub
278 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
End Function
R210 Custom Algorithm Block and Custom Data Block User's Guide 279
10/04 Honeywell
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
Case DoWrite
Select Case ProcessWrite()
Case Failed
Response.Value = Failed
State = NoAction
Case Else ' MyResponseEnum.Pending
State = DoCheck
End Select
Case DoCheck
Select Case CheckWriteStatus()
Case Failed
Response.Value = Failed
State = NoAction
Case Succeeded
Response.Value = Succeeded
State = NoAction
Case Else ' MyResponseEnum.Pending
' Keep checking
End Select
280 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
End Select
End If
End Sub
R210 Custom Algorithm Block and Custom Data Block User's Guide 281
10/04 Honeywell
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
Return Succeeded
End Function
Enum enumMyRequest
None = 0 : ControlManual = 1 : ControlAutomatic = 2
End Enum
• The program uses a simple VB.NET class to group parameter references that point to
the same Control Module. This is the class "CMRefClass".
• CMRefClass has 3 data members of type "Int32PRef". There is an additional
Boolean data member, "IsNull". When True, IsNull indicates that all of the parameter
references are null. When false, IsNull indicates that none of the parameter references
are null. The IsNull data member of CMRefClass is set by using the IsNull property
of Int32PRef to identify null references.
• The program uses a block scope array variable, "CMRef(5)" to allow indexing over
each CM.
• Within the Initialize() subroutine are copies of the parameter references
established at configuration time into CMRef(). This is a way to work around the fact
that CAB does not support indexed parameter references.
282 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
• The CMRef array is only initialized as a result of block configuration load. It's not
necessary to do this initialization at any other time as the address of a parameter
reference can only change during load.
• Initialize() also does validation checking on the parameter reference configuration of
the instance. The CAB type is designed so that all instances must obey these rules:
− If any of the three parameters on a particular CM are referenced then all three
must be referenced.
− Up to five CMs can be referenced but at least one CM must be referenced.
− If only one CM is referenced then the parameter references labeled "1" must be
used.
− The non-null references must be at low indices and the null references at high
indices.
• The program has defined four internal functions to make the program simple and
readable. These are Initialize(), SetUpCMRef(), ProcessWrite(), CheckWriteStatus()
and Check1ParameterWrite(). These routines are distinct from Execute() in that they
are unknown to the CAB system infrastructure. Also, no other CAB type can use
them.
• Two of the internal functions, SetUpCMRef() and Check1ParameterWrite(), pass
arguments of type Int32PRef.
R210 Custom Algorithm Block and Custom Data Block User's Guide 283
10/04 Honeywell
CAB and CDB Example Scenarios
Use of parameter reference variables in CAB
284 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB operations
Startup and shutdown
Custom Algorithm Blocks
Startup and shutdown of the CAB build-time environment (tools for creating CAB types)
are manual procedures within the Experion CB application. Startup of the MSVS
development environment occurs when you use CB menu selections to initiate the
creation or edit of a CAB type. Shutdown occurs when you end the creation or edit
session by closing MSVS.
Startup and shutdown behavior of CABs in the run-time environment follows that of the
ACE application on which they are hosted. Behavior is equivalent to that of any native
block running on ACE. This includes block activation or deactivation. In addition, CAB
algorithm execution terminates automatically if its execution time exceeds 250
milliseconds (see “Transition descriptions”).
Process operations
Monitor CAB and CDB
Monitoring CAB and CDB operations is the same as for strategies using native blocks.
The normal Experion monitoring features apply to CAB and CDB. CAB and CDB can be
monitored as part of routine process operations, which would normally be conducted
from Station. You can also use standard Windows performance monitoring tools. See
“Resource management” for more information.
285 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB operations
View CAB and CDB from Station
TIP
The block property forms can be customized in PDE when the type is defined.
The form configurations shown below are the default configurations.
286 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB operations
Properties forms specific to CAB and CDB
R210 Custom Algorithm Block and Custom Data Block User's Guide 287
10/04 Honeywell
CAB and CDB operations
Properties forms specific to CAB and CDB
The figure shows a portion of a CAB properties form. A CDB form will not have the
Parameter References, Source, and Alarms tabs.
If you view the Value CDPs tab on the monitor side, you can change CDP values on the
running CAB. If you view the tab on the project side, you can change values only if the
parameter’s Configuration load attribute was set to LOAD when you created the type,
but they will not be reflected in the monitor side instance until you do a load.
288 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB operations
Properties forms specific to CAB and CDB
If you view this tab on the project side, you can use the browse buttons to configure
parameter references (or change existing references). You can also type in or past in a
parameter reference address instead of using the browse button. You must do a load for
these parameters to be reflected on the monitor side instance. If you view the tab from the
monitor side, you can see the last-loaded references but you cannot change them.
Source tab
This tab is present for CAB instances. It displays the CAB algorithm. On the project side,
it displays the most recent code saved to ERDB from MSVS. On the monitor side, it
shows the last-loaded version of code (the code that the instance is using). If you modify
and save code, you must do a load to transfer the new code to the monitor side instance.
The Source tab has some important uses. It can be used to compare the code that is
running in the CEE (monitor side) with the code stored in the ERDB (project side). It can
also be used to recover code that has been saved over. See ‘Recover CAB source code.’
R210 Custom Algorithm Block and Custom Data Block User's Guide 289
10/04 Honeywell
CAB and CDB operations
Properties forms specific to CAB and CDB
290 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB operations
Properties forms specific to CAB and CDB
Alarms tab
This tab is present on CAB Block Properties forms.
Figure 39 Alarms Tab on CAB Block Properties Form
For information on the parameters that are displayed on this tab, see “CAB alarms.”
You can change configuration values on the project side, but you must do a load to
reflect them on the monitor side. You cannot change values on the monitor side.
R210 Custom Algorithm Block and Custom Data Block User's Guide 291
10/04 Honeywell
CAB and CDB operations
Properties forms specific to CAB and CDB
292 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system administration
CAB development environment administration
Recovering from a Control Builder crash
In the unlikely event that Control Builder crashes while Visual Studio is open to create or
edit a CAB type, it is possible that the Visual Studio process will not terminate properly.
If this happens, you will need to use Task Manager to delete any instance of devenv.exe
that is running.
User management
User management functions
CAB and CDB use the standard Experion user management features. For example,
access to Control Builder requires a logon password. Access to parameters in the run-
time environment are determined by the Access Lock attributes that are configured when
the block type is created.
The CAB developer’s license is a user management function that is special for CAB. A
developer’s license is required for users to be able to create and edit CAB types. For
more information, see “Licensing considerations.”
• The NT user account that the user is logged on the client must also exist on the
SimACE with the same password.
• This User account on the SimACE must be a member of the "Administrators" group.
• To prevent the user from logging on the SimACE, the "Deny logon locally" Policy
should be set for the user. This is done by executing "Local Security Settings" under
Administrative Tools and clicking on "User Rights Assignment".
• On the client, the User account should be added to the "Debugger Users" group.
293 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system administration
Resource management
Resource management
Overview
Most resource management functions for CAB and CDB are the same as normal
Experion system resource management functions. Because of the nature of CAB,
however, you might wish to pay special attention to monitoring ACE processor and
memory utilization. The section “Determine ACE shutdown horizon” contains
information about how to estimate ACE memory usage, especially the memory
consumed by “orphan” CAB types resulting from development and debug activities.
This section describes three CAB FDPs that may help you determine if a CAB instance is
nearing its performance limits. This section also contains some tips for using standard
Windows monitoring tools to observe ACE memory and processing statistics.
You can also obtain information from Experion monitoring functions. For example, if
your CAB applications start to experience timeout errors, it could be an indication that
you are starting to overload the CPU. It could also indicate that a CAB algorithm is in an
unintended loop.
294 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system administration
Resource management
R210 Custom Algorithm Block and Custom Data Block User's Guide 295
10/04 Honeywell
CAB and CDB system administration
Resource management
296 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system administration
Resource management
Step Action
1 Click Start, choose Run, enter “perfmon” in the Open box, and click OK.
2 Right-click and choose Properties.
R210 Custom Algorithm Block and Custom Data Block User's Guide 297
10/04 Honeywell
CAB and CDB system administration
Resource management
Step Action
3 Click Add.
298 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system administration
Resource management
Step Action
4 Select Process in the Performance Object box. Choose ACE in the instance
list. Choose % Processor Time in the list of counters. Click Add.
R210 Custom Algorithm Block and Custom Data Block User's Guide 299
10/04 Honeywell
CAB and CDB system administration
Resource management
Step Action
5 Next choose Private Bytes from the list of counters. Click Add.
300 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB system administration
Resource management
Step Action
6 Click OK to close the Properties dialog box. The ACE processor and memory
utilization will be shown and monitored. In this manner, other items of interest
can be added to the display for monitoring. Note—you will probably have to
return to the property pages and adjust the Scale on the Data tab and the
Maximum and Minimum values on the Graph tab in order to get a meaningful
display.
R210 Custom Algorithm Block and Custom Data Block User's Guide 301
10/04 Honeywell
CAB and CDB system administration
Backup and restore
Step Action
1 Create an up-to-date checkpoint for the ACE.
2 Use CB to open the ACE configuration form on the monitoring side.
3 Use the CEE Command to set the CEE State to IDLE.
4 Use the ACE Command to set the ACE State to SHUTDOWN.
5 Load the ACE
6 Restore the checkpoint
7 Use the CEE Command to set the CEE State to RUN.
302 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
Troubleshooting approach
Overview
Debugging takes place in the three stages of CAB and CDB development:
• Development activity in the CB/MSVS/PDE environment.
• Off-process debugging using SIM-ACE (using SIM-ACE is optional but highly
recommended).
• On-process debugging.
These three stages are discussed at an overview level in “Test and debug the CAB.” The
section you are reading now presents more detailed information.
303 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB instance states
State diagram
All CAB types have the CABSTATE parameter. This parameter provides summary
information on the operating state of the CAB instance. CABSTATE is a view only
parameter. In some cases the operator can affect the value of CABSTATE by writing to
parameter CABCOMMAND.
Behaviors of CABSTATE and CABCOMMAND are illustrated in the following
diagram. Transitions are indicated as either "auto" or "man." Automatic transitions are
triggered automatically by system infrastructure or by actions taken by the CAB
program. Manual transitions are caused by explicit user command.
304 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB instance states
Note that in the above diagram Quit is usually asserted manually. It is possible for Quit to
occur automatically. But this only happens if the CAB type has been programmed to
assert Quit itself.
R210 Custom Algorithm Block and Custom Data Block User's Guide 305
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB instance states
State descriptions
Each value of CABSTATE is described in the following table:
Table 71 CAB instance states
CABSTATE Description
Unloaded CAB instance has been created and is waiting for completion of
program load.
306 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB instance states
CABSTATE Description
R210 Custom Algorithm Block and Custom Data Block User's Guide 307
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB instance states
Transition descriptions
Each possible transition in CABSTATE is described in the following table:
Table 72 Transitions in CAB state
Transition Description
CABCOMMAND -> Quit Occurs when a human being explicitly commands the
CAB instance to stop executing. This might be done to
eliminate alarm noise if the instance has repeatedly gone
to Terminated, indicating that it is defective and cannot
execute. It might also be commanded when CABSTATE
was Normal or Exception, though this would happen
rarely if ever. Quit could also occur automatically if the
CAB program were designed to cease execution in
response to specific detected conditions.
CABCOMMAND -> Run Occurs when a human being explicitly commands the
CAB instance to resume execution. This would generally
be used when CABSTATE is Dormant. It could be used
when CABSTATE is Terminated. But in that case the
instance would most likely go right back to state
Terminated.
308 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB alarms
CAB alarms
Overview
CAB programs can work in conjunction with other blocks to generate process alarms.
For example, a CAB instance can deliver a computed PV value to a Data Acquisition
block to generate one or more PV alarms. Similarly, it can set the PV value on a Flag
block to generate a discrete alarm.
Beyond this, there are four notifications built into the CAB infrastructure. All of these are
alarms. Two of the notifications are associated with values of CABSTATE. Although
associated with CABSTATE, they are not reported as state change notifications. The
other two notifications are associated with CAB parameter access. These are optionally
enabled at the time the CAB type is designed.
Full notification recovery is supported for each of these notifications without burden on
the CAB programmer. Support is built into the CAB infrastructure. Also, each
notification is implemented so as not to overburden the notification-reporting channel.
After an alarm goes active it is never re-reported until it has returned to normal.
R210 Custom Algorithm Block and Custom Data Block User's Guide 309
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB alarms
Read error
This alarm (condition shown as “READERR”) is optionally enabled at CAB type design
time by setting the default value of parameter READERROPT to Event. The alarm is
reported whenever parameter READSTATUS <> OK. The alarm priority and severity
are configurable using the RDERRALM.PR and RDERRALM.SV parameters (see
“Detailed description Of CAB specific FDPs”). This alarm’s priority and severity are
instance-configurable and default to JOURNAL priority and 0 severity. Information
reported with the alarm includes parent CM tag name, CAB instance descriptor, the
condition (the condition value distinguishes the three from one another) and whether the
report indicates alarm or return too normal.
Write error
This alarm (condition shown as “WRITEERR”) is optionally enabled at CAB type design
time by setting the default value of parameter WRITEERROPT to Event. The alarm is
reported whenever parameter WRITESTATUS <> OK. The alarm priority and severity
are configurable using the WRTERRALM.PR and WRTERRALM.SV parameters (see
“Detailed description Of CAB specific FDPs”). This alarm’s priority and severity are
instance-configurable and default to JOURNAL priority and 0 severity. Information
reported with the alarm includes parent CM tag name, CAB instance descriptor, the
condition (the condition value distinguishes the three from one another) and whether the
report indicates alarm or return too normal.
310 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB alarms
TIP
These parameters only show the exact information about the exception when
the program was built to the Debug target.
R210 Custom Algorithm Block and Custom Data Block User's Guide 311
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
Debug with SIM-ACE
Scope
This guide contains only an outline of how to use SIM-ACE. For detailed information,
refer to the Simulation ACE User Guide. Similarly, this guide does not cover the details
of using MSVS, including using the debugger capabilities. Refer to the Microsoft Help
for these details. For example, in MSVS choose Help > Contents. Choose Visual Basic
from the Filtered by list. Navigate as follows: Visual Studio.NET > Developing with
Visual Studio.NET > Building, Debugging and Testing > Using the debugger as
shown in the following figure:
312 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
Debug with SIM-ACE
This would be a good place to start when looking for general information about using the
debugger.
R210 Custom Algorithm Block and Custom Data Block User's Guide 313
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
Debug with SIM-ACE
ATTENTION
Attach the debugger ONLY to ACE.exe. Do not attach the debugger to any
other process on the same node or on a remote node. If you attach to another
process, the process might crash when you terminate the debugging session
resulting in loss of view or other undesirable consequences.
ATTENTION
Attach the debugger to nodes that will be used as SIM-ACE. Do not attach the
debugger to ACE nodes that are on process. See the discussion in “Security
policy.”
ATTENTION
You must have proper privileges to run debugger on ACE. See Establishing a
User account for SimACE to establish the proper User account.
Step Action
1 Build a debug version of your CAB and save to ERDB. Leave MSVS open.
314 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
Debug with SIM-ACE
Step Action
2 Note: ACE.exe must not be running before configuring and loading as SIM-
ACE.
Open the properties form for the CEEACE FB and check the SIMENABLE
option on the Main tab. Close the form.
3 Load and activate SIM-ACE, CEE, and the CM with CAB block instance.
4 If you have more than one SIM-ACE configured, you need to determine the
process ID for the one that has your CAB. In the monitor view, right click on
the CEE that contains your CAB and choose Module Properties.
Note the process ID (2524 in the figure below). Close the form.
5 With an edit session open for your CAB, choose Debug > Processes from the
MSVS menu.
R210 Custom Algorithm Block and Custom Data Block User's Guide 315
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
Debug with SIM-ACE
Step Action
6 Make sure that the Show system processes checkbox is checked.
Browse for the name of the remote machine in your network where the SIM-
ACE is running. If you have more than one ACE running, select the one with
the ID that matches the Process ID you determined in Step 4. Click Attach.
316 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
Debug with SIM-ACE
Step Action
7 If the ACE.exe process is unavailable (dimmed), it indicates that another user
has a debug session attached to the ACE. You can determine the name of
that user’s computer by collapsing the Title field to expose the right portion of
the ACE process line, as shown in the following figure.
R210 Custom Algorithm Block and Custom Data Block User's Guide 317
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
Debug with SIM-ACE
Step Action
9 Now you can set a breakpoint in your CAB program. Note that CB will show
SIM-ACE and everything running on it on the monitor view in red when the
program sits on the breakpoint.
Note: Since CB will not respond when breakpoints are set, you must change
input values in the MSVS environment (see “Tips for using MSVS with SIM-
ACE”).
10 When you are through debugging, choose Debug > Stop Debugging.
318 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Structure
R210 Custom Algorithm Block and Custom Data Block User's Guide 319
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Structure
ArgIterator, Boolean,
Byte, Char, DateTime,
Decimal, Double,
Guid, Int16, Int32,
Int64, SByte, Single,
TimeSpan, UInt16,
UInt32, UInt64
ICloneable,
IComparable,
IConvertible,
ICustomFormatter,
IDisposable,
IFormatProvider,
IFormattable
320 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Structure
CounterSample
R210 Custom Algorithm Block and Custom Data Block User's Guide 321
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Attempt to use Detection at program Use of programming After a CAB has been
programming build time leading to statements that attempt built in Visual Studio
construct CAB “compiler” error. to access the system with no error, the CAB
inappropriate to registry. will scan the user’s
control mission. program verifying that
Invocation of graphical the constructs used are
user interface services. appropriate for process
control. Any
Attempted file access
inappropriate constructs
under atomic execution.
found are presented to
Attempted use of thread the user as CAB
scheduling services. “compiler” error and
must be removed
Attempted use of OS before the user’s
timer utilities for CAB program can be built
program execution successfully. This
scheduling. feature, however, may
not flag every construct
that is detrimental to
process control and
therefore, site
practices must also be
in place to prevent
this fault category.
The consequence of not
preventing a specific
construct varies
depending on the
particular fault caused.
In some cases they
might be as bad as
crash of the entire CEE.
In some cases they
might be detected and
neutralized by the long
execution time-out built
into the CAB
infrastructure.
322 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Attempt to execute Detection at run time Parameter store check Data access errors
in presence of data signaled by status fails at target block. cause program
access error. information readable status to be
and optional event. Indexed parameter on set without causing
external block is program execution to
accessed with out-of- cease. The degree to
range index. which these errors are
detected and managed
Parameter is accessed
within the CAB program
on external block that
is a decision made by
no longer exists.
the program designer.
Target block is not Data access errors also
loaded. cause status feedback
to the operator and
Host node of target optionally enabled
block has failed. events. See additional
comments on
Communication link to “Parameter access
target node has failed. faults” after this table.
R210 Custom Algorithm Block and Custom Data Block User's Guide 323
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
324 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Attempt to have Detection at runtime One ACE has multiple This restriction is to
more than 101 off- signaled by exception CAB instances that prevent CAB from
node, peer-to-peer if the have a total of more exhausting the ACE
parameter WRITEERROPT than 101 peer-to-peer cyclic store resources.
reference stores in value is set to Event. parameter references This applies only to off
an ACE node, peer-to-peer
stores. If this limit is
exceeded, the user
block code will receive a
store limit exceeded
status on the offending
parameter(s).
For the program, the APIs "ReadStatus" and "WriteStatus" are provided for each
parameter reference. This information can be used or ignored by the CAB programmer.
CAB infrastructure itself never aborts program execution or throws an exception in
response to a parameter access error. If this behavior is desired, it must be deliberately
designed into the program. Further information on the status APIs may be found in
section “Detailed description Of CAB specific FDPs.”
For the operator, two FDPs are supported: READSTATUS and WRITESTATUS.
READSTATUS normally shows OK. If a read error occurred on the last execution,
READSTATUS shows the first non-OK status encountered during execution.
WRITESTATUS behaves analogously for parameter writes. Two other parameters,
READERROPT and WRITERROPT, allow CAB types to report events in response to
read or write errors. For further information on READSTATUS, WRITESTATUS,
READERROPT and WRITEERROPT, see the section “Detailed description Of CAB
specific FDPs.”
Divide-by-zero handling
System treatment of divide-by-zero is different depending on whether the numbers are
integer or floating point. The former causes an exception to be thrown. The latter
continues processing as normal. The reason for the difference is that, unlike integers,
R210 Custom Algorithm Block and Custom Data Block User's Guide 325
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
IEEE 754 floating-point numbers have a representation for infinity. This allows for
consistent handling of floating-point divide-by-zero without the use of an exception.
Unbounded recursion
There are two possible responses to an unbounded recursion: throw exception, or
terminate. In general, it is not possible to predict ahead of time which of these will occur.
It depends on how the program is implemented and whether or not available stack would
be exhausted before expiration of ½ base cycle duration.
Exception handling
Some faults are detected by language run-time services, causing an exception to be
thrown. Response to the exception varies depending on how the CAB program has been
written.
If an exception handler has been provided within user-written code, it catches the
exception and continues processing according to its own design. It may cause the
program to run to completion or it may break program execution early. If program
execution breaks for the current cycle, it starts fresh at the next execution cycle.
If the program does not contain a user-written handler to catch the exception, then
exception handling is provided by system code. Default system behavior is to cause
program execution to break and then start fresh at the next execution cycle. After
program execution has been broken, parameter CABSTATE is set to Exception. This
allows the abnormal state to be read by the operator in cases where an exception fires
repeatedly. In addition, system implementation causes an event to be reported under the
name of the CAB instance and its CM parent. For further information on CABSTATE
and the exception event see “CAB instance states.”
Overlong execution
CEE has a built-in monitoring service that allows CAB programs to use, at most, ½ of the
base cycle time. If execution of an individual CAB instance exceeds this duration,
execution is stopped, the CABSTATE is set to Terminated, and an alarm is reported. The
block instance never runs again until it is restarted by a human being. After it is restarted,
the alarm and state parameter return to normal. For further information on CABSTATE
and the long execution alarm, see “CAB instance states.”
326 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Loop overrun detection is done on the basis of CAB instances rather than on CAB types.
Thus, if a given instance uses a flawed program and has data conditions that allow the
flaw to be triggered, it is taken out of service. If another instance uses the same program
but does not have data conditions that trigger the defect, it is not taken out of service.
In some cases, an individual block using ½ the duration of the base cycle will be enough
to cause a control processing cycle overrun. Forcing the block into a termination state
prevents this from happening repeatedly.
R210 Custom Algorithm Block and Custom Data Block User's Guide 327
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Attempt to use Use of any programming See the first row of Table 74 Summary of
programming construct that accesses CAB fault handling.”
construct disk.
inappropriate to
control mission. Use of any programming
construct that uses
command line monitor input
or output.
Attempt to execute in Use of loops in "Catch" or See the last row of Table 74 Summary of
presence of long "Finally" clauses CAB fault handling..
duration algorithmic
design defect.
328 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
The table below lists .NET constructs that are allowed in CEE control applications. Note
the explanatory items at the end of the table.
Table 76 .NET constructs appropriate to control mission
R210 Custom Algorithm Block and Custom Data Block User's Guide 329
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
ArgIterator, Boolean,
Byte, Char, DateTime,
Decimal, Double,
Guid, Int16, Int32,
Int64, SByte, Single,
TimeSpan, UInt16,
UInt32, UInt64
ICloneable,
IComparable,
IConvertible,
ICustomFormatter,
IDisposable,
IFormatProvider,
IFormattable
330 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
CounterSample
• When just the namespace is specified, the user can use any construct (class,
structure, etc.) in this namespace.
• When items are listed in the Class/Structure column, just those classes and structures
specified in that namespace can be used by the programmer. For example, the class
System.Int32 can be used, but System.IntPtr cannot.
• When items are listed in the Method column, just those metheds specified for that
class in that namespace can be used. For example, the method
System.Diagnostics.Debug.WriteLine can be used, but
System.Diagnostics.Debug.Assert cannot.
R210 Custom Algorithm Block and Custom Data Block User's Guide 331
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Type creation Errors such as source code syntax errors are reported directly in Microsoft
time Visual Studio .Net 2003.
Errors related to commissioning the CAB type within ERDB are reported by CB
as they occur.
Errors related to commissioning the CAB type within ERDB are also recorded
within the EPKS error log files. These files have the name "ErrLog_n.txt" where
n is an integer. They can be found in folder "c:\Documents and Settings\All
Users\Application Data\Honeywell\Experion PKS".
Instance Errors related to the process of converting CAB instances to a different type are
conversion time reported by CB as they occur.
These errors are also recorded in the Experion error log files.
Instance Errors related to the process of configuring CAB instances are reported by CB
configuration as they occur.
time
These errors are also recorded in the Experion error log files.
Instance Errors related to the process of assigning the CM parent of CAB instances are
assignment time reported by CB within error dialogs as they occur.
These errors are also recorded in the Experion error log files.
Instance load Errors related to the load of CAB instances and to the load of the CAB
Time programs associated with the instances are reported by CB as they occur.
These errors are also recorded in the Experion error log files.
Program Program defects that result in throw of an exception that is not caught by user
execution time written code are reported by issuing an event and by setting parameters
CABSTATE, EXCPTNTYPE and EXCPTGNMSG.
Program defects that result in excessive execution time are reported by issuing
an alarm and by setting parameter CABSTATE.
Operations Time Errors that result from attempts to store inappropriate values to CAB
parameters are reported by Experion Station with a status indication at the time
they occur.
332 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Export / Import Errors detected at import are reported within the error log files.
Time
Informational messages associated with import that are not errors are reported
within a supplementary log file. This file is called "IXP_Log.txt" and may be
found in folder "c:\Documents and Settings\All Users\Application
Data\Honeywell\Experion PKS".
The following table provides examples of CAB error conditions that are detected by the
system. It indicates how the user is informed of the error and recommends a user
response.
Table 78 CAB error type examples and recommended actions
See Note 2.
Type creation Program source code MSVS reports build errors. If meaning of error is
time has compile errors. See Note 3. unclear consult MSVS
help documentation.
Correct error, rebuild.
Type creation User attempts save of MSVS presents error Use Save As to save
time pre-existing type to message with options to type with a different
ERDB after deleting or Save As or Cancel. type name and/or library
modifying a parameter name. Later, convert
definition. existing instances to
new type.
See Note 4.
R210 Custom Algorithm Block and Custom Data Block User's Guide 333
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
See Note 5.
334 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Instance load User attempts to load CB presents error User can see that value
time an instance whose message indicating that of parameter
CAB type has not been operation is disallowed INCOMPLETE is On by
successfully built. and why. opening the CAB form
from the library tree.
User must rebuild CAB
type.
See Note 2.
Instance load User attempts to load CEE returns parameter Load instance to ACE
time an instance to an ACE access error on load. platform which has CAB
for which the CAB run- CABSTATE shows value run-time.
time license has not Unloaded.
been purchased.
Instance load Communication failure CEE returns parameter Repeat instance load.
time occurs during load of access error on load.
CAB program. CABSTATE shows value
Unloaded.
Program Parameter reference CEE returns data access Load the missing block
execution time points to local block error to complete
that has not been (CABAccStatusEnum. configuration of the
loaded. ConfigurationMismatch) to overall control strategy.
CAB instance. CAB
program responds as
designed. Error
information is posted in
parameter READSTATUS
or parameter
WRITESTATUS.
Depending on design of
the CAB type an event
may be reported. See
Note 1.
R210 Custom Algorithm Block and Custom Data Block User's Guide 335
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Program Parameter reference CEE returns data access Fix the node that has
execution time points to remote block error failed.
in node that has failed. (CABAccStatusEnum.
CommFail) to CAB
instance. CAB program
responds as designed.
Error information is posted
in parameter
READSTATUS or
parameter
WRITESTATUS.
Depending on design of
the CAB type an event
may be reported. See
Note 1.
Program Program has been CEE puts CAB instance Operator responds as
execution time designed to invoke the into state Exception. directed by defined
Abort() subroutine in Parameter CABSTATE operational practices for
response to a run-time has value Exception. the site.
detected error Parameter EXCPTNTYPE
condition. has the value
"Honeywell.CAB.AbortExc
eption". Exception event is
active. See Note 6.
Program Program has defect CEE puts CAB instance Operator may change
execution time that causes exception into state Exception. CABSTATE to Dormant
to be thrown. Parameter CABSTATE to cause the event to go
has value Exception. inactive. CE should
Exception event is active. correct program defect
Parameter EXCPTNTYPE and reload instance.
contains a string that
indicates the type of
exception. For example,
for an integer-divide-by-
zero error EXCPTNTYPE
would contain
"System.OverflowExceptio
n". See Note 6.
336 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Program Program has defect CEE puts CAB instance Operator may change
execution time that causes overly long into state Terminated. CABSTATE to Dormant
execution. Parameter CABSTATE to eliminate alarm
has value Terminated. noise. CE should
Terminated alarm is correct program defect
active. and reload instance.
Operations time Operator stores CEE rejects the store and Store correct value or
inappropriate value to returns status code. wait for CAB instance to
FDP or CDP. enter a state when the
store can be accepted.
Export / Import Import of CAB type is CB automatically changes Inspect library name
time attempted when library name and places after import. If desired,
identical library name status message in error modify the automatically
and type name are log. assigned name to a
already used within preferred name.
target ERDB.
See Note 7.
Export / Import Import of CAB instance CB reports error and fails Go back to system from
time is attempted when the import. which CAB instance
corresponding type was exported. Repeat
was not included with the export including the
the export files and is CAB type. Go to target
not already in ERDB. system. Repeat the
import.
See Note 7.
Note 1
Parameter access errors are returned to the CAB program at run time as members of
enumeration CABAccStatusEnum. This is further discussed in “Enumeration
CABAccStatusEnum.” Also, see description of parameters READSTATUS,
WRITESTATUS, READERROPT and WRITEERROPT in “Detailed description Of
CAB specific FDPs.”
Note 2
Block type locking flags are discussed in “Block type locking flags.”
Note 3
All VB.NET compile errors are documented within MSVS.
R210 Custom Algorithm Block and Custom Data Block User's Guide 337
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Note 4
Procedures involved in the modification of CAB types are discussed in “Modify a CAB.”
Note 5
Data types supported by CAB parameter references are discussed in “Data types for
CDPs and parameter references.”
Note 6
CABSTATE and related functionality is discussed in “CAB instance states.”
Note 7
Import of CAB types is described in “Import CAB.”
338 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
TIP
You can select a Microsoft error code number and press F1 to bring up MSDN
help.
If any of these errors occur, please contact your TAC representative if the workaround
provided is not sufficient.
Table 79 CAB/CDB error messages
Error message Warning: Data Type of Parameter LOADDATA1 does not match the selected
block.
Description Indicates that during a Convert operation, the LOADDATA1 parameters of the
instance you are converting, and the type you are converting from, do not
match. The LOADDATA1 parameter is an internal parameter that contains the
CAB program (dll) when the program is built.
Cause If you use the Function Block Convert to convert a CAB type to another CAB
type and the new CAB type is in an incomplete state, you will get this warning in
the Convert dialog. You will get the same error in the case where you have a
CAB instance that is incomplete and now you convert it to a CAB type that is
complete.
Workaround It will convert okay and the result will have the Incomplete Lock set.
R210 Custom Algorithm Block and Custom Data Block User's Guide 339
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Error message <CAB name> is being used by <Machine name/ User name>.
The CAB type is locked either by an open project chart, configuration form, or
an Import/Export operation by the user named in the message above. Do you
want to correct the problem before continuing? If you select "No", you will need
to contact your administrator to clear this CAB's Active Lock before it can be
used again.
Description This indicates that the database has locks set related to the CAB type.
Cause DB locks are set by a chart being open, a properties form open, or
import/export by another user when attempting to do a Save As to ERDB
operation or the user is exiting Visual Studio and is saving their data to the
ERDB.
Workaround You will need to either release the DB lock (or have the user that has the DB
lock release it) by finding the operation that has it locked (e.g. close a chart or
properties form, wait for export to finish) and try the operation again. If you do
not do this, you will need to have the lock removed later by an Admin using the
DBAdmin tool.
Error message The EditLock value cannot be reset. You will need contact your administrator
to clear the EditLock from this CAB. You will not be able to reedit this CAB until
this is done.
Description It means that a serious failure occurred while trying to reset the Edit Lock.
Workaround You can contact TAC and provide the error logs to find out why the Edit Lock
could not be reset. You can have the admin reset the Edit Lock by using the
DBAdmin tool.
340 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Error message The EditLock value for <block name> in <library name> cannot be reset. You
will need to contact your administrator to clear the EditLock from this CAB. You
will not be able to reedit this CAB until this is done.
Description This is the same as the previous only on a Save To ERDB As operation.
Workaround You can contact TAC and provide the error logs to find out why the Edit Lock
could not be reset. You can have the admin reset the Edit Lock by using the
DBAdmin tool.
Error message An unexpected error occurred within the CAB Development Environment.
Please contact your Honeywell representative.
Workaround You should contact TAC and provide the ErrorLog file.
Error message An unexpected error occurred within the CAB Development Environment and it
will be closed. The Development Area is <Development Area Path>' and
contains this project and will not be deleted. Please contact your Honeywell
representative.
Workaround There probably are changes that were not saved to the ERDB. The Build
Directory will be left with the modified def files and programs. You should
contact TAC to investigate the problem. The Error Log will show more detailed
information for TAC.
R210 Custom Algorithm Block and Custom Data Block User's Guide 341
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Error message <New block name> is an invalid name or is already being used in <library
name>.
Cause Indicates on a Save As to ERDB, that you entered a name that is already used
or the name and/or library has invalid characters in it.
Workaround See “Open a new CAB block type for edit” for proper naming conventions
and/or check to make sure the CAB name isn’t already being used.
Cause You tried to do an operation that is not allowed. (for example, adding a
reference).
Error type VS CAB build-time “Compiler” error shown in the Task List and Output Window.
Error message CAB Error: Not allowed to use <class or method name>.
Cause You are trying to use a class or method not appropriate for process control.
Workaround Do not use this class or method. Click on the Task List item to take you to the
construct that is not allowed. Building the CAB will not be successful until all
inappropriate constructs are removed. If you believe that this construct is
appropriate for process control, you need to contact TAC.
342 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
CAB fault handling
Error type VS CAB build-time “Compiler” error shown in the Task List and Output Window.
Error message CAB Error: Not allowed to Declare references to external procedures.
Cause You are trying to use the Declare statement to access external procedures.
This is not allowed.
Workaround Do not use the Declare statement. Click on the Task List item to take you to
the approximate area where the Declare statement is located. Building the
CAB will not be successful until all Declare statements are removed. Any
procedures that you want to access must be part of the CAB.
Error message Ildasm.exe has generated errors and will be closed by Windows. You will need
to restart the program.
Cause This indicates that a serious problem occurred with the .Net Framework.
Error type VS CAB build-time “Compiler” error shown in the Task List and Output Window.
Cause You failed to add “.Value” to a CDP name when referencing its value.
R210 Custom Algorithm Block and Custom Data Block User's Guide 343
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
CAB fault handling
Error type VS CAB build-time “Compiler” error shown in the Task List and Output Window.
Cause You failed to add “.Value” to a PRef name when referencing its value.
344 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB and CDB troubleshooting and maintenance
Contacting TAC
Contacting TAC
Overview
If you encounter a CAB or CDB problem that you cannot resolve it using the
documentation, you will need to contact TAC. This section lists the information required.
R210 Custom Algorithm Block and Custom Data Block User's Guide 345
10/04 Honeywell
CAB and CDB troubleshooting and maintenance
Contacting TAC
346 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
Overview
The overall CAB map
Figure 44 below is a map of the overall CAB API. The CAB type is shown in the center
of the diagram. Solid arrows indicate that CAB types have a general dependence on the
designated elements. The dashed arrow from the CAB box to the BlockBase box
indicates a particular kind of dependence—that class CAB inherits from class BlockBase.
Figure 44 Overall map of CAB API
R210 Custom Algorithm Block and Custom Data Block User's Guide 347
10/04 Honeywell
CAB API reference
APIs supplied from CAB to system
This is shown near the center of the map and consists of the class CAB along with the
subroutine Execute().
• Elements supplied by the system infrastructure to the CAB type.
This is shown by the four largest boxes. There are Enumerations, CDP Definition
Classes, Parameter Reference Classes, and the base class, BlockBase.
• Elements supplied by the VB.NET language infrastructure to the CAB type.
This is shown by the box to the right of the class CAB box..
The following topics describe the syntax for the Honeywell-defined elements of the CAB
API. Some include short, illustrative examples. Further examples can be found in the
scenarios section of this document.
348 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
None 0
CABToNormal 5
CEEWarmStart 10
CEEColdStart 20
BlockActivate 30
BlockLoad 40
Restart can be used to identify whether system events have occurred that may require
special initializations. A value of None indicates that no system event has occurred.
Usage is illustrated below.
R210 Custom Algorithm Block and Custom Data Block User's Guide 349
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
Imports Honeywell.CAB.SysCommon.RestartEnum
Enumeration CABAccStatusEnum
Enumeration CABAccStatusEnum is predefined for use with the ReadStatus and
WriteStatus properties of the parameter reference classes. Its definition is as follows:
Table 81 Members of enumeration CABAccStatusEnum
OK 0 OK
350 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
To use the short form of a CABAccStatusEnum member name (for example, "OK"
instead of "CABAccStatusEnum.OK"), the following statement can be inserted ahead of
any other program declarations:
Imports Honeywell.CAB.SysCommon.CABAccStatusEnum
For a more detailed example on the usage of CABAccStatusEnum and the parameter
reference property ReadStatus see “Use of data access status in CAB.”
Enumeration CABCommandEnum
Enumeration CABCommandEnum is predefined for use with the CABCOMMAND
property of BlockBase. It can also be used with a parameter reference that points to the
CABCOMMAND FDP of another CAB block. Its definition is as follows:
R210 Custom Algorithm Block and Custom Data Block User's Guide 351
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
None 0
Quit 1
Run 2
See “Fixed definition parameter CABCOMMAND” for information on the use of this
enumeration with property CABCOMMAND.
Enumeration CABStateEnum
Enumeration CABStateEnum is predefined for use with the CABSTATE property of
BlockBase. It can also be used with a parameter reference that points to the CABSTATE
FDP of another CAB block. Its definition is as follows:
Table 83 Members of enumeration CABStateEnum
Unloaded 0
Normal 1
Exception 2
Terminated 3
Dormant 4
See “Fixed definition parameter CABSTATE” for information on the use of this
enumeration with property CABSTATE.
CDP classes
CAB infrastructure provides a predefined class for each supported CDP data type. When
the CAB program reads and writes CDPs, it is reading and writing a VB property of these
classes. The complete set of classes is listed below:
352 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
Class name
BooleanCDP
Int32CDP
Float64CDP
StringCDP
TimeCDP
DeltaTimeCDP
TimeOfDayCDP
CDP classes are never used to explicitly declare variables within CAB programs and are
not exposed within the CAB API. Instead, they are used implicitly by virtue of
predefined CDP objects declared within class BlockBase.
Each CDP class is defined to have a property called "Value." This property has the type
implied by the name of the class and is used to read or write the value of the CDP. The
declaration of the Value property and other properties for class Float64CDP is shown
below. For all other classes the properties are declared with syntax that is equivalent
except for data type in the Value and Item properties, with the following exception: Min,
Max, Sum, and Avg apply to Float64CDP class only.
R210 Custom Algorithm Block and Custom Data Block User's Guide 353
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
354 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
For any of these Float64CDP member functions, if the CDP value is NaN (for scalar
CDPs) or any element in the array (for array CDPs) is a NaN, a NaN is returned.
If Temp1 is defined as a Float64CDP then CABMath.Min (Temp1) is equivalent to
Temp1.Min(). This is true for all CABMath functions.
The example below shows how CDP objects are used. Here it is assumed that two
Float64CDPs, Temp1 and Temp2, have been defined for the CAB type using PDE.
TEMP1.Value = 50.0
TEMP2.Value = TEMP1.Value
R210 Custom Algorithm Block and Custom Data Block User's Guide 355
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
Class name
BooleanPRef
Int32PRef
Float64PRef
StringPRef
TimePRef
DeltaTimePRef
TimeOfDayPRef
PRef classes can be used to explicitly declare variables within CAB programs. However,
this is a minority use case. Usually, the PRef classes are used implicitly by virtue of pre-
defined PRef objects declared within class BlockBase. For an example of explicit use of
PRef classes, see “Use of parameter reference variables in CAB.”
Each PRef class has several members. Member declarations are shown in Table 87 below
using Float64PRef as an example. For all other PRef classes, member declarations are
equivalent except for the Value property. Declaration of the Value property differs only
in data type.
356 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
R210 Custom Algorithm Block and Custom Data Block User's Guide 357
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
358 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
R210 Custom Algorithm Block and Custom Data Block User's Guide 359
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
Although the PRef classes support several members, only a few are used with any
frequency. Value is used most often, being essential in any program that has PRefs.
Read() and Write() are used occasionally. But it turns out that for most programs,
PRefList.Read() and PRefList.Write() can be used instead with less coding effort. This is
discussed in “Parameter reference list class.” ReadStatus is used occasionally depending
on how the programmer has chosen to organize error handling for data access. IsNull is
used quite rarely.
The following paragraphs illustrate the use of the most frequently used PRef members.
PV.Read()
If PV.ReadStatus = CABAccStatusEnum.OK Then
LASTPV.Value = PV.Value
BADPVCOUNT.Value = 0
' use PV.Value
ElseIf BADPVCOUNT.Value <= 3 Then
BADPVCOUNT.Value = BADPVCOUNT.Value + 1
' use LASTPV.Value
Else
' handle case of PV which has become unuseable
End If
In the example above, ReadStatus is used merely to obtain a binary indication of whether
the PV value is useable. Since PV is real valued, the IsNan() function of the VB.NET
Double structure could equally well be used. This is because PRefs automatically set
Value to the fail-safe value for any read access that does not complete successfully. For
reals, the fail-safe value is NaN. Thus, the first two lines of the above code could be
replaced with the following:
PV.Read()
If Double.IsNan(PV.Value) Then
360 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
Of course many applications using process variables would not be implemented to hold a
last good PV value over execution cycles where the current PV was unavailable. For
these applications, there might not be any need to use ReadStatus or IsNan() at all.
PV.Read()
' use PV.Value regardless of whether it's bad or good
In the above segment, the computation implied by the comment would process correctly
if there had been no error on the PV access. If there had been an error, it would propagate
NaN values. The final result of the computation would end up either as a useable value or
as NaN.
Examples of conditions that would cause a data access error for Read() of a PRef are
deletion of the block supplying the input, failure of the node supplying the input, or
communication failure. Note, however, that an error in definition of the CAB type could
cause this condition as well.
If parameter reference PV were declared to be an output and not an input, then the error
path discussed above would execute. Similarly, if a parameter reference were used as an
output but had not been declared as such within PDE, the runtime output reference would
not work.
Write()
A more compelling motivation for the use of ReadStatus can be found in the case of
references that are not real-valued.
Consider the example below which uses ReadStatus and Write() as well. Here it is
assumed that MODE and MODEATTR are Int32PRefs, SP is a Float64PRef and
LocalModeAttr is a local INTEGER. The PRefs point to parameters on a block in the
same CEE as the CAB instance. It is also assumed that the CAB type has been designed
to write parameters with an access level of "PROGRAM" (that is, FDP ACCESSLEVEL
was set to PROGRAM at the time the CAB type was created).
R210 Custom Algorithm Block and Custom Data Block User's Guide 361
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
MODEATTR.Read()
If MODEATTR.ReadStatus <> CABAccStatusEnum.OK Then
' handle error condition
Else
LocalModeAttr = MODEATTR.Value
' Program Mode Attribute is 2
MODEATTR.Value = 2
MODEATTR.Write()
' Auto Mode is 1
MODE.Value = 1
SP.Value = 50.0
MODEATTR.Value = LocalModeAttr
MODE.Write() : SP.Write() : MODEATTR.Write()
End If
There are several things to note about the above example. First, observe that the code is
written with a general sequence in which invocations of Read() precede the use of Value
for input PRefs, and stores to Value precede invocations of Write() for output PRefs. The
Value property acts like a local data cache with no connection to the world outside the
CAB block. To transfer data into Value, Read() must be invoked first. To transfer data
out of Value, Write() must be invoked afterwards.
Next, observe the use of ReadStatus. MODE and MODEATTR are not real-valued. Thus
there are fewer options for error detection. CAB infrastructure does automatically supply
a fail-safe value for Int32PRefs (zero). But this fail-safe value is not uniquely different
from all operational values. To get around this, ReadStatus is used to unambiguously
identify whether the referenced data is useable.
Now observe the use of Write() in the above example. The purpose of this code segment
is to write 50.0 to the set point of a RegCtl block.
As noted above, the CAB type has been designed to write with access level of Program.
This means that MODE at the PID target must be Auto in order for SP stores to be
accepted. To accomplish the MODE and SP write, MODEATTR must first be set to
Program. If this isn't done and done in the right order, then the target RegCtl block will
ultimately reject the SP write. However, the example assumes the MODEATTR change
must be temporary. Thus, MODEATTR must be returned to its original value after the
write is complete.
362 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
The code above accomplishes these objectives. MODEATTR is written twice, once to
change into program mode attribute and once to return to its original value. The
sequencing of writes to MODEATTR, MODE, and SP are such that the SP write will be
accepted.
Note, however, that the code is somewhat verbose. Every PRef used for input requires a
call to Read() and an access to Value. Every PRef used for output requires an access to
Value and at least one call to Write. In fact, the style of coding shown above is not
frequently used. “Parameter reference list class” describes a style of coding that requires
fewer statements.
Be aware that the example above applies to cases where the CAB instance and the
destination block for writes are in the same CEE. For considerations on communications
between CAB and remote blocks see “Data access integrity.”
WriteStatus
The code segments below illustrate two potential uses for WriteStatus. They attempt to
set a CM's EXECSTATE to Active and then verify that the store went through. Here
EXECSTATE is an Int32PRef.
EXECSTATE.Value = 1
EXECSTATE.Write()
If EXECSTATE.WriteStatus <> CABAccStatusEnum.OK Then
' do error processing
End If
The code segment above assumes that the value of WriteStatus is available for use
immediately after the invocation of Write(). This would be true if the EXECSTATE
reference pointed to a block within the same CEE as the CAB block. If this constraint
were always met, the above code would accomplish the intended purpose. However, if
the program designer wished to avoid this constraint, the program would have to be
written differently.
To handle status collection for remote writes, the programmer must first realize that they
can only be detected after sufficient time has passed for the write to be sent and for the
status to be returned. Since CAB and VB.NET do not support preemption, the program
would have to be written to detect write status in a later execution cycle. Furthermore,
depending on the latency of the status return and on the period of the CAB block, the
status value may or may not be available by the first execution to follow the Write()
invocation.
R210 Custom Algorithm Block and Custom Data Block User's Guide 363
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
The code segment below illustrates the use of WriteStatus in a manner that is valid for
both local and remote references. DoCheck and DoWrite are local Boolean state
variables used to control the check and write actions.
If DoCheck Then
If EXECSTATE.WriteStatus = CABAccStatusEnum.WritePending Then
' no status to check yet
Else If EXECSTATE.WriteStatus <> CABAccStatusEnum.OK Then
' handle error
Else
' write went through
DoCheck = False
End If
End If
If DoWrite Then
DoWrite = False
EXECSTATE.Value = 1
EXECSTATE.Write()
DoCheck = True
End If
When status is collected after a parameter write operation, it may or may not be available
immediately after the write. If the parameter is remote—that is, if it is owned by a block
in an environment different from the one hosting the CAB program—then the write
status is unknown until a subsequent CAB execution. For an example of using the Status
property with output references, see “Use of data access status in CAB.”
364 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
Class name
PRefListClass
Class PRefListClass is never used to explicitly declare variables within CAB programs
and is not exposed within the CAB API. Instead, it is used implicitly by virtue of the
predefined object in BlockBase called "PRefList."
Members of PRefListClass are described in the following table.
Table 89 Description of members of class PrefListClass
R210 Custom Algorithm Block and Custom Data Block User's Guide 365
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
GetType() Public Function The GetType function comes with .Net. It will
GetType() probably not be used by the general CAB
programmer. It gets the System.Type of the
current instance.
Init() Public sub Init() The Init() method should NOT be called by user
code. This is an internal method used to set up
the list for all of the Prefs.
366 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
Use of PRefListClass can be illustrated using a variant of the example from the section
"Write().” Note that it is still assumed here that the target PID block being written to is in
the same CEE as the CAB instance.
PRefList.Read()
If MODEATTR.ReadStatus <> OK Then
' handle error condition
Else
LocalModeAttr = MODEATTR.Value
' Program Mode Attribute is 2
MODEATTR.Value = 2
MODEATTR.Write()
' Auto Mode is 1
MODE.Value = 1
SP.Value = 50.0
MODEATTR.Value = LocalModeAttr
End If
PRefList.Write()
In the example above, PRefList is the single instance of PRefListClass that is predefined
within BlockBase. The Read() call of the example from the section “Write()” has been
replaced with a call to PRefList.Read(). Three of the four Write() calls have been
replaced with a single call to PRefList.Write(). The Write() call after the first assignment
to MODEATTR.Value is still required as MODEATTR is written twice within the same
execution cycle. The order of assignments to MODEATTR.Value, MODE.Value, and
SP.Value are faithfully preserved by PRefList.Write().
The example above applies to cases where the CAB instance and the destination block
for writes are in the same CEE. For considerations on communications between CAB and
remote blocks see “Data access integrity.”
CABMath class
Four CABMath functions are available: Min, Max, Sum, and Avg. The following table
describes the methods for these functions. For examples of the usage of these functions,
see “Examples of CABMath functions usage.”
In the table, “Logical Declaration” shows how the function would be logically used.
“Actual Declaration” shows how the method is actually declared and how it would
appear in IntelliSense.
R210 Custom Algorithm Block and Custom Data Block User's Guide 367
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
368 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
R210 Custom Algorithm Block and Custom Data Block User's Guide 369
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
370 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
For any of the CABMath functions, if any value passed in is a NaN, the function returns
a NaN.
R210 Custom Algorithm Block and Custom Data Block User's Guide 371
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
A Min and Max function also exists in the MSVS Math class found under the System
namespace of the .NET framework. However, these only take two parameters where the
CABMath functions allow any number of parameters. Also, the System.Math functions
do not allow the user to specify an array.
FDP classes
CAB infrastructure defines classes to make a subset of FDPs accessible from within the
CAB program. They are never used to explicitly declare variables and are not exposed
within the API. Instead, they are used implicitly by virtue of instances predefined in
BlockBase.
Table 91 Fixed definition parameter classes
Class name
Float64FDP
StringFDP
CABCommandEnumFDP
CABStateEnumFDP
BooleanFDP
Each FDP class is defined to have a single property called "Value." This property has the
type implied by the name of the class and is used to read or write the value of the FDP.
The declaration of Value for class Float64FDP is shown below. For all other classes,
Value is declared with syntax that is equivalent except for data type.
372 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
Base class
Class "BlockBase" is the parent of class "CAB" that establishes the algorithm definition
for the CAB type. The only reference to BlockBase within a CAB program occurs in the
declaration of class CAB. The CAB programmer uses BlockBase through the variables,
properties, and subroutines that it defines and that are inherited by class CAB. Inherited
content includes the following.
R210 Custom Algorithm Block and Custom Data Block User's Guide 373
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
374 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
If PV.ReadStatus = OK Then
LASTPV.Value = PV.Value
BADPVCOUNT.Value = 0
' use PV.Value
ElseIf BADPVCOUNT.Value <= 3 Then
BADPVCOUNT.Value = BADPVCOUNT.Value + 1
' use LASTPV.Value
Else
' handle case of PV which has become unuseable
PROGSTSDESC.Value = "Bad PV: " + PV.ReadStatus.ToString
Abort()
End If
In the example above, the programmer has chosen to send out an event with the
statement "Abort()." This causes the CAB instance to go into state Exception as soon as
the Abort() subroutine is called. No further statements within the program are executed
on the current execution cycle.
Before generating the event the programmer publishes the cause of the error by writing a
description into PROGSTSDESC. To produce the error description, the programmer has
used the "Bad PV: " string literal. The string literal is combined with the string
representation of the current value of the parameter access status for the PV parameter
reference. To convert the binary enumeration value into a string representation, the
programmer has used the VB.NET "ToString" method.
In the above example the displayed value of PROGSTSDESC would vary depending on
what kind of parameter access error had occurred. If the access status had been
CommFail then PROGSTSDESC would take on the following value:
"Bad PV: CommFail"
R210 Custom Algorithm Block and Custom Data Block User's Guide 375
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
TIP
A CAB algorithm containing the statement CABCOMMAND.Value =
CABCommandEnum.Run will compile, load, and run without errors, but the
statement will have no effect.
The code below illustrates how CABCOMMAND might be used. This example assumes
that other code within the program detects conditions that warrant a shutdown of self.
The need for shutdown is signaled within the program by setting the internal variable
Shutdown to True.
If ShutDown Then
CABCOMMAND.Value = CABCommandEnum.Quit
End If
The action of the code above is different from that of the Abort() subroutine. Abort()
causes immediate cessation of the current cycle of execution, immediately changing the
CABSTATE to Exception. Setting CABCOMMAND to Quit allows all statements in the
current cycle to complete and then causes CABSTATE to go to Dormant. When Abort()
is called, the CAB program resumes execution on the next cycle. When
CABCOMMAND is set to the value of Quit, the CAB program does not resume
execution until commanded to do so by a human being or by another application.
376 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
Note that the CABSTATE FDP is used for examining the self state of a CAB instance.
For examining the state of different CAB instances, a PRef must be used. When
CABSTATE of other CAB instances is observed, it is possible for any of the four states
to be seen.
R210 Custom Algorithm Block and Custom Data Block User's Guide 377
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
If PROCSPECEXEC.Value Then
' Do special processing
End If
' Do normal processing
Note that the mnemonic for this restricted FDP is "PROCess SPECial EXECution".
Subroutine Send()
Subroutine Send() allows text to be sent to the operator message display. Messages
appear in those consoles mapped to the area assigned to the parent CM of the CAB
instance. Send() supports a single string argument that can be up to 132 characters long.
Each string sent corresponds to one line in the message display. The signature of Send()
is shown below.
Table 93 Declaration of subroutine Send()
The single argument of Send() can be constructed using the inherent string conversion
capabilities of VB.NET. In the example below, Send()is used to present a string literal
and floating-point values. ReportPressValues is a local Boolean variable and the array
Press is a block scope variable. The VB.NET line continuation character, "_", is used to
put multiple floating point values on a single message line even though they do not
conveniently fit into a single line of source code.
If ReportPressValues Then
Me.Send("Pressure Array:")
Send(CStr(Press(0)) + " " + CStr(Press(1)) + " " + CStr(Press(2)) _
+ " " + CStr(Press(3)) + " " + CStr(Press(4)))
Send(CStr(Press(5)) + " " + CStr(Press(6)) + " " + CStr(Press(7)) _
+ " " + CStr(Press(8)) + " " + CStr(Press(9)))
End If
378 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from system to CAB
Note that in the example above, two of the send statements have the syntax "Send()", but
one has the syntax "Me.Send()". The name "Me" refers to the CAB class instance. Any
members of the CAB instance can be referred to by their name directly or by the
contstruct "Me.<member name>." The two different syntaxes are equivalent in terms of
execution properties. The advantage of using Me.<member name> is that it causes the
Visual Studio IntelliSense feature to display a list of all members of the CAB class right
after the user types "Me." This prevents the need to remember all members inherited
from BlockBase when coding.
Message notifications issued with the Send() subroutine differ from alarms and other
notifications in that they do not support automatic event recovery. It is unlikely but
possible that under conditions of notification overload, one or more messages requested
by a CAB program might not be sent. If this happens, an error message is sent after the
notification communication channel clears. The text of the message is as follows:
"!! Message(s) lost due to notification overload !!"
Messages reported through the Send() API can be seen in the same Station displays as
messages sent by the CEE message block. They are visible from the message summary
display or from the event journal.
Subroutine Abort()
BlockBase supports a subroutine which allows the program to break the current cycle of
execution. Calling Abort() when there is no surrounding Catch clause does the following:
• Prevents any further instructions from executing in the current cycle.
• Puts CABSTATE into Exception.
• As with any Exception condition, reports an alarm.
• As with any Exception condition, execution of the block resumes on the next cycle.
Abort() is supported for programmer convenience. Almost the same effect could be
achieved by calling the VB.NET Throw statement without an enclosing Catch statement.
Abort() can be used if the progammer prefers not to throw exceptions explicitly. There
are slight differences between Abort() and Throw in the way in which CAB FDPs reflect
the Exception state. For example, parameter EXCPTNTYPE contains the following
string after Abort() has been called:
"Honeywell.CAB.AbortException"
If a Throw is explicitly called the contents of EXCPTNTYPE are determined by the
exception type used for the Throw.
R210 Custom Algorithm Block and Custom Data Block User's Guide 379
10/04 Honeywell
CAB API reference
APIs supplied from system to CAB
Property Restart()
BlockBase supports the Restart property that allows code executing under the Execute()
calling tree to detect whether one of a set of system events has occured. The set of events
that can be detected is defined by the enumeration RestartEnum. The declaration of
Restart is as follows:
Table 95 Declaration of property Restart()
The parentheses are optional as there are no variables to pass. Use of Restart is illustrated
by the example of “Enumeration RestartEnum.” Further information can be found in the
section “Data initializations under Execute().”
380 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
CAB API reference
APIs supplied from VB.NET to CAB
R210 Custom Algorithm Block and Custom Data Block User's Guide 381
10/04 Honeywell
CAB API reference
APIs supplied from VB.NET to CAB
• Class variables (block scope variables) are always private within CAB. Regardless
of whether they are declared with access type Private, access type Public, or with no
explicit access type, they can only be used by the CAB instance that owns them.
• CDPs declared for a CAB type using PDE are effectively public. But they are not
made public through the same mechanism as a Public class variable in VB.NET. The
mechanism depends on CEE services and allows the CDP to be visible beyond the
hardware platform that hosts the CAB instance. For one CAB instance to access the
CDPs of another CAB instance or of a native block instance, PRefs must be used.
This cannot be done through inherent data reference capabilities of VB.NET.
382 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Glossary of terms and acronyms
Introduction
.NET CLR
.NET Common Language Run time. A set of language services which make it possible
for .NET programs to run on a target platform.
ACE
Application Control Environment
AICHANNEL
One type of IO block supported within CEE.
AND
API
Application Programming Interface
R210 Custom Algorithm Block and Custom Data Block User's Guide 383
10/04 Honeywell
Glossary of terms and acronyms
Special terms and acronyms
Basic block
Blocks that can exist only as dependent blocks within container blocks. Basic blocks
have dependent names. That is, their names are not unique within the PKS name space
until qualified by the name of their parent container block. CABs and CDBs are always
basic blocks.
Block instance
A single copy or instance of a block type. Holds a unique set of data values that can
specify the properties of a block type. See block type and block template.
Block template
A concept of block that incorporates some qualities of block type and some qualities of
block instances. A template is like a type in that it can serve as the pattern from which
one or more instances are created. It is like an instance in that one template can be copied
to make another. A template can serve as the master for changes to parameters that
propagate to all derived instances. Like an instance, a template is always dependent on an
independently defined block type. See also the definitions for block type and block
instance.
Block type
A universal definition of block data set and or block algorithm that can be physically
realized in multiple different copies or instances. See also Block Instance and Block
Template.
Build a program
The operation of compiling and linking a CAB program is often referred to within this
document as "building" it.
CAB algorithm
The control computation of a CAB. The algorithm is to be distinguished from the data
definition of the block. The algorithm is expressed within the CAB program.
384 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Glossary of terms and acronyms
Special terms and acronyms
CAB program
The programming language description of the CAB algorithm written in VB.NET. While
the algorithm is defined with the CAB program, the public, persistent data of a CAB is
defined as a set of CDPs through the use of PDE. CDP definitions established by PDE
are known to the CAB Program but are not explicitly declared within the CAB program.
CAB
Custom Algorithm Block
CB
Control Builder
CDB
Custom Data Block
CDP
Custom Data Parameter
CE
Control Engineer
CEE
Control Execution Environment
CM
Control Module
R210 Custom Algorithm Block and Custom Data Block User's Guide 385
10/04 Honeywell
Glossary of terms and acronyms
Special terms and acronyms
Component block
Within CEE, a component block is a block contained in a container block. Component
blocks are usually Basic Blocks, though within Experion, CMs can be components of
other CMs.
Connections
See “graphical connections.”
Container Block
Within the CEE architecture a container block is one capable of holding other blocks.
There are two types of container blocks: SCMs and CMs. SCMs are inherently single-
level. Their component blocks can only be basic blocks. In Experion, CMs can be multi-
level. They can hold basic blocks as components but they can also hold other CMs.
Container blocks have independent names (tag names). Some people prefer to think of
container blocks as "modules."
Control Module
A container block that supports execution of continuous algorithm blocks. In Experion, It
also supports containment hierarchies by being able to contain itself. CAB and CDBs are
always contained in CMs.
Convert
In the context of block types and block instances this term refers to a configuration
operation supported by CB. It allows an instance of one block type to be converted into
an instance of another block type.
386 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Glossary of terms and acronyms
Special terms and acronyms
DATAACQ
A signal conditioning and alarm block supported within CEE.
DLL
Dynamic Link Library
Edit Lock
A string parameter associated with all CAB and CDB types. When blank, it indicates that
the type is available for edit. When non-blank it contains the machine name and user
name of the person who is editing the type. Edit Lock is automatically set when an edit
session starts and automatically cleared when the session ends. A type may be opened for
viewing when it is already open but it cannot be saved to ERDB. The value of Edit Lock
can be viewed for a block type by opening the form from the library tree.
R210 Custom Algorithm Block and Custom Data Block User's Guide 387
10/04 Honeywell
Glossary of terms and acronyms
Special terms and acronyms
EE
Execution Environment
ERDB
Engineering Repository Database
EU
Engineering Unit
Exception handler
A programming construct provided in modern programming languages such as VB.NET.
Exception handlers allow error conditions to be detected and forwarded to the software
agent designed to respond. Error handling can be coded more concisely with Exception
handlers than through the traditional technique of passing error status up through a
calling tree. Exception handling is expressed through the use of "Try," "Catch," and
"Finally" clauses in VB.NET. Within CAB programs, Exception handlers can be used at
the discretion of the CE. When not used, runtime exceptions (for example, integer-
divide-by-zero exception) are caught by CAB system services, which terminate current
execution and resume it on the next cycle.
FDP
Fixed definition parameter
388 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Glossary of terms and acronyms
Special terms and acronyms
Graphical connections
Connections used to interconnect parameters. Wire connections are used within a CM
between pins exposed on blocks. Parameter connections are used between blocks in
different CMs, (although they can also be used within the same CM). Parameter
connections are implemented using symbol pins that are also exposed on the blocks.
GUID
Globally Unique Identifier. This identifier is generated in such a way that it will not
reoccur on any other PC. In CAB, it is stored in the BLOCKTYPEID parameter and
appears on the source code tab in MSVS. A new GUID is generated on each build.
IDE
Integrated Development Environment
IEEE 754
Prevalent standard for floating point arithmetic in computing.
Incomplete Lock
A flag parameter associated with all CAB types. When On it indicates that the parameter
definitions and algorithm definition of the type have not been rebuilt since changes were
made. The act of rebuilding clears the lock. A CAB type can be instantiated when the
Incomplete Lock is set, but it cannot be loaded.
INF
+INF and –INF are bit patterns in IEEE 754 that represent respectively positive and
negative infinity. Any magnitudes that are too large to not be represented within the
defined range of the floating-point number are represented instead as +INF or –INF.
I/O
Input/Output
R210 Custom Algorithm Block and Custom Data Block User's Guide 389
10/04 Honeywell
Glossary of terms and acronyms
Special terms and acronyms
MS
Microsoft, Inc.
MSVS
Microsoft Visual Studio .Net 2003
NaN
Not A Number. A set of bit patterns in IEEE 754 numbers that are not part of the defined,
ordinal numerical range. They can be used to represent alternative data states such as
"bad data."
Native blocks
Blocks whose type cannot be created or modified by application engineers who use the
Experion system. Examples include PID, Device Control and Data Acquisition.
OS
Operating System
PDE
Parameter Definition Editor
390 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04
Glossary of terms and acronyms
Special terms and acronyms
PKS
Process Knowledge System
PRef
Parameter reference
SCE-C200
Simulation Control Environment for the C200 embedded controller.
SCM
Sequence Control Module
SIM-ACE
Simulation environment for the ACE supervisory controller. SIM-ACE cannot be used
for on-process control. It is the intended platform for CAB source level debugging in
which break point activity can disrupt the main execution thread.
SR
System Repository
System Repository
The file where all Experion Server point data is stored.
R210 Custom Algorithm Block and Custom Data Block User's Guide 391
10/04 Honeywell
Glossary of terms and acronyms
Special terms and acronyms
System template
Block profile
Template
Block template
UI
User Interface
User template
Block template
392 Custom Algorithm Block and Custom Data Block User's Guide R210
Honeywell 10/04