0% found this document useful (0 votes)
112 views66 pages

30805_LAB HMIWeb Display Builder Basic Scripting

Uploaded by

f4461238
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views66 pages

30805_LAB HMIWeb Display Builder Basic Scripting

Uploaded by

f4461238
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 66

Topic: HMIWeb Display Builder Basic Scripting

Contents
Create a Script to Restrict Operator Action.......................................................................................... 3

Create a Temperature Profile Display................................................................................................ 15

Create a Script Using Script Data Tab............................................................................................... 27

Create a Script Using System Custom Properties.............................................................................49

4/24/2023 Copyright © 2023 Honeywell International Inc. 1


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
This page was intentionally left blank.

2 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

Create a Script to Restrict Operator Action


Practice
Objective

The purpose of this lesson is to demonstrate script writing to restrict Operator actions.
After completing this LAB, you will be able to:
 Create scripts to restrict Operator actions that exceed SP operating limits.

4/24/2023 Copyright © 2023 Honeywell International Inc. 3


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

Prerequisites

 An Experion PKS Server and HMIWeb Display Builder (for completion of lab exercises)
 All points downloaded and active in Control Builder

Introduction

The purpose of this lab is to:


 Create scripts to restrict operator actions.
 Provide additional scripting concepts for database access.

TIP

Many of the drawing methods are similar to those used


in other Windows-based drawing and paint applications.

4 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

Creating scripts to intercept Operator actions

 Step Action

1 If you have performed the previous lab as per pre-defined course sequence then open
dynamic shape Loop.sha which you have built from C:\ProgramData\Honeywell\
Experion PKS\Client\Abstract, else open the Loop.sha shape from C:\ProgramData\
Honeywell\Experion PKS\Client\DisplayDB
 This shape will be modified to call a Popup that resembles a custom faceplate.
(The Popup will be scripted to restrict the amount of SP change allowed.)

2 In Object Explorer, expand the loop.sha group to expose the individual components that
make up the group.

4/24/2023 Copyright © 2023 Honeywell International Inc. 5


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

 Step Action

3 Working in Object Explorer, select the alphanumeric that represents the SP value, right
click and select Property pages. (Your SP alphanumeric may have a different name.)

4 On the Behaviors tab of the SP alphanumeric, deselect Faceplate and Hover and select
the Popup option.

6 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

 Step Action

5 Select the Popup tab and browse to the file 11_FC01_SP.htm in your Abstract folder:
C:\ProgramData\Honeywell\Experion PKS\Client\Abstract\11_FC01_SP.htm
(This is a pre-built Popup that resembles the standard faceplate – it’s located in your
Abstract folder.)

6 Close the Properties window and Save As this shape display as Loop_Restrict.sha in
the abstract folder.
 Close the Loop_Restrict.sha display.

ATTENTION

If the alphanumeric is not shown in the shape then use


bring to front option to bring the alphanumeric to front.

4/24/2023 Copyright © 2023 Honeywell International Inc. 7


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

 Step Action

7 In HMIWeb Display Builder, open the custom pre-built Popup:


C:\ProgramData\Honeywell\Experion PKS\Client\Abstract\11_FC01_SP.htm
Open the Properties Window for the SP value.
 Select the Behaviors tab. Select Script Data and note that Hover is already
selected.
 Select the Data tab. Select Type of Database Link as None.

ATTENTION

This display is an example of a custom Popup being


used as a faceplate for point manipulation and control
for point 11_FC01.

8 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

 Step Action

8 On the Script Data tab, Select the Add button and enter the data shown.
Close the Properties window when finished.

9 Open Windows Explorer, browse to your abstract folder and, using notepad, open the
text file “RestrictScript.txt”. (This text file contains the script/code that will be used in
this scripting exercise.)

NOTE: The script written in the text file is for 3 different events i.e. onchange,
ondatachange, ondeactivate. You need copy the script content from the text file
"RestrictScript.txt" and paste it in the particular event in the script editor.

4/24/2023 Copyright © 2023 Honeywell International Inc. 9


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

 Step Action

10 Return to HMIWeb Display Builder and right-click the SP alphanumeric on the custom
faceplate; select Edit Script from the context menu.

Script will be added to the SP field that will restrict the amount of SP change to less than
5% of the point’s range.

10 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

 Step Action

11 Using the Event Browser drop-down arrow, select onchange as the event.
Copy the script mentioned in onchange section from the text file” RestrictScript.txt”
and paste it in the onchange event in script editor.

TIP

Onchange Event: The script in this event will execute


whenever there is change in the data value of
alpha001. According to the conditions written in the
script, a message box will be displayed providing
information regarding the change requested.

NOTE: When reading a value from the system, as in checking if the mode is “AUTO”,
the value you are reading is a string which looks for an exact match. Therefore, the
value must be typed in CAPS as the system enumerations are capitalized.

12 Select ondatachange as the event and copy the script content for ondatachange
section from the text file "RestrictScript.txt" and paste it in the ondatachange event in
the script editor.

4/24/2023 Copyright © 2023 Honeywell International Inc. 11


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

1 Select ondeactivate as the event and copy the script content for ondectivate section
from the text file "RestrictScript.txt" and paste it in the ondectivate event in the script
editor.

2 Close the script window, and save your Popup display in the Abstract folder.

3 Open the display T_100_SCP from C:\ProgramData\Honeywell\Experion PKS\Client\


DisplayDB and save it in Abstract folder as T_100_SCP and then insert the modified
Loop_Restrict.sha as shown below.

4 Open the Properties of the inserted shape and enter the following details on the Custom
Properties tab:

5 Close the shape Properties window and add dashed lines for the new shape
connecting to Heavy Feed.

6 Save your T_100_SCP display in the C:\ProgramData\Honeywell\Experion PKS\


Client\Abstract folder.

12 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

7 In Station, call your T_100_SCP display.


Click the SP value of 11_FC01 to open the Popup window.

8 Verify the MD (mode) field displays AUTO (change to AUTO if needed).

4/24/2023 Copyright © 2023 Honeywell International Inc. 13


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script to Restrict Operator Action

9 Select the SP field on the Popup and enter a value less than ± 5% of the SP range
(range 0 – 600).
 If the change is less than the restricted amount, a message similar to the following is
displayed.

Click OK. The SP value for 11_FC01 is changed as shown in your T_100_SCP display.

10 Change the SP by more than ± 5%.


 The following message is displayed.

You have restricted an Operator entry of more than the allowed limit, and the change is
cancelled.

14 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

Create a Temperature Profile Display


Practice
Objective

To create a Popup, with bar indicators, showing critical temperature process values.

Prerequisites

 An Experion PKS Server and HMIWeb Display Builder (to complete the lab exercises).

Introduction

It is essential to watch the tower temperatures to achieve optimum top-to-bottom product quality.
The following table lists 7 temperature sensors. These points provide critical process values.

Unit
Tag Description Range Units
11_TI26 D-100 Reflux 0 - 260 °C
11_TI25 T-100, Overheads 0 - 260 °C
11_TI24 T-100, Tray 23 0 - 260 °C
11_TI23 T-100, Tray 4 0 - 260 °C
11_TI22 E-100, Reboiler Inlet 0 - 260 °C
11_TI21 E-100, Reboiler Outlet 0 - 260 °C
11_TI20 T-100, Bottoms 0 - 260 °C

4/24/2023 Copyright © 2023 Honeywell International Inc. 15


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

Temperature Profile Display Example

Create a Popup similar to the one illustrated below. Use bar indicators to show the temperature of
each tag. The tags are arranged from bottom to top on the Y-axis. The X-axis represents the
temperature range.

Textboxes on the left represent the tagnames of the points being represented by the indicator bars in
the center of the Popup. (The bars are indicating the tag’s DACA.PV parameter.)
In a real process environment, indicators bring in values from the field and do not permit data entry.
However, because we are in a “simulated” lab environment, add alphanumerics to the right side of
your Popup to allow a change to be made to the indicator values for testing purposes. (The
alphanumerics you add will access the tag’s NUMERICA.PV parameter on the Data tab and have
data entry enabled).

16 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

Create a Temperature Profile Display

 Step Action

1 In HMIWeb Display Builder, create a new Popup display.

2 Access the Properties of the display and modify the size to 400 x 400.
Change the color of the display to silver.

3 Select the Indicator tool and draw an object similar to the following example:

4/24/2023 Copyright © 2023 Honeywell International Inc. 17


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

4 Open the Properties of the indicator and select the Data tab.
 Enter points and parameters from the Temperature Profile Example on the
page10.

5 If necessary, modify the Details tab for a Horizontal bar direction.


 Make the entries as shown below.

18 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

6 In the colors tab


Select Fill color. Change the RGB value to 221.

Select Level Color as Gray and close the properties.

4/24/2023 Copyright © 2023 Honeywell International Inc. 19


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

7 Right-click the indicator and select Edit Script.

8 Using script, we will assign the color lightslategray to the indicator bars if the
temperature exceeds 190 Deg C, and assign the color dimgray if the temperature goes
below 10 Deg C.
 Using the Event Browser drop-down arrow, select OnUpdate as the event. (By
default, onactivate is the first event shown – be sure to select OnUpdate.)
 Copy the script content from the text file (NotePad) “TempProfileScript.txt” located
in your abstract folder and paste it in the script editor OnUpdate event.

TIP

OnUpdate Event: The script in this event will execute


whenever there is an update in the data value of
associated point.
Here 11_TI20 is the point in the data field of the
indicator properties, so whenever there is an update in
the value of data, the fill color of the indicator bar
changes according to script.

20 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

9 Using the “me” syntax (as shown below) allows the script to be generic in regard to the
object it’s attached to copying script from one object to another requires no modification
to the object name because the script is directly attached to the new object and uses the
“me” identifier to refer to itself.

NOTE: In the above example script, elseif is written as one word. It can be written as
one word or two. However, if you write elseif as two words (i.e. else if), then you must
add another end if to comply with script syntax rules.
Also note the event being used: OnUpdate

10 Since the generic “me” identifier is used, all you need to do is create the first indicator
and add the script, then duplicate the Indicator and change the point in the Data tab.

11 When finished, close any open script window, and position the indicators on your display
similar to the Temperature Profile Display shown prior to Step 1 in the Introduction.

12 Save your display as TempProfile in the Abstract file. (It’s good practice to save your
displays periodically.)

4/24/2023 Copyright © 2023 Honeywell International Inc. 21


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

13 Add textboxes to show the tagnames on the left as shown below (or enter the tagname
in the tool tip field of each indicator.)
 Create the X and Y-axis markers using lines and text.
 Your textboxes and indicators should be positioned similar to the illustration below.

14 Add alphanumerics to the right of the indicators to show the temperature values. The
next step provides data tab details for the added alphanumerics.

22 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

15 Modify the Data tab for each alphanumeric to display the relevant tag and parameter
NUMERICA.PV (remember to allow data entry for all alphanumeric.)

4/24/2023 Copyright © 2023 Honeywell International Inc. 23


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

16 To finalize your Temperature Profile popup:


 Add a pushbutton (or rectangle) at the top for a display title.
 Change the color to silver.
 Enter the label T-100 Temperature Profile (font 10, bold, center)

17 Close the Properties window and save your display as TempProfile in your abstract
folder.

24 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

18 Open T_100_SCP display from Abstract folder in HMIWeb Display Builder.


 Add a pushbutton to call your TempProfile popup.

19 On the Behaviors tab of the pushbutton, select PopUp.

20 On the Details tab, change the label from Button to Temp Profile.

21 On the Colors tab, use the Custom Color you defined in a previous lab exercise for the
button’s fill color.

22 On the Popup tab, enter (or browse to) the following:


C:\ProgramData\Honeywell\Experion PKS\Client\Abstract\TempProfile.htm

23 Close the Properties window and save T_100_SCP in your Abstract folder.

4/24/2023 Copyright © 2023 Honeywell International Inc. 25


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Temperature Profile Display

 Step Action

24 Call T_100_SCP in Station and test your PopUp by entering values => 190 and <= 10
in the numerics on the right side of the popup.

Open Detail Display for Alphanumeric at the right side of Pop up display, then select
chart. Enter the values for NUMERICA block (PV) which you wish to check.

ATTENTION

The color change of the indicators was done using script primarily
for the purpose of showing methods and scripting syntax.
However, using breakpoints on the Animation tab of the indicator
objects could also accomplish a color change and would be more
per-formant.
Breakpoint animation can also be done using Cascade Style sheets,
as shown in an earlier lab exercise.

26 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

Create a Script Using Script Data Tab


Practice
Objective

The purpose of this lesson is to use the Script Data Tab and access the point/parameters in script.
After completion of this LAB, you will be able to:
 Add points and parameters to the Script Data Tab and access these values using script.

Prerequisites

An Experion PKS Server with HMIWeb Display Builder

Introduction

When you need point data in your scripts, you normally read the “value” property of a data bound
object in your display (e.g. alpha001.value). The Script Data Tab lists point/parameters that can be
directly accessed by scripts (e.g., 11_FC17.OP) without requiring the object to be in the display.
Adding a point/parameter to one object’s Script Data Tab makes it accessible to all scripts in the
display. (However, it is generally more convenient to add point/parameters and the scripts that
access them to the same object.)
In the case of a dynamic shape, you can add custom properties to the Script Data Tab. (This enables
scripts to access point/parameters that have been mapped to custom properties.)
In this lab, you will modify a previously created dynamic shape (TempInd.sha) and add two alarm
parameters to the Script Data Tab. Script will then be written that uses the point/parameters listed on the
tab.

When the new dynamic shape is used for an indicator and there is an alarm on that point, clicking the tag
name calls a word document that provides temperature stabilization/recovery instructions. The new
shape, with the added script, will be saved with the name TempIndScript.sha.

4/24/2023 Copyright © 2023 Honeywell International Inc. 27


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

Procedure

 Step Action

1 If you have performed the previous lab as per pre-defined course sequence then open
dynamic shape TempInd.sha which you have built from C:\ProgramData\Honeywell\
Experion PKS\Client\Abstract, else copy the TempInd.sha shape from C:\
ProgramData\Honeywell\Experion PKS\Client\DisplayDB and paste it in Abstract
folder.
Note: In a previous lab, a dynamic shape (TempInd.sha) was created for analog
indication. TempInd will be modified in this lab exercise.
 In HMIWeb Display Builder, open the shape TempInd.sha Save As this display as
TempIndScript.sha in your abstract folder.

2 Open the Properties of the shape display and select the Custom Properties tab.
 Custom Properties make a dynamic shape flexible; database points are linked
with Custom Properties when the dynamic shape is inserted into a display.

28 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

3 Add an additional Custom Property to TempIndScript to indicate the path to a word


document (stabilization instructions).
 Select the Add button and enter the data shown.
 Close the Properties window when finished.

ATTENTION

By entering a default value of c:\Student\ for the


Custom Property named “PathStr,” this provides an
already filled in value for PathStr. (If necessary,
default values can be changed when the shape is
inserted into a display.)

4/24/2023 Copyright © 2023 Honeywell International Inc. 29


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

4 Point/parameters will now be added to the Script Data tab to enable direct script access.
In Object Explorer, expand the grouped shape; select the alphanumeric representing
the tagname, right-click and select Property pages…

NOTE: If your alphanumeric representing the tagname is named something other than
alpha001, modify your script or rename your object accordingly.
When scripting, pay particular attention to object names.

 Rename your alphanumeric from its current name (i.e. txtName) to alpha001.
(This renaming is being done because the script refers to an object in the display
as alpha001. In reality you should give meaningful names to all objects added to
your displays.)

30 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

5 Select the Behaviors tab; select Script Data.


 When the Script Data option is selected, a new tab (Script Data) is added to the
object’s properties.

 Note the description shown for the script data selection. When scripting in
HMIWeb Display Builder, you normally read the “value” property of a data bound
object. (The value property accesses the point and parameter listed on the Data
tab.) Using the script data access feature allows scripts to access process data
directly.

4/24/2023 Copyright © 2023 Honeywell International Inc. 31


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

6 If the point that is linked to this shape has either an unacknowledged or acknowledged
alarm and the point name is clicked, a word document will be called. (The word
documents that will be accessed for this lab exercise have already been placed in
Student folder on your C: drive).
Two point/parameters will be added to the Script Data tab for use in script;
UnackAlarmExists and TotalAckAlarms.

 Select the Script Data tab


 Select Add and enter the following information for the parameter
“UnackAlarmExists”.
 Use the drop-down arrow to select the generic Point <Tag>. Because we are
using a generic tag that has not yet been linked to a real database point, the
parameter information will need to be typed in.

32 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

7 Select Add again and enter the Point Details shown for the parameter
“TotalAckAlarms”.

 Close the Properties window for the alphanumeric when finished.

8 In Object Explorer, right-click the alphanumeric that represents the tagname


(alpha001) and select Edit Script.

4/24/2023 Copyright © 2023 Honeywell International Inc. 33


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

9 By default, the scripting window opens with an onactivate event for the object.

 Select the drop-down arrow to the right of the event browser and select
“onclick” for the script execution event.

34 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

10 In Windows Explorer, browse to your abstract folder and copy the script content from
“ScriptDataTabScript.txt” and paste it in alpha001’s “onclick” event.

 A completed script, in the Script Editor, is shown below.

 Close the script window when finished entering the above script.

TIP

OnClick Event: When the object alpha001 is clicked,


the script will check for alarms. If alarms are found, a
word document (whose name is written to the variable
called “filename”) will be opened.

11 Add an Alarm State indicator as shown

4/24/2023 Copyright © 2023 Honeywell International Inc. 35


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

12 Open the properties window


Enter the following information in the Data tab

13 First ungroup and then regroup all the objects in the display.

14 Save the modified dynamic shape TempIndScript.sha in your Abstract folder.

36 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

15 In HMIWeb Display Builder, open T_100_SCP from Abstract folder. We will now
replace the temperature indicators currently in T_100_SCP (TempInd.sha) with the new
TempIndScript.sha
 Select Tools > Replace Shapes.

Using the drop-down arrow for “Current shape file” select TempInd.sha as the shape to
be replaced. Then browse to the new shape file TempIndScript.

 Select Replace.

4/24/2023 Copyright © 2023 Honeywell International Inc. 37


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

16 A “Replace Shapes” message box displays “Replace operation is completed


successfully!”.

Select OK and close the Replace Shapes dialog box.


Reposition the replaced objects if necessary.

17 Open the Properties of each newly inserted shape, select the Custom Properties tab,
and verify that the appropriate value for Tag was retained. (Note: For PathStr the
default value of c:\Student\ is used; the word document to be called is located at Student
folder on C: drive.)

38 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

18 Save your T_100_SCP display in the Abstract folder.

19 Test the display by calling T_100_SCP in Station.


 Select the TempProfile button to call the Temperature Profile popup.

To create an alarm, select the alphanumeric on the Temperature Profile for 11_TI20 and
enter a value of 225.
 The alarm icon of the tag 11_TI20 should start flashing in yellow color. This
shows that the tag 11_TI20 is in alarm condition.

4/24/2023 Copyright © 2023 Honeywell International Inc. 39


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

20 Select the alphanumeric (11_TI20) as shown.


A word document is called.

ATTENTION

When you select Tag name (11_TI20) a Windows Security


Warning will appear. Click Yes to continue.

21 Close the word document and create additional alarms using your TempProfile display.
When finished testing the indicators, close the word document.
 Return the indicator values to a normal condition (not in alarm) and close the
Temperature Profile popup display when finished. Acknowledge any alarms that
were generated.

40 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

22 Return to HMIWeb Display Builder and open T_100_SCP (if not already open) from
Abstract folder. We will now test some enhanced error handling features for Script Data.
Open the Properties of the TempIndScript shape that is linked to 11_TI20.

23 On the Custom Properties tab, clear the Value entered for Tag -- leave the tag value
field blank as shown below.

ATTENTION

The Custom Properties Value field for “Tag” is being left


blank intentionally to understand the usage of the
DataExists() property when used in Script.

24 Save your display T_100_SCP in the Abstract folder.

4/24/2023 Copyright © 2023 Honeywell International Inc. 41


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

25 Test the display by calling T_100_SCP in Station.


 One TempIndScript.sha shape indicates “------” in Station.
 Click on “------” the dashes where the tag name should be.
 A basic error message box is displayed. Select the “Advanced” button on the
error message box for additional details regarding the error. Select OK.
 Click on the tag name dashes again. No error message is displayed. (This is an
example of the generic error handling capabilities provided by Station. The error
only gets reported one time.)

ATTENTION

When you select Tag name (11_TI20) a Windows Security


Warning will appear. Click Yes to continue.

In the following steps, the DataExists() property will be used


to check whether the tag is defined in the Script Data tab and
linked with a database point.

Adding a point/parameter to the Script Data tab also adds a


corresponding set of point-related properties and methods,
such as DataExists(), to the object.

42 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

26 Open the shape TempIndScript.sha in HMIWeb Display Builder.


 Expand the grouped object in Object Explorer.
 Select alpha001 from the Object Explorer, right click and select Property pages.
 Select the Script Data tab and add a new point as shown in the following example.
1. Point: <Tag>
2. Parameter: NAME

Keep the other entries at their default values.

Close the Properties Window when finished.

4/24/2023 Copyright © 2023 Honeywell International Inc. 43


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

27 Open the Script Editor for alpha001. Modify the script to add the highlighted statements
as shown below.

ATTENTION

The script addition of the DataExists() property checks


to see if the Point/Parameter has been defined in the
Script Data tab and linked to a point (before
executing any further lines of code) and therefore
improves the display performance.

28 Save As the modified dynamic shape as TempIndScript1.sha in the abstract folder.

44 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

29 In HMIWeb Display Builder, open T_100_SCP from Abstract folder. We will now
replace the temperature indicators currently in T_100_SCP (TempIndScript.sha) with
TempIndScript1.sha
 Select Tools > Replace Shapes.

Using the drop-down arrow for “Current shape file,” select TempIndScript.sha as the
shape to be replaced. Then browse to the new shape file TempIndScript1.

 Select Replace.

4/24/2023 Copyright © 2023 Honeywell International Inc. 45


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

30 A dialog box will show Replace operation completed successfully!.

Select OK and Close the Replace Shapes dialog.

31 Open the Properties of the 11_TI20 upgraded shape and verify that the Custom
Properties tab does not have any Value for Tag.

ATTENTION

The tag Value is being left blank intentionally to


understand the usage of the DataExists() property.

32 Close the Properties window and save your display T_100_SCP in the Abstract folder.

46 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

33 Test the display by calling T_100_SCP in Station. One TempIndScript1.sha shape will
show a value of “------“in Station.
 Click on the TempIndScript1 shape that is not showing a value. A message box will
be displayed “Point not defined in Custom Properties or Script Data Tab” as
shown below.

Click OK.

34 Return to your T_100_SCP display in HMIWeb Display Builder.


 Select the embedded TempIndScript1 shape for 11_TI20
 Select the Custom Properties tab; enter the point name 11_TI20.

4/24/2023 Copyright © 2023 Honeywell International Inc. 47


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using Script Data Tab

 Step Action

35 Save As your T_100_SCP display as T_100_NAV in the Abstract folder.

36 Test the T_100_NAV display by calling it in Station. The shape for 11_TI20 will be
showing a blinking yellow color alarm icon if the tag is in alarm state.

48 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

Create a Script Using System Custom Properties


Practice
Objective

The purpose of this lesson is to use System Custom Properties and access the properties in script.
By using System Custom Properties, you can create generic displays that can be used across your
plant.
After completion of this LAB, you will be able to:
 Make use of the Display Data Repository using the system custom properties.

Prerequisites

An Experion PKS Server with HMIWeb Display Builder

Introduction

System custom properties are like variables. Instead of binding an object on a display directly to a
single point, you can bind the object to system custom properties.
At run time, the value of system custom properties can be changed and stored in either the Station
data repository or the Display data repository. When you create a system custom property, you set
where the value of the property will be stored by setting the scope.
A Custom Trend display will be created in this lab exercise. The display will have a system
custom property defined, and buttons will be added to your display to pass a tagname to the Display
Data Repository. A dynamic shape display containing a trend will also be created – the dynamic
trend shape will use custom properties and get its trace values from the Display Data Repository.
The trend shape will be inserted into the parent Custom Trend display; the plots in the trend will
change based on script written on the pushbuttons. When a button is selected, a tagname will be
written to the display data repository, which the trend and alphanumerics use to populate their data.
An example of the finished display is shown below.

4/24/2023 Copyright © 2023 Honeywell International Inc. 49


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

Procedure

 Step Action

1 Open a blank display in HMIWeb Display Builder.


 Double click on the display.
 Select the Appearance tab and enter the following information:
 Color: Silver
 Width: 820
 Height: 300

50 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

2 Select the Custom Properties tab.

4/24/2023 Copyright © 2023 Honeywell International Inc. 51


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

3 Click Add to add a blank line to the list.


Enter the following information in the Details section:
Name: PNT
Type: Point
Scope: Display

Leave any other options at their default values.

 Close the Display Properties window.

ATTENTION

By defining the Scope as “Display,” the custom


properties will be available only to this display and only
while this display is running.

52 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

4 Add three alphanumeric to the display as illustrated.


Set the properties of the lower alphanumeric (which are alpha002 and alpha003 in the
example) as follows:
 Fill color: No fill color
 Text color: Black
 Font size: 8, bold, left alignment
 Behaviors Tab: Select Faceplate
Open the top alphanumeric properties.
 On the Details tab, set the “Display as” property to Text.
 On the Colors tab, set the text color to dimgray, and select no fill color.
 On the Font tab, set the font to 10, bold, left alignment.

5 Using the Textbox tool, place a textbox in front of the first alphanumeric as illustrated.

4/24/2023 Copyright © 2023 Honeywell International Inc. 53


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

6 Replace the word Text with SP, and modify the following properties:
 Text Color: dimgray
 Font Size: 8, bold

Copy the textbox and move the copy in front of the next alphanumeric.
 Modify the text to PV as shown.

54 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

7 Five objects have now been added to your display: two textboxes and three
alphanumeric.

Arrange your objects so that your display is similar to the one shown.

4/24/2023 Copyright © 2023 Honeywell International Inc. 55


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

8 Modify the Data Tab of the alphanumeric as shown below:

Name: alpha001 (displayed as text)


Data base Link
 Point: <PNT>
 Parameter: NAME

Name: alpha002
Data base link
 Point: <PNT>
 Parameter: PIDA.SP

Name: alpha003
Data base Link
 Point: <PNT>
 Parameter: DACA.PV

Note: Recall that a system custom property <PNT> was defined on the display to store
“point” data. The data-bound objects in your graphic will retrieve their point information
from <PNT>.

9 It’s a good idea to save periodically. Save your display as CustomTrend in the abstract
folder.

56 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

10 Using the Pushbutton tool, add a pushbutton object to your display as shown in the
following example. Open the properties window; select the Details tab and enter
11_FC01 as the button label.
Change the following pushbutton properties:
 Fill color: Silver
 Font size: 8, bold, center

Close the properties window of the pushbutton.


11 Select the Pushbutton, right-click and select Edit Script…

4/24/2023 Copyright © 2023 Honeywell International Inc. 57


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

12 By default, the scripting window opens with the onactivate event for the object.
 Select the drop-down arrow in the event browser and select “onclick” for the
script execution event.

13 Copy the script content from “CustomPropertiesScript.txt” in your abstract folder and
paste it in the first pushbutton’s onclick event in the script editor.
The following illustration shows a completed script in the Script Editor.

To review the above script:


PNTValue: A scripting variable that will be used to store a tagname.
The Display Data Repository Object: A collection of named System Custom Properties
with the scope of the current display.
AutoReloadContent: Returns or sets automatic reloading of the custom property when
there is a change in the value.
PutValue: Sets the value of a System Custom Property in the Display Data Repository.
GetValue: Returns the value of a System Custom Property.
SetCustomProperty: Writes a value to a dynamic shape’s custom property.
 Close the script window when finished entering the above script.

58 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

14 Make 7 copies of the pushbutton 11_FC01. Open the properties of each button, and on
the Details tab label them as shown in the following table.

11_FC01 11_LC16 11_TC10 11_TI20

11_FC02 11_FC20 11_FC15 11_PI14

Organize the pushbuttons on your display as illustrated below.

Note: It’s good practice to rename objects in your display for easy identification. For
example, because pushbutton001 will pass point information for tag name 11_FC01, this
object could be renamed to btnFC01.

15 Save your display as CustomTrend in the Abstract folder.

4/24/2023 Copyright © 2023 Honeywell International Inc. 59


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

16 In previous labs you learned how to build dynamic shapes. We will now create a new
dynamic trend shape.
 Open a blank dynamic shape display.
Add custom properties to the dynamic shape display as follows:
Custom Property 1
 Name: TrendPNT
 Type: Point

Custom Property 2
 Name: Param1
 Type: Parameter

Custom Property 3
 Name: Param2
 Type: Parameter

Close the Shape Properties window when finished.

60 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

17 Select the Trend tool on the toolbar and add a Trend object to your display.
Open the properties of the Trend. On the General tab, modify the size of the trend
object to 800 x 235.
Select the Plots tab and (using the drop-down point and parameter lists) assign the
following plot colors, point and parameters:
Plot -- Blue
 Point ID: <TrendPNT>
 Parameter: <Param1>
Plot 2 -- White
 Point ID: <TrendPNT>
 Parameter: <Param2>
(To assign a color, click the colored square, and select the desired plot color.)

Select the View Tab, and for the Trend’s legend type, select “No legend”.
When finished, close the properties window and save your dynamic shape with the name
ChartShape.sha in the abstract folder.

4/24/2023 Copyright © 2023 Honeywell International Inc. 61


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

18 Open your CustomTrend display (if not already opened) and insert the ChartShape into
your CustomTrend display.
 Position the inserted trend as shown below. (You may need to reposition the
objects already in your CustomTrend display).

19 Open the properties window for shape001 (the inserted ChartShape).


 Select the Custom Properties tab and enter the following values.

TrendPNT: <PNT>
Param1: PIDA.SP
Param2: DACA.PV

62 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

20 Open the Script for each Pushbutton and change the reference of the point in the
script to the correct tag name as shown on the pushbutton label.
(Remember that all the pushbuttons were copied or duplicated from the first pushbutton
11_FC01.)
Example:
Open the Script for the pushbutton showing the label 11_FC02.
Change the reference given in the script from point 11_FC01 to 11_FC02 as shown in
the following.

Repeat the above for all pushbuttons to enter the correct point data.

21 Save the display to your abstract folder.

4/24/2023 Copyright © 2023 Honeywell International Inc. 63


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

22 Call CustomTrend in Station.


 Initially there will be no values since no point information has been passed to the
system custom parameters, as illustrated below.

23 Click on the pushbutton 11_LC16.


 You will see the current values of the SP and PV in the trend and in the
alphanumerics, as illustrated.

64 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

24 Due to our database simulation process, the SP and the PV values may be exactly the
same; you may not see two plots in the trend chart.
Navigate to the detail display of 11_LC16 (double-click the tag name at the top left of
your trend display to call up its detail display).
 Change the SP value.
 Recall your Custom Trend display. Click on the 11_LC16 pushbutton.
 Change the Time Period to 5 minutes, and you will see two plots in the Chart area.

25 Click on each pushbutton to see that point’s values.

Note: Two points (11_TI20 and 11_PI14) are analog indicators. Therefore, a SP value
will not be shown. When a button associated with an analog indication points is
selected, your display will show “--------” in the SP field.

4/24/2023 Copyright © 2023 Honeywell International Inc. 65


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary
HMIWeb Display Builder Basic Scripting
Create a Script Using System Custom Properties

 Step Action

26 Practice using the Show Legend toggle icon at the top left of the chart area. The legend
at the bottom of the trend will appear and disappear.

Practice removing the checkmarks in the Pen column to view the individual parameters
being plotted on your trend.

66 Copyright © 2023 Honeywell International Inc. 4/24/2023


Honeywell Academy written permission required to distribute
Honeywell Confidential and Proprietary

You might also like