76
PI ProcessBook Exercises – version 4.6 Table of contents Introduction................................................................ 2 Exercise PB1 - Basics....................................................... 3 Exercise PB2 – Building Trends.............................................11 Exercise PB3 – Inserting static element in displays........................15 Exercise PB4 – Inserting dynamic element in displays.......................19 Exercise PB5 - Organize your displays......................................25 Exercise PB6 – PI Calculation Data sets....................................31 Exercise PB7 – ODBC Data Set...............................................39 Exercise PB8 – ODBC Data Set 2 (Optional)..................................45 Exercise PB9 – AF2 Data Set (Optional).....................................49 Exercise PB10 – Using Visual Basic for Applications I (Optional)...........55 Exercise PB11 – Using Visual Basic for Applications II (Optional)..........59 Exercise PB12 – Using Add-Ins (Optional)...................................63 Exercise PB13 – Exporting Displays (Optional)..............................65 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 Canada. All rights reserved, OSIsoft 2008 Page 1

Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

Embed Size (px)

Citation preview

Page 1: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Table of contents

Introduction........................................................................................................................................................ 2

Exercise PB1 - Basics........................................................................................................................................... 3

Exercise PB2 – Building Trends.......................................................................................................................... 11

Exercise PB3 – Inserting static element in displays.............................................................................................15

Exercise PB4 – Inserting dynamic element in displays........................................................................................19

Exercise PB5 - Organize your displays................................................................................................................ 25

Exercise PB6 – PI Calculation Data sets.............................................................................................................. 31

Exercise PB7 – ODBC Data Set........................................................................................................................... 39

Exercise PB8 – ODBC Data Set 2 (Optional)........................................................................................................ 45

Exercise PB9 – AF2 Data Set (Optional).............................................................................................................. 49

Exercise PB10 – Using Visual Basic for Applications I (Optional).........................................................................55

Exercise PB11 – Using Visual Basic for Applications II (Optional)........................................................................59

Exercise PB12 – Using Add-Ins (Optional)........................................................................................................... 63

Exercise PB13 – Exporting Displays (Optional)...................................................................................................65

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 Canada. All rights reserved, OSIsoft 2008

Page 1

Page 2: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

IntroductionThe following are the PI ProcessBook exercises. Some of the exercises cannot be completed unless you have completed the previous ones.

The exercises in this book are designed to be performed using live software. In order to perform the exercises in a self-study environment, you will have to have an installed and working PI System and the appropriate client applications. Some applications require tags, modules, and/or elements and attributes to be configured. If there are configurations required they will be described in detail before the exercise. Occasionally, sample data files are provided. Prerequisites are described for each exercise if necessary.

The exercises are designed to be accomplished using only the descriptions in the Approach sections. If you have trouble you can reference the Step-by-step Solutions at the end of each exercise. You should always try to complete the exercise from the Approach section first.

Properly licensed software is required. OSIsoft does not provide sample software or test environments for this tutorial. Any sample data files or configuration files referenced can be acquired as part of the zipped Training Materials package that can be downloaded from the OSIsoft technical support web site (http://support.osisoft.com). You will be required to register to validate customer status.

If you have any questions please contact the Training Department at [email protected].

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 Canada. All rights reserved, OSIsoft 2008

Page 2

Page 3: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB1 - 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 ProcessBook file; Find data, statistics and annotations related to tags.

ApproachOpen the PI ProcessBook application and establish a connection to a PI server given to you by your instructor.

PI Server

Username

The default workbook PIDEMO.PIW opens. Open the Main Column Bottom display and familiarize yourself with the different windows, options and functions. Within the four (4) different sections below, you will explore all those essential items and will be able to fulfill the objectives.

A. The PI ProcessBook environment

Open the different top bar menus to have a taste of the different functions available; Observe the different toolbars that contain the same functions you just saw in the menus. Maximize the Main Column Bottom display.

B. The common dialog windows

Open the Connections window and connect to your PI server (hint: Use the File menu); Open the Tag Search window and find all tags that begin with the letter b, all tags that contain

the word reactor in their descriptor and all tags that have a value of zero (hint: Use the Tools menu).

C. The trend display

Maximize the Crude Charge trend; Zoom in and out of the trend; Change the time scale to 1 day; Go backward and forward in time by one or by several time periods; Find when the maximum value was attained for the current time range (Hint: use the Trend

Cursor);

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 Canada. All rights reserved, OSIsoft 2008

Page 3

Page 4: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Revert back to the original time scale; Highlight the trace of the trend; Hide the trace of the trend and then make it appear again;

D. The details and annotations

Point the mouse directly on the trend trace and wait until you can observe the ToolTip yellow window;

Point other symbols from the display and wait until you can observe the ToolTip yellow window;

Right-click on the trend and click Show Details and Annotations; Observe the Data, Statistics and Point Attributes for the trend; Validate the timestamp you just found for the maximum value; Refresh the Data displayed; Save the Statistics to a file; Copy the Point Attributes and paste them in a Microsoft Excel spreadsheet; Add an annotation to the latest value to indicate an out of range value.

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 4

Page 5: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

A. The PI ProcessBook environment

1. Open PI ProcessBook Application.

2. Click on the Refinery tab.

3. Double-click on the Main Column Bottom display.

4. Open the top bar menus: File, Edit, View, Insert, Tools, Draw, Arrange, Window and Help.

5. Stop your mouse on some of the different icons of the toolbars to observe those with the same functions that are present in the menus you just opened.

6. Maximize the Main Column Bottom display window by clicking on the ( ) button located on the upper-right corner.

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 Canada. All rights reserved, OSIsoft 2008

Page 5

Page 6: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

B. The common dialog windows

1. The Connections window

· Open the Connections window by selecting File > Connections.

· Select Server > Add Server… to add a PI server.

· Enter the PI server name in the Network Node field and the user name in the Default User Name field.

Note

Remember that they were specified to you by your trainer

· Leave the Port Number to the 5450 value

· Click on the OK button to add the specified PI server.

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 Canada. All rights reserved, OSIsoft 2008

Page 6

Page 7: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

· Check the checkbox beside the PI server you want to connect to. If you are prompted for a password, enter the one that will be specified by the trainer.

2. The Tag Search window

· Open the Tag Search window by clicking on the ( ) button or by selecting Tools > Tag Search.

· Enter b* in the Tag Mask field and click on the Search button to get all the tags beginning with the letter b.

· Click on the first tag of the result list. Then, press and maintain the Shift key and click on the second tag of the list. The two (2) first tags will be selected. Click on the Pt. Attr button to access the attributes of those tags. You can move from one tag to another with your keyboard arrow keys.

· Write * in the Tag Mask field and *reactor* in the Descriptor field, then press on the Search button to find all the tags containing the string “reactor” for their descriptor attribute.

· Erase the data in the Descriptor field and enter 0 (zero) in the Value field, then click on the Search button to find all the tags with a snapshot value of 0.

Note

The more criteria you use for your tag search, the more effective you will be in finding exactly the tag(s) you need.

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 Canada. All rights reserved, OSIsoft 2008

Page 7

Page 8: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

C. The trend display

1. In Run mode, maximize the Crude Charge trend to take the entire display window. Double-click within the trend. To return at the original time scale, double-click within the trend again.

2. 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 > Revert or use this button ( ).

3. Modify the time range by using the View > Time Range and set it to 1 day to now.

4. Use the time forward and backward buttons ( ) to scroll the time range forward or backward on a trend. Try replay in playback the last week of data by clicking six (6) times on the Move backward in time button and then return back using the Move forward in time.

5. Return to the original time scale (See step 2).

6. Use a Trend Cursor to find when the maximum value of the last day occurred ( ).

7. Return to the original time scale (See step 2).

8. 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.

9. Move the mouse cursor over the SINUSOID trace or the SINUSOID tag label in the legend area and click to hide this trace. You can notice that when the mouse cursor is over the trace or the tag label are highlighted. Click again to show them back.

D. The details and annotations

1. Maximize the Crude Charge trend.

2. Point the mouse directly on the trend trace and wait until you can observe the ToolTip yellow window.

3. Minimize the trend.

4. Point the mouse directly on any other symbols and wait until you can observe the ToolTip yellow window.

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 Canada. All rights reserved, OSIsoft 2008

Page 8

Page 9: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

5. Right-click on the trend and click Show Details and Annotations. The Show Details and Annotations window will appear on the right. The Data option should be presented to you.

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 Canada. All rights reserved, OSIsoft 2008

Page 9

Page 10: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

6. Observe the Data, Statistics and Point Attributes for the selected tag by changing the Option field.

7. Validate if the maximum value you have found in part C is the same returned by the Statistics window.

8. Refresh the tag’s data from Data option by clicking on the Refresh Data button ( ).

9. Choose the Statistics option and click on the Save to file button ( ). Enter the filename and choose the extension: .TXT or .CSV.

10. Using the Windows Explorer locate the file you just saved and open it.

11. Open a blank MS Excel sheet.

12. Choose the Point Attributes option and click on the Copy to clipboard button ( ). Switch to MS Excel application, select the cell which will receive information and select right-click > Paste. Point Attributes information will be copied through the clipboard to MS Excel.

13. Choose the Data option. Select the last event in the data grid by clicking once on it. The Annotations section will no longer be grayed out.

14. Click into the Value field of the first row and enter: This value is out of range.

15. Click in the drop-down list of the Value Type field and choose String. Leave the description field empty.

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 Canada. All rights reserved, OSIsoft 2008

Page 10

Page 11: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

16. Click on the Save all changes button to save the annotation with the event.

17. You can try to visualize the annotation from the trend object. An annotation takes the representation of a white sheet above the trace area as shown in the figure below. If you move your mouse cursor over and leave there for a moment you can read the added comment.

18. Exit PI ProcessBook without saving.

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 Canada. All rights reserved, OSIsoft 2008

Page 11

Page 12: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB2 – Building Trends Objectives

Build trends. Familiarize yourself with the different trend building options.

Pre Requisites A PI Server (read); A PI ProcessBook Workbook created in the directed exercise in class.

Problem DescriptionYou are now ready to create a trend with PI tags. You will need a new display in your workbook to do this. Make sure you create the display inside your workbook.

ApproachCreate a ProcessBook independent display file called Exercise PB2.PDI. 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)

Make the trend show the last 5 days of values; Label the trend so the title reads Exercise PB2.

If the time permits, add a second trend showing all of the tags that begin with the letters BA:.

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 Canada. All rights reserved, OSIsoft 2008

Page 13

Page 13: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 14

Page 14: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

1. Create a new PI ProcessBook independent display using the following steps:

· Click on File > New.

· A new screen appears with three choices:

· ProcessBook (.piw) File;

· ProcessBook Entry;

· ProcessBook Display (.pdi) File.

· Select ProcessBook Display (.pdi) File and name it Exercise PB2.

· Click on the OK button. A new screen will appear with the name Exercise PB2.

· Save this ProcessBook with the name Exercise PB2.PDI.

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 PB2 - Trend;

· Use the Tag Search button to locate and select the SINUSOID tag. To facilitate the query, use a

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 Canada. All rights reserved, OSIsoft 2008

Page 15

Page 15: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

mask like SIN*;

· Specify the time range to display the last 5 days in the plot time section by setting the style to Full time stamp, the Start field to *-5 Day and the End field to *;

· Click on the OK button to create the trend.

4. Save the trend object by saving the display using File > Save.

5. Optionally repeat the steps above except in the Tag Search find all tags with a tag mask of BA:*. Leave the remainder of the options to their defaults.

6. Save the trend object by saving the display using File > Save.

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 Canada. All rights reserved, OSIsoft 2008

Page 16

Page 16: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB3 – Inserting static element in displays

Objectives Learn to add static elements to your displays.

Problem DescriptionThe 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.

ApproachCreate a ProcessBook independent display file called Exercise PB3.PDI. To make it easier to align items, you can activate the Snap to Grid option by selecting Arrange > Snap to Grid.

Add the following items to the display:

One tank from the Symbol Library. You can use any tank you wish. One horizontal pipe from the Symbol Library going in to the tank and one pipe going out. If you

wish you can draw one long pipe and set the tank over it, so it appears to pass behind it. One text box labeling the tank stirred Tank. Place this near the tank. You may wish to alter the

color and size of the text for visibility. One mixer from the Symbol Library. Place this over the tank. One valve from the Symbol Library. Place this over the pipe, so it appears that the valve is in

line with the pipe flow.

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 Canada. All rights reserved, OSIsoft 2008

Page 17

Page 17: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

There are many possible solutions – yours does not have to look exactly like this. Feel free to improvise and be creative with your display.

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 18

Page 18: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

7. Create a new PI ProcessBook independent display using the following steps:

· Click on File > New.

· A new screen appears with three choices:

· ProcessBook (.piw) File;

· ProcessBook Entry;

· ProcessBook Display (.pdi) File.

· Select ProcessBook Display (.pdi) File and name it Exercise PB3.

· Click on the OK button. A new screen will appear with the name Exercise PB3.

· Save this ProcessBook with the name Exercise PB3.PDI.

8. It can be easier to arrange and align objects when the grid is activated. Select Arrange > Snap to grid option.

9. Draw the tank by selecting Draw > Symbol Library. Once this option is selected, use the left button of the mouse to select the area where you want to draw the symbol. Select the tank category, then a tank symbol.

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 Canada. All rights reserved, OSIsoft 2008

Page 19

Page 19: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

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.

10. Draw the pipes by selecting Draw > Symbol Library. Once this option is selected, use the left

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 Canada. All rights reserved, OSIsoft 2008

Page 20

Page 20: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

button of the mouse to select the area where you want to draw the symbol. Select the tank category, then a horizontal pipe symbol. Stretch to fit. Repeat if necessary for the second pipe.

11. Draw the agitator by selecting Draw > Symbol Library. Once this option is selected, use the left button of the mouse to select the area where you want to draw the symbol. Select the mixer category, then a mixer symbol. Click on Options if you want to change the color or fill pattern of the tank.

12. Add a Text item by selecting Draw > Text. Write in the tank: Stirred tank.

13. Draw the valve by selecting Draw > Symbol Library. Once this option is selected, use the left button of the mouse to select the area where you want to draw the symbol. Select the valve category, then a symbol. Click on Options if you want to change the color or fill pattern of the tank.

14. Save the display and exit the display.

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 Canada. All rights reserved, OSIsoft 2008

Page 21

Page 21: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB4 – Inserting dynamic element in displays

ObjectivesLearn how to enhance your displays by adding live elements whose properties change in time. These elements consist of the following PI ProcessBook objects:

Bar Graph; Value of a PI Tag; Multi-State Symbol; Command Button.

Problem DescriptionDynamic 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 PB3 and save it under Exercise PB4.PDI, add a level indicator and an alarm display (low and high). Modify the design of the tank so that it graphically shows the level.

ApproachYou need to edit the display entry in your workbook from the last exercise to contain the items found in the list below (all items can be found in the Draw Menu). Try to use the Data Favorites add-in to speed up the creation of dynamic elements.

One Dynamic Value indicating the level in the tank. You will use the tag BA:LEVEL.1. Place that near the tank. You may wish to alter the color and size of the text for visibility.

One Bar Graph to indicate visually the level in the tank. You will use the tag BA:LEVEL.1. Place that over the tank body and make it slightly smaller than the tank. This might be easier if you activate the Snap to Grid option by clicking on Arrange > Snap to Grid. You will have to experiment with the Forward and Backward options in the Arrange Menu to get the tank on the bottom, the bar graph, and the mixer to display all at once.

Two Multi-state Symbols will act as visual alarms for high and low level. You will use the tag BA:LEVEL.1 as the triggering tag. To do this, add two small circles or squares to the display, off to one side of the tank. They will have the following parameters:

The upper circle/square will be green if the value is below 50 and red if above 50. The lower circle/square will be green if the value is above 10 and red if below 10.

One Multi-state Symbol will act as visual indicator of the valve position. You will use the tag BA:ACTIVE.1. The valve itself will be a multi-state symbol with the following parameters:

Green if the state is ACTIVE

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 Canada. All rights reserved, OSIsoft 2008

Page 23

Page 22: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Red if the state is INACTIVE

Optional (time permitting) 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).

Save the display by selecting File > Save.

One possible configuration example of this is shown below.

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 24

Page 23: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution with the use of Data Favorites

15. Open the display created in Exercise PB3.

16. Click on View > Data Favorites to make the window add-in appears.

17. Enter this Search Mask: BA:* and click on the left green arrow button ( ).

18. Locate the BA:LEVEL.1 tag from the result list and drag and drop it in the Favorites area.

19. Click on the drop-down list of the Default Symbol of the Data Favorites windows and choose Value.

20. From the Favorites area, drag and drop the BA:LEVEL.1 tag into the blank display. Write Level (%) above the value by selection Draw > Text.

21. Add a low and high visual alarm.

· By selecting Draw > Ellipse first, draw two small circles, they will be activated to become visual alarms;

· In 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 to <= 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.

22. Create a bar graph to replace the tank.

· Click on the drop-down list of the Default Symbol of the Data Favorites windows and choose Bar.

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 Canada. All rights reserved, OSIsoft 2008

Page 25

Page 24: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

· From the Favorites area, drag and drop the BA:LEVEL.1 tag into the blank display.

· Resize the bar and make it the same size as the tank body. This might be easier if the option from Arrange > Snap to Grid is not activated;

· Set the bar graph’s parameters. Select the BA:LEVEL.1 tag. Keep the default values of upper and lower limits, and the start value. Click on the OK button to complete the bar graph configuration;

· 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.

23. Move the agitator drawing on the bar graph. Use Arrange > Bring to front option to move the agitator out from under the bar graph.

24. Add a calculator command button by selecting Draw > 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.

25. Save your display with the Save as option under the name: Exercise PB4.

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 Canada. All rights reserved, OSIsoft 2008

Page 26

Page 25: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution without the use of Data Favorites

26. Open the display created in Exercise PB3.

27. Insert a level indicator. Select Draw > Value to insert the BA:LEVEL.1 tag value. Write Level (%) above the value by selection Draw > Text.

28. Add a low and high visual alarm.

· By selecting Draw > Ellipse first, draw two small circles, they will be activated to become visual alarms;

· In 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 to <= 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.

29. Create a bar graph to replace the tank.

· Use Draw > Bar 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 option from Arrange > Snap to Grid is not activated;

· Set the bar graph’s parameters. Select the BA:LEVEL.1 tag. Keep the default values of upper and lower limits, and the start value. Click on the OK button to complete the bar graph configuration;

· 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.

30. Move the agitator drawing on the bar graph. Use Arrange > Bring to front option to move the agitator out from under the bar graph.

31. Add a calculator command button by selecting Draw > 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.

32. Save your display with the Save as option under the name: Exercise PB4

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 Canada. All rights reserved, OSIsoft 2008

Page 27

Page 26: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB5 - Organize your displaysObjectives

Learn how to build and modify a PI ProcessBook; Understand the PI ProcessBook entries hierarchy; Use the Book and Outline views to visualize and modify a PI ProcessBook.

Problem DescriptionYou need to organize existing displays from your organization to give one access point for users. You want to publish only the path to this ProcessBook file (workbook) to facilitate the deployment and security management from the enterprise’s IT/IS group.

Problem ApproachCreate a ProcessBook file called Exercise PB5.PIW and follow these instructions:

Try to do this exercise on your own before proceeding to the step-by-step solution.

Insert a text separator that will appear as a tab in book view and name it Exercises Book Create a display named Plant Status that will be put at level 2 Create a linked display to Exercise PB4.PDI that will be put at level 3 and name it Batch

Reactor. Create a linked ProcessBook to PIDEMO.PIW file that will be put at level 2 and name it External

Plant. The file PIDEMO.PIW is located under the PIPC\Procbook\en folder. Create a link to call the calculator from PI ProcessBook. 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. This entry will be at level 2.

Modify the hierarchy to follow these instructions.

Leave the text separator as the first item at level 1 Second item is External Plant at level 3 Third item is Plant Status at level 3 Fourth item is Batch Reactor at level 2 Fifth item is Calculator at level 3

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 Canada. All rights reserved, OSIsoft 2008

Page 29

Page 27: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step1. Select File > New.

2. A new screen appears with three choices:

· ProcessBook (.piw) File;

· ProcessBook Entry;

· ProcessBook Display (.pdi) File.

3. Select ProcessBook (.piw) File and name it Exercise PB5.

4. Click on the OK button. A new screen appears with the name Exercise PB5.

5. Save this ProcessBook with the name Exercise PB5.PIW.

B. Insert a Text type entry on level 1 and name it Exercises book using the steps below.

1. In Build mode, select Insert > Text. A new screen appears in which you must supply additional information.

2. Type a label like: Exercises book.

3. As this is your first entry, its hierarchy level is 1 and it may not be modified.

4. Click on the OK button. A title corresponding to Exercise book appears in the ProcessBook file

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 Canada. All rights reserved, OSIsoft 2008

Page 30

Page 28: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

created earlier.

C. Insert a Display type entry on level 2 and name it Plant Status.

1. In Build mode, select Insert > Display. A new screen appears in which you must supply additional information.

2. Type a label named Plant Status.

3. Choose a hierarchy level of 2.

4. Click on the OK button. This will create and open a display. You can add a trend into it or simply close it by selecting File > Close.

5. Save the display; it will be saved inside the Exercise PB5.PIW ProcessBook file. A title on the second hierarchy level corresponding to Plant Status appears in the PI ProcessBook file created earlier.

D. Add a Linked Display type entry on Level 3 and name it Batch Reactor.

1. To link a display from another ProcessBook file, the file must be opened (open the file Exercise PB4.PDI).

2. In Build mode, select Insert > Link / OS Command. A new screen appears in which you must supply additional information.

3. Type a label name Batch Reactor.

4. Choose a hierarchy level of 3.

5. Press the arrow next to the Browse button and select Display Search and select the Exercise PB4 display. (Hint: Do not forget to open the ProcessBook where the display resides.).

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 Canada. All rights reserved, OSIsoft 2008

Page 31

Page 29: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

6. Click on the OK button. This will link the display and open it. You can close it by selecting File > Close. A title on the third hierarchy level corresponding to Batch Reactor appears in the PI ProcessBook file created earlier.

E. Insert a Linked ProcessBook type entry on level 2 and name it External Plant.

1. In Build mode, select Insert > Link / OS Command. A new screen appears in which you must supply additional information.

2. Type a label named External Plant.

3. Choose a hierarchy level of 2.

4. Press the arrow next to the Browse button and select ProcessBook file. Browse to and select the PIDEMO.PIW ProcessBook (this file is located under the PIPC\Procbook\en folder).

5. Click on the OK button. This will link the ProcessBook and open it. You can close it by selecting File > Close. A title on the second hierarchy level corresponding to External Plant appears in the ProcessBook file.

F. Insert an Operating System Command type entry on level 2 and name it Calculator.

1. In Build mode, select Insert > Link / OS Command. A new screen appears in which you must supply additional information.

2. Type a label named Calculator.

3. Choose a hierarchy level of 2.

4. 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.

5. Click on the OK button. This will create the OS command and open the calculator. You can close it by selecting File > Close. A title on the second hierarchy level corresponding to Calculator appears in the PI ProcessBook.

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 Canada. All rights reserved, OSIsoft 2008

Page 32

Page 30: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

G. Modify your PI ProcessBook. Change the order in which the entries appear and modify the hierarchy to follow these directives:

Leave the text separator as the first item at level 1 Second item is External Plant at level 3 Third item is Plant Status at level 3 Fourth item is Batch Reactor at level 2 Fifth item is Calculator at level 3

1. In Build mode, select View > Outline.

2. 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.

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 Canada. All rights reserved, OSIsoft 2008

Page 33

Page 31: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB6 – PI Calculation Data sets Objectives

Learn how to use dynamic elements based on data sets; Learn how to obtain statistics from PI data archives; Learn how to define equations with PI points.

Problem DescriptionYou need to see displays not of raw data but showing the results of particular calculations. In one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum and minimum and display all with the live process value.

In a second calculation you want to create a display to illustrate the mixing of two ingredients: CDT158 and BA:LEVEL.1. Your calculation will solve for the percent of Product A (CDT158). You will show this graphically in a display. The approaches to solve each problem with sample illustrations are on the next sections.

Problem Part A approachIn the ProcessBook file you created earlier in Exercise PB5, add a new display entry called Exercise PB6A. Add a new trend on the average value for the last 12 hours. The trend shows stair step trace. Also, add the live process value to the trend. Label the trend CDT158 Calcs. The figure below illustrates the resulting trend.

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 Canada. All rights reserved, OSIsoft 2008

Page 35

Page 32: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Problem Part B approachTwo different products (A and B) feed a tank. You want to illustrate in a trend the product percentage used per 30 minutes. The synchronization of the calculations starts at 00:00:00 AM (every 30 minutes starting at midnight). The trend will show the results for the last 8 hours in a stair step 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 Exercise PB6B in the ProcessBook created in Exercise PB5. Add a tank (static drawing and bar object) that will show the two products at the inlet and the usage percentage of product A at the outlet. The figure below illustrates the resulting display and schematic.

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 Canada. All rights reserved, OSIsoft 2008

Page 36

Page 33: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 37

Page 34: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution for Exercise PB6 Part A

33. Create a new display type entry titled Exercise PB6A in the ProcessBook file you created in Exercise PB5 and open it.

34. Create a data set by following Tools > Data Sets > New > PICalculation.

35. 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: CDT158

· Interval: 1 h

· Synchronization: 00:00:00

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 Canada. All rights reserved, OSIsoft 2008

Page 38

Page 35: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

36. Build a new trend named Tank level. Click on PI Calculation from the dropdown menu to select the curves.

37. Select the data set you just created. Select the Average, Minimum and Maximum columns by holding down the ctrl key. Return to the Define Trend dialog by clicking on the OK button.

38. Set the plot time:

· Start: *-12h

· End: *

39. Set the display and trace formats as you want and click on the OK button.

40. Add the percent good values by selecting Draw > Value.

41. Click on the PI Calculation button from the dropdown menu and choose the PctGood column.

42. Set the value’s format to General; select a tag name position from the drop-down list and click on the OK button.

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 Canada. All rights reserved, OSIsoft 2008

Page 39

Page 36: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

43. Save the display and the ProcessBook file.

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 Canada. All rights reserved, OSIsoft 2008

Page 40

Page 37: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution for Exercise PB6 Part B

44. First a trend symbol will be added; in the ProcessBook file of Exercise PB5, create a display type entry named Exercise PB6B and open it.

45. Create a data set by following Tools > Data Sets > New > PICalculation.

46. Enter the following parameters in the PI Calculation Data dialog:

· Name: PERCENT_PRODA

· Description: % Product A

· Refresh interval: 1 m

· Step Plot: yes

· Server: select a server

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

· Interval: 30m

· Synchronization: 00:00:00

· Column: %ProductA

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 Canada. All rights reserved, OSIsoft 2008

Page 41

Page 38: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

47. Create a new trend named % Product A. Click on PI Calculation on the dropdown menu.

48. Choose the data set PERCENT_PRODA and select the column %ProductA. Return to the Define Trend dialog.

49. Set the plot time:

· Start: *-8h

· End: *

50. Set the display and trace formats as you want and click on the OK button.

51. A tank symbol will be added; draw a tank with two inlet pipes and an outlet one.

52. Type the products’ names and add the CDT158 tag value as product A and the BA:TEMP.1 tag value as product B.

53. Type %ProductA = at the tank’s outlet and add the value and the timestamp of column %ProductA of the Product A data set.

54. Save the display and the ProcessBook file.

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 Canada. All rights reserved, OSIsoft 2008

Page 42

Page 39: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB7 – ODBC Data SetObjectives

Demonstrate your ability to construct an ODBC Connection and an ODBC Data Set.

Problem DescriptionYou want to trend test values from a database used and maintained by your laboratory that looks like the figure below.

Pre-requisitesThe following items must be installed on your system:

LabData_2008.MDB (a Microsoft Access data file); The ODBC Data Source configured on your system.

ApproachWe will use an ODBC data set that uses a SQL Query to filter the data from the lab database. In that query, we’ll 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.

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 Canada. All rights reserved, OSIsoft 2008

Page 43

Page 40: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 44

Page 41: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

55. Open the ProcessBook file created in Exercise PB5.

56. Create a new ProcessBook display named: Exercise PB7.

57. Select Tools > Data Sets > New > ODBC.

58. Enter a name and a description for the new data set

59. 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_2008.mdb).

60. 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:

SELECTTEST_DATA.TIME_TAKEN, TEST_DATA.VALUEFROMTEST_DATAWHERE (TEST_DATA.TIME_TAKEN >= ?AND TEST_DATA.TIME_TAKEN <= ?)

The screen resembles the figure below.

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 Canada. All rights reserved, OSIsoft 2008

Page 45

Page 42: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

61. The question marks represent parameters which will be fed from PI 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 will be translated.

Placeholder 1 must be set as Type=Start Time (don’t forget to press Set button after choosing this type from the dropdown list) and Placeholder 2 will be Type=End Time. Parameters will appear to you as presented next on the figure below. Click on the OK button.

62. Hit the Check Syntax button; PI ProcessBook will test the query and once it finds it syntactically correct, it will allow you to click on the OK button.

63. Back on the blank display, create a trend (use the last 24 hours as a range) using the data set you just created. Trend the Value element.

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 Canada. All rights reserved, OSIsoft 2008

Page 46

Page 43: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

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 Canada. All rights reserved, OSIsoft 2008

Page 47

Page 44: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Note

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

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

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 Canada. All rights reserved, OSIsoft 2008

Page 48

Page 45: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB8 – ODBC Data Set 2 (Optional)Objectives

Demonstrate the ability to construct an ODBC Connection and data set. In this exercise quality specifications for various grades of paper are stored in an Access database.

Problem DescriptionThe control system reports the current grade of paper to PI as a tag named GRADEINDEX. This number can change from 0 to 10 depending on the current grade of paper. Each grade has its own target, high reject limit, and low reject limit. These specifications are stored in a database maintained by the laboratory, LabData_2008.mdb, and the table that interests us looks like this.

Pre-requisitesThe following items must be installed on your system:

LabData_2008.MDB (a Microsoft Access data file); The ODBC Data Source configured on 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.

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 Canada. All rights reserved, OSIsoft 2008

Page 49

Page 46: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

ApproachThe purpose of this exercise is to retrieve the laboratory specs from MS Access, conditionally based on the value of the grade index tag (GRADEINDEX). We will then compare the current values of a tag called BASISWEIGHT to those upper and lower limit specifications. By doing this we can trend the real-time basis weight and at the same time show what the target basis weight and reject limits were as different grades of paper were made on the same machine.

This time, we will set up a placeholder based on a PI Tag: GRADEINDEX. That tag name will be passed along with the SQL query so that the proper specs are retrieved for the proper product.

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 50

Page 47: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

65. Open the ProcessBook file created in Exercise PB5.

66. Create a new ProcessBook display named: Exercise PB8.

67. We need to define a new data set. Select Tools > Data Sets… > New > ODBC.

68. Define a new data set using these parameters:

· Name: SpecsByGrade;

· Description: Specs retrieved by grade index;

· Data Source: Select LabData from the dropdown list. It will be already set up on your machine.

69. Next we need to define the query. Enter the following SQL query:

SELECTSPECS.LOWER_LIMIT, SPECS.LOWER_REJECT,SPECS.TARGET, SPECS.UPPER_LIMIT, SPECS.UPPER_REJECTFROMGRADES GRADES, SPECS SPECSWHERESPECS.GRADE_CODE = GRADES.GRADE_CODEAND GRADES.GRADE_INDEX = ?

70. Note the single placeholder ? this will provide the value of the current grade from the control system. Once the placeholder has been defined, hit the OK button and check the syntax of the query. PI ProcessBook will tell you that everything is fine. The data set is ready to use.

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 Canada. All rights reserved, OSIsoft 2008

Page 51

Page 48: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

71. To build the trend, we’ll select ODBC from the dropdown menu in the Trend Definition Window. Use the CTRL key with the mouse to target and the limits. We’ll also add the real tag for the basis weight (tag name: BASISWEIGHT) to the trend. The trend definition is as follows:

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 Canada. All rights reserved, OSIsoft 2008

Page 52

Page 49: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Note

How the order of the items will control how they are ordered in the list on the trend control.

72. Once you have defined the trend, hit the OK button and you will see a powerful trend of real-time data mixed with specification data!

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 Canada. All rights reserved, OSIsoft 2008

Page 53

Page 50: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

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 Canada. All rights reserved, OSIsoft 2008

Page 55

Page 51: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB10 – Using Visual Basic for Applications I (Optional)

Objectives Add functionality to your ProcessBook displays by using Visual Basic for Applications; Program a function that runs automatically when a new value is received by PI ProcessBook.

Problem DescriptionYou want to monitor the level of the reactor created in previous exercises and notify an operator if the level gets too high or too low. Also, the operator is to enter a comment when the level is too high or too low and to display the comments.

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 56

Page 52: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

73. Open the ProcessBook independent display file created in Exercise PB4.

74. Save it as Exercise_PB10.PDI.

75. Insert the Microsoft Forms 2.0 listbox control (ActiveX) in your display. To do so, insert control by selecting Draw > Control and select a region on the display in which you wish to insert it (approximately: 3 inches wide by 2 inches high).

76. In Build mode, select the new control and show its properties by clicking the right button on the mouse. Note the control name that is used in the VBA function.

77. To add visual basic code to your display, you must enter in the Visual Basic Editor. To do so, select Tools > Macro > Visual Basic Editor.

78. Select THISDISPLAY in the VBA project. To insert code, go to View > Code.

79. In the GENERAL drop-down list, select the value object. In the Event drop-down list, select DATAUPDATE. All the code that will be written in this procedure will be executed when a new value appears in the Value object.

80. The first step in building your procedure is declaring the variables.

'Variable declaration

Dim sngValue As Single

Dim strComments As String

Dim dtmDateTime As Date

Dim strDateTime As String

Dim strAddLine As String

81. The next step is to obtain the latest value.

'Obtain latest value

sngValue = Value.GetValue(Now(), 0)

'Format value Format Fixed - 0.00)

sngValue = FormatNumber(sngValue, 2)

82. The last step is to add the code to verify if we are in alarm conditions. If so, you need to prompt the user for a comment. Finally we add the timestamp, value and comment in the list box:

'Verify alarm limits

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 Canada. All rights reserved, OSIsoft 2008

Page 57

Page 53: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

If sngValue > 90 Or sngValue < 10 Then

'If value is in alarm the user is prompted for a comment.

strComments = InputBox("Enter a comment", "Value out of Spec")

'Get current date and time

dtmDateTime = Now()

'Format date and time to PI time stamp format

strDateTime = FormatDateTime(dtmDateTime, vbGeneralDate)

'Concatenate together Timestamp, value and comment

strAddLine = strDateTime & " " & sngValue & " " & strComments

'Add information to list box

ListBox1.AddItem (strAddLine)

'Check if the list box has more than 10 items

If ListBox1.ListCount > 10 Then

'If the list box has more than 10 items then remove the first item

ListBox1.RemoveItem (0)

End If

End If

83. Close the VBA Editor.

84. Each time the value is outside the specified limits, an input box appears to notify that a value is out of specification and to enter a comment.

85. Save the display and the ProcessBook file.

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 Canada. All rights reserved, OSIsoft 2008

Page 58

Page 54: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB11 – Using Visual Basic for Applications II (Optional)

Objectives Add functionalities to PI ProcessBook by using Visual Basic for Applications; Change the display showing when in Run mode.

Problem DescriptionModify the Exercise_PB11_Template.PDI file in order to allow the addition or removal of a curve from a trend without going into the Build mode.

The three (3) functions required are already included in the Exercise_PB11_Template.PDI file, but they are incomplete. To complete them, Visual Basic code needs to be added.

ApproachComplete missing Visual Basic code from the template file. To add visual basic code to controls already include you must use the Visual Basic Editor. To do that, select View > Code.

Select THISDISPLAY in the VBA project. To insert the code, select View > Code.

In the procedure cmdAddTag_Click(), add the code that allows the addition of a curve to the trend. When the button Add a curve is selected this procedure associates the tag name, located in the text box, to a new curve. The tag name must be preceded by the PI server name, example: \\NT08\BA:CONC.1. Use the Tag Search tool to validate the proper syntax of a tag name.

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 59

Page 55: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

86. Add cmdAddTag_Click() method and set up the task like this:

Private Sub cmdAddTag_Click()

' Variables declaration

Dim intCount As Integer

Dim txtTagName2 As String

'Errors verification

On Error GoTo ErrorVBA

'Capture of the tag name in the text box

txtTagName2 = Me.txtTagName.Text

'Capture of the number of curves

intCount = Me.Trend.TraceCount

'Verify if the number of curves is greater than 7

If intCount > 7 Then

MsgBox "Maximum number of curves is reached", vbInformation

'Add the curve

Else

Me.Trend.AddTrace (txtTagName2)

End If

Exit Sub

'Error Handling

ErrorVBA:

Select Case Err

Case 8322

MsgBox "Invalid tag name", vbInformation

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 Canada. All rights reserved, OSIsoft 2008

Page 60

Page 56: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Resume Next

Case Else

Call MsgBox("Error appends", vbInformation)

Resume Next

End Select

End Sub

87. In the procedure cmdRemoveFirst_Click(), add the code that allows the removal of the first curve in the trend. This procedure is executed when the Delete first curve button is clicked.

Private Sub cmdRemoveFirst_Click()

'Variables declaration

Dim intCount As Integer

'Count the number of curves in the trend

intCount = Me.Trend.TraceCount

'Verify if there is more than one curve in the trend

If intCount > 1 Then

'Remove the first curve

Me.Trend.RemoveTrace (1)

Else

MsgBox "You cannot remove the last curve", vbInformation

End If

End Sub

88. In the procedure cmdRemoveLast_Click(), add the code that allows the removal of the last curve in the trend. This procedure is executed when the Delete last curve button is clicked.

Private Sub cmdRemoveLast_Click()

'Variables declaration

Dim intCount As Integer

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 Canada. All rights reserved, OSIsoft 2008

Page 61

Page 57: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

'Count the number of curves in the trend

intCount = Me.Trend.TraceCount

'Verify if there is more than one curve in the trend

If intCount > 1 Then

'Remove the last curve

Me.Trend.RemoveTrace (intCount)

Else

MsgBox "You cannot remove the last curve", vbInformation

End If

End Sub

89. Close the VBA Editor.

90. Save your display in PDI format (Exercise PB11.PDI) by using File > Save As.

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 Canada. All rights reserved, OSIsoft 2008

Page 62

Page 58: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Exercise PB13 – Exporting Displays (Optional)Objectives

Convert a ProcessBook file into a usable format for PI ActiveView or other web client.

Problem DescriptionYou need to deploy the ProcessBook file (that act as workbook file) across your organization. The organization has elected to use PI ActiveView instead of PI ProcessBook. Break apart your workbook file for posting on the web server.

Pre-requisitesPI ActiveView software must have installed prior to this exercise.

Try to do this exercise on your own before proceeding to the step-by-step solution.

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 Canada. All rights reserved, OSIsoft 2008

Page 63

Page 59: Exercises Format template - PROYTEK, S.A. - Offline Visita 2011…  · Web viewIn one calculation you need to see a 30 minute running average for CDT158. Also show the interval maximum

PI ProcessBook Exercises – version 4.6

Step-by-Step Solution

91. Open the PIDEMO.PIW file, located in the \PIPC\Procbook folder.

92. Open the file EXPORT.PDI, located in the\PIPC\AcView\WebDev to extract the individual components to the temporary directory C:\Activeview as shown below. Click through any errors you may get, as they can be repaired later.

If you browse to your destination directory you will find three types of files:

The display (.pdi) files from the workbook (.piw) file separated ; .htm wrapper files; A graphic file for the links.

PI ActiveView creates a simple frames page that will hold your display files and a menu file containing the links. Open the PBHome.htm file to see your ProcessBook displays in a browser.

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 Canada. All rights reserved, OSIsoft 2008

Page 64