Sunteți pe pagina 1din 30

PI ProcessBook Exercises

The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 1
PI ProcessBook
Exercise 1 - Basics
Objectives
Familiarize yourself with the Common Dialog Windows
Familiarize yourself with the PI ProcessBook environment.
Learn how to manipulate a trend display using an existing PI ProcessBook.
Exercise A: Exploring the Common Dialog Windows
1. Tag Search Window
1. Open the Tag Search Window with the button or with the Tag Search option of the Tools
menu.
2. Use b* in the tag mask field and click on the Search button to get all the tags beginning by
b.
3. Click on the first tag name. Then press the shift key and click on the second tag name. This
will select the first two tags. Click on the Pt. Attr button to access the Point Attributes of those
tags. You can move from one tag to another with the arrow keys on your keyboard.
4. Write * in the tag mask field and *reactor* in the descriptor field, then press Search to find
all the tags with the string reactor in the descriptor.
5. Erase the descriptor field and enter 0 (zero) in the Value field, then press Search to find all
the tags with a snapshot value of 0.
6. Try to build searches based on multiple search criteria.
2. Connection Window
1. Open the Connection Window with the Connections option of the File menu.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 2
2. Click on Add to add a PI server. Enter the PI server name specified by the trainer. Enter
pidemo as the user name and let the port number at 5450. Click on OK to create the
specified PI server.
3. Highlight this PI Server and click on Connect. You might be prompted for a password. If so,
enter the password specified by the trainer.
Exercise B: Using ProcessBook
Load the ProcessBook called Pidemo.piw PI that is located in the installation
directory (by default: C:\Program Files\PIPC\PROCBOOK).
Explore the contents of each tab. To change from one tab to another, simply click on the tab
you want to see
One at a time, open all 3 displays of the Refinery tab. To open a display, you can double-click
on it or click once on the display to highlight it and press the Open button. To close a display,
you can use the Close option of the File Menu or press where indicated below:

Exercise C: Using a trend
Open the Batch Reactor display (see the example below) located on the Refinery
tab. To successfully complete this exercise, you must be able to manipulate the
Reactor Level trend as follows:
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 3
Maximize the trend.
Zoom in and out of the trend.
Go backward and forward in time by one or by several time periods.
Change the time scale to 1 day.
Find when the maximum value was attained (Hint : use the trend cursor).
Revert back to the original time scale.
Return back to the Batch Reactor display.

Using a Trend
Solution
1. Load the PI ProcessBook file C:\Program Files\PIPC\PROCBOOK\Pidemo.piw .
2. Take a moment to locate the different components of the menu bar: Title, Menu and Tools.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 4
3. Open the batch reactor display, (see the example below), located in the Refinery tab.
4. With the Run mode pointer, display a section of the trend display. Drag the pointer diagonally to
draw a rectangle. This area will be magnified when you release the mouse button. To return to
the original time scale, use the View option in the menu bar, then Revert or use this tool .
5. With the Run mode pointer, expand the trend on the entire display window. Double-click within
the trend. To return at the original time scale, double-click within the trend again.
6. Use the time forward and backward buttons to scroll the time range forward or backward on a
trend . To modify the time range, use the View > Time Range. Change the time scale
to 1 day.
7. Use a trend cursor to find when the maximum value of the last day occurred. .
8. Return to the original time scale. (see step 4).
9. Alter the y-axis scale of a trend by double clicking on the y-axis. Use the Trend Scale dialog box
to change the vertical scale for the tag in the trend. You do not have to be in Build mode to edit
the trend.
10. Return to the original Batch reactor display.
11. Exit PI ProcessBook without saving.




PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 5
Exercise 2 - Building a PI ProcessBook
Objectives
Learn how to build and modify a PI ProcessBook.
Learn the differences between the Run mode and the Build mode.
Understand the PI ProcessBook entries hierarchy.
Use the Book and Outline views to visualize and modify a PI ProcessBook.
Exercise
You are asked to create a new PI ProcessBook into which you will insert new
elements and establish links to other PI ProcessBook components and applications.
You will also assign a level of hierarchy to each element.
1. Create a new PI ProcessBook using the following steps:
Select the New option from the File menu.
A new screen appears with three choices:
ProcessBook (.piw) File.
ProcessBook Entry (There are five types: display, linked display, linked ProcessBook,
text entry and operating system command).
ProcessBook Display (.pdi) File.
Select ProcessBook File and name it PB exercise2 My first ProcessBook.
Click OK.
A new screen appears with the name PB exercise2 My first ProcessBook.

PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 6
2. Insert a Text type entry on level 1 and name it Exercise book using the steps below:
In Build mode, select the Text option from the Insert menu.
A new screen appears in which you must supply additional information.
Type a label, ie. Exercise book.
As this is your first entry, its hierarchy level is 1 and it may not be modified.
Click OK.
A title corresponding to Exercise book appears in the ProcessBook file created earlier.
3. Insert a Display type entry on level 2 and name it Display 1.
In Build mode, select the Display option from the Insert menu.
A new screen appears in which you must supply additional information.
Type a label named Display 1.
Choose a hierarchy level of 2.
Click OK.
This will create and open a display. You can add a trend into it or simply close it with the
Close option of the File menu.
Save the PI ProcessBook file with the name PB exercise My First ProcessBook
A title on the second hierarchy level corresponding to Display 1 appears in the PI
ProcessBook file created earlier.
4. Add a Linked Display type entry on Level 3 and name it Linked display 1.
To link a display from another ProcessBook file, the file must be opened (open the file
Pidemo.piw).
In Build mode, select Link / OS Command from the Insert menu.
A new screen appears in which you must supply additional information.
Type a label name Linked Display 1.
Choose a hierarchy level of 3.
Press the arrow next to the Browse button and select Display Search. Select the Batch
Reactor Display from the Pidemo.piw ProcessBook file.(Hint: Do not forget to open the
ProcessBook where the display resides.).
Click OK.
This will link the display and open it. You can close it with the Close option of the File Menu.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 7
A title on the third hierarchy level corresponding to Linked display 1 appears in the PI
ProcessBook file created earlier.
5. Insert a Linked ProcessBook type entry on level 2 and name it PB from exercise 1.
In Build mode, select Link / OS Command from the insert menu.
A new screen appears in which you must supply additional information.
Type a label named PB from exercise 1.
Choose a hierarchy level of 2.
Press the arrow next to the Browse button and select ProcessBook file. Browse to and
select the pidemo.piw ProcessBook used in exercise 1.
Click OK.
This will link the ProcessBook and open it. You can close it with the Close option of the File
menu.
A title on the second hierarchy level corresponding to PB from exercise 1 appears in the
ProcessBook file.
6. Insert an Operating System Command type entry on level 2 and name it Calculator.
In Build mode, select Link / OS Command from the Insert menu.
A new screen appears in which you must supply additional information.
Type a label named Calculator.
Choose a hierarchy level of 2.
Press the arrow next to the Browse button and select Applications. Browse to select the
calc.exe file from the c:\winnt\system32 directory for Windows NT4/2000, or
c:\windows\system32 directory for Windows 95/98/XP/ME/2003.
Click OK.
This will create the OS command and open the calculator. You can close it with the Close
option of the File menu.
A title on the second hierarchy level corresponding to Calculator appears in the PI
ProcessBook.
7. Modify your PI ProcessBook. Change the order in which the entries appear and modify the
hierarchy to resemble the next figure.
In Build mode, select outline from the view menu. Use the four arrows located in the upper
left corner of the window.
The signs + and are used to expand or collapse the hierarchy level of the selected entry.
Numbers 1 9 are used to display different levels of hierarchy in the PI ProcessBook.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 8

The final result should resemble the figure below.


Building a ProcessBook
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 9
Exercise 3 - Building Trends
Objectives
Build trends.
Familiarize students with the different trend building options.
Exercise 3A Trend Display
You are now ready to create a trend with PI tags. To place the trends in the
ProcessBook you created during Exercise 2, you must open the ProcessBook and
then double click on Display 1 entry.
The goal of this exercise is to build a trend similar to the figure below using the
following steps:
Add a trend containing the SINUSOID tag. Use the trend item from the tool bar. (Hint :
make sure you are in build mode).
Edit the trend to show the last 5 days of values.
Edit the trend so the title reads Exercise 3.
Close the trend configuration and save the file.


PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 10

Building a Trend
Solution 3A
1. Open Display 1.
2. In Build mode, use the Trend tool . Drag diagonally to create a rectangular area to contain the
trend. When you release the mouse button, the Trend definition dialog box is displayed.
3. Enter the following information in the General tab:
Type the trend name in the Plot box : Exercise 3A.
Use the Tag Search button to locate and select the SINUSOID tag. To facilitate the query,
use a mask, ie: Sin*;
Specify the time range to display the last 5 days in the Plot Time section.
Style: Full time stamp.
Start: *-5 Day
End: *
Click on OK to create the trend.
4. Save the trend object by saving the display (File >Save).
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 11
Problem 3B Multiple Trends Display
Add a new display entry in the ProcessBook you created in exercise 2. Place it on
level 2 and name it Exercise 3B. Create three trends arranged per the figure
below.



Using Multiple Trends
Trends should show units of each tag as well as their names and descriptions.
Refer to the next characteristics to create these trends.
Trend 1 displays BA:LEVEL.1 tag with a green color for y-scale located outside the trend.
Change the line weight and use a different marker type.
Trend 2 displays BA:CONC.1 tag with a blue color for y-scale located inside the trend.
Change the line style and use a different marker type.
Trend 3 displays CDT158 tag with a yellow color for y-scale located inside the trend. Change
the line weight or line style, and use a different marker type.
Solution 3B
1. Add a new display entry in the ProcessBook you created during exercise 2, its level will be 2 and
name it Exercise 3B. Refer at Exercise 2 - Building a PI ProcessBook.
2. In Build mode, use the Trend tool . Drag the mouse diagonally to create a rectangular area
to contain the trend. When you release the mouse button the Trend definition dialog box is
displayed.
3. Enter the following information in the General tab:
Type the trend name in the Plot box: Trend 1.

Trend 1


Trend 3

Trend 2
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 12
Use the Tag Search button to locate and select the BA:LEVEL.1 tag.
Click on New Plot button. The plot name is updated to Plot-1 and there is now no tag in Tags
in Plot area.
Type the name for the second trend in the Plot box: Trend 2.
Use the Tag Search button to locate and select BA:CONC.1 tag. Click OK.
Click on New Plot button.
Type the name for the third trend in the Plot box: Trend 3.
Use the Tag Search button to locate and select CDT158, then click on the Display Format
tab.
4. In Display Format:
Modify display format of Trend 1 to show y-scale outside the trend.
Click on Trace Format tab.
5. In Trace Format:
Assign green to Trend 1.
Assign blue to Trend 2.
Assign yellow to Trend 3, then click on Layout tab.
6. In Layout:
Enter the trends arrangement: [Row : 1 x Col : 2] [ExRow : 1 x ExCol : 1]. An overall view is
shown in the preview area.
Trends are finished. Click on OK. It is important to note that the Layout tab will not appear
after you have edited these trends. Be sure that you have arranged trends properly before you
exit this configuration screen.
7. Save and exit the display.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 13
Exercise 4 - Inserting Static Elements in Displays
Objectives
Learn to add static elements to your displays.
Exercise
The goal is to represent a process as a schematic to make it easy for all personnel
to identify its components. Drawing tools are available to create schematics.
In this exercise, you are to create a simple schematic to represent a tank, an
agitator and a valve as presented in the figure below.
In the ProcessBook you created in Exercise 2, add a new display entry that will be
named Exercise 4.
In this display, reproduce the stirred tank drawn below. If you wish, you can activate the Snap
To Grid option from the Arrange menu.
Using the Symbol Library tool (from the toolbar), create the tank. If you wish, you can modify
the color or fill pattern using the Options button of the symbol library. Select the Tank
category and the Flat vessel 7 symbol.
Create the feed and the outlet pipes.
Write "stirred tank" in the tank.
Using the Symbol Library tool (from the toolbar), create the agitator. If you wish, you can
modify the color or fill pattern using the Options button of the symbol library. Select the
Mixers category and the Mixer blade symbol.
Using the Symbol Library tool (from the toolbar), create the valve. If you wish, you can modify
the color or fill pattern using the Options button of the symbol library. Select the Valves
category and the Hand valve 2 symbol.

PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 14

Inserting Static Elements in Displays
Solution
1. Hint: It can be easier to arrange and align objects when the grid is activated.
From the Arrange menu, activate the Snap to grid option.
2. Draw the tank with the Symbol Library option of the Draw menu. Once this option is selected,
use the left button of the mouse to select the area where you want the symbol. Select the Tank
category, then the Flat vessel 7 symbol. Click on Options if you want to change the color or fill
pattern of the tank. Note that the color can only be changed if the Fill mode is Shaded, Solid or
Hollow.
3. Add the feed and outlet pipes.
Start by modifying the line width with the Line Width button . Note that you may also
change the ending of lines to obtain arrows. It is possible to draw lines first and change their
ends later.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 15
Draw lines with the Line option from the Draw menu. Select the lines and modify their ends
with the Line Width button. An option is to use the Poly-Line button and draw a line with
multiple sections.
4. Add the agitator in the tank.
Draw the agitator with the Symbol Library option of the Draw menu. Once this option is
selected, use the left button of the mouse to select the area where you want the symbol.
Select the Mixers category, then the Mixer blade symbol. Click on Options if you want to
change the color or fill pattern of the tank.
Write in the tank: Stirred tank with the Text option of the Draw menu.
5. Add a valve on the outlet pipe.
Draw the valve with the Symbol Library option of the Draw menu. Once this option is
selected, use the left button of the mouse to select the area where you want the symbol.
Select the Valves category, then the Hand valve 2 symbol. Click on Options if you want to
change the color or fill pattern of the tank. .
OR
Create the symbol yourself using the basic drawing tools.
6. Save and exit the display.



PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 16

PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 17
Exercise 5 - Inserting Dynamic Elements in Displays
Objectives
Learn how to enhance your displays by adding live elements whose properties
change in time. These elements consist of the following ProcessBook objects:
Bar Graph
Value of a PI Tag
Multi-State Symbol
Command Button
Exercise
Dynamic elements allow displaying changes of operating conditions in time, which
facilitates the understanding of the use of dynamic elements in schematics.
With this exercise, you use the display created in Exercise 4, add a level indicator
and an alarm display (low and high). Modify the design of the tank so that it
graphically shows the level.
To add these elements, follow these steps:
Insert a level indicator using the Value tool.
Add a low and high visual alarm. (Draw two circles; then modify their properties using Multi-
state Symbol).
Write the text associated with each alarm as shown in the figure below.
Create a bar graph over the tank body and make it the same size as the tank. This might be
easier if the Snap to Grid option of the Arrange menu is not activated.
Insert a command button in your display from the button icon. A configuration dialog box
appears. In the text item, enter Calculator . Select Operating system command as its
type. Finally, in the action item, enter the command line that will start the calculator (Typically:
C:\WINDOWS\SYSTEM32\CALC.EXE or C:\WINNT\SYSTEM32\CALC.EXE).
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 18
Keep the propeller and the text inside the tank, in front of the bar graph. (Hint: use the Bring
to front command in the Arrange menu).
Save the display you created in PDI format (Exercise5.pdi). Use the Save as item of the File
menu.


Inserting Dynamic Elements
Solution
1. Open the display created in Exercise 4.
2. Insert a level indicator.
Use the Value option from the Draw menu to insert the BA:LEVEL.1 tag value. Write
Level (%) above the value with the Text option from the Draw menu.
3. Add a low and high visual alarm.
With the Ellipse option of the Draw menu, draw two small circles, as shown in the figure below
they will be activated to become visual alarms;
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 19
In the Build mode, select the high-level circle and then click on Multi-State button . Select
BA:LEVEL.1 tag. Set the number of states to 2. Define the limit of the first state at <= 90.
Set the color of the first state to green and second state to red.
Repeat the same thing to add the low-level alarm using the same tag. Set the number of
states to 2. Define the limit of the first state at <= 10. Set the color of the first state to red and
second state to green.
4. Create a bar graph to replace the tank.
Use the Bar item from the Draw menu to create a bar graph. Draw a rectangle over the tank
body and make it the same size as the tank body. This might be easier if the Snap to Grid
option of the Arrange menu is not activated.
Set the graphs parameters. Select the BA:LEVEL.1 tag. Keep the default values of upper
and lower limits, and the start value. Click on OK to complete the Bar Graph
In Build mode, right-click on the Bar Graph and choose Format Color. Choose the proper fill
color. Use None for the background and line color.
5. Move the agitator drawing on the bar graph.
Use the Bring to front option from the Arrange menu to move the agitator out from under the
bar graph.
6. Add a command button Calculator.
Use the Button option from Draw menu to add a command button. In the Define Button dialog
box, put in a name for the button: Calculator. In the action item, enter the command line that
will start the calculator. You will find the calculator (calc.exe) in the
C:\WINDOWS\SYSTEM32 or C:\WINNT\SYSTEM32 according to the operating system used.
7. Save your display as PDI file with the Save as option.


PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 20

PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 21
Exercise 6 - PI Calculation Datasets
Objectives
Learn how to use dynamic elements based on datasets.
Learn how to obtain statistics from PI data archives.
Learn how to define equations with PI points.
Exercise 1A PI Summary
In the ProcessBook you created in Exercise 2, add a new display entry named
DataSet1. In it, display in a new trend the hourly minimum value, maximum value
and the tank level average. Synchronize the calculations at 00:00:00 AM. The
trend has to display the results of the last 12 hours in a stairstep trace.
Also, add a value item to show the percentage of good values.
Use the Sinusoid PI tag to do this exercise. The figure below illustrates the
resulting trend.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 22

Trend Tank level
Solution 1A
1. Create a new display type entry titled DataSet1 in the ProcessBook you created in Exercise 2 and
open it.
2. Create a dataset with the Data Set/New/PICalculation item of the Tools menu.
3. Enter the following parameters in the PI Calculation Data dialog:
Name: Level
Description: Tank level
Refresh interval: 1 min
Step Plot: yes
Server: select a server
Tag name: Sinusoid
Interval: 1 h
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 23
Synchronization: 00:00:00
4. Build a new trend named Tank level. Click PI Calculation from the dropdown menu to select the
curves.
5. Select the dataset you just created. Select the Average, Minimum and Maximum columns by
holding down the Ctrl key. Return to the Define Trend dialog by clicking the OK button.
6. Set the plot time:
Start: *-12h
End: *
7. Set the display and trace formats as you want and click on OK.
8. Add the percent good values with the Value item of the Draw menu.
9. Click on the PI Calculation button from the dropdown menu and choose the PctGood column.
10. Set the values format to general, select a tag name position from the drop-down list and click OK.
11. Save the display in PDI format.
Exercise 1B PI Expressions
Two different products (A and B) feed a tank. You want to illustrate in a trend the
products percentage use per 30 minutes. The synchronization of the calculations
starts at 00:00:00 AM (every 30 minutes starting at midnight). The trend should
show the results for the last 8 hours in a stairstep trace. Use the tag name CDT158
as product A and BA:TEMP.1 as product B. Define a column named %Product A
for the results of the calculation. Use the following expression:

'CDT158'*100/('CDT158'+'BA:TEMP.1)

Place the trend in a new display entry named DataSet2 in the ProcessBook created
in Exercise 2. The figure below presents the resulting trend.
Add a tank (static drawing + bar object) that will show the two products at the inlet
and the usage percentage of product A at the outlet.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 24
Solution 1B
Add Trend
1. In the PI ProcessBook of Exercise 2, create a display type entry named DataSet2 and open it.
2. Create a dataset with the Data Set item of the Tools menu.
3. Enter the following parameters in the PI Calculation Data dialog:
Name: ProductA
Description: % Product A
Refresh interval: 1 m
Step Plot: yes
Server: select a server
Expression: 'CDT158'*100/('CDT158'+'BA:TEMP.1)
Interval: 10m
Synchronization: 00:00:00
Column: %ProductA
4. Create a new trend named % Product A. Click on PI Calculation on the dropdown menu.
5. Choose the dataset Product A and select the column %ProductA. Return to the Define Trend
dialog.
6. Set the plot time:
Start: *-8h
End: *
7. Set the display and trace formats as you want and click on OK.

Add Tank
1. Draw a tank with two inlet pipes and an outlet pipe as seen in the figure below.
2. Type the products names and add the CDT158 tag value as product A and the BA:TEMP.1 tag
value as product B.
3. Type %ProductA = at the tanks outlet and add the value and the timestamp of column
%ProductA of the ProductA dataset.
4. Save the Display and the PI ProcessBook.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 25

Trend % Product A


Notes on ODBC Exercises

For the following two exercises to work properly, the following items must be installed
on your system:
LabData_2006.MDB (a Microsoft Access data file)
The ODBC Data Source configured in your system
ODBC tags.xls (with the PI-SMT menu in Microsoft Excel)

The last element in the above list reflects three tags that must be created for this
exercise to work. You can create them individually or use the free SMT download Tag
Configurator for Microsoft Excel to export them into your PI database. Each of these
tags makes use of standard interfaces and needs only be created to begin functioning.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 26
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 27

Exercise 7 - ODBC Datasets
Objectives
Demonstrate your ability to construct an ODBC Connection and an ODBC DataSet.
Problem
You want to trend test values from a database used and maintained by your laboratory
that looks like this one:




PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 28
The result should resemble the illustration below.



Approach

We will use an ODBC DataSet that uses a SQL Query to filter the data from the lab
database. In that query, well use placeholders to send the start time and end time of
the graph through with the SQL query. As the trend updates, the query will update
automatically.




Please try to complete the exercise before moving on to the answer below.

PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 29

Step-by-Step Solution
1. Create a new ProcessBook display and select Tools Data Sets.
2. Select New ODBC.
3. Enter a name and a description for the new dataset
4. Choose LabData from the Data Source list (if LabData is not available in the choice list,
you will have to create it to point to LabData_2006.mdb).
5. Next we have to build the query; you can type it manually or use the Microsoft Query
application (if available) by clicking on the Design button. The request is built as follows:
SELECT TEST_DATA.TIME_TAKEN, TEST_DATA.VALUE FROM TEST_DATA WHERE
(TEST_DATA.TIME_TAKEN>=? AND TEST_DATA.TIME_TAKEN<=?)
The screen should now resemble the following:

6. The question marks represent Parameters which will be fed from ProcessBook itself. In the
query above, we wish to look for data beginning at the start time of the trend and ending at the
end time of the trend. Hit the Placeholders button to define how each of the question marks
should be treated.
Placeholder 1 must be set as Type=Start Time (dont forget to press Set after choosing this
type from the dropdown list) and Placeholder 2 will be Type=End Time. When you have a
window that looks as follows, hit OK.
PI ProcessBook Exercises


The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSIsoft Inc.
All rights reserved, OSIsoft Inc. 2007
Page 30

7. Hit Check Syntax. ProcessBook will test the query and once it finds it syntactically correct, it
will allow you to select OK.
8. Back on the blank display, create a trend (use the last 24 hours as a range) using the DataSet
you just created. Trend the Value element.



Note here that we can edit the DataSet (SQL query, placeholders, etc.) from this window; if we do so it will
be edited for all elements that use it.

9. Hit OK, finish the trend as usual and the data from the Access database will now be visible in
your trend you can mix it with PI Data if desired!

S-ar putea să vă placă și