GUS Display Authoring Tutorial EPDOC-XX43-En-431
GUS Display Authoring Tutorial EPDOC-XX43-En-431
EPDOC-XX43-en-431A
February 2015
Release 431
Document Release Issue Date
EPDOC-XX43-en-431A 431 0 February 2015
Disclaimer
This document contains Honeywell proprietary information. Information contained herein is to be used solely
for the purpose submitted, and no part of this document or its contents shall be reproduced, published, or
disclosed to a third party without the express permission of Honeywell International Sàrl.
While this information is presented in good faith and believed to be accurate, Honeywell disclaims the implied
warranties of merchantability and fitness for a purpose and makes no express warranties except as may be stated
in its written agreement with and for its customer.
In no event is Honeywell liable to anyone for any direct, special, or consequential damages. The information
and specifications in this document are subject to change without notice.
Copyright 2015 - Honeywell International Sàrl
2 www.honeywell.com
Contents
3
CONTENTS
4 www.honeywell.com
CONTENTS
5
CONTENTS
6 www.honeywell.com
1 About This Document
This document contains guidelines for building performant displays using GUS Display Builder.
7
1 ABOUT THIS DOCUMENT
8 www.honeywell.com
2 References
In conjunction with the Prerequisites listed earlier, the following TDC 3000 manuals can be used as an
information source:
Control Language/Application Reference Manual, Button Configuration Data Entry, and Actor’s Manual.
9
2 REFERENCES
10 www.honeywell.com
3 Guidelines for Performant Displays
The guidelines for building performant displays are written in support of the GUS Display Builder beginning
with GUS TPS R3xx.
11
3 GUIDELINES FOR PERFORMANT DISPLAYS
12 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
13
3 GUIDELINES FOR PERFORMANT DISPLAYS
to 7 allows the system to support more than 4 concurrent displays. Note that in this figure, it has been assumed
that SafeView workspace configuration has limited the number of displays to 6.
3.2.3 Increasing the Number of Displays and Invoking Multiple Simultaneous Displays
Increasing the number of GPB processes in the Process Pool allows more than 4 displays on a ES-T at the same
time and enables multiple simultaneous display invocation.
The following figure labeled Sequence 3 shows that increasing the number of GPB processes in the pool to 10
allows the system to support 6 displays and assures the simultaneous invocation of 4 displays. Note that in this
figure, it has been assumed that SafeView workspace configuration has limited the number of displays to 6.
Figure 3: Sequence 3: A System Supporting Six Displays and Simultaneous Invocation of Four Displays
14 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.2.4 Guidelines for Configuring the Number of GPB Processes in the Pool
Guideline 1: Configure the number of GPB Processes in the Pool to be the minimum that will support the design of
your operational workspace and invocation scheme.
The maximum number of GPB processes allowed is 16. Do not simply enter this maximum number. Remember
each process runs in memory and will use memory that could be used by another application.
Example:
If your workspace definition has eight GUS displays running concurrently and your invocation scheme invokes
four GUS display at one time, then you would configure the size of your GPB process pool to be 12.
Guideline 2: When designing the operator's workspace, remember that the maximum number of GUS displays that
may run concurrently is eight.
The Honeywell Experion Product and System Test Teams have tested running eight displays concurrently and
replacing eight displays at one time. Honeywell has not tested running more than eight displays concurrently. To
reiterate, the ability to provide more than four displays brings with it the responsibility of assuring that the
displays do not overload the ES-T node or the data owners.
15
3 GUIDELINES FOR PERFORMANT DISPLAYS
Attention
The first set of display callups takes slightly longer than subsequent display callups.
On PC startup, the Display Manager is invoked, and one or four gpb processes (four if you have Multiple
Displays) are started. The initial running of displays using these gpb processes takes longer than subsequent
reuse of the gpb processes.
3.3.4 For faster callup, use 'InvokeDisplay( )' to invoke one display from another one
For faster callup, invoke a display from another display by using the script function “InvokeDisplay( )” rather
than invoking the display using the “runpic” command from the command line.
Attention
The SCHEM actor is as performant as “InvokeDisplay( ).”
16 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.4.1 Use public variables or display parameters instead of DDB items or LCN points
Accessing data stored in public variables or display parameters is faster than accessing data stored in the DDB
or LCN. For this reason, use public variables or display parameters whenever possible when scripting a display.
Constraint
If a display is scripted to invoke another display, public variables from the invoking display are not copied to the
invoked display; however, global DDB values of the invoking display are copied to the global DDB of the
invoked display. Public variables do not take the place of the global DDB.
Considerations when writing scripts using public variables and display parameters:
• You cannot use public variables to store values of variable and entity data types; use the DDB or display
parameters to store variable and entity data.
• A change to a public variable will not cause an OnDataChange event, whereas a change to a display
parameter will cause an OnDataChange event.
• Public variables cannot be used in a variable expression on a basic object dynamic (rotate, fill, bar, and text
value). Display parameters can.
3.4.2 Use the DDB instead of the LCN for temporary storage or passing of data
Accessing data from the DDB is faster than accessing data from the LCN. Avoid using LCN point.parameters
for temporary storage of data. Use the DDB for temporary storage of data and/or passing data to a display
invoked from another display.
Attention
You must use LCN point.parameters to pass data among running displays.
3.4.3 Use an error handler instead of doing LCN reads for errors
Consider using an error handler instead of doing LCN point.parameter.status reads for handling errors. This
especially applies to non-OnDataChange scripts since LCN and DDB reads are immediate in non-
OnDataChange scripts.
The BasicScript language element, OnError, allows you to define what action is to be taken when a trappable
runtime error occurs.
3.4.4 Use an error handler when accessing multiple servers with OnDataChange
If you include an expression in your OnDataChange script that references data from more than one server, the
script will execute as soon as data is returned from the first server. At this time, the variant data type for
variables from other servers may still be “unknown,” and this will trigger a Type Mismatch error report. You
should, therefore, always include an explicit error handler in your script, to prevent displaying these Type
Mismatch error messages during normal startup.
3.4.5 Use OnDataChange script with added logic for values you read only once
If some values need to be read once, still use OnDataChange script, and put some logic around those variables
so that the code is executed only once. Here is an example:
17
3 GUIDELINES FOR PERFORMANT DISPLAYS
Sample Script
Public once as Boolean
Sub OnDataChange()
If not once then
<read parameters and assign to public variables>
once = TRUE
end if
<other script instructions>
End Sub
The Boolean “once” will be false when this script is executed for the first time, then be set to true for the
duration of the display execution.
3.4.6 Minimize the use of .Internal in onDataChange scripts accessing HCI data
It is not very effective when you access the HCI data from GUS Data Collection Group using “.internal” name
form. Accessing the .internal value of an HCI data source from a GUS script (such as
HCI.svr1.A100.PV.internal) involves a .internal single-point retrieval. So, access the default or .external value
of the same parameter than the .internal value.
3.4.7 Ensure that all dynamic indices are initialized at display startup
Initialize the DDB parameter or scripting variable being used as a dynamic index. Failure to do so results in the
default value of the parameter or variable being used as the dynamic index value. This can either cause GUS
Runtime to read from or write to the wrong element of an array, or cause a runtime error if the indexed member
is not a legal member of the array. Here is an example:
Sample Script
Sub OnDataChange()
me.text = lcn.am_1349(dispdb.int01).[name]
End Sub
Dispdb.int01 was not initialized during display startup, therefore, the dispdb.int01 was equal to its default value
of zero. This script raised a Configuration Error since lcn.am_1349(0) was not a legal member of the array.
3.4.9 Ensure that writing to a display/DDB param doesn’t initiate unnecessary actions
In a script, writing to a display parameter or DDB parameter of all data types except entity and variable will
cause an OnDataChange event to be sent immediately to all objects that reference the changed parameter in
their OnDataChange scripts. The unnecessary execution of OnDataChange scripts reduces performance.
Attention
When a script statement writes to a display parameter or DDB parameter, GUS Runtime does not compare the old
value to the new value to determine if the value really changed. It simply marks the parameter as changed and sends
out the OnDataChange events to all appropriate objects.
18 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
Sample Script
dim LoAllmColor as long
dim HiAlmColor as long
Sample Script
dim LoAlmColor, HiAlmColor as long
19
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.5.2 Use 'Enter Parameters' to set entity and variable display parameters at build time
Display parameters of type entity and type variable can be set only at build time, using the “Enter Parameters”
dialog. You cannot set the reference of a display parameter of type entity or variable in a script. If you script
“set display.params.tag = GetEnt(“A100”)” where tag is of type entity, you will get an error.
To enter a reference for a display parameter of type entity or variable in the “Enter Parameters” dialog, enter an
LCN reference, a DDB reference, or a reference to another display parameter of the same type.
Attention
Either the syntax, “me.text = dispdb.ent01.[name]” or “me.text = dispdb.ent01.external” will cause an immediate read
in an OnLeftButtonClick script.
Note also that even though the previous example uses dispdb.[$cz_enty], this performance tip applies for all DDB
entities.
Scenario
In displays using the change zone, you may want to write a conditional statement in an OnDataChange script to
determine if there is an entity assigned to dispdb.[$cz_enty], and then script some actions if dispdb.[$cz_enty] is
assigned to an entity.
Using “dispdb.[$cz_enty].[name] <> ”“” will give a configuration error (error number 1052) if there is no entity
assigned to dispdb.[$cz_enty]. Here are two scripting options:
Option 1
Instead of scripting as follows:
Sample Script
if (dispdb.[$cz_enty].[name]<>“” then,
20 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
Sample Script
if dispdb.[$cs_enty].[name].status = HOPC_NO_ERROR
then
<script actions when $cz_enty is assigned an entity>
else
<script actions when $cz_enty is NULL>
end if
Option 2
Use “if dispdb.[$cz_enty].[name] <> ”“” in the script and put an error handler in the script to handle the
configuration error (1052). Script the action to be taken when the configuration error 1052 occurs (i.e., when the
entity is null) in the Error Handler.
3.5.4 Use GetEnt('') to set a Display Data Base entity or variable to NULL
To set a Display Data Base Entity to NULL, use the syntax, “set dispdb.<entity> = GetEnt(“”)”. To set a Display
Data Base Variable to NULL, use the syntax “set dispdb.<variable> = GetVar(“”)”.
Here is an example:
Sample Script
Sub OnLButtonClick()
set dispdb.[$cz_enty] = GetEnt(“”)
End Sub
Sample Script
Sub OnDataChange()
If dispdb.[$cz_enty].[name].status = HOPC_CONFIGURATION_ERROR
then
‘dispdb.ent01 is NULL
‘script actions when ent01 is NULL
end if
End Sub
3.5.6 How to set a Display Data Base entity = a display param of type entity
To set a Display Data Base entity equal to a display parameter of type entity, use the syntax, “set
dispdb.<entity> = display.params.tag” where tag is of type entity.
Here is an example:
Sample Script
Sub OnLButtonClick()
set dispdb.ent01g = display.params.tag
‘tag is a display parameter of type entity
End Sub
Attention
The .external property does not work with the display parameter of type entity.
21
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.5.7 To change an NT registry entity setting, save the internal ID not the entity name
To save an entity to an NT registry setting for the purpose of setting a different entity to this saved setting, save
the internal ID (for example, dispdb.ent01.internal) rather than the name of the entity (for example, A100).
Setting the new entity to the saved registry setting containing the internal ID of the entity is more performant.
Example
Consider two displays, a Unit display and a Faceplate display. Selecting a target on the unit display changes the
point-of-interest in the Faceplate display.
22 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
23
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.6.1 OnDataChange
All LCN and DDB reads are from cache (that is, stored, scanned values). All writes are immediate to the LCN
and DDB.
Time T1:
The point.parameter lcn.A100.PV changes, causing an OnDataChange event to be sent to the PVText object.
The OnDataChange script on the PVText object executes. The PVText's OnDataChange script changes the
display parameter P1. Because the OnDataChange script of the SPText object references the display parameter
P1, SPText is immediately sent an OnDataChange event.
Time T2:
The OnDataChange script on the SPText object executes in response to the OnDataChange event sent as a result
of P1 changing. The SPText's OnDataChange script changes the display parameter P2. Because the
OnDataChange script of the PVText object references the display parameter P2, PVText is immediately sent an
OnDataChange event. YOU ARE NOW IN AN INFINITE LOOP. This OnDataChange “Ping-Pongs”
between the PVText and SPText objects.
24 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.6.2 OnPeriodicUpdate
All LCN and DDB data reads are from cache, which means they are stored, scanned values. All writes are
immediate to the LCN and DDB.
Sample Script
Const Period = 10
Dim Cycles as integer
'at startup, “cycles” is automatically initialized to 0
Sub OnPeriodicUpdate()
if cycles >= Period then
cycles = 0
'put code here to run at the end of each period
else
'period has not yet been reached
cycles = cycles + 1
end if
End Sub
25
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.6.5 OnDisplayStartUp
All LCN and DDB reads and writes are immediate.
3.6.6 OnDisplayShutDown
All LCN and DDB reads and writes are immediate.
26 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
A display taking a long time to be displayed could be an indication that the PREVIOUS display (the one being
closed to make room for the new display) had a problem shutting down, and had to wait for the shutdown wait
limit to force it to shutdown.
An example of a problem that could occur is with a “Msg” object (used to provide progress dialog) in a GUS
display under SafeView control that will not close if the code never breaks out of the loop.
The timeout setting here can force a shutdown of a display within a specified time, which means that the display
itself can shutdown before all other currently executing scripts run to completion. When deciding to use this
timeout option, users take responsibility that any scripts whose executions are being preemptively terminated
are inconsequential.
The Shutdown Wait Limit should allow sufficient time for scripts to complete, but shut down the display after a
reasonable time if the script gets into a very long or infinite loop. Be very careful when changing the Shutdown
Wait Limit. Note that a value between 1 and 249 milliseconds will be automatically rounded up to 250
milliseconds (1/4 second). Setting the Shutdown Wait Limit too high can delay invocation of new displays.
Attention
Setting the Shutdown Wait Limit to zero will essentially disable the OnDisplayShutdown subroutine.
27
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.7.2 When testing a display with animation, monitor the CPU usage of the display
You can monitor the CPU usage of a running display by viewing the Performance page of the Windows NT
Task Manager. Because GUS displays run in a multi-window environment, monitoring CPU usage is a
necessary task when testing a display. A single display should not use all the available CPU; the performance of
the other running displays decreases as a result.
28 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.8.3 Consider a Display Data Base item, $cz_enty in a custom Change Zone
To improve the performance when invoking the standard change zone for a point or changing the point of
interest in the change zone, enhancements have been made in the GUS Application, gpb.exe. These
enhancements are concerned with the Display Data Base (DDB) item, $cz_enty. You can utilize dispdb.
[$cz_enty] in scripting a custom change zone to take advantage of these enhancements. Following is the list of
enhancements.
• When a display having reference(s) to dispdb.[$cz_enty] is validated, the dispdb.[$cz_enty] variables for
example., dispdb.[$cz_enty].pv) are put in the data collection group named “CZE” and the collection rate of
each reference is set to 4 seconds.
Attention
When a previously validated display is validated again, the data collection group assigned to dispdb.[$cz_enty]
variables is not changed to the “CZE” group. You may change the group using the Data Collection dialog invoked
from “Display/Data Collection” menu item in the GUS Display Builder. Use this admonishment to identify
information that requires special consideration. DO NOT use this admonishment to identify information that can be
classified as a “tip” or other “nice-to-know” material.
29
3 GUIDELINES FOR PERFORMANT DISPLAYS
• When the point assigned to dispdb.[$cz_enty] is changed during the running of a display, all variables in the
CZE group are updated immediately.
30 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.9.1 Reference subroutine and function data from OnDataChange scripts carefully
During validation, data references in all subroutines and functions are not put in the data collection list to be
scanned, and therefore are not part of the GPB cache. This behavior has no effect on the performance or
behavior of User Event for example, OnLButtonClick), OnDisplayShutDown, or OnDisplayStartUp scripts
because all reads are immediate. It could, however, have an effect on the performance and behavior of the
OnDataChange and OnPeriodicUpdate scripts.
Consider the following when writing an OnDataChange script:
• A value change to a data reference in a subroutine or function that is invoked from an OnDataChange script
will not cause an OnDataChange event to be fired, and therefore the data reference's value will not update in
the display.
• If an OnDataChange script is triggered, the subroutines called from within the OnDataChange script will be
executed and data will be collected. BUT there may be a performance hit. A subroutine called from an
OnDataChange script first checks the GPB cache for the referenced data item. If the LCN or DDB value is
referenced in some other object's OnDataChange or OnPeriodicUpdate script, then it will be in the GPB
cache and appear in the data collection list. The value will be read from the stored value, BUT if it is not in
the GPB cache, then an immediate read of that value will occur. This will decrease performance.
The same considerations apply when writing OnPeriodicUpdate scripts.
3.9.2 Consider using a public script variable when reading same LCN vrbl repeatedly
Consider using a public script variable to store the value of the variable to read the same LCN variable
repeatedly within a collection of subroutines. Remember that “reads” in subroutines are immediate so the value
must be read from the process network. Reading a public variable into which you have stored the LCN variable
is faster.
The same considerations apply when writing OnPeriodicUpdate scripts.
31
3 GUIDELINES FOR PERFORMANT DISPLAYS
32 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
3.11.2 Consider using a data type object display parameter to read or write data
Using the object parameter to write directly to another embedded display's parameters is fast. It causes the
immediate firing of the OnDataChange scripts when a display parameter changes.
Data can also be read and/or written between embedded displays using the Display Data Base. This is a less
performant method because writing data to a DDB item means an out-of-process write to the DDB that is
located in the HOPC Server.
Example
33
3 GUIDELINES FOR PERFORMANT DISPLAYS
34 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
No. Rule
1 Certain kinds of data should reside in their own Collection group to localize the effect of gathering that kind of data.
For instance, DispDb data can ultimately point to various data owners on the LCN/UCN. Putting these data items
into their own group minimizes their effect on other Data Collection groups. This is also true for Collector data.
Collector and DispDB data can be combined into one group. The recommended update frequency for this group is 4
seconds or slower. For best system performance, use the slowest collection rate that meets your system
requirements.
2 Put non-updating parameters (such as Point and Engineering Unit descriptions, and Alarm limits) into a separate
group with an update frequency of 0 (zero). This will cause the data to be retrieved only upon Display startup. The
data can be retrieved on demand as well. Do not use Group 0 for non-updating parameters because the
LCNUPDATE 0 command will update ALL groups, not just group 0.
3 Do not modify the update frequency for changezone parameters assigned to the special collection group CZE. The
default update frequency for this group is 4 seconds and it should not be changed.
4 For point.parameter references from LCN nodes (data owners) such as AMs, HGs, CGs and NIMs:
1. Determine the LCN node number where the point.parameter resides (this is listed in each point detail display in
the parameter NODE_NO).
2. Group parameters by LCN node (or redundant pair). That is, put references associated with each LCN node into
separate Collection groups.
Note that the reason for grouping by “node” is that some nodes return data more slowly than others do. For
example, if a Data Collection group contains references to both an AM and a CG, the message to the LCN that
contains both requests will be delayed until both pieces of data are returned. Because a CG may return data
more slowly than an AM node, the effect would be to delay the acquisition of the AM data.
3. In order to accommodate a number of different scan frequencies, do not to increase the total number of scan
groups to the point where communication inefficiencies result. The following table provides a Collection Group
layout that recombines points and reduces the total number of groups.
4. If there are more then say 20 points that do not change often, put them either in a very slow collection group
(for example, 60 seconds), or in a collection group with a zero rate, which means that the points will only be
updated on demand. These parameters cannot include alarm limits and point execution status.
35
3 GUIDELINES FOR PERFORMANT DISPLAYS
If certain parameters need to be scanned at a faster rate, you have two options:
1. Create a group with ID set to FST. This special group is called the “FAST” group. It has a default scan
frequency of 4 seconds. However, when the FAST button on an IKB is pressed, that group will begin to scan
at a 1-second rate.
2. Create a separate group for points that need to be scanned more often.
CAUTION
You must use this group judiciously, because scheduling a large number of points for a fast update rate can
adversely affect system performance.
36 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
In R530, this grouping can be done automatically for schematics built on a Universal Station (US) with the
Picture Editor (PE), using the PE OPTIMIZE command. For a GUS display, the grouping is done manually.
Example
You are creating a display that requests both Control and IOL data from multiple APMs. Some of the data is not
updated (descriptors, point names, and so on.).
You determine that the best overall system loading is achieved by using two update rates (for example, the
standard 4-second update and an 8-second update).
If there are more than 10 parameters in either the xPM control or IOP group that do not change often, put them
either in a very slow collection group (such as 60 seconds), or in a collection group with a zero rate. This means
that parameters will only be updated on demand. These parameters cannot include alarm limits and point
execution status.
Because the numbering of groups is arbitrary within the 0-245 limit allowed by the Display Builder, you could
establish the following groups.
37
3 GUIDELINES FOR PERFORMANT DISPLAYS
When the NIM constructs UCN parameter requests, it sorts each group's parameters by UCN node and each
APM receives a homogeneous request.
38 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
CAUTION
Note that there are over 10 Collection Groups defined. Because of messaging overheads, this may result in a non-
performant display. It is anticipated that most displays will NOT require all the types and numbers of Collection
Groups that are shown in the following table. In fact, efforts need to be made to minimize both the number of data
Collection Groups and the number of “features” built into any one display.
39
3 GUIDELINES FOR PERFORMANT DISPLAYS
where 20 is a constant, RF is the “faster” scan rate; RS is the “slower’” scan rate; and S is the number of
parameters in the “slower” group.
40 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
If this inequality is true, then the groups should be kept separate. Otherwise, they should be combined into the
faster group.
Example
Given 2 Collection groups; one at 4 seconds, the another at 8 seconds, and with 50 points in the 8 second group,
the calculation would be:
The inequality is true, which means that these 50 points should be left in the 8-second group.
It is also obvious that, for the given collection rates, an 8 second group of less than 20 points should be
combined into the 4 second group.
Tip
This recombination is valid as long as the resultant Group size (the numerator) is less than 200. This is because data
request messages have a maximum size of 200 references. Groups with more than 200 parameter references result
in multiple messages. And the intent here is to reduce the number of data request messages.
Additional UCN group divisions based on your particular network dynamics and load may prove useful. Here
are some examples:
• Separate slow parameters (such as temperature and tank level) from fast parameters (such as flow and
pressure).
• Separate slow UCN boxes from fast UCN boxes (for example, separate APM and PM from HPM
parameters). Do this only if your process warrants it since the creation of additional collection groups can be
inefficient.
41
3 GUIDELINES FOR PERFORMANT DISPLAYS
Prerequisites
To complete the procedures listed in this section, the user should be familiar with
• GUS Scripting
• TDC Button Configuration
• AM Custom Point Building
• Custom Data Segment Definition
Procedure
The user will create a new script in a GUS picture that will update parameters defined by a Custom Data
Segment (CDS) on an AM Custom point. The parameters on the AM Custom point will be used to pass picture
name and console station/screen number data to a button configured on a TDC Universal Station to execute the
CROSSCRN actor. When correctly implemented, the ES-T user will be able to press a button on a GUS graphic
and cause a CROSSCRN to execute on TDC.
The following steps are provided as an example only. There are other techniques that could be implemented to
achieve the same functionality. This is a “rough” example to provide the user with the basic steps that must be
performed to create CROSSCRN functionality. It would be prudent for ES-T/TDC users to review the examples
and add error checking where appropriate.
Here are the four basic steps that must be performed:
1. Define the Custom Data Segment
2. Build the AM Custom Point
3. Configure a Button on Universal Station
4. Create Script on a GUS Graphic
Note that although ”BLD_VISIBLE“ is the default, for purposes of documentation it has been included on each
parameter in the previous example.
NAME = TDCGUSDA
42 www.honeywell.com
3 GUIDELINES FOR PERFORMANT DISPLAYS
UNIT = 01
NOPKG = 1
PKGNAME = TDCGUSDA
When properly configured, page 5 of the builder will display parameters defined in the CDS that is included as
the “package” on this AM Custom point.
CROSSCRN(TRUNC(GS_REAL(TDCGUSDA.SCRN_NO)));
SCHEM(GS_STR(TDCGUSDA.XSCRNAME))
The first line in the configured button retrieves the scrn_no parameter from the AM Custom point
(TDCGUSDA in the previous example), truncates that number to an integer and returns that to the crosscrn
actor which tells the station to execute the next actor on the screen number requested.
The second line in the configured button retrieves the xscrname parameter from the AM Custom point
(TDCGUSDA in the previous example) and returns it as a string to the SCHEM actor that will mount the
picture on the screen requested by the crosscrn actor.
OnLButtonUP
1 This routine will execute each time the user “presses” the target and clicks the left mouse button. When the
left button is released the user will be presented with a dialog box to enter the name of the desired picture to
mount. Next the user will be presented with a dialog box to enter the station/screen number to mount the
picture on.
2 After the user has entered both the picture name and screen number a test is performed to determine if this is
an actual cross screen request or if the user has requested to mount the picture on the current screen. This
test is necessary because of a problem with the cross screen implementation on GUS that causes the station
NOT to search for GUS Graphic pictures on the current station when executing the SCHEM actor.
43
3 GUIDELINES FOR PERFORMANT DISPLAYS
3 If the request is for the current screen, the script does a simple invoke of the display, which will cause it to
be mounted at the station the script is running on. If the request is for some other screen, then the script will
fire the button configured for the cross screen and the picture will be mounted on the requested screen.
3.16.5 Limitations
Display names used with this technique must be 8 characters or less or they will be truncated. For example, if
the user wanted to mount the picture “blueflower” on screen two the name would be truncated to “blueflow”
and an error returned to screen 2.
3.16.6 References
In conjunction with the Prerequisites listed earlier, the following TDC 3000 manuals can be used as an
information source:
Control Language/Application Reference Manual, Button Configuration Data Entry, and Actor’s Manual.
44 www.honeywell.com
4 Data Access Model
45
4 DATA ACCESS MODEL
46 www.honeywell.com
4 DATA ACCESS MODEL
47
4 DATA ACCESS MODEL
Tip
The cached value of LCN.B100.P1 is not affected by this operation.
48 www.honeywell.com
4 DATA ACCESS MODEL
49
4 DATA ACCESS MODEL
50 www.honeywell.com
4 DATA ACCESS MODEL
Figure 13: Indirect Access When A200.Ndirect Contains the Name of B100
In the following figure, the value of A200.Ndirect has been changed to contain the name of the point C100.
Hence the Text object on the display will show the value of C100.P2 and the rectangle will increment the value
of C100.P2.
51
4 DATA ACCESS MODEL
52 www.honeywell.com
4 DATA ACCESS MODEL
Refer to the subsection “Using the Data Types Entity and Variable in Scripts” on page 20 for additional
information.
53
4 DATA ACCESS MODEL
Attention
Information is passed only once when another display is invoked, and only in one direction — from the display
currently on the screen to the display being evoked.
54 www.honeywell.com
4 DATA ACCESS MODEL
55
4 DATA ACCESS MODEL
56 www.honeywell.com
4 DATA ACCESS MODEL
4.7 Relationship between Displays, GUS Run Time, and Global DDBs
The following figure illustrates the relationship between a display, the GUS Run Time process, and Global
DDBs. Specifically, each display is rendered by a single GUS Run Time process and each GUS Run Time
process has a single Global DDB space.
Attention
Each GUS Run Time process has its own Global DDB space. When one display invokes another display, the invoking
display's Global DDB gets copied to the Global DDB of the display being invoked. From that time forward, the Global
DDBs are independent. Changing a value in one will not affect the other.
57
4 DATA ACCESS MODEL
The following figure illustrates the callup of a display for Reactor 4, by selection of the appropriate object in the
Reactor_Menu display. The OnLButtonClick subroutine for the rectangle stored the names of points for Reactor
4 into the Global DDB Variables ENT01G and ENT02G. The name of the reactor was stored into STR01G.
The InvokeDisplay statement then executes. It copies the Global DDB Values from the Global DDB space
associated with the run time executing the Reactor_Menu display to the Global DDB space for the run time
associated with the SafeView window to receive the next display. It then invokes the Reactor display in that
window. When that display executes, it shows the values for the points in reactor 1, by accessing them indirectly
through ENT01G and ENT02G.
58 www.honeywell.com
4 DATA ACCESS MODEL
In the previous figure, the background color of the Native Window has been changed to enhance the visibility
for black and white printing.
59
4 DATA ACCESS MODEL
60 www.honeywell.com
5 Propagation of System Events
Conceptually, events move (or propagate) through the objects in a display, “looking for” a script to service it.
When a system event finds a subroutine to handle, the subroutine is executed and the event continues until all
objects have been visited.
61
5 PROPAGATION OF SYSTEM EVENTS
Example: A Display That Shows the Number of Seconds It Has Been Active
The following figures illustrate a display that shows the amount of time the display has been running and the
structure of that display.
The display consists of three objects: the object representing the display, a Text object displaying the constant
text “Number Of Seconds This Display Has Been Running:” (Text1), and a Text object that displays the elapsed
time since the display was called, in seconds (Elpsd_Time).
When the display is initially called, the GUS Run Time generates a DisplayStartUp event and sends it to the
display. The following figure shows the path of the DisplayStartUp event as it propagates through the display.
62 www.honeywell.com
5 PROPAGATION OF SYSTEM EVENTS
63
5 PROPAGATION OF SYSTEM EVENTS
No. Sequence
1 The PeriodicUpdate event visits the Display object. Because no subroutine to service this event exists in the
script of the Display object, the event continues to propagate.
2 The PeriodicUpdate event visits the Text1 object. Because no subroutine to service this event exists in the
script of this object, the event continues to propagate.
3 The PeriodicUpdate event visits the Elpsd_Time object, finds the OnPeriodicUpdate subroutine, and executes
it.
4 This subroutine calls a Global Function that calculates the time the display has been running. The result of the
function is stored in the Text property of the Elpsd_Time object, displaying it to the operator.
5 The PeriodicUpdate event continues to visit all objects in the display, if there are any.
64 www.honeywell.com
5 PROPAGATION OF SYSTEM EVENTS
<!30846>
65
5 PROPAGATION OF SYSTEM EVENTS
3 This subroutine stores the value of A100.PV into the text property of Text1, causing it to be shown on the
screen.
4 The DataChange event visits the Text2 object. Because no subroutine to service this event exists in the script
of this object, the event continues to propagate.
Tip
In reality, all objects are not searched for an OnDataChange subroutine. When a display is verified, the GUS
Display Builder minimizes the time to fire a subroutine in response to the datachange event. However, for the
purpose of a model to explain the operation of the runtime, we can think in terms of each object being searched
for an OnDataChange subroutine.
66 www.honeywell.com
5 PROPAGATION OF SYSTEM EVENTS
When the display is invoked, the GUS Run Time generates the DisplayStartUp event and sends it to the display.
The OnDisplayStartUp subroutine opens the file, records the File ID in a Public variable, and initializes another
public variable with the current time:
When the display is closed, the GUS Run Time generates the DisplayShutDown event and sends it to the
display. The OnDisplayShutDown subroutine writes the statistical data to the file (the file is accessed using the
Public Variable “File_ID”), then closes it.
When all OnDisplayShutDown subroutines have been run, the GUS Run Time closes the display.
67
5 PROPAGATION OF SYSTEM EVENTS
68 www.honeywell.com
5 PROPAGATION OF SYSTEM EVENTS
The following figure illustrates the structure of the Pump Display and shows two possibilities of the order of
execution for subroutines servicing the DisplayStartUp event. These figures illustrate, that the GUS Run Time
only guarantees the order of DisplayStartUp subroutines for container objects (i.e., that the DisplayStartUp
subroutine for the container executes before the DisplayStartUp subroutine for the member objects).
Figure 32: One Possible Sequence of Visits to Display Objects by Display StartUp Event
69
5 PROPAGATION OF SYSTEM EVENTS
Figure 33: Another Possible Sequence of Visits to Display Objects by Display StartUp Event
The following figure illustrates the structure of the 2_Pump Display showing that the OnDisplayStartUp
subroutine defined when the Pump Display was constructed executes before the OnDisplayStartUp subroutine
defined when the Pump Display was added to the 2_Pump Display.
Figure 35: Another Possible Sequence of Visits to Display Objects by Display StartUp Event
70 www.honeywell.com
6 User Events
71
6 USER EVENTS
72 www.honeywell.com
6 USER EVENTS
73
6 USER EVENTS
As shown in the following figure, the display consists of five objects (one of which represents the display
itself).
When the user clicks on the upper rectangle with the mouse, a LButtonClick event is generated. This event then
propagates through the display looking for a subroutine to handle the event.
74 www.honeywell.com
6 USER EVENTS
Figure 39: The Event Finds the Subroutine to Handle it and Causes the Subroutine to Execute
As shown in the following figure, subroutines to handle the RButtonClick event have been added to the
rectangles (the GUS Basic for the subroutine to show the display menu is not shown in the figure).
75
6 USER EVENTS
The following figure illustrates the “z” ordering of the objects in the Tank Display (Tank_ID and T_Edge are in
front of T_Body).
76 www.honeywell.com
6 USER EVENTS
The following figure illustrates the problem in terms of the scripting model.
Clicking the Text object used to display the tank name generates a LButtonClick event. Because the Text object
is selectable, the LButtonClick event will look for a subroutine on the Text object to execute (Sub
OnLButtonClick). Because the Text object has no such subroutine (in fact it has no script at all), the
LButtonClick Event stops its propagation and the result is no action.
A similar result would occur if the operator clicked on the line separating the top from the body of the tank.
77
6 USER EVENTS
78 www.honeywell.com
6 USER EVENTS
79
6 USER EVENTS
When the pump is off, the operator can turn it on by selecting the rectangle labeled “On.” Clicking on the
rectangle labeled “Off” has no effect. The Selectable property for the embedded display is set to false.
When the pump is on, the operator can turn it off by selecting the rectangle labeled “Off.” Clicking on the
rectangle labeled “On” has no effect (i.e., the Selectable property for the embedded display is set to false).
80 www.honeywell.com
6 USER EVENTS
The first parameter is named Pump, and is an Entity type. When the user adds an instance of a pushbutton, the
Pump parameter is bound to a point representing a pump.
The second is named NewState and is a Boolean type. When the user adds an instance of a pushbutton, the
NewState parameter is bound to True, to turn the pump on, or False, to turn the pump off.
For the purpose of this example, we assume that points representing pumps have a Boolean parameter named
“State.” The value True means the pump is on and the value False means the pump is off. Storing True to the
State parameter for a pump point will turn the pump on and storing False to the State parameter for a pump
point will turn the pump off.
The following figure shows the structure of this display:
PushButton.pct
The embedded display PushButton.pct consists of two objects: a Text object (named Label) and a rectangle
(named PB_Face).
The value of the Selectable property for Label is set to False to allow user events to pass through it. The value
of the Selectable property for PB_Face is set to True so that the LButtonClick event will execute the subroutine
to turn the Pump on or off.
81
6 USER EVENTS
Figure 51: Pump Display after Assigning False to On_PB Embedded Display
Note that in the previous display, the initial value of the Selectable property is shown in italics. The value then
assigned to the selectable property for each member object and the display itself is shown in normal font.
The following figure illustrates the operation of the Pump display after the Selectable property for the Off_PB
embedded display has been set to False.
82 www.honeywell.com
6 USER EVENTS
Figure 52: Pump Display after Assigning True to the Selectable Property of On_PB and False to the Selectable Property of
Off_PB
Note that in the previous display, the initial value of the Selectable property is shown in italics. The value then
assigned to the selectable property for each member object and the display itself is shown in normal font.
83
6 USER EVENTS
Note that in the previous display, the initial value of the Selectable property is shown in italics. The value then
assigned to the selectable property for each member object and the display itself is shown in normal font.
The invisible rectangle on the top of pump allows easy selection by the operator.
84 www.honeywell.com
6 USER EVENTS
85
6 USER EVENTS
Note that in the previous display, the initial value of the Selectable property is shown in italics. The value then
assigned to the selectable property for each member object and the display itself is shown in normal font.
86 www.honeywell.com
7 Scripting Threads
87
7 SCRIPTING THREADS
88 www.honeywell.com
7 SCRIPTING THREADS
The following figure illustrates the structure of this display and shows one possible order of execution of its
OnDataChange subroutines on the Data Change thread for the display.
89
7 SCRIPTING THREADS
90 www.honeywell.com
7 SCRIPTING THREADS
91
7 SCRIPTING THREADS
92 www.honeywell.com
8 User Interface Guidelines
93
8 USER INTERFACE GUIDELINES
Guideline 1: Use a standard display hierarchy to represent the multilevel views that are necessary for monitoring
and control.
Good practice has found that normally, a four-level display hierarchy is sufficient and effective. Levels can be
characterized as follows:
• an overview display for the area of control
• high-level displays, such as unit displays
• high-level overview displays, such as unit displays
• low-level displays, such as detail displays on smaller parts of a unit
• point-specific displays, such as context-sensitive displays for a point or a small piece of equipment
Guideline 2: Design operator displays to minimize the number of display changes required to complete typical
operation tasks.
The design of operator displays should minimize the number of display changes required to complete typical
tasks. The designer needs to understand the typical tasks for a given process and be able to determine the
essential information and control requirements to execute each task.
94 www.honeywell.com
8 USER INTERFACE GUIDELINES
GUS User Interface Display Callup Performance LCN Loading as related to a Universal
Style Station
US Replacement Native Window: - equivalent to TDC Equivalent to a US
Basic Monitoring and GUS Display: - 2 - 5 seconds Equivalent to 2 USs
Control
Native Window: equivalent to TDC
Multi-Level Main Display: - 2 - 5 seconds Equivalent to 2 \ to 3 USs
Monitoring and
Mid-level Detail: 1 - 2 seconds
Control
Point Viewer: - 1 - 1.5 seconds
Navigator: - 1 - 1.5 seconds
Native Window: - equivalent to TDC
Wide Area Monitoring Wide Area Display: - 5 - 7 sec's Equivalent to 2 \ to 3 USs
and Control
Mid-level Detail: 2 - 5 seconds
Dual Screen Node
Navigator: - 1 - 1.5 seconds
Point Viewer: - 1 - 1.5 seconds
Auxiliary Display: 0.5 - 1.5 sec's
Native Window: - equivalent to TDC
Wide Area Monitoring Wide Area Display: 5 - 7 seconds (2) Equivalent to 3 to 8 USs
and Control
Mid-level Detail: 2 - 5 seconds (2)
4-Screen Node
Navigator: - 1 - 1.5 sec's (1)
Point Viewer: - 1 -1.5 seconds (1)
Auxiliary Display: 0.5 - 1.5 sec's (1-2)
Native Window: - equivalent to TDC
95
8 USER INTERFACE GUIDELINES
96 www.honeywell.com
8 USER INTERFACE GUIDELINES
97
8 USER INTERFACE GUIDELINES
8.3.5 Applying the Wide Area controlling and monitoring style to the Icon console
Honeywell's Icon Console can have two to four flat panel screens. For an icon console with four screens,
consider duplicating the Wide Area monitoring and control style across four screens as a starting point. When
defining the workspace and the displays, remember to consider the following:
• Loading of the LCN
• Application of user interface guidelines
• Computing power of the PC
98 www.honeywell.com
8 USER INTERFACE GUIDELINES
Sample Script
Sub OnLButtonClick
dim pntType as string
' Pass point to Point Viewer display
Set Dispdb.ENTO1G = lcn.A100
' Get the name of the LCN point type for point in ENTO1G
pntType =lcnPointType ()
' Invoke the Point Viewer display for that type
InvokeDisplay (“PVD_” + pntType + “.PCT”)
End Sub
The key to this technique is determining the type of the point of interest. One way to do this is to use the value
of the property ent_type. This property returns the type of the point as a string.
The following script fragment contains an example.
Sample Script
.
.
type = lcn.A100.ent_type
.
.
99
8 USER INTERFACE GUIDELINES
While this statement will return an indication of the point type, it can take up to 0.5 seconds to execute,
compromising call up time of the Point Viewer display. A faster way to obtain the LCN point type is to extract it
directly from the internal point ID, avoiding any access to LCN resident Data Owners. Because the LCN point
type in the internal ID is represented as an integer, the string form of the point type can be obtained using an
array, indexed by the point type obtained from the internal ID.
The following script will extract the integer representation of an LCN point type from an internal ID of an LCN
point in dispdb.ENT01G.
Sample Script
Public Function lcnEntType () As Integer
Dim crackEntType As String *
' Put the internal ID in the String
crackEntType = dispdb.ENT01G.internal
' Extract the byte containing the LCN TYPE and return it
lcnEntType = ascb (mid(crackEntType, 1, 1))
End Function
The following table maps the integer type to the string equivalent:
Integer String
0 NULL
1 POCSTAT
2 HIWAY
3 BOX
4 LIBRARY
5 ANLINHG
6 ANLOUTHG
7 ANLCMPHG
8 DIGINHG
9 DIGOUTHG
10 DIGCMPHG
11 CTLCOUNT
12 REGHG
13 COUNTHG
14 TIMERHG
15 FLAGHG
16 NUMERCHG
17 PRCMODHG
18 LGKBLKHG
19 UNT_ENBL
20 REGAM
21 LOGICAM
22 CUSTOMAM
23 SWITCHAM
24 COUNTAM
25 TIMERAM
26 FLAGAM
100 www.honeywell.com
8 USER INTERFACE GUIDELINES
Integer String
27 NUMERCAM
28 BCHHISAM
29 BCHHISPR
30 - 58 Internal use by LCN
59 ACIDP
60 ACCRDP
61 HM_HIST
62 UPIDP
63 UPCRDP
64 - 66 Internal use by LCN
67 BHASMDHG
68 - 70 Internal use by LCN
71 NODE
72 MGLIB
73 ANLINMG
74 ANLOUTMG
75 DIGINMG
76 DIGOUTMG
77 DIGCMPMG
78 REGPVMG
79 REGCTLMG
80 LOGICMG
81 Internal use by LCN
82 FLAGMG
83 NUMERMG
84 TIMERMG
85 PRCMODMG
86 ANLINIPC
87 ANLOTIPC
88 DIGINIPC
89 DIGOTIPC
90 REGPVIPC
91 DIGIPC
92 SPR05IPC
93 SPR04IPC
94 SPR03IPC
95 SPR02IPC
96 SPR01IPC
97 AMG
98 - 104 Internal use by LCN
105 PMBOX
101
8 USER INTERFACE GUIDELINES
Integer String
106 - 118 Internal use by LCN
119 ARRMG
120 RSV_ARRMG
121 DEVCTL
122 RSV_DEVCTL
123 CMMG
124 RSV_CMMG
102 www.honeywell.com
8 USER INTERFACE GUIDELINES
103
8 USER INTERFACE GUIDELINES
104 www.honeywell.com
9 Implementing a Display That References HCI Data
This section details the design approach to implement an embedded display that references HCI data. HCI
server names are global in a display. Therefore, if embedded display A binds HCI.Server1 to “ServerFred” in its
startup script, and embedded display B binds HCI.Server1 to “ServerSam” in its startup script, HCI.Server1 will
be bound to the server referenced in the last script run. In other words, if the startup script of embedded display
A runs last, then HCI.Server1 will be bound to “ServerFred”, and embedded display B will also be bound to
“ServerFred” and display data accessed from “ServerFred.”
105
9 IMPLEMENTING A DISPLAY THAT REFERENCES HCI DATA
Sample Script
Sub OnDataChange()
'add formatting here if necessary
Me.text = server.point.parameter
End Sub
106 www.honeywell.com
9 IMPLEMENTING A DISPLAY THAT REFERENCES HCI DATA
Figure 61: Scripting and Display Structure for Reusing an Embedded Display
107
9 IMPLEMENTING A DISPLAY THAT REFERENCES HCI DATA
108 www.honeywell.com
10 Developing ActiveX Controls
109
10 DEVELOPING ACTIVEX CONTROLS
Attention
You can only select this option after the project has been built. If this option is not set, then future builds of this control
will be given a new, different “globally unique identifier.” This means that essentially it is a new and different control
(VB rewrites this number, but tracks it internally so it knows about the new GUID). If this occurs, then previous GUS
displays that have included this control will not load correctly, because the ID of the previous display for this control
will no longer be valid.
Note also that the name of the .ocx must match that of the actual .ocx being made as determined by the VB5 File/
Make <your Project.ocx> menu item.
110 www.honeywell.com
10 DEVELOPING ACTIVEX CONTROLS
Example 1
This example demonstrates the resizing of a shape, Shape1, such that it is always appropriately centered within
its control as the control resizes. This example uses the Move method.
Sample Script
Private Sub UserControl_Resize()
Shape1.Move Width / 4, Height / 4, Width / 2, Height / 2
End Sub
Example 2
This example demonstrates the constraining of a control to a square aspect ratio. You can modify this example
to constrain a control such that the control will not resize at all. This may limit the usefulness of the control in
scaleable displays.
Sample Script
Private Sub UserControl_Resize()
Dim X, Y As Integer
X = UserControl.Width
Y = UserControl.Height
'Enforce 1-1 Aspect Ratio
If X < Y then
X = Y
ElseIf Y < X Then
Y = X
End If
UserControl.Size X, Y
End Sub
111
10 DEVELOPING ACTIVEX CONTROLS
10.3.1 Change the font of your control's text upon Resize to keep it proportional
Microsoft provides a free, useful text-control, called “FlexLabel,” which demonstrates text scaling, and can also
be used to provide scaleable text within your own controls. Consider using FlexLabel control as a constituent
component of your control for scaleable text.
Attention
FlexLabel requires your control to be single-threaded (see your control's Project Properties).
Note also that although possible, it is never necessary to use FlexLabel directly in a GUS display, since GUS native
Text objects automatically scale themselves.
112 www.honeywell.com
10 DEVELOPING ACTIVEX CONTROLS
10.4.1 Do not access Ambient and Extender object property too soon
Visual Basic often includes access to a control's client site (such as, the container) in the default
implementations for controls, typically in the UserControl_ReadProperties and/or UserControl_InitProperties
events. This is accomplished by accessing the Ambient or Extender object properties. In the current GUS
display runtime environment, the control's client site is not available to the control until after these two events
have fired. Accessing Ambient or Extender object properties will fail at GUS display load time and produce a
“Client Site Not Available” error message.
Delay access of any Ambient or Extender object properties until after the ReadProperties or InitProperties
events are fired. A good alternative is to access these properties later, as shown in the UserControl_Show
example that follows.
Sample Script
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_BackColor = PropBag.ReadProperty(“BackColor”,
m_def_BackColor)
m_ForeColor = PropBag.ReadProperty(“ForeColor”,
m_def_ForeColor)
m_Enabled = PropBag.ReadProperty(“Enabled”, m_def_Enabled)
'Set m_Font = PropBag.ReadProperty(“Font”, Ambient.Font)
Don't access Ambient object this early!
m_BackStyle = PropBag.ReadProperty(“BackStyle”,
m_def_BackStyle)
m_BorderStyle = PropBag.ReadProperty(“BorderStyle”,
m_def_BorderStyle)
'Caption = PropBag.ReadProperty(“Caption”, Extender.Name)
'Don't access Extender this early either!
End Sub
Sample Script
Private Sub UserControl_Show()
Font = Ambient.Font
BackColor = Ambient.BackColor
End Sub
10.4.2 Using Ambient and Extender object properties to enhance your control
Use the Ambient object property to make your control track related container properties such as BackColor and
Font. Use the Extender object property such as Name.
Provide a UserControl_AmbientChanged event for your control, so it can track changes to changes to its
container's ambient properties.
113
10 DEVELOPING ACTIVEX CONTROLS
Sample Script
Private Sub UserControl_Show()
Set Font = Ambient.Font
FlexLabel1.Font = Ambient.Font
BackColor = Ambient.BackColor
FlexLabel1.Caption = Extender.Name
End Sub
114 www.honeywell.com
10 DEVELOPING ACTIVEX CONTROLS
115
10 DEVELOPING ACTIVEX CONTROLS
116 www.honeywell.com
10 DEVELOPING ACTIVEX CONTROLS
117
10 DEVELOPING ACTIVEX CONTROLS
118 www.honeywell.com
10 DEVELOPING ACTIVEX CONTROLS
119
10 DEVELOPING ACTIVEX CONTROLS
120 www.honeywell.com
11 Point Manipulation Keys on the IKB
121
11 POINT MANIPULATION KEYS ON THE IKB
Attention
The PMK object does not send a key event if the Display object currently defined as the PMK event handler does not
have an event handler for the particular key that was pressed. For example, if a Display object called Text1 is the PMK
event handler, but does not contain the OnPMKMan sub in its scripting, the PMK object will not generate an event
when the MAN key is pressed.
This section provides a detailed example scripting the PMK in a display. Refer to the Display Scripting User's
Guide for a detailed list and description of PMK Object properties, scriptable events, functions, and methods.
CAUTION
In a display containing the Honeywell Standard ChangeZone (changezone_G120_0.pct), do not set dispdb.
[$cz_enty] in the script of an object that uses the PMK object.
You should only set dispdb.[$cz_enty] for Display objects that (1) are designed to invoke the ChangeZone for a
specific point and (2) do not use the PMK object should set dispdb.[$cz_enty]. Whenever a valid entity ID is
stored in dispdb.[$cz_enty], ChangeZone will make itself the PMK event handler, PMK error handler, and set
some of the PMK properties to non-default values.
11.1.2 PMK.entity
Set the PMK “entity” property, (for example, PMK.entity), to a valid entity to enable the PMK keys.
11.1.3 PMK.eventhandler
Set the PMK “eventhandler” property, (for example, PMK.eventhandler), to a main Display object or an object
in one of its embedded displays in order to enable PMK functionality under certain conditions. Setting this
property is optional.
Attention
The display itself or an embedded display can be the eventhandler. If you want the GUS display to function as the
PMK.eventhandler, assign the Display object, not its name, to the PMK.eventhandler in your script.
Example: Consider a GUS display for which the display author has assigned the name “CrudeTower.” Here is a correct
script statement followed by an incorrect script statement for this example.
Correct Script Statement:
• Set PMK.eventhandler = display
• Incorrect Script Statement (will cause a runtime error):
• Set PMK.eventhandler = CrudeTower
122 www.honeywell.com
11 POINT MANIPULATION KEYS ON THE IKB
Under certain conditions it is not necessary to set the PMK eventhandler property to enable PMK functionality.
When certain PMK properties are set to TRUE, the PMK object will automatically change a parameter value
and force GUS Runtime to generate OnDataChange events to display the new value. A set of rules explaining
when the eventhandler is not needed follows.
11.1.4 PMK.errorhandler
Set the PMK “errorhandler” property (for example, PMK.errorhandler) to a main Display object or an object in
one of its embedded displays to enable error handling. Because there is no default error handling done by the
PMK object, failure to set the errorhandler results in the PMK object “throwing away” all errors generated by
PMK functionality. This includes errors from the LCN generated during the ramping of a point.parameter or
changing the mode. It is, therefore, strongly recommended that you always set the PMK errorhandler property.
Attention
The display itself or an embedded display can be the eventhandler. The errorhandler does not have to be the same
object as the eventhandler.
123
11 POINT MANIPULATION KEYS ON THE IKB
Functional Overview
At display runtime, the previous PMK Example display shows the pointname and the current PV, SP, OP, and
MODE of the REGAM point ramp0001. The entry boxes for the PV, SP, and OP are invisible. The MODE
listbox is invisible.
When the operator clicks the PV, SP, OP buttons, the appropriate entry box is displayed and has input focus.
Pressing the SP key or the OUT key on the IKB initiates the same behavior for the SP or OP. The IKB rampkeys
increment/decrement the SP or OP when the SP or OP entry box, respectively, has focus. The displays show
each incremented/decremented value. When the SP or OP entry box loses focus, the rampkeys will no longer
ramp the parameter of interest.
Pressing the MAN, AUTO, NORM keys on the IKB changes the mode of the point. Clicking the Mode button
on the display shows the list of valid modes for the point with the current mode highlighted and sets the focus to
the mode listbox. The IKB raise/lower keys “walk through” the list of valid modes. Pressing the ENTER key
selects the highlighted mode as the new mode. Double-clicking the highlighted mode also selects that mode as
the new mode.
All errors are handled.
A runtime view of the PMK Example display follows.
124 www.honeywell.com
11 POINT MANIPULATION KEYS ON THE IKB
125
11 POINT MANIPULATION KEYS ON THE IKB
126 www.honeywell.com
11 POINT MANIPULATION KEYS ON THE IKB
11.3.1 DISPLAY
Sample Script
Public Sub DisplayError( valueObject as object, errornumber as long )
beep
select case errornumber
case HOPC_VALUE_ERROR
valueObject.text = “--------”
case HOPC_COMMUNICATION_ERROR
valueObject.text = “???????”
case HOPC_CONFIGURATION_ERROR
valueObject.text = “@@@@@@@”
case else
valueObject.text = “!!!!!!!”
end select
End Sub
Public Sub DisplayValue(Param as string, Value as Variant)
on error goto errorhandler
select case Param
case “SP”
sptext.text = format$(lcn.ramp0001.sp, “#####0.0”)
'reset the timeout timer for the entry box
spentry.TimeoutActive = true
'case “PVTV”
'not a valid parameter for this point, but for some point
'types, PVTV is used instead of SP
'case “AVTV”
'not a valid parameter for this point, but for some point
'types, AVTV is used instead of SP
case “OP”
optext.text = format$(lcn.ramp0001.op, “#####0.0”)
'reset the timeout timer for the entry box
opentry.TimeoutActive = true
case else
err.raise 2001, “Ramping”, “Illegal Param from PMK
Ramp”
end select
exit Sub
errorhandler:
msgbox Err.Description, ebinformation, “Display Ramp Value”
end Sub
Sub OnDisplayStartup()
set PMK.entity = lcn.ramp0001
set PMK.ErrorHandler = me
set PMK.EventHandler = me
PMK.UserData = “”
'holds the parameter to be ramped
'The EnableMode, AutoUpdate, AutoWrite properties for this
'display at startup have the default values
'The AutoDataChange property is set to false; this display
'assigns the value in the raise/lower events to the
appropriate Text object
PMK.AutoDataChange = false
End Sub
Sub OnPMKError(ErrCode As Long,ErrString As String)
msgbox ErrString, ebinformation, “Error”
End Sub
Sub OnPMKAUTO()
'set focus to cause a clear param if SP or OP
'had focus
pointname.setfocus
End Sub
Sub OnPMKMAN()
'set focus to cause a clear param if SP or OP
' had focus
pointname.setfocus
End Sub
Sub OnPMKNORM()
'set focus to cause a clear param if SP or OP
' had focus
pointname.setfocus
End Sub
127
11 POINT MANIPULATION KEYS ON THE IKB
Sub OnPMKSP()
on error goto errorhandler
'used as a flag by OnLostFocus event of OPEntry object
PMK.UserData = “SP”
spentry.text = “”
spentry.visible = true
spentry.selectable = true
spentry.setfocus
'activate the timeout timer
spentry.TimeoutActive = true
exit sub
errorhandler:
beep
pointname.setfocus
msgbox Err.Description, ebinformation, “Change SP”
End Sub
Sub OnPMKOut()
on error goto errorhandler
'used as a flag by OnLostFocus event of SPEntry object
PMK.UserData = “OP”
opentry.text = “”
opentry.visible = true
opentry.selectable = true
opentry.setfocus
'activate the timeout timer
opentry.TimeoutActive = true
exit sub
errorhandler:
beep
pointname.setfocus
msgbox Err.Description, ebinformation, “Change OP”
End Sub
Sub OnPMKFastLower(Param As String,Value As Variant)
'on error goto errorhandler
if modelist.visible = TRUE then
'can't walk the mode list with the Fast keys
beep
else
DisplayValue Param, Value
end if
End Sub
Sub OnPMKFastRaise(Param As String,Value As Variant)
if modelist.visible = TRUE then
'can't walk the mode list with the Fast keys
beep
else
DisplayValue Param, Value
end if
End Sub
Sub OnPMKLower(Param As String,Value As Variant)
if modelist.visible = TRUE then
'walk down the list of valid modes
modelist.TimeoutActive = true
if modelist.ListIndex < (modelist.ListCount - 1) then
modelist.ListIndex = modelist.ListIndex + 1
end if
else
DisplayValue Param, Value
end if
End Sub
Sub OnPMKRaise(Param As String,Value As Variant)
if modelist.visible = TRUE then
'walk up the list of valid modes
modelist.TimeoutActive = true
if modelist.ListIndex > 0 then
modelist.ListIndex = modelist.ListIndex - 1
end if
else
DisplayValue Param, Value
end if
End Sub
11.3.2 SPTEXT
Sample Script
Sub OnDataChange()
on error goto errorhandler
me.text = format$(lcn.ramp0001.sp, “#####0.0”)
128 www.honeywell.com
11 POINT MANIPULATION KEYS ON THE IKB
exit Sub
errorhandler:
DisplayError sptext, err.number
End Sub
11.3.3 SPBUTTON
Sample Script
Sub OnLButtonClick()
'set the PMK key to SP (same as
'pressing the SP key)
PMK.Key PMK_SP
End Sub
11.3.4 SPENTRY
Sample Script
Sub OnEnter()
on error goto errorhandler
if IsNumeric(me.text) then
lcn.ramp0001.sp = me.text
else
beep
msgbox “Enter a Valid Numeric”, ebinformation, “Valve”
me.setfocus
end if
pointname.setfocus
me.text = “”
exit sub
errorhandler:
beep
msgbox Err.Description, ebinformation, “SP Error”
me.text = “”
me.setfocus
End Sub
Sub OnTimeout()
pointname.setfocus
End Sub
Sub OnLostFocus()
me.visible = false
me.selectable = false
if PMK.UserData <> “OP” then
PMK.ClearParam
'neither SP nor OP is in focus for rampin
PMK.UserData = “”
end if
End Sub
11.3.5 OPTEXT
Sample Script
Sub OnDataChange()
on error goto errorhandler
me.text = format$(lcn.ramp0001.op, “#####0.0”)
exit Sub
errorhandler:
DisplayError optext, err.number
End Sub
11.3.6 OPBUTTON
Sample Script
Sub OnLButtonClick()
'set the key to the OUT button (same as pressing
129
11 POINT MANIPULATION KEYS ON THE IKB
11.3.7 OPENTRY
Sample Script
Sub OnEnter()
on error goto errorhandler
if IsNumeric(me.text) then
lcn.ramp0001.op = me.text
else
beep
msgbox “Enter a Valid Numeric”, ebinformation, “Valve”
me.setfocus
end if
pointname.setfocus
me.text = “”
exit sub
errorhandler:
beep
msgbox Err.Description, ebinformation, “OP Error”
me.text = “”
me.setfocus
End Sub
Sub OnTimeout()
pointname.setfocus
End Sub
Sub OnLostFocus()
me.visible = false
me.selectable = false
if PMK.UserData <> “SP” then
PMK.ClearParam
'neither SP nor OP is in focus for rampin
PMK.UserData = “”
end if
End Sub
11.3.8 MODEBUTTON
Sample Script
global modeValue
as string
Sub OnLButtonClick()
on error goto errorhandler
'Setting ListIndex will cause that item to be highlighted in
'the listbox.
modelist.ListIndex = modelist.FindItem(modevalue )
modelist.visible = true
modelist.selectable = true
modelist.setfocus
modelist.TimeoutActive = true
'Activate timeout timer
exit sub
errorhandler:
beep
msgbox Err.Description, ebinformation, “Change Mode”
End Sub
11.3.9 MODETEXT
Sample Script
global modeValue
as string
Sub OnDataChange()
on error goto errorhandler
modevalue = lcn.ramp0001.mode
me.text = modevalue
130 www.honeywell.com
11 POINT MANIPULATION KEYS ON THE IKB
exit sub
errorhandler:
beep
DisplayError modetext, err.number
End Sub
11.3.10 MODELIST
Sample Script
global modattr as string
dim nmode as string
dim nmodattr as string
Sub OnDataChange()
'collect values to be used in Click event
On Error Resume Next
nmode = lcn.ramp0001.nmode
nmodattr = lcn.ramp0001.nmodattr
modattr = lcn.ramp0001.modattr
'note the mode list is built at
'build time for this example
End Sub
Sub OnLButtonDoubleClick()
dim selectedItem as String
dim paramstring as string
on error goto errorhandler
selectedItem = modelist.List(modelist.ListIndex)
if selectedItem = “NORM” then
if nmode <> “NONE” then
paramstring = “Change MODE to ” + nmode
if ( nmodattr <> modattr ) and ( nmodattr <>
“NONE” ) then
paramstring = paramstring + chr$(13) +
chr$(10) + “and MODATTR to ” + nmodattr
end if
else
beep
msgbox “Configure normal mode”, ebinformation
end if
else
paramstring = “Change MODE to ” + selectedItem
if modattr = “PROGRAM” then
paramstring = paramstring + chr$(13) + chr$(10) +
“and MODATTR to OPERATOR”
end if
end if
Begin Dialog UserDialog 137,198,130,51,“Change Mode”
OKButton 8,32,40,14
CancelButton 80,32,40,14
Text 8,8,116,20,paramstring,.Text1,“Courier New”,8
End Dialog
dim d as UserDialog
dim resp as integer
if selectedItem = “NORM” then
if nmode <> “NONE” then
resp = dialog( d, , 30000 )
if resp = -1 then
lcn.ramp0001.mode = nmode
if ( nmodattr <> “NONE” ) then
lcn.ramp0001.modattr = nmodattr
end if
lcn.update 222
end if
end if
else
resp = dialog( d, , 30000 )
if resp = -1 then
lcn.ramp0001.mode = selectedItem
lcn.ramp0001.modattr = “OPERATOR”
lcn.update 222
end if
end if
me.visible = false
me.selectable = false
exit sub
errorhandler:
beep
msgbox Err.Description, ebinformation, “Change Mode”
End Sub
131
11 POINT MANIPULATION KEYS ON THE IKB
me.visible = false
me.selectable = false
'set the AutoWrite back to true
PMK.AutoWrite = true
End Sub
Sub OnLostFocus()
me.visible = false
me.selectable = false
'set the AutoWrite back to true
PMK.AutoWrite = true
End Sub
Sub OnGotFocus()
'AutoWrite must be false in order to use the ramp keys to
'walk the mode list
PMK.AutoWrite = false
End Sub
11.3.11 PVTEXT
Sample Script
Sub OnDataChange()
on error goto errorhandler
me.text = format$(lcn.multisch.pv, “#####0.0”)
exit Sub
errorhandler:
DisplayError pvtext, err.number
End Sub
11.3.12 PVBUTTON
Sample Script
Sub OnLButtonClick()
pventry.text = “”
pventry.visible = true
pventry.selectable = true
pventry.setfocus
'activate the timeout timer
pventry.TimeoutActive = true
End Sub
11.3.13 PVENTRY
Sample Script
Sub OnEnter()
on error goto errorhandler
if IsNumeric(me.text) then
lcn.ramp0001.pv = me.text
else
beep
msgbox “Enter a Valid Numeric”, ebinformation, “Valve”
me.setfocus
end if
pointname.setfocus
me.text = “”
exit sub
errorhandler:
beep
msgbox Err.Description, ebinformation, “PV Error”
me.text = “”
me.setfocus
End Sub
Sub OnTimeout()
pointname.setfocus
End Sub
Sub OnLostFocus()
me.visible = false
132 www.honeywell.com
11 POINT MANIPULATION KEYS ON THE IKB
me.selectable = false
End Sub
133
11 POINT MANIPULATION KEYS ON THE IKB
134 www.honeywell.com
12 Notices
Trademarks
Experion®, PlantScape®, SafeBrowse®, TotalPlant®, and TDC 3000® are registered trademarks of Honeywell
International, Inc.
OneWireless™ is a trademark of Honeywell International, Inc.
Other trademarks
Microsoft and SQL Server are either registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
Trademarks that appear in this document are used only to the benefit of the trademark owner, with no intention
of trademark infringement.
Third-party licenses
This product may contain or be derived from materials, including software, of third parties. The third party
materials may be subject to licenses, notices, restrictions and obligations imposed by the licensor. The licenses,
notices, restrictions and obligations, if any, may be found in the materials accompanying the product, in the
documents or files accompanying such third party materials, in a file named third_party_licenses on the media
containing the product, or at http://www.honeywell.com/ps/thirdpartylicenses.
135
12 NOTICES
136 www.honeywell.com
12 NOTICES
137
12 NOTICES
12.3 Support
For support, contact your local Honeywell Process Solutions Customer Contact Center (CCC). To find your
local CCC visit the website, https://www.honeywellprocess.com/en-US/contact-us/customer-support-contacts/
Pages/default.aspx.
138 www.honeywell.com
12 NOTICES
139
12 NOTICES
140 www.honeywell.com