You are on page 1of 192

PI ProcessBook, PI DataLink, PI WebParts

Version 5.1

PI ProcessBook, PI DataLink, PI WebParts Course

How to contact us
OSIsoft, LLC

OSIsoft Australia Pty Ltd.

777 Davis St., Suite 250


San Leandro, CA 94577 USA
(01) 510-297-5800 (main phone)
(01) 510-357-8136 (fax)
(01) 510-297-5828 (support phone)

Perth, Australia
New Plymouth, New Zealand
OSIsoft Europe GmbH
Frankfurt am Main, Germany
OSIsoft Asia Pte Ltd.

support@osisoft.com

Singapore

Houston, TX
Johnson City, TN
Longview, TX
Mayfield Heights, OH
Philadelphia, PA
Phoenix, AZ
Savannah, GA

OSIsoft Canada ULC


Montreal, Canada
OSIsoft, Inc. Representative Office
Beijing, Shanghai, Peoples Republic of
China
OSIsoft Japan KK
Tokyo, Japan
OSIsoft Mexico S. De R.L. De C.V.
Mexico City, Mexico
OSIsoft do Brasil Sistemas Ltda.
Sao Paulo, Brazil

Sales Outlets/Distributors
Middle East/North Africa
Republic of South Africa
Russia/Central Asia

South America/Caribbean
Southeast Asia
South Korea Taiwan

www.osisoft.com
OSIsoft, LLC is the owner of the following trademarks and registered trademarks: PI System, PI
ProcessBook, Sequencia, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known
to be trademarks or service marks have been appropriately capitalized. Any trademark that appears in this
book that is not owned by OSIsoft, LLC is the property of its owner and use herein in no way indicates an
endorsement, recommendation, or warranty of such party's products or any affiliation with such party of
any kind.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
1994-2010 OSIsoft, LLC. All rights reserved

PI ProcessBook, PI DataLink, PI WebParts Course

Conventions
The following conventions are used throughout this book.
Bulleted List

This represents different ideas on a topic.

Item 1
Item 2
Item 3

Numbered lists
This represents a list of steps with a specific order to respect.
1. Item1
2. Item 2
3. Item 3
A bold font is to emphasize user interface element names, including names of buttons, dialog boxes, and
menu items; it also highlights processes, utilities, system components and modules.
A Consolas font is used for code or computer input by the user or output to the display, also for
filenames and path names and formulas.
A Consolas font with a border like the figure below represents a block of code.
' Variables / Objects.
Dim myvar as string
Myvar =

A Consolas font with a border like the figure below represents a block of SQL query.
SELECT FROM TABLE WHERE

An italic font is used as placeholders for variables or information unknown that will be determined by
you, the reader.
An underlined blue font is used to report URL.

The content you will retrieve in this rectangle is important and requires your attention.

This image represents:

A group recap question to verify understanding of the


material;
A directed exercise (green);
A self-paced exercise (blue).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page i

PI ProcessBook, PI DataLink, PI WebParts Course

How to Use this Class Workbook


Each chapter contains one or more
Heading 2 sections.

Each Heading 2 section contains a list of


your objectives. In most cases, you will be
tested on these objectives.
The first Heading 3 states the first objective.
Every Heading 3 indicates a new objective,
unless it is marked "Optional."
The book icon refers to a different
document. If you want more info on this
topic, look there.1
When a Heading 3 is marked
"Optional" then it is not a critical
objective and can be skipped. In
class we usually skip these.

The second Heading 3 states the


second objective. The third Heading
3 states the third objective etc.

The Question Mark icon indicates an


activity designed to reinforce or
validate a new skill. This could be
something the class does together as a
group, a question, or a solo activity.2
1

Most of these references are to user manuals that can be downloaded from
http://techsupport.osisoft.com > Download Center > Documentation > User Manuals. (Login
to an OSIsoft technical support account is required.) Use the "Product" drop down list box to
choose the correct user manual.
2

You can download solutions to the self-paced exercises at http://training.osisoft.com >


Downloads > Class Downloads. Click on a class and download the .zip file that contains the
class workbook and exercise solutions. (Login to an OSIsoft technical support account is
required.)

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page ii

PI ProcessBook, PI DataLink, PI WebParts Course

Table of Contents
1.

2.

3.

4.

Introduction to the PI System ................................................................................. 1


1.1

PI Described, PI Architecture, PI Points and Attributes............................. 1

1.2

How Data Moves through the PI System ..................................................... 5

1.3

Time and PI ...................................................................................................10

ProcessBook: Connecting, Navigating, Trends, and Displays .........................13


2.1

Create, Modify Connections to a PI Server ...............................................13

2.2

Tag Search and Point Attributes Dialogs ..................................................15

2.3

Navigating, Resizing, and Formatting........................................................19

2.4

The Display, Status Report, and Tooltip Statistics ...................................20

2.5

Details Docking Window, Browser Toolbar, and Playback Toolbar .......22

2.6

Navigating Within a Trend, Trend Cursor, Show/Hide Trace ..................24

2.7

Building a Display, Add Static Elements, the Symbol Library ................33

ProcessBook: Dynamic Elements and ProcessBook Workbooks ...................39


3.1

Dynamic Elements, Data Favorites ............................................................39

3.2

Build Trends, Linear Regression, the Format Paintbrush, and XY Plots40

3.3

Bars, Values, Multi-State Objects and Buttons .........................................44

3.4

Creating Workbooks and Organizing Displays .........................................51

3.5

Creating Entries ...........................................................................................52

ProcessBook: Performance Equation (PE) Syntax ............................................59


4.1

5.

ProcessBook: Calculations ..................................................................................63


5.1

6.

7.

Performance Equations Basics ..................................................................59

PI Calculations in PI ProcessBook and Performance Equation Syntax.63

DataLink: Current and Archived Data..................................................................73


6.1

Introduction and Installation .......................................................................73

6.2

DataLink Settings and Time Formats.........................................................73

6.3

Simple DataLink Queries .............................................................................77

6.4

Multiple Value DataLink Queries ................................................................85

6.5

Arrays in PI DataLink ...................................................................................88

DataLink: Calculated and Filtered Data ...............................................................93


7.1

Graphical Data in DataLink .........................................................................93

7.2

Calculations Within DataLink .....................................................................98

7.3

Expression Data .........................................................................................107

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page iii

PI ProcessBook, PI DataLink, PI WebParts Course


7.4
8.

9.

10.

Complex Calculations and Other Functions ...........................................115

PI WebParts: PI Gauge, PI Values, and PI TimeSeries .....................................127


8.1

Introduction to PI WebParts ......................................................................127

8.2

Using and Configuring PI WebParts ........................................................135

PI WebParts: PI Trend, PI TimeRange, PI Graphic, DLES ...............................147


9.1

PI Trend and PI TimeRange ......................................................................147

9.2

PI ProcessBook Within PI WebParts .......................................................150

9.3

Requirements and Configuration of DataLink for Excel Services ........155

PI ActiveView .......................................................................................................159
10.1 Advanced Web Part Possibilities .............................................................159

11.

AF Element Relative Visualizations ...................................................................163


11.1 Introduction and Element Relative Displays ...........................................163
11.2 The AF Database, PI WebParts, and Web Part Connections .................170

12.

Conclusion ...........................................................................................................179
12.1 Training .......................................................................................................179
12.2 vCampus .....................................................................................................179
12.3 Tech Support ..............................................................................................179
12.4 Further Questions ......................................................................................180

13.

Exercise Global Recap Question (optional) ...................................................181

14.

Group Recap Answers ........................................................................................183

15.

Glossary ...............................................................................................................185

16.

Index .....................................................................................................................186

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page iv

PI ProcessBook, PI DataLink, PI WebParts Course

1. Introduction to the PI System


1.1

PI Described, PI Architecture, PI Points and Attributes

Objectives

1.1.1

Describe what the PI system is


Draw a diagram of the architecture of a PI System
Describe what a point is
List the basic point attributes and their usage
List the possible data point types
The PI System Described

The PI System collects, stores, and manages data from your plant or process. You connect
your data sources to one or more PI Interface Nodes. The Interface Nodes get the data from
your data sources and send it to the PI Server. Users get data from the PI Server and display it
with client tools (for example, PI ProcessBook, PI DataLink, and PI WebParts).
There are generally four parts involved in a PI System:

Data
Source

Interface
Node

PI / AF
Server

Client
PC

Figure 1
Data is collected from the source by the PI Interface program hosted by the Interface Node.
The data is sent to the PI Server (Asset data can be contained in the PI AF Server). It is read
from the PI/AF Servers by the Client tools.
1.1.2

Architecture of a PI System

Sometimes the architecture can be very simple. Some customers have as few as one or two
interfaces feeding data to a PI Server. Everyone reads that PI Server for their data.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 1

PI ProcessBook, PI DataLink, PI WebParts Course

PUMPS

3RD PARTY HISTORIANS


RELATIONAL DATA

VALVES
MANUAL DATA
PI SERVER
NODES

PRESSURE SENSORS
PLC / INSTRUMENT SYSTEMS

PI INTERFACE
NODES

CLIENT APPS

ACTUATORS

SCADA / DCS

CLIENT APPS

TRANSFORMERS

WEB APPS

ANALYTICAL TOOLS
MOTORS

LIMS SYSTEM
CLIENT APPS

10101
00110
10011

OTHER DATA
SOURCES

DATA SOURCES

OTHER
SYSTEMS

OTHER
SYSTEMS

MANUFACTURING CONTROL NETWORK

DMZ

CLIENT APPS / CORPORATE LAN

Figure 2
Figure 1 shows how the PI System architecture can be deployed at the site level and
integrates your manufacturing and corporate networks.
Each part of the PI System can be multiplied or connected to another system. Every
installation is a little unique.
Figure 2 shows how this architecture can be expanded and built up to provide access across
your entire enterprise organization and tie together all of your manufacturing and business
data.

BUSINESS SYSTEMS

PORTAL SERVERS

SITE 1

APPLICATION SERVERS

PI ENTERPRISE
SERVICES
MORE CLIENT APPS

MOBILE CLIENTS

SITE 2

ENTERPRISE
PI COLLECTIVE

ENTERPRISE DATACENTER
SITE 3

Figure 2

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 2

WIRELESS

BUSINESS NETWORK

PI ProcessBook, PI DataLink, PI WebParts Course

1.1.3

The PI Point The Basic Unit in the PI System

What is a PI Tag? It is a unique storage point for data in the PI system. It is simply a single
point of measurement.
1.1.4

Directed Exercise Data Types


You are invited to watch what the instructor is doing or perform the same steps at the
same time to explore the different concepts presented in this chapter or section.

Problem Description
Identify the type of data that might be associated with each of the following:
Example: a Temperature Sensor ___a floating point value___
A switch position:

_______________________________________

A Batch ID:

_______________________________________

Operator comments:

_______________________________________

The results of a calculation:

_______________________________________

Memory available on a server: _______________________________________


Current phase of the reaction:

_______________________________________

Current product count:

_______________________________________

1.1.5

The Possible Data Point Types

So What Types of Data Can PI Store?


The answer is pretty much everything. Below are the data types:

Digital:
Discrete value (On/Off, Red/Black/Green)
Int16: Integer value, 16 bits (0 to 32767, acc: 1/32767)
Int32:
Integer value, 32 bits (-2147450880 to 2147483647)
Float16:
Scaled Floating Point number, 16 bits (1/32767 times range)
Float32:
Floating Point number, 32 bits (single precision)
Float64:
Floating Point number, 64 bits (double precision)
String: Text value up to 976 characters
Timestamps: Any Time/Date in the range 1-Jan-1970 to 1-Jan-2038

And for anything that will not fit cleanly into any of the defined types,

Blob:

Binary large object up to 976 bytes

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 3

PI ProcessBook, PI DataLink, PI WebParts Course


1.1.6

Some Basic Point Attributes and Why They are Important to You

There are some common tag attributes that are often used in client tools. Most of these
attributes are used for display or informational purposes.
Tag Name
Unique name of the PI point used to search for tags. Most tags are built using a local naming
convention. Sometimes knowing the naming convention this can be helpful in searching for tags. For
example, try to determine what the following tag may refer to:
M03_E1P2_MOTDRV1202_RUNSTAT
________________________________________________________
Descriptor
This is the human-readable description of the PI Tag. It is often used as a search criterion in place of the
tag name when the tag name is not intuitive. Very often the tag name is some sort of abbreviation
convention and the descriptor is used to capture the full name.
EngUnits
This field refers to the Engineering Units of the point. Since there is no referential integrity involved
here, this field can be of very limited use in searching. For example, gallons per minute could be written:
Gallons/minute, Gallons per Minute, gals/min, gpm, etc.
PointType
This is the type of variable stored, sometimes used to help in searching (for example when looking for a
string tag).
Zero and Span
These two tag attributes define the minimum and maximum values for a tag. The minimum is the Zero
value and the maximum is derived from taking the Zero point and adding the Span. This affects the
following items:

Default boundaries of a trend


Number of visual states in a multistate symbol
Range of a Bar Graph
The behavior of the Current State item in the PI Values Web Part
How much data is compressed (more on this later)

Note: In most cases, users will not be able to change these attributes.
PointSource

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 4

PI ProcessBook, PI DataLink, PI WebParts Course


All tags are related to their interfaces that collect the data by an attribute called Point Source. This means
that in many cases you can find all of the tags associated with a particular device by searching for all tags
of a certain Point Source. This assumes that the user knows the point sources in use and that will not
be true in most situations.

1.2

How Data Moves through the PI System

Objectives

1.2.1

Explain why it looks like there are holes in the data.


Explain how the Interfaces filter noise and define noise.
Explain how the PI Server applies compression to store only meaningful data and
define meaningful.
Explain default exception and compression values and why they are important to the
end user
Why Does My Data Appear to Have Holes?

Often you will experience a situation where one of the following conditions will be true:

You are watching a trend and you can see many values, but when the trend is
refreshed most of them disappear.

Figure 3 Before and After Compression

You query for historical data in Microsoft Excel. You are sure the device is being
scanned every ten seconds, yet you see an uneven recording of data (what appear to
be gaps in timestamps).

This is completely normal behavior. It is a result of two filters that are applied.
1.2.2

Filtering Noise

At the Interface level, a process called the Exception Test is applied. The Exception Test
filters all values that are considered noise.
Noise: Insignificant changes, as defined as those below the instruments accuracy threshold, as set by the
person creating PI Points, and identical values, such as a valve that is reading OPEN over and over again.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 5

PI ProcessBook, PI DataLink, PI WebParts Course


Exception reporting uses a simple deadband algorithm to determine whether to send events to
the PI Server. For each point, you can set exception reporting specifications that create the
deadband. The interface ignores values that fall inside the deadband.
How do I know what the deadband measurement is?

Temperature

The deadband is created by applying the tag attribute ExDev in both a plus and minus
direction.

ExMax
ExDev

C
A
B

ExDev
F

Time
Figure 4
In the illustration, which values will be sent to the PI Server?
Answer: Values _____, _____, and _____.
Why do we need the previous value?
We send the previous value for a very basic reason: without the previous value it would not
be possible to correctly draw the historical trend.
Consider the series of points below. Draw one trend using just the initial value (Value A) and
the value that jumps out of the deadband (Value B). Then draw a trend line that includes not
only those two points but the value previous (Value C).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 6

PI ProcessBook, PI DataLink, PI WebParts Course

Temperature

Time
Of the two trend lines you just drew, which trend is more accurate?
But what if my values never go outside the deadband!
No problem. The ExcMax attribute sets a limit on how long the interface can go without
reporting a value to PI. After the ExcMax time period, the interface sends the next new value
to PI, regardless of whether the new value is different from the last reported value.
Note: Some interfaces do not support exception reporting. See the documentation for your interface to
determine whether it supports this capability.

1.2.3

Directed Exercise Exception Testing


You are invited to watch what the instructor is doing or perform the same steps at the
same time to explore the different concepts presented in this chapter or section.

Problem Description
You want to determine from the raw data which values will pass the exception test and which
will be filtered out.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 7

PI ProcessBook, PI DataLink, PI WebParts Course


Approach
Consider the following parameters:
ExcDevPercent:

Span:

200

ExcMax:

180

The current snapshot value and timestamp are:


70.3

10:00:00

Which pass the exception test, not including previous values?

1.2.4

Storing Only Meaningful Data

The PI Server uses a Compression Algorithm to determine what events need to be saved in
the PI Archive, or what is meaningful.
Meaningful: The data required to accurately reproduce the original data from the data source.
But isnt everything meaningful?
Not necessarily. For example, consider the following illustration. Which values would you
require to accurately represent the movement of the value at a later date?

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 8

PI ProcessBook, PI DataLink, PI WebParts Course

Co
E

Temperature

D
mp
Co

ev

D
mp

ev

B
A

CompMax

Time

Figure 5
In the illustration, which values will be sent to the PI Server?
Answer: Values _____, _____, and _____.
1.2.5

Default Values for Exception and Compression

The default values for exception and compression are as follows:

ExcDevPercent = 1 (% of span);
ExcMax = 600 seconds (10 minutes);
CompDevPercent = 2 (% of span);
CompMax = 28800 seconds (8 hours);
Zero = 0;
Span = 100.

Why are the default values important to me?


Because a deadband that is too wide will filter too much of your data and a deadband that is
too narrow may give you a lot of unnecessary data.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 9

PI ProcessBook, PI DataLink, PI WebParts Course


On the other hand, there are instances where you would want to capture everything you
collect with no filtering. You might be performing a calculation and want to capture every
result, or you may have regulatory requirements that require you to store every reading.
Everyones situation is unique. We simply present the options.

For more information see the PI Server System Management Guide.

1.3

Time and PI

Objectives

1.3.1

Express absolute time in the proper format


Express relative time in the proper format
Explain how PI handles DST
The Absolute Time Format

Absolute Time (a specific point in time)


My PI client tools will accept any number of different time formats. You should use the one
that is easiest for you although you will discover that some will be better than others. To
specify a time in PI use one of the following:

A PI Time Abbreviation
A time alone
A date alone
A date and time combined

A date or time can be a either the Windows time format (configured in the Regional Setting
dialog of Microsoft Windows) or the PI Time format (dd-mmm-yy HH:mm:ss.00000)
Note: If no date is specified the system will assume today. If no time is specified then the system will
assume midnight.
What are the Common PI Time Abbreviations?

* represents NOW
T represents today at midnight
Y represents yesterday at midnight
Monday or Mon represents Monday at midnight (or another specified day or its first
three letters)

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 10

PI ProcessBook, PI DataLink, PI WebParts Course


1.3.2

The Relative Time Format

Relative Time (time is offset from another time)


+ 8h : + 8 hours

Combined Time (using Absolute and Relative Times together)


t + 8h : today + 8 hours

Relative Time Units of Measure:

Hours (h)
Minutes (m)
Seconds (s)
Weeks (w)
Days (d)
Years (y)
Months (mo)

Note: There is no default time unit. Hour, Minute and Second intervals can use fractions (for example
+2.5h or -0.5m).

1.3.3

How does PI Adjust for DST?

The short answer is that we dont!


When we collect data we convert it to UTC (Universal Coordinated Time), or what used to be
called Greenwich Mean Time (GMT). This means that each day has exactly 24 hours. Any
adjustments for time, such as time zone or Daylight Saving Time (DST), are made by the
local machine clock of the user looking at the data.
So once a year the day will look like it has 23 hours and another 25, but the PI Server never
knows anything other than 24 hour days.
Also, because the clients and PI Server know what time zone they are in, the data can be
viewed in either Server Time or Client Time. This is determined by a setting in the client
tool.
1.3.4

Directed Exercise PI Times


You are invited to watch what the instructor is doing or perform the same steps at the
same time to explore the different concepts presented in this chapter or section.

Problem Description
All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 11

PI ProcessBook, PI DataLink, PI WebParts Course


Determine the times indicated in the table below:
Abbreviation

Answer

* - 30m
y + 8h
Tuesday 2d
Express the following times in valid PI time abbreviations:
Abbreviation

Answer

Today at 6:00 AM
Monday at 6:30 am
12 hours ago

1.3.5

Group Recap Question


The following questions are intended to reinforce key information presented in this
chapter or section. The answers can be found at the end of the book.

Questions
1.

What are the four parts of OSIsofts PI System?

2.

What are the two filtering tests that each event can go through before being archived in the PI
Server?

3.

What are the valid relative time units?

Hours
Minutes
Seconds
Days
Weeks
Months
Years

_____________
_____________
_____________
_____________
_____________
_____________
_____________

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 12

PI ProcessBook, PI DataLink, PI WebParts Course

2. ProcessBook: Connecting, Navigating, Trends, and


Displays
2.1

Create, Modify Connections to a PI Server

Objectives

2.1.1

Describe the common dialog boxes


Connect to a PI Server and determine what credentials you are connecting with
Modify existing connections using a common dialog window
Cleanup connections in the Known Servers Table
Introduction and Description

There are three dialog boxes that are used in one way or another in every PI application that
you will use. They are common because they address functions that are used regardless of the
specific application. They involve:

Connecting to a PI Server or Collective;


Searching for Tags;
Query for Tag Attributes / Values.

Some applications will use different formats, but they all accomplish the same functions. For
example, the Tag Search function on PI WebParts is based on different web architecture
and thus looks slightly different.
2.1.2

Create New Connections to a PI Server

The PI Connection Manager is invoked from most applications and will control what PI
Server(s) you can communicate with.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 13

PI ProcessBook, PI DataLink, PI WebParts Course


When the dialog box is invoked it will display all of the PI Servers that have been configured
from that machine.
Note: The first time a PI application is installed a default PI Server is selected. This is why even if you
have never configured a PI Server at least one should appear in your PI Connection Manager.
In this dialog box you can add and remove connections to PI Servers, add PI Server Aliases,
change your default server, or change the user you are currently logged in as.

You will need to know the following when you need to connect to a PI Server:

2.1.3

IP Address or Host Name;


Username;
Password (if any).
Cleanup Connections in the Known Servers Table

All PI Server connections are stored in something called the Known Servers Table (KST).
Each client computer keeps its own serialize list of PI Servers in the registry. Sometimes
there can be duplicate or bad entries. Use this feature of the About PI-SDK application to
clean it out.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 14

PI ProcessBook, PI DataLink, PI WebParts Course

2.2

Tag Search and Point Attributes Dialogs

Objectives

Search for tags

Examine point attributes

2.2.1

Search for Tags

Tag Search is one of the most common functions that users will perform. There are three
types of search:

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 15

PI ProcessBook, PI DataLink, PI WebParts Course

Basic

Advanced

Alias

Basic and Advanced do the same thing, just in different ways.

Basic allows you to search using common criteria through a defined menu

Advanced allows you to search using a SQL like syntax.

They both produce the same results.


Note: Alias Search uses the PI Module Database.
Most of the tag searches will be filtered in one of three ways:
Tag Mask
This can also be called Tag Name. If your organization has a convenient naming convention
or you are very familiar with the tags in your plant, then you are all set. However, most
people do not have that luxury. Most of us have to use some other criteria.
Descriptor
Descriptor is not a required tag attribute, but it is the one that many people use to find their
tags. For example, a temperature tag might be TC365674A.pv but the descriptor might be
read as Reactor 65 Operating Temp. The downside to searching by Descriptor is that it is
comparing text strings, and so can be fairly intensive on your computer processes.
Point Source
Point Source can be extremely helpful, but it does require certain knowledge of the PI System
and how the interfaces have been set up. Each device interface will be labeled with a specific
Point Source. So if you know what device you want data from, but you are not sure what the
tag names are, you can bring up a list of all of the tags that are associated with that device.
Variations
Remember that wildcards can be used in any of the above searches.
Use * to replace any number of characters like in this example:
flow* = flow_meter1, flow_meter2, flow_meter3
Use ? to replace one character like in this example:
tank?_level = tankA_level, tankB_level
Note 1: Search criteria are not case sensitive, but are case preservative.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 16

PI ProcessBook, PI DataLink, PI WebParts Course


Note 2: Search criteria can be combined like in this example where we look for Tag Mask: =
flow* and Point Source = o
2.2.2

Search for Points, Advanced

Advanced Tag Search allows those who prefer a SQL Query syntax to find the tags they
need. In certain circumstances it can be more specific than the Basic Search.

Note: Only the AND operator is supported.

2.2.3

Directed Exercise Tag Search


You are invited to watch what the instructor is doing or perform the same
steps at the same time to explore the different concepts presented in this
chapter or section.

Problem Description
You need to familiarize yourself with the principles of tag searching.
Approach
Answer the following questions using tag search:
How many tags are there that begin with the letters BA:?

__________________

How many tags appear where he Compression Deviation is greater than 1 and the Point Class
is 'Base' in the Advanced Tag Search?

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 17

PI ProcessBook, PI DataLink, PI WebParts Course


_______________________
Which Tag Search method do you prefer?

2.2.4

______________________________

Look at Point Attributes Using a Common Dialog Window

The way we collect, aggregate, and store data is all determined by a tags configuration
called tag attributes. Ever wondered how to actually see the tag attributes?

Simply open a tag search, find a tag, and click Pt.Attr.

For more information see PI Point Classes and Attributes (PI Server
System Management Guide, version 3.4.380, pp. 21).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 18

PI ProcessBook, PI DataLink, PI WebParts Course


2.2.5

Group Recap Question


The following questions are intended to reinforce key information presented in this
chapter or section. The answers can be found at the end of the book.

Questions
1.

What information needs to be specified when creating a new connection to a PI Server?

2.

What are the two wildcard characters available in a Tag Search?

3.

Which of the following PI Tag Attributes are not default filtering search criteria in a Basic Tag
Search?
a. Point Type
b. Tag Name
c. Zero
d. Point Class
e. Point Source
f. Typical Value

2.3

Navigating, Resizing, and Formatting

Objectives

2.3.1

Navigate in Run and Build Modes


Resize and reposition elements on a display
Navigate in Run and Build Modes

There are two modes of operation within ProcessBook, Run Mode and Build Mode.
Run Mode has the following properties:

Default mode;
Allows you to browse PI ProcessBook (Workbook) elements;
Visualize previously created displays;
Change to Build Mode at any time by selecting Tools > Build or by clicking on the
Build icon in the Drawing toolbar.

Build Mode has the following properties:

Build or edit PI ProcessBook (Workbook) elements;

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 19

PI ProcessBook, PI DataLink, PI WebParts Course

2.3.2

Add or modify elements within an existing display;


Change mode by selecting Tools > Run or by clicking on the Run icon in the
Drawing toolbar.
Resizing Elements in Build Mode

In Build Mode when you select an object (with a single click) you can resize and reposition it
on the display.

2.4

The Display, Status Report, and Tooltip Statistics

Objectives

Identify invalid elements using the status report


Show statistics information added to tooltips

PI ProcessBook displays one or more ProcessBooks, which are collections of display entries.

For more information, see "What Can You View with PI ProcessBook" in
PI ProcessBook User Guide, version 3.2, pp. 1-2.

Here is an example of what a ProcessBook Display can look like:

2.4.1

The Status Report

A Status icon (labeled 3 in the figure below) is at the bottom of the display in the Status Bar.
A green circle indicates all dynamic elements are good. If the circle is red, at least one
dynamic element is in a Bad Data state. To find out which element(s) is in error, you can

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 20

PI ProcessBook, PI DataLink, PI WebParts Course


double-click on the Status icon to open a pane displaying a list of all dynamic elements and
their individual states.

For more information, see "Status Report for Dynamic Symbols" in PI


ProcessBook User Guide, version 3.2, pp. 161-162.

2.4.2

Other Status Bar Elements(Optional)

There is a Status Bar at the bottom of the display window. This Status Bar shows several
pieces of information about the display(s) that is open. It shows whether the data being
displayed is using the Time Zone for the PI Server or for the Client Time (1). It shows the
Layers of displays that are open (2). Finally, there is an icon representing the Default Line,
Fill, and Background color for an element (4).
2.4.3

Tooltip Statistics

Hovering the mouse cursor over a dynamic element presents the Tooltip Statistics, which
presents the statistics for the longest time range specified by an element in your display.
These Statistics are the average, minimum, maximum, count, range, and population standard
deviation.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 21

PI ProcessBook, PI DataLink, PI WebParts Course

If the data source is unavailable, Trends show nothing, Dynamic Values show "No Data",
Trend Cursors show "No Data", Bar Graphs show diagonal lines, and Multi-state Symbols
show the user defined Bad Data color.

2.5

Details Docking Window, Browser Toolbar, and Playback Toolbar

Objectives

2.5.1

Use the Details docking window to show data in a table


Use the Details docking window to show, add or edit annotations
Use the Details docking window to export data to file
Navigate using the new Browser toolbar, home, and bookmarks
Use the playback functionality to change the timerange
Details Docking Window

It is possible to view the Details about a dynamic element by going to View>Details or rightclicking and selecting Show Details and Annotations. You can choose Data, Statistics, or
Point Attributes. If you select Data, you can view snapshot and compressed data, and
annotations from a dynamic element selected on your display.
2.5.2

Add Annotations

If you have write privileges to the specified point, it is also possible to write an annotation
directly from the display. Annotations are stored on the PI Server and so will be available to
all users and will be stored with your process history.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 22

PI ProcessBook, PI DataLink, PI WebParts Course


By choosing Statistics, you can view the same statistics as the Tooltip Statistics, but without
having to hover the cursor. And selecting Point Attributes allows you to see the list of
attributes and values for the selected point.

2.5.3

Export Data to a File

Data, Statistics or Point Attributes can be exported to a file or copied to the clipboard. If you
choose to export to a comma delimited .csv file, you can easily import that into Microsoft
Excel.
2.5.4

The Browser Toolbar

It is also possible to navigate between PI ProcessBook Workbooks and Displays using the
Navigation Toolbar. This toolbar, shown below, allows you to easily open recently opened
Workbook and Display files from the drop down menu, use the forward and backward arrows
to switch between displays rapidly, set a Home Workbook or Display, and to Bookmark
several of your favorite displays. This toolbar should hopefully be intuitive as it is
reminiscent of a web browser navigation toolbar.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 23

PI ProcessBook, PI DataLink, PI WebParts Course

2.5.5

The Playback Toolbar

Below the Navigation Toolbar is the Playback Toolbar, shown below. This lets you easily
scroll through the time range of your entire display. You can manually change the time range
included by clicking and dragging the end markers individual, or you can slide the whole
time range by clicking and dragging from somewhere in the middle of the time range. Finally,
there are play, stop, and fast-forward buttons that provide control very similar to a DVR or
other recording device. This allows you to scan the display quickly.

2.6

Navigating Within a Trend, Trend Cursor, Show/Hide Trace

Objectives

2.6.1

Create a Trend in Run Mode


Expand and reduce a trend in Run mode
Use the zoom in and out functionality directly on the trend
Use the Revert button on the time axis
Use forward and backward arrows on the time axis
Show timestamp of a value with the Trend Cursor
Show and hide multiple traces on a Trend
Create a Trend in Run Mode

You can quickly produce a trend of any dynamic symbol on an existing display to
immediately research the history of any symbol on your display.
In Run mode, there are two ways to create a trend.
1.
2.

In the current window, select one or many values.


Then click on the Trend button, and draw a rectangle to display the trend.

Or:
1.

For a trend in a new window, select one or many values.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 24

PI ProcessBook, PI DataLink, PI WebParts Course


2.

Then click on the Trend Display button to create an Ad-Hoc Trend. It is possible to save this new
window as a Display using File>Save.

2.6.2

Expand and Reduce a Trend

Certain functions can be used in Run mode only. A full screen trend is activated by doubleclicking on the trend in the display in Run mode. Double-click again to deactivate it and
return to the full ProcessBook display.
2.6.3

Zoom In and Out

You can zoom in and out on a trend by clicking the cursor and drawing a rectangle to
represent the boundaries of the area over which you would like to zoom in on. This will
temporarily change the x- and y-axes.
You can also manually change the vertical axis by selecting the View>Trend Scale or by
double-clicking on the vertical axis. This will open a pop-up window where you can choose
one of three options for the vertical scale. The Autorange option scales to the minimum and
maximum of the tag over the specified time range. The Database option scales to the zero
and span of the tag. Finally, you can select the Absolute option, which lets you specify the
exact minimum and maximum you would like displayed. These three options for scaling are
common within the trends in our client tools, and they will be seen again.
There are also buttons provided on each trend for zoom options. The magnifying glasses
either halve or double the time range currently shown. The arrows move forward or backward
one unit in time as currently shown.

In the example above, the plus magnifying glass will halve the time range specified, in this
case taking it from 8 hours to a time range of 4 hours. The minus magnifying glass will
double the specified time range, in this case going from 8 hours to 16 hours. The forward and
backward arrows will move the trend forward and backward in time, in this case an amount
of 8 hours.
2.6.4

Reverting a Trend

You can use the Revert button to go back to your original configuration. This is an easy way
to return to the configured view after you have zoomed in or out on a specific time range.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 25

PI ProcessBook, PI DataLink, PI WebParts Course


2.6.5

Scroll Forward and Backward through Time

Finally, you can use the menu or toolbar to change the time range of the trend. To change it
from the toolbar, use the Change Time Range icon. To change the time range from the
menu, you must select View> Time Range. Either of these will open a pop-up window that
allows you to specify the start time (the From parameter) and end time (the To parameter) in
either PI Absolute or Combined time. It is important to note that for your trend to receive
automatic updates that the end time must be now (*) and that the time range must be 7 days
or less (24 hours or less for ProcessBook v. 3.0 or earlier).
2.6.6

Trend Cursors

Trend cursors are static indicators that display the timestamp and value(s). You can have
multiple trend cursors per trend, and they can display values for multiple traces (tags). To
activate a cursor, just click on the edge of the trend and drag to the point of interest on the
trend. You can also set them manually from the toolbar by clicking on the Trend Cursor
icon.
2.6.7

Show/Hide Traces

Traces can be shown or hidden by clicking on the tag name in the legend or by right-clicking
on Trend > Trend Traces. Traces can be shown or hidden individually or all at once.
Changes made in View mode are temporary. To make any changes permanent, you must be
in Build mode and save the display.
2.6.8

Exercise PI ProcessBook Basics


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

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.

Problem Description
Open the PI ProcessBook application and establish a connection to a PI server. If you do not
know the name of your PI Server or the username and password you will use, please contact
your PI system manager.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 26

PI ProcessBook, PI DataLink, PI WebParts Course


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
different sections below, you will explore all those essential items and will be able to fulfill
the objectives.
A. The PI ProcessBook Environment:
1. Open the different top bar menus to have a taste of the different functions available;
2. Observe the different toolbars that contain the same functions you just saw in the menus;
3. Maximize the Main Column Bottom display.
B. The common dialog windows:
1. Open the Connections window and connect to your PI server (hint: Use the File menu);
2. 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:
1. Maximize the Crude Charge trend;
2. Zoom in and out of the trend;
3. Change the time scale to 1 day;
4. Go backward and forward in time by one or by several time periods;
5. Find when the maximum value was attained for the current time range (Hint: Use the Trend
Cursor);
6. Revert back to the original time scale;
7. Highlight the trace of the trend;
8. Hide the trace of the trend and then make it appear again.
D. The details and annotations:
1. Point the mouse directly on the trend trace and wait until you can observe the ToolTip yellow
window;
2. Point other symbols from the display and wait until you can observe the ToolTip yellow window;
3. Right-click on the trend and click Show Details and Annotations;
4. Observe the Data, Statistics and Point Attributes for the trend;
5. Validate the timestamp you just found for the maximum value;
6. Refresh the Data displayed;
7. Save the Statistics to a file;
8. Copy the Point Attributes and paste them in a Microsoft Excel spreadsheet;
9. 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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 27

PI ProcessBook, PI DataLink, PI WebParts Course

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

Open the top bar menus: File, Edit, View, Insert, Tools, Draw, Arrange, Window and Help.
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.

) button located on

Maximize the Main Column Bottom display window by clicking on the (


the upper-right corner.
B. The common dialog windows
1. The Connections window

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 28

PI ProcessBook, PI DataLink, PI WebParts Course

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.

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.
The Tag Search window

2.

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 first two (2) tags will be selected. Click on the Pt. Attr button to
access the attributes of those tags. You can move from one tag to the other 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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 29

PI ProcessBook, PI DataLink, PI WebParts Course

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

The trend display


1. In Run mode, maximize the Crude Charge trend to take the entire display window by doubleclicking within the trend. To return to the original time scale, double-click within the trend again.
2. Display a section of the trend display. Click and 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
3.
4.

scale, use the View > Revert or use this button (


).
Modify the time range by using the View > Time Range and set it to 1 day to now (*-1d and *).

5.

Use the time forward and backward buttons (


) to scroll the time range forward or
backward on the trend. Try to playback the last week of data by clicking six (6) times on the
Move backward in time button and then return to the current time by using the Move forward
in time.
Return to the original time scale (See step 2).

6.
7.
8.

Use a Trend Cursor to find when the maximum value of the last day occurred (
).
Return to the original time scale (See step 2).
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 display them again.
D. The details and annotations
1.
2.

3.
4.

5.

Maximize the Crude Charge trend.


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

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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 30

PI ProcessBook, PI DataLink, PI WebParts Course

6.
7.
8.

Observe the Data, Statistics and Point Attributes for the selected tag by changing the Option
field.
Validate if the maximum value you have found in part C is the same returned by the Statistics
window.
Refresh the tags 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 spreadsheet.
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. The Point Attributes information will be copied from the clipboard to MS Excel.
13. Choose the Data option. Select the last event in the data grid by clicking on it once. The
Annotations section will no longer be grayed out.
14. Click in 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.
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 it there for a moment you can read the added comment.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 31

PI ProcessBook, PI DataLink, PI WebParts Course

18. Exit PI ProcessBook without saving.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 32

PI ProcessBook, PI DataLink, PI WebParts Course

2.7

Building a Display, Add Static Elements, the Symbol Library

Objectives

2.7.1

Create new independent displays


Create and edit static elements
Insert Symbol Library images
Create a Display

To create a new ProcessBook file use File > New or the New icon. From here, you can create
new ProcessBook Displays, ProcessBook Workbooks, or ProcessBook Entries. The easiest
ways to conceive of ProcessBook Displays are that they are individual sheets, similar to
memos. Workbooks are entire books that are composed of many of these sheets, but to put
these sheets in the book, we need to create individual Entries. For now, we will focus on
Independent Displays and return to Workbooks and Entries later.
A display can contain a wide variety of elements, both static and dynamic. To add any of
these elements to a display, you must be in Build mode, and then select the desired element.
Draw it on the display and define its configuration when prompted. For now, we will focus
on the static elements.
2.7.2

Add and Edit Static Elements

The static objects available include shapes, lines, and text boxes. ProcessBook does come
with its own Symbol Library that includes many familiar process symbols. These include
things like tanks, values, and heat exchangers.
The majority of the static elements have options similar or identical to many Paint programs.
Things like grouping, alignment, stacking, rotation, and attachments. Just like these Paint
programs, you can do multiple object selection by clicking and dragging, using the Control
key, or using the Shift key.
If this Symbol Library (described below) is insufficient, you can also import graphics from
files. Use Draw > Graphic to insert a graphic file. This provides you greater options for
customization.
2.7.3

The Symbol Library

The symbol library button allows access to a rich library of symbols. To access the symbol
library, use the Symbol Library icon from the toolbar or Draw> Symbol Library from the
menu. Similarly, to import an image file into a display, use the Graphic button in the toolbar
or select Draw > Graphic from the menu.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 33

PI ProcessBook, PI DataLink, PI WebParts Course


2.7.4

Group Recap Questions


The following questions are intended to reinforce key information presented in this
chapter or section. The answers can be found after the questions.

Questions
4.

5.

What two user interface elements allow you to change the start time and end time of a Trend or XY
Plot in Run mode?

Which one of these statements is false:


In Run mode, both the vertical scale and the time scale of a trend element can be changed.
After changing the display in Run mode, the modifications will be saved if we do not use the
Revert function before saving the file.
The status report will indicate all tags used in the display that are in error and their associated
ProcessBook elements.

6.

What type of information can be stored within an annotation?

2.7.5

Exercise Inserting Static Elements into Displays


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 34

PI ProcessBook, PI DataLink, PI WebParts Course


Objective

Learn to add static elements to your displays.

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

Approach
Create a ProcessBook independent display file called Exercise PB2.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 into 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.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 35

PI ProcessBook, PI DataLink, PI WebParts Course

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 36

PI ProcessBook, PI DataLink, PI WebParts Course

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. It can be easier to arrange and align objects when the grid is activated. Select Arrange > Snap to
grid option.
3. 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.

4.

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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 37

PI ProcessBook, PI DataLink, PI WebParts Course

5.

6.

7.
8.

9.

Draw the pipes 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 pipes category,
then a horizontal pipe symbol. Stretch to fit. Repeat if necessary for the second pipe.
Draw the agitator by selecting Draw > Symbol Library. Once this option is selected, use the left
mouse button to select the area where you want to draw the symbol. Select the mixers category, then
a mixer symbol. Click on Options if you want to change the color or fill pattern of the tank.
Add a Text item by selecting Draw > Text. Write in the tank: Stirred Tank.
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 valves
category, then a symbol. Click on Options if you want to change the color or fill pattern of the tank.
Save the display and exit the display.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 38

PI ProcessBook, PI DataLink, PI WebParts Course

3. ProcessBook: Dynamic Elements and ProcessBook


Workbooks
3.1

Dynamic Elements, Data Favorites

Objectives

3.1.1

Use the Data Favorites docking window to drag and drop items to create dynamic
elements
Import and Export your Data Favorites for consistency
Introduction to Dynamic Elements (Optional)

Dynamic Elements are ProcessBook objects that are linked to PI data and that update in realtime. The following Dynamic Elements can be added to a display:

3.1.2

Trend
XY Plots
Bar Graphs
Dynamic Values
Multi-State Objects
Drag from Data Favorites to Create a Dynamic Symbol

Data Favorites is a way to store a persistent list of the tags you reference the most often. It is
accessed by View> Data Favorites. This allows you to configure dynamic elements by
dropping a data source from the list onto the display or element. You specify if you would
like to create a Bar, Trend, Dynamic Value or XY Plot elements when a data reference is
dropped. Additional traces are added when dropped onto an existing Trend or XY Plot. You
can also create multiple items at a time.
The Data Favorites pane consists of two sections, the Search and Favorites sections. The
Search section is where you can search for tags based on tag mask or use the Tag Search icon
to open a dialog for increased search options. When the tags are listed, you can drag and drop
individual tags into your Favorites section, or you can select one or multiple tags, right-click,
and then select Add to Favorites.
3.1.3

Import/Export Data Favorites

The list of Data Favorites is local to the machine only. So to propagate a consistent list of
Data Favorites across multiple physical machines, it is possible to import and export your list
of Data Favorites to and from a file. Simply right-click in the Favorites section and choose
the appropriate action. You can import favorite tags from any applications supporting drag
and drop like Excel, Word, etc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 39

PI ProcessBook, PI DataLink, PI WebParts Course

3.2

Build Trends, Linear Regression, the Format Paintbrush, and XY Plots

Objectives

3.2.1

Build a Trend
Add a linear regression trace to a trend
Use the Format paintbrush
Build an XY Plot
Build a Trend

To build a trend in a display, you must first be in Build mode. There are then three different
ways to build a trend. You can just drag and drop the Data Favorite with the Trend option
selected. Alternatively, you can use the menu option by selecting Draw > Trend or use the
toolbar by clicking on the Trend icon. Then draw a rectangle with the mouse to define the
size of the trend. A design window with four different tabs allows configuration of the trend:

General;
Display Format;
Trace Format;
Layout.

For more information see "Create a Trend" in PI ProcessBook User Guide,


version 3.2, pp. 81-84.

In the Display Format tab, Markers indicate PI archived values. When not checked three
trace markers appear at evenly spaced intervals to help identify individual traces on a
multiple trace trend.
3.2.2

Add a Regression Line

You can also add a regression line in the form y=mx+b, where m is the slope and b is the yintercept. Simply check the box in the Trend Definition configuration pane.
3.2.3

The Format Paintbrush

Use the Format paintbrush to copy the formatting properties to another trend. Double-clicking
the Formatting Paintbrush button allows you to apply formatting to more than one symbol.
To turn off the formatting paintbrush selection, click the button again or press the ESC key.
There is a maximum of fifty traces by default, but this setting can be changed. (This change is
made in Procbook.ini. For more information on this see Trend Definition Section in the PI
ProcessBook User Guide, version 3.2, p. 215).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 40

PI ProcessBook, PI DataLink, PI WebParts Course


3.2.4

XY Plots

XY Plots, also known as Scatter Plots, are used to show relationships between value sets. It is
a powerful tool to graphically show the correlation between two or more tags.
Values on the horizontal scale (x-axis) represent the values of a PI point rather than time.

For more information see "XYPlots" in PI ProcessBook User Guide,


version 3.2, Ch. 6, pp. 101-119.

3.2.5

Exercise Building Trends in ProcessBook


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objectives

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

Problem Description
You 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.
Approach

Create a ProcessBook independent display file called Exercise PB3.PDI.


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

If the time permits, add a second trend showing all of the tags that begin with the letters BA:.
Try to do this exercise on your own before proceeding to the step-by-step solution.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 41

PI ProcessBook, PI DataLink, PI WebParts Course

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

2.

3.

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.

Enter the following information in the General tab:


Type the trend name in the plot box: Exercise PB3 - Trend;
Use the Tag Search button to locate and select the SINUSOID tag. To facilitate the query, use a
mask like SIN*;

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 42

PI ProcessBook, PI DataLink, PI WebParts Course

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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 43

PI ProcessBook, PI DataLink, PI WebParts Course

3.3

Bars, Values, Multi-State Objects and Buttons

Objectives

3.3.1

Build a Bar Graph


Build a dynamic Value
Create a Multi-State Object
Insert a command button
Bars

A Bar Graph shows the current value of a tag as compared to a specified range of values.

For more information see "Bars" in PI ProcessBook User Guide, version


3.2, pp. 125-127.

A common mistake is to confuse Fill color with Background color when working with Bars.
Typically Fill color is the bottom part that indicates the value of a traditional empty/full
gauge and the Background color is the top part of the gauge.
3.3.2

Values

A Value is the reading obtained at a particular moment in time for a tag in the PI database.

For more information see "Values" in PI ProcessBook User Guide, version


3.2, pp. 121-123.

3.3.3

Multi-State Symbols

A Multi-State symbol is one that changes color to reflect changes in value for a particular
tag. Any object except a trend, graphic, button, or OLE object can be made a Multi-State
symbol by assigning a tag to it.

For more information see "Multi-State Symbols" in PI ProcessBook User


Guide, version 3.2, pp. 127-129.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 44

PI ProcessBook, PI DataLink, PI WebParts Course


3.3.4

Buttons

Buttons are elements that create a link to other applications, such as a calculator or word
processor, or other ProcessBook workbooks or displays. They give you the ability to navigate
to the desired information quickly, efficiently, and logically can mean the difference between
an application that is useful and one that frustrates the user. There are two types of navigation
when using PI ProcessBook, and they are not exclusive.

Using the Workbook hierarchy;


Command Buttons within displays.

For example, if you find you work often with a particular display and frequently need to
update a report with the information you have been monitoring, you can add a Button that
automatically will open a spreadsheet program. You also can use a Button to connect to
frequently used displays, other ProcessBook workbooks, or Web sites.

For more information see "Button" in PI ProcessBook User Guide, version


3.2, pp. 123-125.

3.3.5

Exercise Inserting Dynamic Elements into Displays


The following exercise is intended to reinforce key information presented in this
chapter or section. The answers can be found at the end of the exercise.

Objectives

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

Problem Description
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 2 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.
Approach

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 45

PI ProcessBook, PI DataLink, PI WebParts Course


You need to edit the display entry in your ProcessBook display from Exercise 2 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


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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 46

PI ProcessBook, PI DataLink, PI WebParts Course

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 47

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution With Data Favorites


1.
2.

Open the display created in Exercise 2.


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

3.
4.
5.

Enter this Search Mask: BA:* and click on the left green arrow button (
).
Locate the BA:LEVEL.1 tag from the result list and drag and drop it in the Favorites area.
Click on the drop-down list of the Default Symbol of the Data Favorites windows and choose
Value.

6.

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.
7. 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.
8. 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.
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 graphs 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.
9. Move the agitator drawing on the bar graph. Use Arrange > Bring to front option to move the
agitator out from under the bar graph.
10. Add a calculator command button by selecting Draw > Button. In the Define Button dialog box,

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 48

PI ProcessBook, PI DataLink, PI WebParts Course


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.
11. Save your display with the Save as option under the name: Exercise PB4.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 49

PI ProcessBook, PI DataLink, PI WebParts Course

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


1.
2.

Open the display created in Exercise 2.


Insert a level indicator. Select Draw > Value to insert the BA:LEVEL.1 tag value. Write Level (%)
above the value by selection Draw > Text.
3. Add a low and high visual alarm.
By selecting Draw > Ellipse first, draw two small circles, they will be activated to become visual
alarms;

4.

5.
6.

7.

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.
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 graphs 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.
Move the agitator drawing on the bar graph. Use Arrange > Bring to front option to move the
agitator out from under the bar graph.
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.
Save your display with the Save as option under the name: Exercise PB4.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 50

PI ProcessBook, PI DataLink, PI WebParts Course

3.4

Creating Workbooks and Organizing Displays

Objectives

3.4.1

Open workbook entries


Change workbook entry levels in Book or Outline mode
Create a workbook
Introduction (Optional)

There are menu options in ProcessBook such as links and operating system commands that
are easy to miss. In this section we study these and the normal ProcessBook display entries.
Then you will be asked to open displays using different techniques and to create new entries.
A ProcessBook Workbook is a collection of individual displays of data and analysis. It
organizes data from the PI Server and other sources in the same workspace. A ProcessBook
Workbook can organize OS Commands, Hyperlinks to files or URLs, or a linked display. A
Workbook and its displays are stored in a single file (.piw). They are useful because you can
allow easier sharing of displays across the enterprise and manage displays by tasks or by
roles. There are fewer files to manage and they incorporate other needed content.
3.4.2

Open Workbook Entries

The New button opens a display in a new window, and the Open button opens a display in
the last window you viewed.

For more information see "Open a Display" in PI ProcessBook User


Guide, version 3.2, p. 49.

If you double click an entry while in Build mode you will edit the entry instead of opening it.
A common mistake is to confuse the New button with File > New to create a new display.
3.4.3

Change Workbook Entry Levels in Book or Outline Mode

You can choose Book View or Outline View to navigate workbook files. Both views support
a hierarchy of levels that can be modified in build mode.

For more on this topic, see Book View (PI ProcessBook User Guide,
version 3.2, pp. 35-39).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 51

PI ProcessBook, PI DataLink, PI WebParts Course


3.4.4

Create a New Workbook

Consider planning an organizational structure and a naming convention for your ProcessBook
and the entries within it.

For more information see "Create a New ProcessBook" in PI ProcessBook


User Guide, version 3.2, pp. 27-30.

An asterisk (*) beside the name of the file in the title bar means that the document has not
been saved or has been modified since the last save.
The next step in creating a ProcessBook is to add individual entries. By arranging and
combining displays and other entry types, you can create a complete working environment
for plant personnel. You can add the entry titles to the ProcessBook and then complete the
detailed design of the entries later.

3.5

Creating Entries

Objectives

3.5.1

Create text entries


Create display entries
Create linked entries
Create Operating System command entries
Create Text Entries

Text entries provide headings or to provide static information. Useful for organizing PI
ProcessBook documents by adding titles.

For more information see "Create a Text or Display Entry" in PI


ProcessBook User Guide, version 3.2, p. 30.

3.5.2

Create Display Entries

Display entries page that can contain different objects (trends, process mimics, etc.).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 52

PI ProcessBook, PI DataLink, PI WebParts Course

For more information see "Create a Text or Display Entry" in PI


ProcessBook User Guide, version 3.2, p. 30.

3.5.3

Create Linked Entries

Linked ProcessBook entries link to another PI ProcessBook document.


Linked Display entries link with a display, internal or external, to the current PI
ProcessBook. A Linked Display allows you to link a display title in a ProcessBook to an
entry elsewhere in the ProcessBook or in another ProcessBook. This means that you create
and store only one copy of the entry.

For more information see "Linked Display Entry" in PI ProcessBook User


Guide, version 3.2, pp. 30-32.

For more information see "Linked ProcessBook Entries" in PI


ProcessBook User Guide, version 3.2, p. 32.

3.5.4

Create OS (Operating System) Commands

Operating System Command entries open another application. This can be used to launch
external files, applications, and websites. The icon will usually represent the application. If
that icon is not available, the default icon is the running man.

For more information see "Operating System Command Entry" in PI


ProcessBook User Guide, version 3.2, pp. 32-34.

For websites, just enter the URL.


If you are creating several entries, you may wait to save until the last one is entered.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 53

PI ProcessBook, PI DataLink, PI WebParts Course


3.5.5

Group Recap Questions


The following questions are intended to reinforce key information presented in this
chapter or section. The answers can be found at the end of this document.

Questions
1.

When creating a new ProcessBook entry in a workbook, what option needs to be set to display that
entry as a separate tab?

2.

Name the five dynamic elements that can be created in a ProcessBook display.

3.5.6

Exercise Organize Your Displays


The following exercise is intended to reinforce key information presented in this
chapter or section. The answers can be found at the end of the exercise.

Objectives

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 Description
You 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 enterprises IT/IS group.
Approach
Create a ProcessBook file called Exercise PB5.PIW and follow these instructions:

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 54

PI ProcessBook, PI DataLink, PI WebParts Course

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:\windows\system32 directory for Windows
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

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 55

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
A. Create the ProcessBook
1. 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
created earlier.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 56

PI ProcessBook, PI DataLink, PI WebParts Course

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.).
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
All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 57

PI ProcessBook, PI DataLink, PI WebParts Course

F.

ProcessBook file.
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.

G. Modify your PI ProcessBook.


1. 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
2. In Build mode, select View > Outline.
3. 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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 58

PI ProcessBook, PI DataLink, PI WebParts Course

4. ProcessBook: Performance Equation (PE) Syntax


4.1

Performance Equations Basics

Objectives

List the three rules of the PI Performance Equation (PE) syntax


List and be able to find Performance Equation Functions
Explain when to use conversion factors

Note: There is not a specific exercise on these objectives. However, the information from this chapter will
be used in subsequent exercises.

4.1.1

Introduction (Optional)

Performance Equations are special tags in the PI Server that perform calculations using other
PI Tags as the data source and record the calculation results as the values of the Performance
Equation tag. These Performance Equation tags require a specific syntax, known as the
Performance Equation Syntax. This syntax is important because, while it originated with the
Performance Equation tags, it is now used in multiple places. These include ProcessBook
Calculation Datasets, DataLink Expressions, and PI WebParts PI Calculation Datasets. They
are also used in filter expressions, found throughout these client tools.
4.1.2

The Three Rules of Performance Equations

The three rules of Performance Equation Syntax are:

Numbers and mathematical operators are written as is: 10, 0.125, 34.56, +, -, *, /, ^
Tag names and timestamps, whether absolute or combined time format, are written
in single quotes: 'cdt158', 'temp_tank_1', 'FIC5821.PV', *, T+6h, 13-Jun-2009
Strings are written in double quotes: "This is a string"

In many places, the single and double quotes will be automatically filled in for you. This is
most common when using a PI Tag Search window. However, you should always double
check to ensure the proper syntax has been used. Also, when looking at the state of a digital
tag, you will want to use the string value of the tag, not the number from the digital set.
4.1.3

Performance Equation Functions

There is also a rich library of mathematical functions available. These are the typical
mathematical functions like sin(), cos(), log(), exp(), abs(), etc. Aside from the mathematical
functions, there are also many PI functions that apply specifically to PI data. These include
things like:

PctGood() Percent of time tag has good values.


All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 59

PI ProcessBook, PI DataLink, PI WebParts Course

Range() Range of min to max.


StDev() Time-weighted standard deviation.
TagAvg() Time-weighted average.
TagMean() Event-weighted average.
TagMax() Maximum value in period.
TagMin () Minimum value in period.
TagTot() Time integral over a period.

An expression can use If-Then-Else, relational and logical operators.


Syntax: IF expr0 THEN expr1 ELSE expr2
Example: IF 'Tag1' >= 50 AND 'Tag2' < 125 THEN under limit ELSE good
Notes: You must include the IF, THEN and ELSE keywords. The NoOutput() PE function can be used in
the THEN or ELSE clause. It is possible to nest if-then-else expressions.

For a complete list of built-in functions that can be used, consult the
PEReference.chm document. It is available at
http://techsupport.osisoft.com. Search for "performance equations" in the
search box at the upper right of the screen. See the file "PI 3 Performance
Equations Help File" in the search results. You will also find it in
\\pipc\help\pereference.chm.

4.1.4

Conversion Factor and Totalizations

The conversion factor is a multiplier used to change a number from one unit of measure to
another.
Ex: 1000 g per kg, 2.54 cm per inch, 24 hours per day, 1440 minutes per day
Because PI is not aware of engineering units, it assumes that rate tags are in terms of units per
day. Typically, this assumption is inaccurate as many tags are measured in terms of units per
second, units per minute, or units per hour. When using the Total function in Calculated
Data, a conversion factor is used to correct PI's assumption that the data is in units per day.
The conversion factor is equal to 1.0 when the source data are in units per day.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 60

PI ProcessBook, PI DataLink, PI WebParts Course

Rate tag
engineering units
Units / day
Units / hour
Units / minute
Units / second

Assumption of
the PI Server
Units / day
Units / day
Units / day
Units / day

Conversion
Factor
1
24
1440
86400

Example: For a flow measured in gallons per min, a conversion factor of 1440 must be
supplied. This is because the PI server assumes all inputs to totalizations are expressed in
units per day, and 1440 represents the conversion between the actual rate tag (units per
minute) and the rate that PI assumes (units per day). This is independent of the interval of the
proposed totalization. For example, the conversion factor of an 8 hour totalization of a rate
tag measured in of units per minute is still 1440.

Normal total = (3 gpm x 3m) + (5 gpm x 2m) + (1 gpm x 3m) = 22 gallons


PI total = ((3 gallons per day x 3m x 1day/1440m) + (5 gallons per day x 2m x
1day/1440m) + (1 gallon per day x 3m x 1day/1440m)) * 1440m/1d = 22 gallons
The total computed by PI must be multiplied by a factor of 1440
When the calculation mode is Total and part of the archived data within the range is bad, the
reported value is equal to the calculated total value divided by the fraction of the time period
with good archived data. This data normalization is equivalent to the assumption that for the
bad data time range, the tag value takes on the average value of the entire range. However,

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 61

PI ProcessBook, PI DataLink, PI WebParts Course


this assumption may not be valid when a large fraction of the time range contains bad data.
Therefore, we recommend that you always look at the percent good value before using the
calculation result.
Since a conversion factor is after all, just a simple multiplication, you can supply a
conversion factor that does double duty by converting for both the rate and the engineering
units. For example, if the rate tag is in thousands of gallons per minutes and you want the
answer in gallons, not thousands of gallons, then you can use the conversion factor of
1,440,000 (which is simply 1440 * 1000).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 62

PI ProcessBook, PI DataLink, PI WebParts Course

5. ProcessBook: Calculations
Data Sets provide a means of displaying some data that was originally derived from raw
process values or other relational data.
Datasets can be:

A PI Calculation (summary or expression)


ODBC Data
AF Data
AF2 Data

We will only be covering the PI Calculation Data Set, as the other topics are more advanced
and covered in other classes offered by OSIsoft.

5.1

PI Calculations in PI ProcessBook and Performance Equation Syntax

Objectives

5.1.1

Create a PI Calculation using Performance Equation Syntax


Use a PI Calculation in a Trend
Creating PI Calculations

The two types of calculated data sets in PI ProcessBook are PI Summary Data Sets and PI
Expression Data Sets. Go to the Tools>Data Sets to define the PI Calculation you would like
to define.
For more details on this see PI Calculation Data Sets (PI ProcessBook
User's Guide, pp. 164-167).
For step-by-step instructions see Create a PI Calculation Data Set (PI
ProcessBook User's Guide, p. 165)

5.1.2

Using a PI Calculation in a Trend

When you define a dynamic element you can specify a PI Calculation Data Set instead of the
common use of a tag. Just click the drop-down arrow next to the Tag Search button and you
are presented with the PI Calculation Data Sets dialog box. Select a Data Set and the desired
column (calculation).
The Stepped Plot is used for calculations as the default. You normally do not wish to
interpolate between calculations. Tag Name can be typed or searched. Interval is the period
to examine. Sync Time is used to offset from other calculations for timing or load balancing.
Elements which include data from a data set are updated automatically. Many elements of a
ProcessBook can use the same Data Set simultaneously. Different ProcessBooks can include

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 63

PI ProcessBook, PI DataLink, PI WebParts Course


the same Dataset. Modification of a data set will only affect elements of the current
ProcessBook (.PIW) and display (.PDI). It is important to verify which elements use a Data
Set prior to modifying it. The Show Use button of the Data Sets screen shows the list of
elements using a given Data Set.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 64

PI ProcessBook, PI DataLink, PI WebParts Course


5.1.3

Exercise PI Calculation Data Sets


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

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 Description
You 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 Approach
In the ProcessBook file (.piw) you created earlier in the "Organize Your Displays" exercise
above, add a new display entry called Exercise PB7A. 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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 65

PI ProcessBook, PI DataLink, PI WebParts Course

Problem Part B Approach


Two 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'/('CDT158'+'BA:TEMP.1'))*100
Place the trend in a new display entry named Exercise PB7B in the ProcessBook created in
the "Organize Your Displays" exercise above. 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.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 66

PI ProcessBook, PI DataLink, PI WebParts Course

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 67

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution for Part A


1.

Create a new display type entry titled Exercise PB7A in the ProcessBook file you created in the
"Organizing Your Displays" exercise above and open it.
2. Create a data set by following Tools > Data Sets > New > PICalculation.
3. Enter the following parameters in the PI Calculation Data dialog:
Server: select a server
Tag name: CDT158
Name: LEVEL
Description: TANK LEVEL
Interval: 1 h
Synchronization: 00:00:00
Refresh interval: 1 min
Step Plot: yes

4.
5.
6.

Build a new trend named Tank level. Click on PI Calculation from the dropdown menu to select the
traces.
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.
In the Tags in Plot section add the tag CDT158.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 68

PI ProcessBook, PI DataLink, PI WebParts Course

7.

Set the plot time:


Start: *-12h
End: *
8. Set the display and trace formats as you want
and click on the OK button.
9. Save the display and the ProcessBook file.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 69

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution for Part B


1.

First a trend symbol will be added; in the ProcessBook file of the "Organizing Your Displays"
exercise above, create a display type entry named Exercise PB7B and open it.
2. Create a data set by following Tools > Data Sets > New > PICalculation.
3. Enter the following parameters in the PI Calculation Data dialog:
Server: select a server
Expression: ('CDT158'/('CDT158'+'BA:TEMP.1'))*100

Name: PERCENT_PRODA
Description: % Product A
Interval: 30m
Synchronization: 00:00:00
Column: %ProductA
Refresh interval: 1 m
Step Plot: yes

4.
5.

Create a new trend named % Product A. Click on PI Calculation on the dropdown menu.
Choose the data set PERCENT_PRODA 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 the OK button.
8. A tank symbol will be added; draw a tank with two inlet pipes and an outlet one.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 70

PI ProcessBook, PI DataLink, PI WebParts Course


Type the products names and add the CDT158 tag value as product A and the BA:TEMP.1 tag value
as product B.
10. Type %ProductA = at the tanks outlet and add the value and the timestamp of column %ProductA
of the Product A data set.
11. Save the display and the ProcessBook file.
9.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 71

PI ProcessBook, PI DataLink, PI WebParts Course

6. DataLink: Current and Archived Data


6.1

Introduction and Installation

Objectives:

6.1.1

Determine when it is necessary to install the add-in in Excel and where it is located
Introduction (Optional)

PI DataLink is an OSIsoft add-in for Microsoft Excel. This lets you import data from the PI
System into a spreadsheet. As the name implies, it provides a link between the PI Server and
spreadsheet programs on Microsoft Windows platforms. DataLink allows a user running
Microsoft Excel or Lotus 1-2-3 can exchange information directly with the PI System.

For more information see "Introduction" in PI DataLink User Guide,


version 4.1, pp. 1.

6.1.2

DataLink Installation

It is also important to note that PI DataLink is an add-in for Excel. For versions of DataLink
3.X and less, this means that even after installing the PI DataLink software, you must still
locate the add-in and manually add it in to Excel. The add-in is located in \\PIPC\Excel.
By default, the PIPC directory is in Program Files, but this is customizable, so you will need
to know where it is on each machine. For versions 4.X and later with Excel 2007 and later,
the add-in is automatically installed during the installation process.

For more information see "Configuration" in PI DataLink User Guide,


version 4.1, pp. 4-5.

6.2

DataLink Settings and Time Formats

Objectives

Find your settings and set them to your desired preferences


Perform a manual refresh of the data
Describe Excel time format and choose between it and PI time format

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 73

PI ProcessBook, PI DataLink, PI WebParts Course


6.2.1

DataLink Settings

The DataLink settings affect how your data is displayed and refreshed. It is important to
know how you have configured your settings to appropriately understand what information
DataLink is giving you.
You can change all of the settings for DataLink by going to the Settings icon in the
Resources section of the PI Ribbon.

1.
2.
3.
4.

Sets how tags selected in the Tag Search dialog window are copied onto the spreadsheet: Columns
(default) or Rows
Sets various display functions within PI DataLink reports. None are used by default.
Sets the Number and Time formats used by PI DataLink.
Sets the method and Interval for the Automatic Update function.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 74

PI ProcessBook, PI DataLink, PI WebParts Course

Note 1: The Calculate option means that values are only recalculated for DataLink functions that
reference Excel time functions and not times in PI time format. The Full Calculate option must be used
to recalculate both DataLink functions based on Excel time functions and on PI time format.
Note 2: The default of 0 for the Interval is considered Auto, which is a 5 second interval.
By default, PI DataLink does not automatically update as new PI data is available in the
Snapshot. With PI DataLink version 4.1, there is a new Automatic Update toggle button on
the PI Ribbon (or choose Update from the PI Menu in Excel 2003) that can be configured to
use either Calculate, which uses Excel Time functions, or Full Calculate, which uses PI
Time functions.
There are also several helpful tricks for each section on the PI Ribbon. You can hover the
mouse over a function to cause a tooltip description to appear.
If you need more assistance, there is DataLink Help documentation available from the Help
icon in the Resources section. Many of the functions have a small triangle near them, which
expands a menu to give you preset functions with specific points in time for you to query.
Just click on one of the desired options to use it.

For more information see "Preference Settings" in PI DataLink User


Guide, version 4.1, pp. 22-24.

6.2.2

Refreshing your Queries

By default, each DataLink query is performed on demand. This means that unlike
ProcessBook, your Excel spreadsheet will not be updated automatically as new snapshot
values are sent to the PI Server. As discussed above, one way to enable automatic refreshes is
through the Automatic Update button.
You can also perform a manual, one time, on-demand refresh of the data. This can be
accomplished in several ways. If you want to perform the Calculate function, as described
above, you can simply hit the F9 key. To do a Full Calculate, as described above, you will
need to hit Ctrl+Shift+Alt+F9 keys simultaneously.
6.2.3

DataLink Versus Excel Time

Because PI DataLink is a set of additional functions within Microsoft Excel, DataLink


queries can use either the PI Time format of using absolute and combined times, or it can use
the Excel time format, which is itself a set of functions. Most people who are familiar with
the PI Time format find it easier to use it in these queries and calculations, but many people
in an organization are not necessarily familiar with this time format, and thus use the Excel

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 75

PI ProcessBook, PI DataLink, PI WebParts Course


Time format. Any time that can be expressed in the PI Time format can also be expressed in
the Excel time format. For example:
Excel Time
=TODAY()
=Today() 1
=NOW()
=Now() - 3/24

PI Time
T
Y
*
*-3h

Time signified
Today at 00:00:00
Yesterday at 00:00:00
Now
3 hours ago

Note: These Excel functions are in units per day.

There are two other tools that should look familiar from the Common Dialogs section
previously discussed. The first is the PI Connection Manager dialog window. This can be
opened from the Connections icon in the Tools section of the PI Ribbon. As previously
described, this is how you manage your connection(s) to your PI Server(s). The second is the
Tag Search dialog window. This is found from the Tag Search icon in the Tools section of
the PI Ribbon. This tool returns a list of tags that you found during your search. This is
useful to use to retrieve a list of tag names for cell references for later PI DataLink queries.

For more information see "PI Server Connections" in PI DataLink User


Guide, version 4.1, pp. 12-13.

OSIsoft recommends that it is best practice to build your spreadsheet using references to cells
for the Tag Name, Start Time and End Time and any other desired parameters. This allows
you to change your functions easily and see how the PI data or calculations change
accordingly.

For more information see "Spreadsheet Construction" in PI DataLink User


Guide, version 3.2, pp. 81-84.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 76

PI ProcessBook, PI DataLink, PI WebParts Course


6.2.4

Directed Exercise PI and Excel Times


You are invited to watch what the instructor is doing or perform the same steps at the
same time to explore the different concepts presented in this chapter or section.

Problem Description
Fill in the table converting the desired times into PI and Excel times
Approach

6.3

Simple DataLink Queries

Objectives

Obtain a current value for a tag


Obtain an archived value for a tag
Describe the different retrieval modes
Retrieve Tag Attributes

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 77

PI ProcessBook, PI DataLink, PI WebParts Course


6.3.1

Obtain a Current Value

The first DataLink function we will discuss is the Current Value (=PICurrVal). This function
retrieves the Snapshot value for a tag. No timestamp is provided to the query, as it is always
assumed to be now (* in PI time or =NOW() in Excel time). When you click the Current
Value icon in the Single Value section of the PI Ribbon (or select it from the menu in older
versions of PI DataLink), a configuration pane opens.
You can retrieve PI data from any PI Server currently connected to your client machine. The
server chosen is the one designated as your default in the PI Connections Manager.
You can, and it is recommend to, use cell references within your DataLink queries. This can
be quite useful for building a single display that easily transitions between sets of data for
various tags, time ranges, filter expressions, and much more.
For the Current Value query, you will need to provide it with the PI Server name and the
Tagname. You must specify the Output Cell where you would like the PI data to be written
in the spreadsheet. Below this Output Cell designation are radio buttons that allow you to
choose if and how the timestamp is displayed. The default is for no timestamp to be shown.
It is a common error to accidentally mix up cell references within a DataLink query in the
configuration pane. Typically, it is easiest to select the desired output cell first, and then open
the configuration pane from the PI Ribbon. Once in the configuration pane, deliberately select
all cell references to be used.

For more information see "Current Value" in PI DataLink User Guide,


version 4.1, pp. 27-28.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 78

PI ProcessBook, PI DataLink, PI WebParts Course


6.3.2

Obtain an Archive Value

The other DataLink function that returns a single value is the Archive Value (=PIArcVal).
This function retrieves an archived value at a specific timestamp.
Similar to the Current Value function, this function requires you to set the PI Server,
Tagname, and Output Cell, and timestamp location. You must additionally, however,
provide a Timestamp in the past. This timestamp may either be in Excel time or PI time, and
additionally may be a cell reference to a cell containing either of those.
The one additional piece of information required is the Retrieval Mode, which prompts a
discussion of those modes.

6.3.3

Retrieval Mode

When you request a value from the PI Archive, there are several options for how it is returned
to you. The first is Exact Time. This will only retrieve a value from the PI archive for the
specified time if and only if an archived value exists at that exact time.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 79

PI ProcessBook, PI DataLink, PI WebParts Course


Previous and Next retrieves, respectively, the previous or next compressed event from the
timestamp specified. If a compressed event does exist at the exact timestamp, it is retrieved.
The Previous Only and Next Only retrieval modes will retrieve the same compressed events,
except if there is a compressed event at that exact timestamp. In this case, it is ignored and
the previous or next compressed event is retrieved.
The two remaining options are Interpolated and Auto. These two retrieval modes behave
very similarly. The Interpolated retrieval mode behaves as you would expect and
interpolates a value at the exact timestamp you specified, with an error margin based on your
compression settings for that tag.
The Auto retrieval mode, which is the default, has the exact same behavior for any tag in
which the Step attribute is turned to Off. When the Step attribute is turned to On, then the
retrieval mode behaves as the Previous retrieval mode. The graphic below demonstrates the
difference in the Auto retrieval mode based on the Step function being On or Off.

For more information see "Archive Value" in PI DataLink User Guide,


version 4.1, pp. 27-28.

6.3.4

Obtaining Tag Attributes

Because it is possible to retrieve interpolated values, it is important to know the Exception


and Compression attributes for the tag(s) you have retrieved. It is possible to retrieve these
attributes, and any other attributes, for a tag using the Tag Attributes function (=PITagAtt).
The Tag Attributes function is in the Tag Information section of the PI Ribbon. Like the
other DataLink functions discussed, you must specify a PI Server and the tag(s), or cell
references to this information. You must then select the Tag Attribute you would like to
retrieve, or a cell reference with the Tag Attribute listed. Then specify the Output Cell.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 80

PI ProcessBook, PI DataLink, PI WebParts Course

For more information see "Tag Attributes" in PI DataLink User Guide,


version 4.1, pp. 45.

6.3.5

Exercise Activity Report


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective
Learn to extract values and attributes from the PI database using the following functions:

Current value;
Archive value;
Tag attributes.

Problem Description
You need to build a basic activity report using data collected in your PI Server. You want this
type of report to show values from the production plant floor before morning meetings. This
report will show current values and ones from a specified time every morning.
Approach
We will use the Current Value, Archive Value and Tag Attributes queries to fill in a
template activity report. We should base our PI DataLink queries on cell references whenever
possible. Open the file Exercise_DL1_Template.xls and fill in data into all of the fields.
Note: Not all of the tags used in this example have engineering units.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 81

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.

Open the file Exercise_DL1_Template.xls.


Select on the cell B7.
On the Ribbon, click on PI > Tag Attributes.
In the task pane click in the Tagname(s) field.
Click and drag through cells A7 through A11 to select the cell range.
In the Attributes drop-down select descriptor.
Click on the OK button.
Select the cell C7.
Repeat Steps 3 7 instead selecting engunits in the Attributes drop-down.
Select on the cell D7.
On the Ribbon, click on PI > Current Value.
In the task pane click in the Tagname(s) field.
Click and drag through cells A7 through A11 to select the cell range.
Select the time at left radio button.
Click on the OK button.
Select on the cell B19.
On the Ribbon, click on PI > Archive Value (not on the drop down menu).
In the task pane click in the Tagname(s) field.
Click and drag through cells A19 through A23 to select the cell range.
In the task pane click in the Timestamp field.
Select the cell D14.
In the Retrieval Mode drop down list select
interpolated.

23. Select the time at left radio button.


24. Click on the OK button.
25. Repeat steps 17 24 for the columns to the
right, changing the Retrieval Mode to the
appropriate selection from the heading (e.g.,
change the Retrieval Mode drop down list to
previous for the Previous column, etc.).

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 82

PI ProcessBook, PI DataLink, PI WebParts Course

Note 1: Notice that you can use the PI Datalink functions without the dialog box. Simply type in the
formulas as follows:
Tag attribute:
Syntax

=PITagAtt("tagname","NameOfAttributeYouWant","PIServer")

Example

=PITagAtt($A$7,"descriptor",)or =PITagAtt("sinusoid","units",)

Current Value:
Syntax

=PICurrVal("tagname",Outcode, "PIServer")

Example

=PICurrVal($A$7,1,)

Archive value:
Syntax

=PIArcVal("tagname","Date",Outcode, "PIServer", Mode)

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 83

PI ProcessBook, PI DataLink, PI WebParts Course

Where Mode = "interpolated" or "previous" or "next"


Example

=PIArcVal($A$7,$D$13,1,, "Interpolated")

Exact Time Value:


Syntax

=PIExTimeVal("tagname","Date","PIServer")

Example

=PIExTimeVal($A$7,$H$25,)

Note 2: We have seen that it is possible to enter a formula by entering one tag at a time. However, it is
possible to save time by selecting a range of cells instead of a single cell or using the copy/paste function
of MS Excel. You must edit the formula and remove any unnecessary $ characters (absolute cell
references) before using MS Excel copy/paste function.
Note 3: Note the impact of the point type and step attributes when you use archive value. For digital tags,
the interpolated and previous values are equal and have the same timestamp because no interpolation is
possible between states.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 84

PI ProcessBook, PI DataLink, PI WebParts Course

6.4

Multiple Value DataLink Queries

Objectives

Retrieve Compressed Data for a tag


Retrieve Sampled Data for a tag
Retrieve Timed Data for a tag

There are three types of queries you can perform to return multiple values. They are
Compressed Data, Sampled Data, and Timed Data.
Compressed Data returns all of the values that were actually archived during the specified
time range. This means that you will only retrieve the events that passed Exception and
Compression Testing. If an event was filtered out due to these tests, you will not see them.
You can include the current value in your query, which will not have gone through
Compression.
Sampled Data retrieves values evenly spaced in time. These values are interpolated from the
archived values. As such, you may miss maxima and minima in your overall trends, but each
data point is a valid interpolation (or exact match) of your actual trend at that timestamp. See
the graphic below for a clearer picture.
Finally, there is Timed Data, which retrieves interpolated (or exact match) events that match
a series of timestamps. This is most often used when comparing the Compressed Data of
one tag with the Timed Data values of another tag to determine correlation between
variables.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 85

PI ProcessBook, PI DataLink, PI WebParts Course


6.4.1

Retrieving Compressed Data

The Compressed Data function (=PICompDat) is in the Multiple Values section of the PI
Ribbon. There are two different ways to query for information. You can either choose a
Time Range, or a Number of Values. To choose between these two, there is a radio button.
The default selection is Time Range.
As should be expected, you must specify the PI Server and Tag(s), either explicitly or by
cell reference. You must then provide the Start Time and End Time.
Note: If you switch the timestamps for Start and End Times, the data will be returned in reverse order.
The next field is optional and is the Filter field. We will return to this field later. There is an
associated check box that will show or hide the filtered data zone(s).
The next drop down menu is how to treat data at the beginning and end of the time range.
Similar to the options for retrieving a single archived point, retrieving multiple values can be
obtained differently. These differences, however, occur only at the boundaries.
The default choice is Inside, and will retrieve events that only fall within the specified time
range.
Outside will retrieve all of the events inside the time range specified, plus one more event
before and after, respectively, of the time range specified. The exception is if the end time
specified is now (* or =NOW()), then no future events can be retrieved.
Interpolated will return compressed events within the time range specified, plus an
interpolated event at the exact timestamps of the start and end time specified. As before, Auto
has the same behavior as Interpolated for all tags with the Step attribute turned Off, but will
retrieve data with the behavior of Inside for all tags with Step turned On. You then need to
specify an Output Cell.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 86

PI ProcessBook, PI DataLink, PI WebParts Course

There are several optional checkboxes that will affect what is displayed, none of which are
selected by default. The first is Hide Count. When this box is unchecked, the top line of your
results will return the number of events that were found within that time range. When this box
is checked, this line is not displayed and only the results are shown.
The Timestamps checkbox determines if only the tag values are returned, or if the
corresponding timestamp is also retrieved.
Quality bits and annotations will return additional fields if there are any annotations or
quality bits associated with the compressed events within the time range specified.
Finally, there is a pair of radio buttons that determine if the results are returned in rows or
columns.
The Number of Values option for this query behaves similarly, but rather than a specific
time range, you will specify a Start Time and the Number of Values that you would like to
retrieve. You can also check the box to have this go backwards, rather than forwards in time.

For more information see "Compressed Data" in PI DataLink User Guide,


version 4.1, pp. 29-31.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 87

PI ProcessBook, PI DataLink, PI WebParts Course


6.4.2

Obtaining Sampled Data

Sampled Data (=PISampDat) is also found in the Multiple Values section of the PI Ribbon.
As stated before, this function retrieves evenly spaced interpolated values from the archive.
Much like the Compressed Data query, you must specify PI Server, Tag(s), Start Time,
End Time, and Output Cell. You have the optional parameters of a Filter Expression (to be
covered later) and timestamp display.
The main difference is the Time Interval field. This field requires a PI time, or cell
reference, that will be used to divide the time range you specified into discreet timestamps at
which data events will be interpolated.

For more information see "Sampled Data" in PI DataLink User Guide,


version 4.1, pp. 32-33.

6.4.3

Timed Data

The final Multiple Value query is the Timed Data function (=PITimeDat), which is also in
the Multiple Values section of the PI Ribbon. This function retrieves sampled data
synchronized with an array of time values.
Again the PI Server, Tag name, Data retrieval mode, and Output Cell must be specified.
In this case, the times used to retrieve events must be a range of cells, rather than a hardcoded
time. This is typically done by querying one tag for events, and then using those timestamps
to find the values for other, related tags.

For more information see "Timed Data" in PI DataLink User Guide,


version 4.1, pp. 33-34.

6.5

Arrays in PI DataLink

Objectives

6.5.1

Identify when it is necessary to resize an array


List the ways to resize and edit an array
When to Resize an Array

The Multiple Value functions just discussed actually return an array of values and
timestamps. These values can change in size based on the tag used, the time range specified,
and exception and compression settings. Therefore, it can be necessary to resize the array.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 88

PI ProcessBook, PI DataLink, PI WebParts Course


There are two signs that you should resize the array. First, if you have too few values in the
array and you have the Display #N/A instead of Blanks option checked in your Settings,
then you will see the appropriate rows and columns displaying the #N/A message. If you
have too many values, you will receive the message Resize to show all values at the
bottom of the array.
Because the Display #N/A instead of Blanks option is not checked by default, it is a
common problem of being unaware of the need to resize your array. This often results in
users attempting to perform new queries or calculations in cells that are believed to be blank.
Excel, however, still considers these to be part of an array, and as such, has locked these cells
and makes them unable to be edited.
6.5.2

How to Resize an Array

If you need to resize the array, there are three options available. First, you can manually
resize the array by selecting the new cell range for the array and pressing F2. Then pressing
CTRL+SHIFT+ENTER simultaneously. The key combination of CTRL+SHIFT+ENTER will
also allow you to edit the values of the array, which you normally cannot do in Excel.
Another method to resize the array is via the dialog window. You should right-click on a cell
in the array, select the name of the function in the contextual menu, do the modifications in
the dialog window, and then click on OK.
Finally, you can right-click on a cell in the array and select the Recalculate (Resize) PIDL
Formula option.

For more information see "Array Management" in PI DataLink User


Guide, version 4.1, pp. 54-55.

6.5.3

Group Recap Questions


The following questions are intended to reinforce key information presented in this
chapter or section. The answers can be found after the questions.

Questions
1.

What is the advantage of having PI DataLink reports using cell references containing Excel
dynamic time functions instead of PI time?

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 89

PI ProcessBook, PI DataLink, PI WebParts Course

2.

What are the three ways to resize an Excel array generated with a PI DataLink function?

3.

Using one of the Compressed Data functions, what additional information will be provided if the
Show Value Attributes and Show Annotations options are checked?

6.5.4

Exercise Operational Start Up


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Learn to retrieve process data using the Compressed Data function.

Problem Description
You need to compare the values stored in the PI Server that relate to the startup of a piece of
equipment in your facility. You want to determine if there is any deviation between startup
operations by examining today and comparing it to the same time period from the day before.
The tag you want to use as a metric is CDT158. Your shift begins at 6:30 am in the morning
and you want to gather the first 30 values beginning at that time for today and yesterday, and
do some quick math to determine the deviation. A ten percent deviation in a positive or
negative direction will be considered over / under range. All other outcomes will be
considered nominal.
Approach
We need to create a spreadsheet that will show the first 30 values today using the tag
CDT158. We want to compare these values to the previous days starting 30 values. Open the
file Exercise_DL2_Template.xls and fill in data into all of the fields. Both queries are using
the Compressed Data (Start Time / Number) query. Use cell references for all of the dialog
box fields. The formulas used to compare the two queries are found in the upper right portion
of the spreadsheet. They both have a single quote inserted before the equal sign so MS Excel
will treat them as strings and not formulas. You can copy and paste the contents and then
remove the leading single quotes.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 90

PI ProcessBook, PI DataLink, PI WebParts Course

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 91

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

19.
20.
21.
22.

Open the file Exercise_DL2_Template.xls.


Select cell A10.
On the Ribbon, Click PI > Compressed Data.
In the task pane select the Number of Values radio
button.
In the task pane click in the Tagname(s) field.
Click on cell B3.
In the task pane click in the Start Time field.
Click on cell B5.
In the task pane click in the Number of Values field.
Click on cell B6.
In the task pane select the Show Timestamps check box.
Click on the OK button.
Select on cell D10.
Repeat steps 4-13 but modify the Start Time field for the
todays start time (cell B4).
Select cell K3.
In the Formula Bar select all except the single quote at
the beginning of the expression.
Paste the expression without the single quote into cell
G10.
Propagate the result down to cell G39 by dragging the cell
by the lower-right corner (cursor will change to a black
cross).
Select on cell K6.
In the Formula Bar select all, except the single quote at
the beginning of the expression.
Paste the expression without the single quote into cell
I10.
Propagate the result down to cell I39 by dragging the
cells handle at the lower-right corner.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 92

PI ProcessBook, PI DataLink, PI WebParts Course

7. DataLink: Calculated and Filtered Data


7.1

Graphical Data in DataLink

Objective

7.1.1

Insert and configure a PI Trend with Excel data and PI data


Insert a Trend

You can create trends similar to ProcessBook Trends in your DataLink reports. These Trends
can be based on PI Data and/or Data from the Worksheet. These Trends have the option to
update automatically. You can also modify scales and appearance and zoom in a part of the
trend in much the same way you can within ProcessBook.
The Trend Control is an ActiveX control that can be inserted onto any Excel spreadsheet. To
insert a Trend, select the Trend icon in the Tools section of the PI Ribbon. A trend wizard is
provided to make inserting trends easier, which allows you to define the data source(s) and
how they are displayed. There are two sources of data that the Trend Control can plot:
Worksheet Data and PI Data.
Note: Because the Trend is an ActiveX control, it cannot be displayed through DataLink for Excel
Services. All other DataLink functionality will work. We will cover this in greater detail later.
To use Worksheet Data, you must specify the cell range of the data by typing it manually or
selecting it with the mouse. For ease of use with PI DataLink functions, the Include all cells
in array option is specified as the default, in which case you need choose only one cell of the
array. The Stepped option plots the data in a stepwise manner, much as the Step attribute for
a point.
To use PI Data, you must specify the tag name by typing it manually, searching for it using
the Search button, or using a reference to a cell. You then click on the Add button. The
last screen of the Trend Wizard is to configure the trend title and the placement of the trend.
If a new worksheet is selected, the trend is placed on a blank worksheet at the top left corner.
If the existing worksheet option is specified, then the cell where the trend is to be placed must
be specified.
Quick changes can be made to the trend by selecting some of the items on the right-click
menu. The right-click menu allows the user to temporarily modify the scales and the time
frame, revert to the original scales and time frame, permanently modify the scales and the
time frame, add a scroll bar for the time frame, add markers, change the trend's appearance,
add or remove traces, and delete, move, or resize the trend. Using the Change Scale item
allows you to change both trend time range and Y-axis scale. If a change in the scale is
deemed undesirable, the Revert option can be selected to undo the changes made. The
Revert option always reverts back to the settings defined in the Trend Wizard.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 93

PI ProcessBook, PI DataLink, PI WebParts Course


To scroll through time, scroll bars can be enabled with the Scroll Bar option. The scroll bar
appears at the bottom of the trend. Again, the Revert option can be used to undo changes
made by the scroll bar.
To change the format of the trace or the trend itself, use the Format option. For instance,
this option can be used to change the color or line thickness of a trace. Also it can be used to
add legends to the trend. Define Trend and Define Trend Time Range bring back the
Trend Wizard screens.

For more information see "Create a Trend" in PI DataLink User Guide,


version 4.1, pp. 57-63.

7.1.2

Exercise Tank Level


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Learn to use the Insert Trend function with data from MS Excel worksheet and PI
data.

Problem Description
You have some production limit specifications and you want to be able to see how the
previous days production measured up against those limits. The production tag you need to
use is CDT158 and the limits are as follows:
Upper Limit

225

Target Rate

150

Lower Limit

75

Approach

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 94

PI ProcessBook, PI DataLink, PI WebParts Course


Use a PI Trend in MS Excel to display real-time data alongside MS Excel data. We could use
MS Excels graphing capability. However, we would not be able to automatically refresh the
graph. Open up Exercise_DL3_Template.xls and use this template to construct the desired
comparison trend.
(Option) Use the Export option on the trend to export the timestamps and values of the trend
to cell J2.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 95

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.

Open the file


Exercise_DL3_Template.xls.
Select cell B7.
On the Ribbon, Click PI > Insert
Trend.
Select the Data from PI radio
button.
Select cells C2 for the Tag name
field.
Click on the Add -> button; it will
add the tag data to the trend.

7.

Select the Data on worksheet


radio button.
8. Select the First element is trace
name check box.
9. In the Cell range containing data
field, select the cell range
containing the data (dates, limit
names and limit values). Click on
the Add-> button.
10. Click on the Next button.
11. For the Start time and End time,

12.
13.
14.
15.
16.
17.

click on the ( ) button and


select cells C4 and C5,
respectively.
Click on the Next button.
Click on the Finish button.
Right-click on the trend object.
Select Export Data from the contextual menu.
In the dialog box select cell J2.
Check the Use Trace Name as heading check box.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 96

PI ProcessBook, PI DataLink, PI WebParts Course

18. Click on the OK button.


19. The result should look similarly to the figure below.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 97

PI ProcessBook, PI DataLink, PI WebParts Course

7.2

Calculations Within DataLink

Objectives

7.2.1

Obtain calculated values


Obtain filtered values
Use Excel conditional formatting to improve DataLink report functionality
Calculated Data

The Calculated Data function (=PIAdvCalcDat) returns a single calculated value or evenly
spaced calculated values from the PI Server. Calculation modes are: Total (time-weighted),
Minimum, Maximum, Standard deviation (time-weighted), Range, Average (time
weighted), Mean (non-time-weighted).
To retrieve a single calculated value, do not specify an interval and the PIAdvCalcVal()
function is used. To retrieve evenly spaced calculated data, the specified interval, in relative
PI Time format, determines the spacing of the calculation and the PIAdvCalcDat() function is
used.
You must supply the PI Server name or cell reference, Tag name or cell reference(s) to a list
of tags, and the Start and End Times for the calculation.
The Time Interval is optional and refers to how often the calculation will be performed.
When a Time Interval is specified, the show start time and show end time options become
available. If no Time Interval is specified, the calculation will only be performed once over
the specified time range. The Conversion Factor is typically only applicable to the Total
calculation mode and will be discussed in further detail below.
Check show pctgood if you want DataLink to display the percentage of the time range that
contains good values. We recommend that you always look at the percent good value before
using the calculation result. The percent good value is normally returned to the right of
calculated value cell. Timestamp(s) are returned when the calculation mode is Minimum,
Maximum, or Range.

For more information see "Calculated Data" in PI DataLink User Guide,


version 4.1, pp. 35-39.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 98

PI ProcessBook, PI DataLink, PI WebParts Course


7.2.2

Exercise Daily Production


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Learn to extract calculated values using Calculated Data function.

Problem Description
You are the production manager and want to create a report showing last weeks daily
production totals. In this report, you want to display the total production, average, minimum
and maximum and standard deviation for that week. Also, you would like to present this data
on a daily basis.
Approach
We will use the built-in PI Calculated Data functions to show the above statistics for the
entire week (using no time interval) and each day of the week (using a time interval of 24h).
Use the file Exercise_DL4_Template.xls to organize and display this data.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 99

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Open the file Exercise_DL4_Template.xls.


Select cell B16.
On the Ribbon, Click PI > Calculated Data.
Make sure the PI Tag radio button is selected near the top of the task pane.
In the task pane click in the Tagname(s) field.
Click on cell B3.
In the task pane click in the Start Time field.
Click on cell B4.
In the task pane click in the End Time field.
Click on cell B5.
In the Calculation Mode drop-down select total.

12. Enter 1440 in the Conversion Factor field for the total calculation mode only. For all other
calculation modes leave this field to one or 1.
13. Click on the OK button.
14. Repeat steps 3-14 for columns C through G using the appropriate selection for Calculation Mode
(e.g., select Average in column C). When you get to column G, make sure the show percent good
check box is checked.

15.
16.
17.
18.

Select cell A20.


On the Ribbon, Click PI > Calculated Data.
In the task pane make sure the PI Tag radio button is selected.
In the task pane click in the Tagname(s) field.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 100

PI ProcessBook, PI DataLink, PI WebParts Course


Click on cell B3.
In the task pane click in the Start Time field.
Click on cell B4.
In the task pane click in the End Time field.
Click on cell B5.
In the task pane click in the Time Interval (optional) field.
Click on cell B7.
In the Calculation Mode drop-down select total.
Enter 1440 in the Conversion Factor field for the total calculation mode only. For all other
calculation modes leave this field to one or 1.
28. For column A only, check the show end time check box to fill the Time stamp column.
29. Click on the OK button.
30. Repeat steps 16-30 for columns C through G using the appropriate selection for Calculation Mode
(e.g., select Average in column C). When you get to column G, check the show percent good check
box to fill the Pct Good column.
19.
20.
21.
22.
23.
24.
25.
26.
27.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 101

PI ProcessBook, PI DataLink, PI WebParts Course


7.2.3

Filtered Data

We now revisit the Multiple Value functions that we previously discussed, but now we will
include filter expressions. Before, these fields were optional. Now we will discuss how they
work. The functions are for Compressed Data (=PICompFilDat or =PINCompFilDat) and
Sampled Data (=PISampFilDat).
Filtered Compressed Data
This function returns compressed values from the PI Server based on a start time and an end
time. The number of data points retrieved for the given time period is returned in the first cell.
If the time range option is chosen and a filter expression is not specified, the PICompDat()
function is called. Otherwise, the PICompFilDat() function is called. If the number of values
option is chosen and a filter expression is not specified, the PINCompDat() function is called.
Otherwise, the PINCompFilDat() function is called.
If a filter expression is specified, the specified range of compressed values are retrieved from
the PI Server while a given filter expression is True. If the Mark as filtered option is
selected, a Filtered status is returned for each group of values that does not satisfy the filter
expression.
Filtered Sampled Data
This function gathers evenly spaced, sampled values from the archive. If a filter expression is
not specified, the PISampDat() function is called. Otherwise, the PISampFilDat() function is
called.
If a filter expression is specified, the specified range of compressed values are retrieved from
the PI Server while a given filter expression is True. If the Mark as filtered option is
selected, a Filtered status is returned for each group of values that does not satisfy the filter
expression.
Note: When using a cell reference for your Filter Expression, be sure that if the Filter Expression begins
with a timestamp or tag name that you use two single quotes. The first single quote is used in Excel to
identify a text string, rather than a value, and will not be seen by the filter expression.

For more information see "Time Filtered Data" in PI DataLink User


Guide, version 4.1, pp. 39-40.

7.2.4

Excel Conditional Formatting

This topic is not specific to PI DataLink, but the Conditional Formatting found in Excel
2007 can give your DataLink reports a great look and a comprehensive perspective. It is
useful to compare values extracted from PI. Conditional Formatting is found in the Home

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 102

PI ProcessBook, PI DataLink, PI WebParts Course


Ribbon in the Styles section. You can use this functionality to provide highlighted maxima
or minima, bar graph backgrounds, and many other visual cues as to the data being displayed.
7.2.5

Exercise Production Level Report


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objectives

Learn to use the Filter Expression option of the Sampled Data function to
constrain the values that are extracted.
Combine PI values with Excel conditional formatting for more intuitive reports.

Problem Description
As a quality control manager, you want to examine the tank level of product over the last 12
hours for a tag that does not report many values due to its lack of volatility, and thus it has a
high compression rate on the PI Sever. Since there are only a few values passing through the
compression test, it is better to perform a Sampled Data query rather than a Compressed
Data query.
The tag you will use is SINUSOID. You want to build a report that will filter out mean tank
levels, which is defined as a level between 30 and 80. You want to use red conditional
formatting to know when the tank is in danger of overflowing, defined as the highest 10% of
values. You are also interested in the times of low product level, defined as the lowest 20% of
values, which should be highlighted in green. For all values returned, data bars should be
used to visually show the overall level of the product in the tank. Then change the upper and
lower limits to 75 and 25, respectively, to test your report.
Approach
Use PI Datalinks Sampled Data function to get evenly spaced data. Since we only want to
see data that are outside of the norm, we will apply filters to show high values, low values,
and a list including both. Use the file Exercise_DL5_Template.xlsx as a template to design
this report.
Note: The MS Excel Today() function returns the serial number of the current date. The serial number is
the date-time code used by Microsoft Excel for date and time calculations. Microsoft Excel stores dates as
whole number of days starting at 1900. Dates and times are values and therefore can be added, subtracted,
and included in other calculations.
Syntax:

=TODAY()

Example:

=(Today() 10 + 16/24) is today minus 10 days at 4 PM

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 103

PI ProcessBook, PI DataLink, PI WebParts Course

When you enter a date in Microsoft Excel 97 and you enter only two digits for the year, Microsoft Excel
enters the year as follows: The years 2000 through 2029 if you type 00 through 29 for the year. For
example, if you type 5/28/19, Microsoft Excel assumes the date is May 28, 2019.The years 1930 through
1999 if you type 30 through 99 for the year. For example, if you type 5/28/91, Microsoft Excel assumes
the date is May 28, 1991.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 104

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.

Open the file Exercise_DL5_Template.xlsx.


Select cell A12.
On the Ribbon, Click PI > Sampled Data.
In the task pane, make sure the PI Tag radio button is selected.
In the task pane, click in the Tagname(s) field.
Click on cell B4.
In the task pane, click in the Start Time field.
Click on cell B5.
In the task pane, click in the End Time field.
Click on cell B6.
In the task pane, click in the Time Interval field.
Click on cell B7.
In the task pane, click in the Expression Filter field.
Click on cell B10.
Check the mark as filtered check box.
Check the show timestamps check box.
Click on the OK button.
Select all of the cells that contain data in column B.
On the Ribbon, Click Home > Conditional Formatting > Data Bars > Blue Data Bar. You should
have a data area scaled with blue bars.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 105

PI ProcessBook, PI DataLink, PI WebParts Course


20. Click on Conditional Formatting >
Top/Bottom Rules > Top 10%...
21. Click on the OK button.
22. Click on Conditional Formatting >
Top/Bottom Rules > Bottom
10%...
23. Change the number to 20%.
24. Click on the OK button.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 106

PI ProcessBook, PI DataLink, PI WebParts Course

7.3

Expression Data

Objectives

7.3.1

Obtain PI Expressions Values and Summaries


Obtain PI Expressions Values and Summaries

PI Expressions behave much the same way that PI Performance Equations do. They follow
the same expression syntax and can use one or many PI Tags as the data source(s). The
benefit to PI Expressions is that they only calculate on demand. However, the downside is
that, unlike Performance Equations, there is no history of these calculations stored on the PI
Server, so it is more difficult to see historical trends.
There are a number of options available for calculating expressions that contain tags.
Expression calculations can be performed for one specific time in the past using the Archive
Value function (=PIExpVal), for evenly spaced data using the Sampled Data function
(PIExpDat), or for a specific list of timestamps using the Timed Data function
(=PITimeExpDat). Expression calculations can also be performed to obtain statistics or totals
on an expression using the Advanced Calculated Data function.
The difference between PI Calculated Data and PI Expressions is shown in an example
below. The PI Calculated Data computes the maximum of the tag over each 24 hour period
for the last 168 hours (7 days). The PI Expression computes the maximum of the tag for the
most recent 8 hours, every 24 hour period for the last 168 hours (7 days). The format for this
expression would be: TagMax(tag,'*-8h','*') with 1 day interval. If the time interval in the PI
Expression is changed to 1 day, the results of both expressions would be identical.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 107

PI ProcessBook, PI DataLink, PI WebParts Course

For more information see "PI Expressions" in PI DataLink User Guide,


version 4.1, pp. 75-82.

7.3.2

Exercise Expression Calculation


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objectives

Learn to carry out a calculation for the current value of an expression;


Use MS Excels Conditional Formatting to make your PI Data Link reports more
useful.

Problem Description
As a Shift Team Leader in a bottling plant, you want to produce a real time report that shows
the average speed of the bottle filler for the past hour. You also wish to compare this average
to the average of the 3 hours before, to know whether you are positively impacting
production speed for your shift or not. The speed of the bottle filler is measured by the tag
SINUSOID.
Approach
Using the built-in function TagAvg, calculate and display the average for the filler speed tag
(SINUSOID) for the last hour. Using the built-in functions Sgn and TagAvg, calculate
whether your hourly production rate is better or worse than that for the three hours prior. Use
MS Excels conditional formatting to get a quick view of your performance. Use the file
Exercise_DL6_Template.xls as a template for this report.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 108

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.

4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

Open the file Exercise_DL6_Template.xls.


In cell B9, Enter this expression:
TagAvg('sinusoid', '*-1h', '*')
In cell B16, Enter this expression:
SGN(TagAvg('sinusoid','*-1h','*')TagAvg('sinusoid','*-4h','*-1h'))
Select the cell B11.

On the Ribbon, Click PI > Archive Value.


In the task pane select the PI Expression radio button.
In the task pane click in the Expression(s) field.
Click on cell B9.
Enter * (PI abbreviation for the now timestamp) in the
Timestamp field.
Click on the OK button.
Select on cell B18.
On the Ribbon, Click PI > Archive Value.
In the task pane select the PI Expression radio button.
In the task pane click in the Expression(s) field.
Click on cell B16.
Enter * in the Timestamp field.
Click on the OK button.
Select cell H2 in its upper left hand corner.

19. On the Ribbon, Click Home > Conditional Formatting > Highlight Cells Rules > Equal To

20.
21.
22.
23.

Select Custom Format from the with drop-down option.


Choose a green color for the filling of the cell.
Click on the OK button.
Repeat steps 18 22 while in the same Conditional Formatting window but for the association
between the red color and value -1.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 109

PI ProcessBook, PI DataLink, PI WebParts Course


24. Press CTRL+Shift+Alt+F9 to refresh the spreadsheet.

7.3.3

Exercise Quality Control Report (Optional)


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objectives

Learn to apply complex filters to extract archived values;


Learn to synchronize data extraction;
Learn to extract the maximum value of a time range using the Calculated data
function;
Use MS Excels Conditional Formatting to make your PI DataLink reports more
useful.

Problem Description
As the person in charge of the quality control of the process, you want to easily identify when
specific characteristics of the process exceed quality threshold values. The process you
analyze takes place in seven (7) phases. During three (3) phases of the process, the
monitoring of physical characteristics is critical at the phase change; these phases are Phase1,

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 110

PI ProcessBook, PI DataLink, PI WebParts Course


Phase3 and Phase5. The physical characteristics give indication of the quality of the product
made in the reactor.
The physical characteristics are the electrical conductivity which is measured by the
expression: 'BA:CONC.1' / 100 and the temperature is measured by the expression:
'BA:TEMP.1' * 10. The threshold value for electrical conductivity should not overcome
0.45 Siemens/cm, and temperature in the reactor should not overcome 500 degree Celsius.
Also, it is necessary to determine the conductivity and temperature maximums of the day and
find when these values occurred.
You need to build your report to make it easier to analyze in a short period of time. You
decide to put red visual indicators when threshold values are exceeded and blue indicators
when everything is normal. You need to be able to locate any high values of the day using the
MS Excel Conditional Formatting.
Approach
We will use the Compressed Data function with a filter expression to retrieve when the
different critical phases took place during the day. The filter expression will contain many
criteria tied together with an OR logical operator.
The Archive Value function will be used to retrieve physical characteristic measurements as
the phases change. We will use the built-in PI Calculated Data function to show the
conductivity and temperature peak of the day. Use MS Excels Conditional Formatting to
get a quick view of your performance. Use the file Exercise_DL7_Template.xls as a template
for this report.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 111

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.

20.
21.
22.
23.
24.
25.
26.
27.

Open the file Exercise_DL7_Template.xls.


In cell B4, enter the tag name 'BA:PHASE.1
In cell B5, enter the expression: ''BA:CONC.1' / 100.
In cell B6, enter the expression: ''BA:TEMP.1' * 10.
In cell B9, build the filter expression to use. Enter the expression: ''BA:PHASE.1'="Phase1" OR
'BA:PHASE.1'="Phase3" OR 'BA:PHASE.1'="Phase5"
Select cell A12.

On the Ribbon, Click PI > Compressed Data.


In the task pane click in the Tagname(s) field.
Click on cell B4.
In the task pane click in the Start Time field.
Click on cell B7.
In the task pane click in the End Time field.
Click on cell B8.
In the task pane click in the Filter Expression (optional) field.
Click on cell B9.
Check the hide count option to remove the number of values extracted.
Check the show timestamps option.
Click on the OK button.
To extract the conductivity measurement at the phases change, we need to use the individual
timestamps returned by the Compressed Data function as input timestamps for the Archive Value
function. Let us start by selecting cell C12.
On the Ribbon, Click PI > Archive Value.
Select the PI Expression radio button in the task pane.
In the task pane click in the Expression(s) field.
Click on cell B5.
In the task pane click in the Timestamp field.
Click on cell A12.
Click on the OK button.
Select cell C12. In the Formula Bar, localize the second argument (this will be a cell reference) and
click on the text forming the cell address.

28. Press on the F4 key on the keyboard two (2) times. This will transform the absolute cell reference
into a row relative cell reference. It means the dollar sign in front of the row position will be
removed. You will then see a reference like Sheet1!$A12 instead of Sheet1!$A$12.
29. Propagate the result down to cell C150 by dragging the cells handle at the cells lower-right corner.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 112

PI ProcessBook, PI DataLink, PI WebParts Course


30. To extract the temperature measurement at the phases change, we need to use the individual
timestamps returned by the Compressed Data function as input timestamps for the Archive Value
function. Let us start by selecting cell D12.
31. On the Ribbon, Click PI > Archive Value.
32. Select the PI Expression radio button in the task pane.
33. In the task pane click in the Expression(s) field.
34. Click on cell B6.
35. In the task pane click in the Timestamp field.
36. Click on cell A12.
37. Click on the OK button.
38. Select cell D12. In the Formula Bar, localize the second argument (this will be a cell reference) and
click on the text forming the cell address.
39. Press on the F4 key on the keyboard two (2) times. This will transform the absolute cell reference
into a row relative cell reference
40. Propagate the result down to cell D150 by dragging the cells handle at the lower-right corner.
41. To extract the conductivity peak we need to use the Calculated Data function and put the result on
cell F13; select cell F13.
42. On the Ribbon, Click PI > Calculated Data.
43. Select the PI Expression radio button in the task pane.
44. Click on cell B5.
45. In the task pane click in the Start Time field.
46. Click on cell B7.
47. In the task pane click in the End Time field.
48. Click on cell B8.
49. In the task pane click in the Filter Expression (Optional) field.
50. Click on cell B9.
51. In the Calculation Mode drop-down select maximum.
52. Check the show min/max time option.
53. Click on the OK button.
54. To extract the temperature peak we need to use the Calculated Data function and put the result on
cell F17; select cell F17.
55. On the Ribbon, Click PI > Calculated Data.
56. Select the PI Expression radio button in the task pane.
57. Click on cell B6.
58. In the task pane click in the Start Time field.
59. Click on cell B7.
60. In the task pane click in the End Time field.
61. Click on cell B8.
62. In the task pane click in the Filter Expression (Optional) field.
63. Click on cell B9.
64. In the Calculation Mode drop-down select maximum.
65. Check the show min/max time option.
66. Click on the OK button.
67. We need to make this report more appealing for the verification; we will use the Conditional
Formatting capabilities of MS Excel to make it through. Select cell range from C12 to C150.
68. On the Ribbon, click Home > Conditional Formatting > Data Bars > Blue Data Bar

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 113

PI ProcessBook, PI DataLink, PI WebParts Course


69. Be sure to keep the cell C12 to C150 range selected.
70. On the Ribbon, click Home > Conditional Formatting > Highlight Cell Rules > Greater Than

71.
72.
73.
74.
75.
76.

Enter the value 0.45 in the Format cells that are GREATER THAN field.
Select Custom Format from the with drop-down option.
Choose a blue color for the filling of the cell.
Click on the OK button.
Select cell range from D12 to D150.
On the Ribbon, click Home > Conditional Formatting > Highlight Cell Rules > Between

77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.

Enter the value 0 and 500 in the Format cells that are BETWEEN fields.
Select Custom Format from the with drop-down option.
Choose a green color for the filling of the cell.
Click on the OK button.
Be sure to keep the cell D12 to D150 range selected.
On the Ribbon, click Home > Conditional Formatting > Highlight Cell Rules > Greater Than
Enter the value 500 in the Format cells that are GREATER THAN field.
Select Custom Format from the with drop-down option.
Choose a red color for the filling of the cell.
Click on the OK button.
The resulting report should look similar to the one presented below.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 114

PI ProcessBook, PI DataLink, PI WebParts Course

7.4

Complex Calculations and Other Functions

Objectives

7.4.1

Obtain PI Expressions values and summaries


Obtain time filtered values
Resolve PointIDs and Attributes to Tag Names
Advanced Calculated Data

Advanced Calculated Data (=PIAdvCalcDat) returns a single calculated value or evenly


spaced calculated values from the PI archive. Calculation modes are: total, minimum,
maximum, standard deviation, range, average and count.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 115

PI ProcessBook, PI DataLink, PI WebParts Course


If a filter expression is specified, the requested summaries on the source point are calculated
for the time ranges where the expression evaluates to true. To retrieve a single calculated
value, do not specify an interval. To retrieve evenly spaced calculated data, the specified
interval determines the spacing of the calculation.
Please consult PI DataLink's online help for more details about the parameters:

Expression sampling modes for the filter expression;


Expression sampling modes for expression to be summarized;
Expression sampling interval;
Calculation basis;
Minimum percent good parameters.

There are three (3) expression sampling modes for sampling the filter expression:

Pt. Compressed (default) Evaluates the filter expression at the timestamp of any
compressed value of the source point;

Exp. Compressed Evaluates the filter expression at the timestamp of any


compressed values of any tags in the filter expression;

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 116

PI ProcessBook, PI DataLink, PI WebParts Course

Interpolated Evaluates the filter expression at evenly spaced sampling intervals.

There are two (2) expression sampling modes for sampling the expression to be summarized:

Compressed (default) Evaluates the expression at the timestamp of any


compressed values of any tags in the expression;

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 117

PI ProcessBook, PI DataLink, PI WebParts Course

7.4.2

Interpolated Evaluates the expression at evenly spaced sampling intervals.


Directed Exercise Event and Time Weighted Averages
You are invited to watch what the instructor is doing or perform the same steps at the
same time to explore the different concepts presented in this chapter or section.

Problem Description
Perform an event-weighted average that evaluates the filter expression at the timestamp of
every compressed value of the source point. Then perform a time-weighted average that
evaluates the filter at the timestamp of every compressed value of any of the tags in the filter
expression.
7.4.3

Time Filtered Data

The Time Filtered Data function (=PITimeFilter) dialog box returns the amount of time for
which a given expression is true over a specified time range. The Expression must still follow
the PI Performance Equation Syntax. The user can specify multiple time ranges as evenly
spaced intervals as in the Calculated Data dialog box.
Note: If you can enter the expression into a cell on the worksheet and refer to it in the dialog box, begin
the expression with a single quote so that Excel will interpret the expression as a string.

Argument

Explanation

Expression (string)

The calculation expression.

Stime (string)

The start time in PI time format

Etime (string)

The end time in PI time format

Interval (string)

The time interval in PI time format

Timeunit (string)

Unit of time for the result to be displayed. Valid entries are:


s, h, m, d

Outcode (integer)

An output code such as 0, 1, 2, or 3.

PIServer (string)

The PI Server.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 118

PI ProcessBook, PI DataLink, PI WebParts Course


7.4.4

Exercise Operating Time with Time Filtered Data


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Calculate an operating time with the Time Filtered function.

Problem Description
As the person in charge of the maintenance program, you want to know the operating time for
a specific pump. Find the amount of time the pump was ACTIVE using the function Time
Filtered. This method performs the calculation in a single step; saving the step of doing the
filtering with the IF function in MS Excel. It returns the amount of time that an expression is
true.
The operating status is measured by the tag BA:ACTIVE.1.
Approach
The Time Filtered function returns the amount of time that an expression is true. Use the
results to perform an analysis of the time that your machine state was ACTIVE. The report
should allow the user to select the time unit to display. Use the file as
Exercise_DL9_Template.xls a template for this report.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 119

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.

Open the file Exercise_DL9_Template.xls.


In cell B7, enter the expression: ''BA:ACTIVE.1' =
"Active".
Select cell A10.
On the Ribbon, Click PI > Time Filtered.
In the task pane click in the Expression(s) field.
Click on cell B7.
In the task pane click in the Start Time field.
Click on cell B4.
In the task pane click in the End Time field.
Click on cell B5.
In the task pane click in the Time Interval (optional) field.
Click on cell B6.
In the task pane click in the Time Units field.

14. Press the ( ) button then click on cell C9.


15. Select the show start time check box.
16. Click on the OK button.

17. For data validation steps write this time unit: seconds in cell I2, and minutes in cell I3, and
hours in cell I4, and days in cell I5.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 120

PI ProcessBook, PI DataLink, PI WebParts Course


18. Select cell C9.
19. On the Ribbon, click Data > Data
Validation.
20. In the dialog box, in the Allow
drop-down list, select List.
21. In the Source field below, select
the cell range you just created
(=$I$2:$I$5).

22. Click on the OK button.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 121

PI ProcessBook, PI DataLink, PI WebParts Course


7.4.5

Resolve PointIDs and Attributes to Tag Names

The PointID to Tag function (=PIPointIDToTag) allows the user to always make reference
to a specific point ID and not the tag name. This is very useful when tag names are expected
to change frequently.
The Attribute Mask to Tag function (=PIAttributeMasktoTag) allows the user to always
have a fresh list of tags based on the specified attribute masks. It allows you to return a list of
PI Tags that meet a certain set of search criteria. This is very similar to doing a Basic Tag
search through the PI SDK, but this allows you to build in cell references into your DataLink
report and search for tags without having to open the Tag Search specifically. Again, this is
useful when you have tags that change names often, or when you want to build a highly
interactive report.
7.4.6

Exercise Advanced Calculated Data (Optional)


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Learn to perform operations on tags using Advanced Calculated Data.

Problem Description
As the section head of a small sawmill, you are responsible for the quality and the quantity of
board that is produced. You wish to create a PI DataLink report to help your weekly analysis
of shift performance.
The tag BA:CONC.1 represents the length of board produced and each archived value
represents another full board. Boards under 5 feet long are considered scrap. This means they
should not be included as production. Accounting has determined that scrap production costs
$2.00 for every foot.
The plant starts up on Monday at 8:00 am and goes idle at 4:00 pm on Friday. Shifts are 8
hours long and run 24 hours per day.
Produce a report for last week, by shift, of the following:

The number of boards produced, excluding scrap;


The average board length produced, excluding scrap;
The cost of scrap.

Approach

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 122

PI ProcessBook, PI DataLink, PI WebParts Course


We will combine a number of functions in the Advanced Calculated Data. We want to
determine how many boards were produced (each archived event represents one board
produced) and the average length of the boards produced (using an event-weighted
expression). These calculations should be done if the boards were over a certain length. Then,
we will run a calculation to determine how much production was lost to scrap. All of this will
be done per interval, which coincides with shift schedule for all last week. Use the file as
Exercise_DL10_Template.xls a template for this report.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 123

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.

Open the file Exercise_DL10_Template.xls.


Select cell A16.
On the Ribbon, click PI > Calculated Data.
Select the PI Tag radio button in the task pane.
In the task pane click in the Tagname(s) field.
Click on cell B4.
In the task pane click in the Start Time field.
Click on cell B5.
In the task pane click in the End Time field.
Click on cell B6.
In the task pane click in the Time Interval (optional) field.
Click on cell B7.
In the task pane click in the Filter Expression (optional)
field.
14. Click on cell B9.
15. In the Calculation Mode drop-down select Count.

16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.

Expand the Advanced area.


In the Calculation Basis drop-down select event-weighted.
Check show start time check box.
Click on the OK button.
In the task pane click in the Time Interval (optional) field.
Click on cell B7.
In the task pane click in the Filter Expression (optional)
field.
Click on cell B9.
In the Calculation Mode drop-down select Average.
Click on the OK button.
Select on cell D16.
On the Ribbon, click PI > Calculated Data.
Click on PI Expression radio button in the task pane.
In the task pane click in the Tagname(s) field.
Click on cell B13.
In the task pane click in the Start Time field.
Click on cell B5.
In the task pane click in the End Time field.
Click on cell B6.

35. In the task pane click in the Time Interval (optional) field.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 124

PI ProcessBook, PI DataLink, PI WebParts Course


36.
37.
38.
39.
40.
41.
42.

Click on cell B7.


In the task pane click in the Filter Expression (optional) field.
Click on cell B10.
In the Calculation Mode drop-down select Total.
Expand the Advanced area.
In the Calculation Basis drop-down select event-weighted.
Click on the OK button.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 125

PI ProcessBook, PI DataLink, PI WebParts Course

8. PI WebParts: PI Gauge, PI Values, and PI TimeSeries


8.1

Introduction to PI WebParts

Objectives

8.1.1

Explain a web part page


Add a new web part page
Add a new document library
Introduction (Optional)

PI WebParts is a set of OSIsofts third party web parts for Microsofts SharePoint server. PI
WebParts pages have these features:

No local installation is required;


No direct connection to the PI Server is required;
Requests and renders data from several data sources (not limited to only PI data);
Repository for files and documents;
Accessible from any computer with internet access and the SVG viewer plug-in.

Because of these features, PI WebParts is considered a thin client. This makes it much more
accessible to members of your organization and means that fewer people need a working
knowledge of PI, while maintaining the visibility of your PI data. You can view your data
from anywhere at any time. The advantages of PI WebParts pages are that you can share files
and documents in online Document Libraries, making it so there is only one version of the
truth because everyone views same data. It also increases team collaboration and
productivity.
8.1.2

Web Part Pages

A web part page is a special type of Windows SharePoint Services page that contains web
parts. A web part page contains WSS zones. A single or multiple web parts are located within
a zone. These web parts can be WSS web parts, PI WebParts, or other third party web parts.
Each zone is configured independently. These zones can be configured to pass parameters
between them to create interactive web part pages. Overall, the display environment offered
by SharePoint and PI WebParts is highly configurable and can be tailored to your specific
needs.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 127

PI ProcessBook, PI DataLink, PI WebParts Course


8.1.3

Directed Exercise Create a New Team Site


You are invited to watch what the instructor is doing or perform the same steps at the
same time to explore the different concepts presented in this chapter or section.

Problem Description
You need a new Team Site for the Web Part Pages for the remainder of the course.
Approach
Create a new Team Site with the same permissions as the parent.
8.1.4

Document Library

A Document Library is an online storage location for Web Part pages and shared documents
and files. The documents stored here can be used as a central point for users needing to view
and edit this material. SharePoint and PI WebParts both support multiple document libraries.
It can also be used to link these documents to specific web parts for display purposes. We
will cover this in more detail later.
To create a new Document Library, click on the Site Actions drop-down menu in the upper
right corner and select the Create link. This will open a new web page with several choices
for the page you are going to create. Click on the Document Library link in the left column
of the Create page and name the library. Finally, click on the Create button to create your
library.
Note: There is no default document library, so when selecting a library, they are presented in alphabetical
order.
You can open a document library by clicking View All Site Content on the Top Bar menu
and then clicking the document library name in the Document Libraries section. If you
chose to add the document library to the Quick Launch bar, you can also click the document
library name there to open it.
8.1.5

Add a Web Part Page

Web Part Pages are where you will add and configure various web parts. It is similar to
ProcessBook, where the Team Site in Web Parts is analogous to a ProcessBook Workbook
and the Web Part Pages are analogous to the ProcessBook Entries.
To create a new Web Part Page, click on the Site Actions drop-down menu in the upper right
corner and select the Create link. This will open a new web page with several choices for the
page you are going to create. Click on the Web Part Page link in the right column of the

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 128

PI ProcessBook, PI DataLink, PI WebParts Course


Create page and name the page. You can change which layout you use for this Web Part
Page. While this is configurable, for the demonstrations and exercises, we will be using the
default Web Part Page layout. Select which Document Library you would like to store this
Web Part Page. Finally, click on the Create button to create your library.
Once a web part page has been created, you can start adding web parts to the zones. Adding
web parts is a lot more intuitive in SharePoint 2007. To add, modify, change layout, or delete
web parts you must be in Design mode. You enter Design mode, click Site Actions> Edit
Page. An Add a Web Part button will be available for each web part zone to which you can
add web parts. In Edit mode, click the Add a Web Parts button for the zone you want to
insert the web part into. You can then select one or many Web Parts. Click OK.
Now that you have a web part page with web parts added to zones, you must configure the
web parts. To configure a web part, go to the upper right corner of the specific web part (title
bar) and click the downward triangle (Web Part menu). Select the Modify Web Part
command. The configuration pane is displayed on the right side of the page. From here, the
configuration of each web part varies. We will go into the PI WebParts configuration shortly.
8.1.6

Exercise Basic SharePoint


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objectives

Navigate a SharePoint site;


Create a web part page;
Insert and modify web parts in a web part page.

Problem Description
You are new to SharePoint. You have your own team site, but you need to be familiar with
how to get around.
Approach
Open a browser and login in to the SharePoint server. If you do not know the name of the
SharePoint server, or the username and password to use, please contact your PI or SharePoint
system manager. Navigate to your Team Site using. Use the Create function to add a new
Document Library. Call this Document Library: ProcessBook Files. Add links to the
default Links web part to the following URLs:

www.osisoft.com;
www.cnn.com;
www.microsoft.com;

Extra Credit

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 129

PI ProcessBook, PI DataLink, PI WebParts Course


Replace the image in the upper right of your home page. You will have to:

Copy an image to your desktop (make sure before you upload it that it is a correct
size - double-click to open it and resize if necessary);
Upload it to your Shared Documents Library;
Copy the URL;
Edit the web part and add the URL.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 130

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.

Navigate to your SharePoint Team Site.


Click on the Site Actions > Create. The menu is located on the upper right side of the page.

3.

Click on Document Library at the top of the left hand column.

4.

Enter information regarding the name and the layout of the document library page.
Enter ProcessBook Files as page name;
Leave the other default settings;
Click on the Create button to validate your selection.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 131

PI ProcessBook, PI DataLink, PI WebParts Course

5.

On your site, click on the Add New Link link.

6.

Add a website URL from the list.

www.osisoft.com;
www.cnn.com;
www.microsoft.com;

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 132

PI ProcessBook, PI DataLink, PI WebParts Course

7.

Add a description. This is what displayed on your web page, e.g.


CNN would be displayed for www.cnn.com.

Extra Credit Step-by-Step Solution


1.
2.
3.
4.
5.
6.
7.
8.

Find an image on the internet and save it to your desktop


(Right-click > Save Picture As).
Resize the image as necessary. The size of the image
displayed is how it will appear on your webpage.
Click on Shared Documents on your website.
Click on the Upload Document link.
Browse to your picture and click on the Open button.
Click on your uploaded picture.
Copy the URL to your clipboard (Right-click > Copy
Shortcut).
Navigate back to your home page.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 133

PI ProcessBook, PI DataLink, PI WebParts Course


9.

Click on Site Actions > Edit Page.

10. In the Site Image box, click on the Edit > Modify
Shared Web Part link.
11. Paste the URL of your picture to the image link.
12. Click on the OK button.
13. Click on the Exit Edit Mode link.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 134

PI ProcessBook, PI DataLink, PI WebParts Course

8.2

Using and Configuring PI WebParts

Objective

Configure the PI Gauge WebPart to show PI Data


Configure the PI Values WebPart to show PI Data
Configure the PI TimeSeries WebPart to show PI Data

PI WebParts are third party web parts that can be used to display processes, documents and
information for effective team collaboration based on Microsoft SharePoint technology. The
special features of the web parts included in PI WebParts are that they can request and render
data from PI Data Services (PI, relational, and web service data sources) and that they
update/refresh automatically.
The following configuration section applies to all PI WebParts:

Time Range
Selected Data
Appearance
Layout
Advanced

The PI WebParts Tag Search is similar to PI smart clients tag search. Advanced and default
search modes can be toggled by hitting the More/Less link in the upper right corner.
8.2.1

Configuring the PI Gauge Web Part

The simplest PI WebPart is the PI Gauge. The PI Gauge web part displays an analog style
gauge with a pointer that indicates the real-time value of the configured data point with
respect to the scale around the perimeter. Hovering over the gauge causes a tooltip to appear
indicating the displayed real-time value. Only one data point can be represented per gauge.
Many gauges can be added to the web part in horizontal or vertical format. The following
configuration section applies specifically to the PI Gauge part:

Format
Legend
Zone and Scale

You can open an Ad hoc Trend of the tag over the time range specified in the PI Gauge
configuration by selecting the Ad hoc Trend option from the PI Gauge web part menu.

For more information see "Configure PI Gauge WebParts" in PI WebParts


User Guide, version 3.0, pp. 62-65.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 135

PI ProcessBook, PI DataLink, PI WebParts Course


8.2.2

Exercise Configure the PI Gauge Web Part


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Familiarize yourself with configuring a web part.

Problem Description
You are new to PI WebParts. You have your own team site, but you are not sure how to use
it. You want to try to configure a simple web part, and have selected the PI Gauge web part.
Approach
Create a new page in your Team Site called Exercise_R2. If you are not already in Edit
Mode, select Edit Page from the upper right page menu. Add an PI Gauge web part to any
zone. Click on the upper-right menu icon for that web part and select Modify Shared Web
Part. Add the tags BA:CONC.1, BA:LEVEL.1, and BA:TEMP.1. Configure each of the tags
separately based on the table below.
Tag
BA:CONC.1

BA:LEVEL.1

BA:TEMP.1

Color
Label
Range
Color
Label
Range
Color
Label
Range

Zone 1
Green
Normal
80%
Blue
Normal
90%
Blue
Cold
20%

Configuration
Zone 2
Red
High
20%
Orange
High
10%
Green
Normal
70%

Zone 3

Red
Hot
10%

Orient the PI Gauges horizontally and quit Edit mode.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 136

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.

Navigate to your SharePoint Team Site.


Click on Site Actions > Create. The menu is located on the upper right side of the page.

3.

Click Web Part Page in the far right column.

4.

Enter information regarding the name and the layout of the web part page
Enter Exercise_R2 as page name;
Leave the other default settings;
Click on the Create button to validate your selection.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 137

PI ProcessBook, PI DataLink, PI WebParts Course


5.

Add web parts to the newly created web part page.


Click on the Add a Web Part button located on the header zone.
Choose the PI Gauge Web Part (scroll down).
Click on the Add button.

6.

In the PI Gauge web part, click Edit > Modify Shared Web Part.

7.

In the edit pane, click the Tag Search icon.

8.

In the Name mask field, enter BA* and then click on the Search button.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 138

PI ProcessBook, PI DataLink, PI WebParts Course

9. Double click on the listed tags or select the tags and click on the Add button.
10. Click on the OK button at the bottom of the window.
11. In the Modify Shared Web Part pane on the right
Select the tag BA:CONC.1.
Change the number of zones to 2.
Change Zone 1 color to Green.
Change the Label to Normal.
Change the Total Scale Percentage to 80.
Select Zone 2.
Change Zone 2 Label to High.
Change Zone 2 Color to Red.
Change Zone 2 Total Scale Percentage to 20.
Repeat for the remaining two (2) tags.
Note that the default setting for the gauge is
horizontal.
12. Click on the OK button at the bottom of the edit
pane.
13. Click on the Exit Edit Mode link.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 139

PI ProcessBook, PI DataLink, PI WebParts Course


8.2.3

Configuring the PI Values Web Part

The PI Values web part presents single events. It can also be configured to present summary
values such as the average, minimum, maximum, or standard deviation. This data is updated
automatically and can be sorted by clicking on the column title.
Clicking on a Dataset will open an ad hoc trend, as will selecting Ad hoc Trend in the PI
Values web part menu.
In the PI Values configuration, the Table Columns section is used to add and remove
columns from the web part.
If you are displaying values for a large number of tags, the Number of Rows to Display
parameter can be adjusted to specify the number you show at one time. The additional rows
are hidden, but can be paged through by using the arrow navigation at the bottom right corner
of the PI Values web part.
Formatting templates can be created and selected in the Behavior Settings dropdown.
Template creation is part of the PI WebParts User and Administration class and is beyond the
scope of this course. For now, we will leave this with the default.
The Summary Parameters section is used to configure the Calculation Interval, Interval
Type, Sync Time and Conversion factor (which is only applicable to Totalizations). You
can also choose to use the web part time range and to display the summary settings.
There are three types of Intervals that can be chosen. The first is type Fixed. If you have an
average that is being calculated over an hour and it is scheduled on the hour, then the Fixed
Interval will only display the last fully run hour and will not update during the hour.
The second Interval type is Running. Using the same calculation as before, this Interval type
will begin the average calculation at the top of the hour and continuously update the average
over the course of the hour as new data becomes available.
The final Interval type is Moving. Again using the concept of an hour average, this Interval
type will calculate the average over the last hour, or, expressed in PI Time, *-1h to *.

For more information see "Configure PI Values" in PI WebParts User


Guide, version 3.0, pp. 102-104.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 140

PI ProcessBook, PI DataLink, PI WebParts Course


8.2.4

Exercise Configure PI Values Web Part


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Configure the PI Values web part.

Problem Description
You understand how to configure a basic web part. You want to try the PI Values web part.
Approach
Create a new page in your Team Site called Exercise_R3. Add one PI Values web part to any
zone. Add all of the tags that begin with BA: to the data area. In the selected columns choose
DataSet, Time, Value, Interval Minimum, and Interval Maximum. The Calculation Interval
should be set to 24h and the sync time to 00:00:00 (this will give yesterdays statistics). You
want to display the Summary Settings in the web part. Click on the OK button and on the
Exit Edit Mode link.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 141

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.

On your SharePoint webpage, click on Site Actions > Create.

2.

Click on Web Part Page.

3.

Enter information regarding the name and the layout of the web part page
Enter Exercise_R3 as page name;
Leave the other default settings;
Click on the Create button to validate your selection.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 142

PI ProcessBook, PI DataLink, PI WebParts Course

4.
5.
6.
7.

8.
9.

In one of the zones, click on the Add Web Part button.


Check the PI Values web part, click on the Add button.
In the PI Values web part, click Edit > Modify Shared Web Part.
In the Modify Shared Web Part pane on the
right:
Click the Tag Search icon.
In the Name mask field enter BA* and click
on the Search button.
Hold down the CTRL key on the keyboard
and select all tags in the list and then click
on the Add button.
Click on the OK button.
In the Available Columns area, select
Interval Minimum.
Click the down arrow just below the list.
Repeat with Interval Maximum.
In the Selected Columns area, select the
Current State column.
Click the up arrow just above the Selected
Columns area.
Repeat with Dataset.
Select the entries in the Selected Columns
area and use the up and down arrows just
below to arrange the items in the specified
order.
Under Summary Parameters in the
Calculation Interval field enter 24h.
Check Display Summary Settings box.

Click on the OK button.


Click on the Exit Edit Mode link.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 143

PI ProcessBook, PI DataLink, PI WebParts Course


8.2.5

Configuring the PI TimeSeries Web Part

The PI TimeSeries web part presents columns and rows of time series data. The configuration
of this web part is similar to that of the PI Values. This web part, however, uses the time
range specified as the bounds of the data that it retrieves.
The data contained in the PI Timeseries and PI Values tables can also be exported to Excel by
selecting the Export to Excel>Open option from the web part menu.
Note: It is a known issue that the Export to Excel>Save function does not work. The work around is to
use the Export to Excel>Open and then save the opened Excel spreadsheet.

For more information see "Create a Trend" in PI WebParts User Guide,


version 3.0, pp. 83.

8.2.6

Group Recap Questions


The following questions are intended to reinforce key information presented in this
chapter or section. The answers can be found at the end of this document.

Questions
1.
2.

True or False: To obtain their values, the PI WebParts are connecting directly to a PI server.
True or False: If you need to display four gauges on your page, you need to insert and configure four
PI Gauge web parts.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 144

PI ProcessBook, PI DataLink, PI WebParts Course


8.2.7

Exercise Configure PI TimeSeries Web Part


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Familiarize yourself with configuring an PI TimeSeries web part.

Problem Description
You want to see historical data for a tag.
Approach
Create a new page in your Team Site called Exercise_R4. Add one PI TimeSeries web part.
Configure it to show the last 4 hours of data for the tag CDT158.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 145

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.

4.
5.
6.
7.

8.
9.

On your SharePoint webpage, click on Site Actions > Create.


Click on Web Part Page.
Enter information regarding the name and the layout of the web part page
Enter Exercise_R4 as page name;
Leave the other default settings;
Click on the Create button to validate your selection.
In one of the zones, click on the Add Web Part button.
Check the PI TimeSeries web part, click on the Add button.
In the PI TimeSeries web part, click Edit > Modify Shared
Web Part.
In the Modify Shared Web Part pane on the right
Change the value in the Start Time field to *-4h.
Click the Tag Search icon.
In the Name mask field enter CDT158 and click on the
Search button.
Double click on the listed tags or select the tags and
click on the Add button.
Click on the OK button in the Tag Search window.
Click on the OK button at the bottom of the edit pane.
Click on the Exit Edit Mode link.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 146

PI ProcessBook, PI DataLink, PI WebParts Course

9. PI WebParts: PI Trend, PI TimeRange, PI Graphic,


DLES
9.1

PI Trend and PI TimeRange

Objectives

9.1.1

Configure the PI Trend to show PI Data


Configure the PI TimeRange web part
PI Trend

The PI Trend web part provides data visualization using an interactive trend graph updating
in real-time. This is very similar to the Trend in ProcessBook and DataLink. The web part
supports trend cursors and zooming. The configuration panel includes Time range selection,
Data selection, Vertical scale, Trends properties and formatting, and Time Scale.
Select the Export to Excel option from the PI Trend web part menu. Data contained in the PI
Trend web part (original configuration or zoomed in area) will be exported in an Excel
spreadsheet.
Note: The Export to Excel > Save is currently a known bug. This should open a save dialogue box to
save the file without opening it, but this is not currently the case. This should be updated in the next
release. In the meantime opening the file and then saving is a simple work around.

For more information see "Configure PI Trend WebParts" in PI WebParts


User Guide, version 3.0, pp. 96-99.

9.1.2

PI TimeRange

PI TimeRange web part makes an implicit connection to other PI WebParts and it allows the
user to change the start and end times for other web parts on the page. The buttons next to the
text fields open a calendar dialog box for selecting a date and time or timestamps can be
directly entered in the fields. Both PI and Windows time formats are supported. By default,
when you edit the PI TimeRange web part, it will affect all PI Trends on the same page.
These connections can be made explicitly, rather than implicitly. We will cover making
explicit connections later.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 147

PI ProcessBook, PI DataLink, PI WebParts Course

For more information see "Configure PI TimeRange WebParts" in PI


WebParts User Guide, version 3.0, pp. 80.

9.1.3

Exercise Configure and Export PI Trend


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objectives

Familiarize yourself with configuring a PI Trend web part;


Familiarize yourself with export capabilities of the PI Trend web part.

Problem Description
You want to see a trend with data and so you will create a page and use the PI Trend web
part. You also want to use the PI TimeRange web part to control the trend. Finally, you want
to export the value to Microsoft Excel.
Approach
Create a new page in your Team Site called Exercise_R5. Add one PI Trend and one PI
TimeRange web part to any zone. Add the tag CDT158 to the data area of the PI Trend web
part. Exit the edit mode and test the web part interaction by changing the time in the PI
TimeRange web part to a Start Time of *-24h and notice the effect on the PI Trend. Click on
the upper-right menu icon for the PI Trend web part and select Export to Excel > Open.
Once the file is opened, save it to your desktop. Re-open the file and verify the contents.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 148

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.

On your SharePoint webpage, click on Site Actions > Create.


Click on Web Part Page.
Enter information regarding the name and the layout of the Web Part Page
Enter Exercise_R5 as page name;
Leave the other default settings;
Click on the Create button to validate your selection.
4. In one of the zones, click on the Add Web Part button.
5. Check the PI TimeRange box then click on the Add button.
6. In a different zone, click on the Add a Web Part button.
7. Check the PI Trend box, and then click on the Add button.
8. On the PI Trend Web Part, click Edit > Modify Shared Web Part.
9. In the Modify Shared Web Part pane on the right
Click the Tag Search icon.
In the Name mask field enter CDT158.
Double click the tag or select the tag and click on the Add button.
Click on the OK button to close the Tag Search window.
10. Click on the OK button at the bottom of the edit pane.
11. Click on the Exit Edit Mode link.
12. In the PI TimeRange web part, change the value in the Start Time field to *-24h, click on the Apply
button.

13. To Export the file, click the down arrow in the upper right corner of the PI Trend and select Export
to Excel > Open. Once the Excel spreadsheet has opened, save the file to your desktop.

14. Reopen the saved Excel file and verify the content.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 149

PI ProcessBook, PI DataLink, PI WebParts Course

9.2

PI ProcessBook Within PI WebParts

Objectives

9.2.1

Explain the SVG format and how to download the SVG Viewer
Create .svg files from ProcessBook displays
Insert ProcessBook .svg files in a SharePoint document library
Configure the PI Graphic to show PI Data
SVG Format Explained

Scalable Vector Graphics is an Adobe graphic file format that enables dynamic generation of
high quality graphics from real time data. PI ProcessBook 2.2 and higher has an SVG add-in
that allows the conversion of ProcessBook files into the SVG type and vice-versa.
9.2.2

Download the SVG Viewer (Optional)

The SVG Viewer can also be downloaded from:


http://www.adobe.com/svg/viewer/install/main.html
9.2.3

More on the SVG Format (Optional)

Scalable Vector Graphics (SVG) is a graphic file format and web development language
based on XML. SVG enables Web developers and designers to create dynamically generated,
high-quality graphics from real-time data with precise structural and visual control. With this
powerful technology, SVG developers can create a generation of Web applications based on
data-driven, interactive, and personalized graphics.
Because it is based on XML, SVG content can be linked to back-end business processes such
as e-commerce systems, corporate databases, and other rich sources of real-time information.
You can create web-based applications, tools or sophisticated user interfaces with common
Web scripting and programming languages such as JavaScript, Java, and Microsoft Visual
Basic.
Source: http://www.adobe.com/svg/overview/svg.html
9.2.4

Create .svg Files from ProcessBook Displays

The PI Graphic presents ProcessBook displays that are saved in an SVG format. They are
then shared in a document library, making it easier for users to share files.

For more information see "Create a ProcessBook Display Graphic (.svg)"


in PI WebParts User Guide, version 3.0, p. 70.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 150

PI ProcessBook, PI DataLink, PI WebParts Course

PI ProcessBook SVG files do not support VBA or ActiveX Scripting, SQC, and Batch trends. The PI
ActiveView web part must be used to maintain all of the functionality of PI ProcessBook PDI displays,
which will be covered later.

9.2.5

Insert.svg files in a SharePoint Document Library

The SVG files that you want to display in PI Graphic web parts must be uploaded to a
SharePoint document library.
9.2.6

Configure the PI Graphic Web Part

The PI Graphic Configuration tool provides the ability to search for SVG files and select
one for display. There is also a button to configure a web part connection that sends a path to
a file. The section is expanded by default, but can be collapsed by clicking its collapse button
(-). This tool part contains two main sections, Selected File and XSL Transform.
The Select File field shows the full path to the SVG file to display in the web part. The path
may be a UNC path to a file share or an absolute or relative URL. Typically, we recommend
uploading the SVG file to the SharePoint Server in one of the Document Libraries associated
with the site and use the URL to the file in that library. The contents of the field can be
changed by typing or by selecting a different file from the File Search dialog box.
The XSL Transform File text field accepts a URL to an XSLT file. By using an XSLT in an
PI Graphic web part, the user can enhance an SVG file that is authored in PI ProcessBook
without permanently altering its contents. The transformation logic can include pattern-based
substitution to change tags or server names, adjust the visual representation of a display, or to
attach JavaScript logic to specific elements.
SVG Displays created in ProcessBook can be edited in the smart clients by:

Edit in PI ProcessBook option in the document library menu;


Launch Analysis Tool in the PI Graphic web part menu.

If you have PI ProcessBook installed on your local machine and you have access to the
PI Server on which the data in the PI Graphic web part relies, it is possible to perform what is
known as a Roundtrip in ProcessBook. This involves launching the SVG file in
PI ProcessBook, making any desired additions, edits, or deletions, and then saving the SVG
file. You can then save it directly the Document Library, or save the file locally and re-upload
it. The PI Graphic should be automatically updated with the changes you made in
ProcessBook. You may have to refresh the screen so that it renders again.

For more information see "Configure PI Graphic WebParts" in PI


WebParts User Guide, version 3.0, pp. 71.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 151

PI ProcessBook, PI DataLink, PI WebParts Course


9.2.7

Exercise Configure the PI Graphic Web Part


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Familiarize yourself with using PI ProcessBook displays in web parts.

Problem Description
You have some PI ProcessBook displays that your users would like to preserve in web parts.
Approach
Create a new page in your Team Site called Exercise_R6. If you are not already in Edit
Mode, select Edit Page from the upper right page menu. Add one PI Graphic web part to any
zone. Minimize the browser window and open PI ProcessBook. Select the display Main
Column Bottom and open it. Use the Save As function and save it to your desktop in the
.SVG file format. Go back to your browser and navigate to the ProcessBook Files Document
Library you created earlier. Upload the .SVG file there. Finally, go back to the page you
created for this exercise and configure the PI Graphic web part to display your .SVG file.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 152

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.

Before you begin, minimize your browser and open PI ProcessBook. The default workbook
PIDEMO.PIW should open. If it does not, navigate and open that workbook.
2. On the Refinery tab, open Main Column Bottom.
3. Select File > Save As and save the file to your desktop as a Scalable Vector Graphics (.SVG) file.
4. Close the PI ProcessBook application.
5. Return to your Team Site in your browser and navigate to your document library ProcessBook Files
that you created earlier.
6. Select Upload and use the Browse button to select the Main Column Bottom.svg on your
desktop. Upload the file to the library.
7. Click on Site Actions > Create.
8. Click on Web Part Page.
9. Enter information regarding the name and the layout of the
Web Part Page.
Enter Exercise_R6 as page name;
Leave the other default settings;
Click on the Create button to validate your selection.
10. In one of the Web Part Zones, click on the Add a Web
Part link.
11. Check the PI Graphic web part, click on the Add button.
12. In the PI Graphic web part, click Edit > Modify Shared
Web Part.
13. Click Browse and select your .SVG file. You may have to
use the folder navigation buttons (in the upper left corner of
the browse window) to travel up one level and into a
different document library.
14. Click on the OK button at the bottom of the edit pane.
15. Click on the Exit Edit Mode link.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 153

PI ProcessBook, PI DataLink, PI WebParts Course

Optional part Step-by-Step Solution


1.

Select Edit > Launch in PI ProcessBook to open the file from the web server.

2.
3.
4.
5.

You will have to re-enter your credentials.


Edit the display file and save the changes.
Close the PI ProcessBook application.
Refresh your SharePoint page to observe the changes.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 154

PI ProcessBook, PI DataLink, PI WebParts Course

9.3

Requirements and Configuration of DataLink for Excel Services

Objectives

9.3.1

List the requirements for DataLink for Excel Services


Insert and configure the Excel Web Access web part with DataLink for Excel
Services
PI DataLink for Excel Services (Optional)

Excel Services is brand new server technology that is included with Office 2007. The
downside to Excel historically is that it is not easy to share and that it was difficult to reuse
the data. Excel Services has been introduced to make life easier when it comes to leveraging
important Excel spreadsheets on a large scale. In summary, Excel Services will make it
simple to manage, share, and control spreadsheets.
This new technology is a thin client (no downloads) way to share the output of Excel files
without the need for any client Excel components to be present and loaded on the client
machine. It represents an innovative way to share the contents and calculations in a controlled
manner to end users.
These server-side Excel files can also be used as the basis on which consumers can build
custom applications based on the data and calculations inside of an Excel document by taking
advantage of the newly introduced set of Web services that expose the Excel spreadsheets
data.
9.3.2

Introduction to Excel Services (Optional)

Excel Web Access offers a web view that displays data and charts from an Excel Workbook,
has a similar "look and feel" to Microsoft Office Excel, such as sheet tabs, outline buttons,
and drop-down arrows, and allows you to edit a few cells from the spreadsheet. It provides
browser-based access to spreadsheets that you can incorporate spreadsheets in portals and
dashboards. You can limit access to spreadsheets either for regulatory and audit concerns or
to protect intellectual property in spreadsheets. It also eliminates multiple versions of the
truth, or many copies of the same spreadsheet that are out of sync with each other by sharing
them via online document libraries. It also allows you to leverage servers to offload longrunning calculations from desktop machines.
An Excel Web Access Web Part is also available which allows embedded Excel reports into
existing Portal pages. Interaction with other Web Parts is available through the use of
connections, covered later.
9.3.3

Requirements of PI DataLink for Excel Services

The major requirements are Microsoft Office SharePoint Server (MOSS) 2007 using
Microsoft Enterprise Client Access License (CAL) and with Excel Services enabled in
SharePoint. To create the worksheets, you need Microsoft Excel 2007, or Excel 2003, XP or
2000 with the latest service pack and Microsoft Office 2007 Compatibility Pack.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 155

PI ProcessBook, PI DataLink, PI WebParts Course


See http://techsupport.osisoft.com > Products > Layered Products > PI WebParts > PI
DataLink for Excel Services > System Requirements for a complete list.

For more information see "System Requirements" in PI DataLink for Excel


Services User Guide, version 3.2, pp. 81-84.

9.3.4

Publishing Reports in Excel Services

Similar to the way you must save and upload an SVG file to a Document Library to display
your independent ProcessBook Displays, you must publish the Excel file to a Document
Library to use it in a Web Part. The Excel Services are installed only with Microsoft Office
SharePoint Server (MOSS), not WSS or SPS.

For step-by-step instructions, see Publish Workbooks (PI DataLink for


Excel Services User Guide, version 3.1.6, pp. 13-20).

9.3.5

Exercise Configure DataLink for Excel Services


The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Familiarize students with using DataLink reports in a web page.

Problem Description
Your manager wants to be able to see reports on the intranet. You decide to use PI DataLink
for Excel Services to post live PI DataLink reports in a web page.
Approach
Open a spreadsheet containing data from the PI DataLink Compressed Data (Start
Time/Number) function (Exercise_DL5_Solution.xlsx if you do not wish to create
your own) and publish it on the SharePoint Server.
Create a new page in your Team Site called Exercise_R7. If you are not already in Edit
Mode, select Edit Page from the upper right page menu.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 156

PI ProcessBook, PI DataLink, PI WebParts Course


Add one EWA (Excel Web Access) web part to any zone on the page. Configure the web part
to use the spreadsheet that you just uploaded to your document library.
Note: The DataLink spreadsheet must be uploaded to the same Document Library as the Web Part Page is
stored.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 157

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.

Navigate to your Team Site in your browser and navigate to your document library Shared
Documents.
2. Select Upload and use the Browse button to find and select Exercise DL5 Solution.xlsx from
where you have saved the class materials. (Alternately, use an Excel 2007 file from a previous
DataLink exercise.) Upload the file to the library.
3. Click Site Actions > Create.
4. Click Add Web Part Page.
5. In the Name field enter Exercise_R7.
6. In one of the Web Part Zones, click Add a Web Part, and then click OK.
7. Check the Excel Web Access (EWA) box, click Add.
8. Click Edit > Modify Shared Web Part.
9. Browse for your workbook you uploaded.
10. Click OK.
11. Click OK to close the edit panel.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 158

PI ProcessBook, PI DataLink, PI WebParts Course

10. PI ActiveView
10.1 Advanced Web Part Possibilities
Objectives

Explain the relationship between PI ProcessBook and PI ActiveView


Configure and use the PI ActiveView web part to display a .pdi file
List the specialty PI WebParts and their purposes.

10.1.1 Introduction to PI ActiveView


PI ActiveView is a rich viewing tool for live and historical data from a variety of sources. It
presents displays of live data from the PI Server as well as information from ODBC sources
(via ADO or VBA). PI ActiveView can be deployed on the Internet or within a corporate
Intranet. PI ActiveView displays may also be inserted as ActiveX controls in existing
spreadsheets or other reporting tools used in your environment. The displays of live data,
called PI Display Documents, are prepared from displays built in the PI ProcessBook
application.
While a user is viewing a PI Display Document in the browser, the display will automatically
be updated with new data that reaches the PI Server. Dynamic symbols such as trends, bars,
or values, will update just as they would in PI ProcessBook. Certain VBA scripting in a
display is also available in PI ActiveView.
In addition to basic PI ProcessBook displays, developers may use displays built with the PI
BatchView and PI SQC add-ins to PI ProcessBook.

For more information see "PI ActiveView WebParts" in PI WebParts User


Guide, version 3.0, pp. 51-54.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 159

PI ProcessBook, PI DataLink, PI WebParts Course

PI ActiveView is a client application that allows users to post .pdi files to their Intranet.
There are a few rules to using PI ActiveView that each user and developer has to keep in
mind. One is that the application will not open a ProcessBook workbook. You must break
your workbook out into individual component display (.pdi) files and insert them as Objects
within HTML (hypertext markup language) files. These can be either .htm files, .asp files, or
any variation on that web standard.
You can do this manually, or you can use a utility that OSIsoft includes in every PI
ActiveView installation. This utility is a small application written in VBA that performs these
tasks. It is possible to find it in: .\PIPC\ACVIEW\WebDev\EXPORT.PDI
Because PI ActiveView connects directly to the PI Server, it does require a direct connection
through port 5450 and a local installation. This does mean that PI ActiveView is a smart
client, not a thin client. Thus, we find it usually better suited to a companys intranet
environment, rather than a full web deployment.
Note: Linked ProcessBook buttons do NOT work with PI ActiveView. You must remove them from PI
ProcessBook before you create your display files.

10.1.2 Configure and Use PI ActiveView


The configuration process for the PI ActiveView Web Part is the same as for the PI Graphic.
The primary difference is that the file now is a .pdi file instead of an .svg file. However, you

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 160

PI ProcessBook, PI DataLink, PI WebParts Course


still follow the same procedure to upload the file to a SharePoint Document Library and link
the file to the appropriate web part.

For more information see "Configure PI ActiveView WebParts" in PI


WebParts User Guide, version 3.0, p. 52.

10.1.3 Specialty PI WebParts


There are two other specialty PI WebParts that we should mention. The RtBatchTable
interfaces with PI Batch to display batch data. This web part is really only useful if you have
licensed our PI Batch software.

For more information see "The PI BatchTable Web Part" in PI WebParts


User Guide, version 3.0, pp. 55-60.

The RtMessenger interfaces with Windows Office Communicator to display who in your
organization is online.

For more information see "The PI Messenger Web Part" in PI WebParts


User Guide, version 3.0, pp. 85-87.

These specialty web parts are covered in more depth in our other training options such as our
PI WebParts User and Administration class and in some of our online webinars.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 161

PI ProcessBook, PI DataLink, PI WebParts Course

11. AF Element Relative Visualizations


11.1 Introduction and Element Relative Displays
Objectives

Describe the AF structure


Build an element relative display in ProcessBook

You can save time by creating element relative PI Displays instead of displays that show data
for specific named PI tags.
11.1.1 The AF Structure Described
AF provides an asset model that allows users to organize and structure PI data and other data
according to objects that users are most familiar with, such as physical objects in their
processes like reactors, transformers and meters.
With AF, the overall PI System evolves from a server-centric approach to a more companyor enterprise-wide approach. The PI System becomes less focused on PI tags and more
focused on user-centric objects called Elements. AF is based on the Element, the useroriented object that contains attributes, which reference PI data, configured data, or data from
other systems.
The PI System Explorer is your access into the databases comprising AF. Use the Explorer to
configure the objects that represent your process, for example, reactors, transformers, meters,
boilers, heat exchangers.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 163

PI ProcessBook, PI DataLink, PI WebParts Course

Figure 6 - PI System Explorer Components


Browser
The Browser displays the PI System objects that you have created or imported into the
database, such as elements, templates, notifications, etc. Elements represent either physical
or logical entities in your process. They can be organized in several hierarchies. The path to a
certain area within the element hierarchy is called a context. If the context (plant, unit, etc) is
changed, the referenced PI points will change without having to search again for their tag
names. The structure of AF allows the information to be stored hierarchically in relation to a
physical model, a business model or an application model.
Element Attributes let you configure common names to access real time information through
references to PI tags. Example: the illustration below shows four reactors each with a
different PI tag that records temperature. The common name "Temperature" can be the name
of the Element Attribute that points to each of those PI tags depending on the Element
context chosen by the user.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 164

PI ProcessBook, PI DataLink, PI WebParts Course

You can search for PI Tags by browsing the PI System explorer browser tree structure or by
specifying search criteria.
11.1.2 Build Element Relative Displays in ProcessBook
PI ProcessBook is able to tie into AF to create Element Relative Displays. It can help you
build displays when you have redundant units.
Problem
A site has 100 units, such as wind turbines, AMI meters, valves, or pumps; each unit is
exactly the same with the same types of tags and properties. It is necessary to build a display
and monitor each one. You would prefer to not have to build 100 displays or to manage the
navigation between them.
Solution
Define the units as elements in AF with the PI Tags referenced as Element Attributes. You
can also build in any additional Attributes that you may want to reference. First, select a
template unit. Design the display using aliases from the template. Shift the context from
one unit to another. One display can be used to monitor all 100 units.
To add elements to a display, go to View > Element Relative Display. Choose the elements
that you wish to be included in the display. They will then be available in that display for
reference. To add the attributes to a Dynamic Element, you need to do the following:

Click Element Relative in the dropdown list beside the Tag Search button.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 165

PI ProcessBook, PI DataLink, PI WebParts Course

You will see a list of all the elements defined underneath the current element of
interest (i.e. the element selected in the Element Relative Display pane).
Choose the item you want to display and click OK.

You have just created one display for multiple units.


ProcessBook 3.2 also still ties in to the Module Database. The process for creating Module
Relative Displays is similar to creating Element Relative Dipslays, so we will not go into it
further at this time.
11.1.3 Exercise PI ProcessBook Element Relative Displays
The following questions are intended to reinforce key information presented in this
chapter or section. The answers can be found in the next step-by-step instruction
section.

Objectives

Create an element relative display in PI ProcessBook.


Use element relative values and trends in a display.

Problem Description
The assets of the production area have been completely modeled in the AF database. This enables the PI
client tools to access it. The operators on the floor will need to use various PI ProcessBook displays to
take advantage of this information. They first need a display that will show general information about the
production lines.
Approach
Both production lines have identical information attached to them, so the best way to build this is to use
an element relative display. A template Production Line - Template.PDI has already been
prepared by the operators with the images and shapes, but they rely on you to add the dynamic
information such as values and trends. The display needs to be converted to an element relative display
and the proper elements of interest attached to the display. You need to add the following information:

The product stored in the storage tank.


The percentage of space filled in the storage tank.
The product being mixed in the mixing tank.
A trend of the temperature in C for the last hour.

At the end, the display will look like this:

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 166

PI ProcessBook, PI DataLink, PI WebParts Course

Figure 7 The final appearance of the production line display

Once the display is completed, select the first production line in the Element
Relative Display panel and move the time range into the past. Notice the product
mixed, which is stored in the AF server and not the PI server, changed based on the
modification done in the Element Versioning exercise.
Save the file.

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 167

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.

Open the template display file named Production Line - Template.PDI. This display
contains only static shapes and text.

Figure 8 PI ProcessBook Template File


2.
3.

Click the menu File > PI Systems and connect to your AF Server and database.
Click the menu View > Element Relative Display. On the left pane appearing, click the Search
icon.

Figure 9 - Searching for Elements


4.

To link the display to the production area and its production lines child elements, search for the
Production Area element, select it and click OK. [If your AF database does not have this element,
please find two elements that have at least 3 common attributes (i.e. the names of the attributes are
identical) and use them in this step and the steps below.]

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 168

PI ProcessBook, PI DataLink, PI WebParts Course


5.
6.

Expand the production area to find the two production lines, select the first.
Insert the value "Percent Full" by going to Draw > Value, clicking in the area labeled "Percent Full"

on the display and selecting Element Relative instead of Tag Search with the
button. At this
point, make sure the ProductionLine1 element is selected, click Add Element Name, OK and OK
again. You can adjust the color and size of the element name to make it bigger.
7. Using similar steps, add as many of the values shown on the display as you can ("Product Stored,"
"Product Mixed," "Mixer Speed"). You will need to select the appropriate attributes.
8. Add a trend of "Temperature" in the rectangle labeled "Temperature."
9. In the Elements of Interest panel on the left side of the display, toggle between ProductionLine1
and ProductionLine2 to confirm all the settings in your display are element relative.
10. Save the file locally on your training computer.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 169

PI ProcessBook, PI DataLink, PI WebParts Course

11.2 The AF Database, PI WebParts, and Web Part Connections


Objectives

Display an attribute of an AF element in a web part.


Configure the PI TreeView web part to display element-relative data in PI WebParts
Create connections between two web parts

11.2.1 Display an Attribute of an AF Element in a Web Part.


Most PI WebParts can display data from the PI Server or other sources by referencing AF
Attributes. An attribute search allows you to pick an AF Server and database, search for
attributes, and add those you need to the Selected Data list.
To add attributes to a web part:
1.
2.
3.

In the Selected Data tool part, click the Select PI Data


button. The Select PI Data dialog
opens.
On the Attribute Search tab, choose an AF Server from the list of available servers.
Choose an AF database from the list of Databases within the selected AF Server.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 170

PI ProcessBook, PI DataLink, PI WebParts Course

Figure 10 - Select PI Data


4.

Navigate through the tree by clicking to expand nodes and select AF attributes.

Note: Support for the display of attribute values is limited to certain types of attributes only. Specifically,
PI WebParts can display the values of attributes containing constant values or PI Point data references.
Furthermore, PI Point data references must be based on a PI Point (not another attribute) and in the data
reference definition in AF the value retrieval methods must not be modified. Attempting to configure a
web part to display the value of other kinds of attributes will result in unsupported data reference errors
in the web part.

11.2.2 Display Element-Relative Data in PI WebParts


The PI TreeView web part is a navigational control most typically used to browse assets in an
AF database and set context paths for other web parts. By providing AF Element and

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 171

PI ProcessBook, PI DataLink, PI WebParts Course


Attribute data to other web parts through web part connections, PI TreeView can drive the
view of assets provided by web parts in the page.

Figure 11 - PI TreeView Web Part

For more information see "Configure the PI TreeView WebPart" in PI


WebParts User Guide, version 3.0, p. 89-92.

PI TreeView web parts can pass AF Attributes and context paths to both PI WebParts and
third-party or custom web parts.
Note: PI TreeView respects access restrictions applied within the AF Server. Users must have Read
access or better to an element or attribute to see it in the web part.
To configure the PI TreeView web part:
1.

Click the Browse button in the PI TreeView tool pane to display the Configure AF TreeView
dialog.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 172

PI ProcessBook, PI DataLink, PI WebParts Course

Figure 12 - Configure AF Tree View


2.
3.
4.

Choose an AF Server from the list of available Servers.


Choose an AF database from the list of Databases within the selected AF Server.
Expand the tree to find the desired elements and then drag them into the settings fields at bottom to
set paths. You can also right-click an element and use the context menu to save it to a field.
Root Node: A path to the root node of a tree that appears in the PI TreeView web part, such as:
\\<AF Server Name>\<AF Database Name>

The root node should specify a parent that includes all desired descendent elements and attributes
desired for use. This parameter is required to configure the web part.
Default Selected Node: An optional path to an element used as the default selected node for the
web part. The path uses the following format:
\\<AF Server Name>\<AF Database Name>\<Element>

Attributes of the specified element path are sent to connected web parts automatically when the
page is loaded.
You can configure the PI TreeView web part as a provider of the AF context path to other
web parts. With proper configuration on both provider and consumer, when the user chooses
an element in the PI TreeView, any data item on the consumer web part will be redirected to
display the attribute on the selected element that has the same name as the data item.
For example, in Figure 11 above if the user is viewing element "Colo 01.01" and then clicks
on element "Colo 01.03", the consumer web parts will all change any data items that
reference attributes in "Colo 01.01" to display the attributes that have the same name in "Colo
01.03".

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 173

PI ProcessBook, PI DataLink, PI WebParts Course

For more information see "Context Path Example" in the PI WebParts


2010 User Guide, version 3.0 pp. 34-35.

11.2.3 More on Connections between Two Web Parts


Using simple menus and dialog boxes, you can connect Web Parts together by passing data
between them and synchronizing their behavior. For example, if you have a List View Web
Part of Contacts with a column that has a hyperlink to a picture of the contact and the Image
Web Part on a Web Part Page, you can connect the two Web Parts together. Each time you
select a row in the List View Web Part of Contacts, you can see the picture displayed in the
Image Web Part.
All PI WebParts, except the PI TreeView, are designed to use the client-side event-based
mechanism for receiving changes. These web parts and any others that support SharePoint
web part connection interface can be specifically configured to use the Start Time and End
Time parameters from the PI TimeRange web part. This web part provides data to other,
connected web parts, but does not accept values from other web parts.
To establish a connection between Web Parts, you must do the following:
1.
2.
3.
4.
5.

On the Web Part Page title bar, click Site Actions> Edit Page. The Connections selection in the
Web Part menu only appears while in Edit mode.
Decide which two web parts you want to connect. You can create or modify the same connection
starting from either web part.
From either the Consumer (the Web Part receiving the data) or Producer (the one providing the data)
Web Part, click the Web Part menu, and then move the cursor over Connections.
From the connection type submenu, select the type of connection you want to create or modify, such
as Provide Row To or Filter Data With.
From the available Web Parts submenu, select the web part for which you want to create or modify
a connection.

Some web parts require editing in the configuration panel to complete the connection. In the
configuration pane for PI WebParts, click on the Connections button (lightning bolt) to
complete the connection.

For more information see "Connect Web Parts" in PI WebParts User


Guide, version 3.0, pp. 41-49.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 174

PI ProcessBook, PI DataLink, PI WebParts Course


11.2.4 Exercise Making Connections
The following exercise is intended to reinforce key information presented in this
chapter or section. The answer can be found at the end of the exercise.

Objective

Familiarize yourself with connecting web parts.

Problem Description
You understand that you can pass data from one web part to another. You want to create a
web page where you can see a list of tags, but drill down to view the recent history for any
one of them. You decide to use the PI Values web part to list some tags and want to pass
selected tag names to the PI TimeSeries web part.
Approach
Create a new page in your Team Site called Exercise_R8. Set the page in Edit Mode. Add
one PI Values and one PI TimeSeries web parts to any zone. Modify the settings of the PI
Values web part by selecting Modify Shared Web Part. Perform a tag search on tags that
begin with CD and add them to the data area. In the selected columns choose: DataSet, Time,
Value, and Current State. Add the values for Interval Maximum and Interval Minimum and
click on the OK button.
For the PI Values web part pass the parameter of Tag Name to the PI TimeSeries web part.
Test the web part interaction by clicking on a tag name in the PI Values web part and observe
the PI TimeSeries web part. Below is a sample illustration.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 175

PI ProcessBook, PI DataLink, PI WebParts Course

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

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 176

PI ProcessBook, PI DataLink, PI WebParts Course

Step-by-Step Solution
1.
2.
3.

4.
5.
6.
7.

8.

On your SharePoint webpage, click on Site Actions > Create.


Click on Web Part Page.
Enter information regarding the name and the layout of the web part page
Enter Exercise_R8 as page name;
Leave the other default settings;
Click on the Create button to validate your selection.
In one of the zones, click on the Add Web Part button.
Check the PI Values box, click on the Add button.
On the PI Values Web Part, click Edit > Modify Shared
Web Part.
In the Modify Shared Web Part pane on the right
Click the Tag Search icon.
In the Name mask field enter CD*.
Double click the desired tags or select them and click
on the Add button.
Click on the OK button to close the Tag Search
window.
In the Selected Columns choose DataSet, Time,
Value, and Current State.
Add the values also for Interval Maximum and
Interval Minimum.
Click on the OK button.
In one of the zones, click on the Add Web Part button.

9. Check the PI TimeSeries box, click on the Add button.


10. In the PI Values web part, click Edit > Connections > Provide Parameters to > PI TimeSeries.

11. On the PI TimeSeries Web Part, click Edit > Modify Shared Web Part.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 177

PI ProcessBook, PI DataLink, PI WebParts Course


12. In the Modify Shared Web Part pane on the right
Click the on Connections icon.
In the Connected web parts dialog box, click PI
Values in the Name area and Tag Name in the
Connection field area.

13. Click on the OK button at the bottom of the edit pane.


14. Click on the Exit Edit Mode link.
15. Select different tag names in the PI Values web part and observe the behavior of the PI TimeSeries
web part.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 178

PI ProcessBook, PI DataLink, PI WebParts Course

12. Conclusion
12.1 Training
The OSIsoft Training page is located at http://training.osisoft.com. From here you can see our
current training offerings and upcoming events. There are currently 5 Ways to Learn about
PI, with additional methods coming shortly.
Live training webinars are offered regularly for customers who are enrolled in the Software
Reliance Program (SRP). We have both the Show Me the Value webinar series which
provides new and exciting business ideas, and the Show Me How webinar series that
provides technical knowledge on a very specific topic.

12.2 vCampus
vCampus is a subscription-based, online offering that consists of providing everything people
need to develop applications on the PI System. Focusing on 'doing it right', this communityoriented program provides resources such as:

Full development PI System;


Community experience with discussion forums and blogs;
Online library;
Technical, interactive webinars.

vCampus is intended to facilitate and encourage communication around PI programming and


integration between OSIsoft partners, customers and employees. Please consult our
Frequently Asked Questions (FAQ) section at http://vcampus.osisoft.com/content/FAQ.aspx
or contact us at vCampus@osisoft.com for more details.

12.3 Tech Support


We recommend visiting the Tech Support site, http://techsupport.osisoft.com, often. From
here you have many options. You can download anything your company is licensed for using
the Download center. You can view our Engineering plan to get information about the most
current releases and predicated release dates and features for new version or products. You
can login and view your support calls, both currently open and previously closed. You can
also search through our Knowledge Base to try and troubleshoot any issues you may be
having on your own.
The phone number and email address for OSIsoft Technical Support:
phone: (01) 510 297-5828
e-mail: support@osisoft.com
Before you contact Tech Support, it is helpful to have certain information readily available.
The OSIsoft engineer will ask the name of the product, the version number, and the computer
platform. Determine the PI version and build numbers using the Operation > Version option

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 179

PI ProcessBook, PI DataLink, PI WebParts Course


in PI SMT. Alternately, you can learn the version of almost all PI executables (including
interfaces) by invoking the executable with the v parameter from a command prompt. Here
is an example:
cd \pipc\bin
bufserv -v

Get computer platform (CPU type, operating system, and version number) as follows:
On Windows, right-click on My Computer icon and select Properties tab.
On UNIX, type uname -a
Note the time that the difficulty started, and be prepared to report the contents of the message
log at that time. The message log is found in the Operation > Message Log Viewer option in
SMT. You will likely also need the PIPC log covering the applicable timerange. This log is
located in \\pipc\dat.

12.4 Further Questions


For questions about Licensing, if you are in the US, you can find your salesman listed at
http://www.osisoft.com > Contact Us > US Sales. If you are outside the US you can find
your salesman listed at http://www.osisoft.com > Contact Us > International Sales.
For questions about existing Support Issues, you should call technical support at 510 2975828 or visit http://techsupport.osisoft.com > My Support > My Calls.
For questions about unresolved training issues, contact your instructor or email
training@osisoft.com.
For all other questions, please contact our Customer Service group via email at
customerservice@osisoft.com.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 180

PI ProcessBook, PI DataLink, PI WebParts Course

13. Exercise Global Recap Question (optional)


The following exercise is intended to reinforce key information presented throughout
this course.

Objectives

Review the main functionalities of PI ProcessBook, PI DataLink and PI WebParts.


Understand and use the relationships between the software.

Problem Description
Your company has extended the production plant with brand new machinery. In order to give
access to the plant data to your coworkers, you need to implement new material using the
PI ProcessBook, PI DataLink and PI WebParts.
Some of the data will only be used by operators who are experienced with PI ProcessBook
and like its flexibility. You will need to create a few displays for them and organize them
adequately. Other data requires a more numerical analysis and you prefer using PI DataLink
to analyze it. Finally, other data are of interest for the whole plant staff and you chose to
distribute it using PI WebParts so that everyone will be able to access the data using their web
browser.
Approach
Here are the items that should be implemented so that your users can have an efficient access
to the data of the new section in the plant:

PI ProcessBook files with the following characteristics:

A standalone display showing a pump picture and two tags related to it,
BA:ACTIVE.1 and B A:CONC.1.
A ProcessBook containing a link to the display mentioned above, an embedded
display (described below) and a URL link to the OSIsoft technical support
website.
The embedded display showing a tank image and a scaled bar graph with its
level. This display should be element relative if you have an AF database
structure you can use that has the same aliases in two or more modules.

PI DataLink and Excel report with the following characteristics:

A cell showing the current state of a piece of machinery using tag CDM158.
A table with the latest 10 values of tag CDT158.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 181

PI ProcessBook, PI DataLink, PI WebParts Course

A PI Expression with the average of Sinusoid for the last hour and how that
compares with the current value of CDT158.
The table should use conditional formatting to highlight the lowest 10% of values
to help the users visualize the report.

PI WebParts page with the following properties

An PI Gauge web part showing the key performance indicator (KPI) represented
by tag sinusoidu
A text web part explaining in 1 sentence how the users can pull an ad hoc trend
of the current electrical consumption using the PI Gauge.
An PI TimeSeries web part showing the history of the last 10 minutes of the tag
BA:TEMP.1.
An PI Graphic web part containing the display previously created in
ProcessBook
An Excel Web Access web part containing the PI DataLink report previously
created.

Note: This recap exercise can be performed in various ways, no Step-by-Step solution is provided so you
can design your own solution. Please consult your instructor if you have any questions.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 182

PI ProcessBook, PI DataLink, PI WebParts Course

14. Group Recap Answers


Chapter 1 Question 1:
The Interfaces, the Server, the Analytics, and the Visuals
Chapter 1 Question 2:
Exception and Compression
Chapter 1 Question 3:

Hours
Minutes
Seconds
Days
Weeks
Months
Years

__H___________
__M___________
__S___________
__D__________
__W__________
__MO_________
__Y___________

Chapter 2 Question 1:
The PI Server name, the connection type, the default user, and the port number.
Chapter 2 Question 2:
The * for any number of characters and the ? for a single character.
Chapter 2 Question 3:
c. and f.
Chapter 2 Question 4:
The scroll bar and the One time period forward backward functions.
Chapter 2 Question 5:
The second statement is false. Any changes done in Run mode are temporary and will not
change the original configuration of the display. Those changes will not be saved.
Chapter 2 Question 6:
Integer, float, string, array, file, etc.
Chapter 3 Question 1:
The level of the entry need to be set to 1.
Chapter 3 Question 2:
The Trend, XY plot, Bar Graph, value and any Multi-state Symbol are all dynamic
elements.
Chapter 6 Question 1:
The PI DataLink functions will be refreshed when the Excel spreadsheet is Calculated. To
refresh PI Time functions, a Full Recalculate must be performed.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 183

PI ProcessBook, PI DataLink, PI WebParts Course


Chapter 6 Question 2:
Manually (select new array, press F9, press CTRL-SHIFT-ENTER), selecting the Recalculate
(Resize) PIDL formula option from the right click menu, or going back into the PI DataLink
function dialog and clicking the OK button.
Chapter 6 Question 3:
For each one of the retrieved archived values, the questionnable, substituded and annotated
flags will be retrieved if the Show Value Attributes option is checked. If the Show
Annotation option is checked and there is an annotation to the value, it will also be retrieved.
Chapter 8 Question 1:
False, the PI WebParts connect to PI Data Services. It is PI Data Services that maintains a
connection to the PI server(s) and also to the external data sources.
Chapter 8 Question 2:
False, a single PI Gauge web part can be configured to display multiple gauges.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 184

PI ProcessBook, PI DataLink, PI WebParts Course

15. Glossary
COM
Component Object Model, a software interface standard for software componentry introduced
by Microsoft in 1993.
DCOM
Distributed Component Object Model, a Microsoft proprietary technology for software
components distributed across several networked computers to communicate with each other.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 185

PI ProcessBook, PI DataLink, PI WebParts Course

16. Index
No index entries found.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, mechanical, photocopying, recording,
or otherwise, without the prior written permission of OSIsoft, Inc.
Copyright 1995-2010 OSIsoft, LLC, 777 Davis St., Suite 250, San Leandro, CA 94577

Page 186