47
2015 OSIsoft TechCon Using Future Data to Predict your Process

Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

  • Upload
    hadung

  • View
    230

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 OSIsoft TechCon

Using Future Data

to Predict your Process

Page 2: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

2 | P a g e

OSIsoft, LLC

777 Davis St., Suite 250

San Leandro, CA 94577 USA

Tel: (01) 510-297-5800

Web: http://www.osisoft.com

© 2015 by OSIsoft, LLC. 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, LLC.

OSIsoft, the OSIsoft logo and logotype, PI Analytics, PI ProcessBook, PI DataLink, ProcessPoint, PI Asset

Framework (PI AF), IT Monitor, MCN Health Monitor, PI System, PI ActiveView, PI ACE, PI AlarmView, PI

BatchView, PI Coresight, PI Data Services, PI Event Frames, PI Manual Logger, PI ProfileView, PI

WebParts, ProTRAQ, RLINK, RtAnalytics, RtBaseline, RtPortal, RtPM, RtReports and RtWebParts are all

trademarks of OSIsoft, LLC. All other trademarks or trade names used herein are the property of their

respective owners.

U.S. GOVERNMENT RIGHTS

Use, duplication or disclosure by the U.S. Government is subject to restrictions set forth in the OSIsoft,

LLC license agreement and as provided in DFARS 227.7202, DFARS 252.227-7013, FAR 12.212, FAR

52.227, as applicable. OSIsoft, LLC.

Published: May 8, 2015

Page 3: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

3 | P a g e

Contents Objectives ................................................................................................................................................. 4

Prerequisites ............................................................................................................................................. 4

Materials ................................................................................................................................................... 4

Instructions ............................................................................................................................................... 4

1. Introduction ...................................................................................................................................... 5

2. Challenge ........................................................................................................................................... 7

3. Use PI Coresight to visualize raw data .............................................................................................. 9

4. Integrate future data in PI AF.......................................................................................................... 11

4.1. Associate future tags with PI AF Attributes ............................................................................ 12

4.2. Create asset-based analytics to leverage future data in PI AF................................................ 15

5. Create an element relative PI Coresight display ............................................................................. 25

6. Create a PI DataLink Report to Schedule Maintenance Teams (Time allowing) ............................ 26

7. Create a PI ProcessBook Display to show anticipated production from solar panels (Time

allowing) .................................................................................................................................................. 33

Annex A: List of PI AF substation parameters ......................................................................................... 42

Annex B: PI AF Categories ....................................................................................................................... 44

OSIsoft Virtual Learning Environment ........................................................................................................ 46

Page 4: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

4 | P a g e

Objectives

o Define “future data” in the PI System

o List the ways future data can be injected into the PI System

o Describe why PI AF is the best container for metadata

o Configure AF templates that reference these future PI points

o Create AF elements based on those templates

o Create AF analyses that that shows delta between forecast and actual

o Create PI Event Frames to capture the metadata around the results

o Create a PI Coresight Display to show your data

o Create a PI DataLink Report and a PI ProcessBook Display to show your data (optional – time

permitting)

Prerequisites

o Some familiarity with PI Data Archive and PI Asset Framework

o Some familiarity with the PI Visualization clients (PI Coresight, PI ProcessBook, PI DataLink)

Materials

Provided for you:

o PI Data Archive server with PI Points and data

o PI Asset Framework with a base hierarchy

o PI Clients installed: PI Coresight 2015, PI ProcessBook 2015, PI DataLink 2014 SP1

Instructions

◊ This lab consist of 5 exercises (2 optional).

◊ The exercises can be performed independently by using the CaliforniaWeather_Completed

database for sections 5,6, and 7

◊ For each exercise, general instructions are provided followed by step-by-step instructions.

◊ If you feel comfortable with the general instructions, go ahead and try to do the exercises on

your own. Don’t hesitate to ask questions to the lab instructor if needed.

◊ If you choose to follow the step-by-step instructions, complete each action marked by a red

diamond symbol.

Page 5: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

5 | P a g e

1. Introduction

In this session, we will describe one way to use “future data” in the PI System. Let’s start with a

common definition, in this case from Wikipedia:

Forecasting is the process of making statements about events whose actual outcomes (typically) have

not yet been observed. A commonplace example might be estimation of some variable of interest at

some specified future date. Prediction is a similar, but more general term. Both might refer to formal

statistical methods employing time series, cross-sectional or longitudinal data, or alternatively to less

formal judgmental methods. Usage can differ between areas of application: for example, in hydrology,

the terms "forecast" and "forecasting" are sometimes reserved for estimates of values at certain specific

future times, while the term "prediction" is used for more general estimates, such as the number of times

floods will occur over a long period.1

And in the PI System, we define “future data” as time-series data that isn't measured and collected in

real-time from machine sensors, and will typically have a timestamp in the future. From its primary

function as a data historian, the PI Data Archive is designed to preserve all time-series data, which

includes future data. As a result, future or "non-measured" data will exist in the future but also in

the past (e.g., important forecasts kept for subsequent analysis, optimization, or auditing).

Future data is now handled natively by PI System 2015 –including storage, analytics, data access,

reporting, and visualization– and is most useful when compared or combined with real-time or

historical data.

Although the internals of future data in the PI System and the configuration and

administration tasks associated to it are not in the scope of this lab, let’s take a quick look

at how future data can be stored into the PI System.

In PI System 2015, a new concept has been introduced: future PI Points. Those can be

created by setting the new “future” attribute to 1 at point creation. This attribute can be

set using the PI SMT Point Builder or the Excel PI Builder add-in and cannot be modified

after the point has been created.

Tags with the attribute set to 0 – referred to as “historical tags” – are identical to the tags in all previous

versions and will reject data with timestamps more than 10 minutes into the future.

1 http://en.wikipedia.org/wiki/Forecasting

Page 6: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

6 | P a g e

The picture below shows a couple ways to create future tags

Generally speaking, future tags should be used when storing data that is not collected sequentially in

chronological order. For example, process or operational data should be kept in historical tags because it

is measured and collected in real time. On the other hand, forecasts or any form of predictive data over

an arbitrary time range are perfectly suited for future tags. Data for all future tags is stored in

completely separate archive files. Future data never moves to the historical archive files even after the

future data ages into the past. The archive files for future tags will be created automatically as data is

written to the tags. All future archive files will be created in the directory specified during installation,

and this location can be changed any time afterwards using the new Archives plug-in included with PI

SMT 2015.

Writing data to future tags is just like writing data to historical tags – just with different timestamps.

Thus, in general, you should be able to use all your favorite programs and tools for writing data. The

allowed timestamp range is January 1970 to January 2038. Some common options are the following:

o Standard OSIsoft interfaces like the PI UFL, PI RDBMS, or PI HTML Interfaces

o Configured analyses and calculations with Asset Analytics, starting with PI Server 2015 Beta 3

o A custom application using PI AF SDK, PI Web API, or PI OLEDB Enterprise

o PI SMT Archive Editor

The ways in which you use future data are only as limited as your need and creativity. In this example

we will use the analytics capability of the PI Server 2015 to determine forecast error from actual, create

more forecast values, etc.

For more information, please watch our webinar titled, Capturing Future Data with PI Server 2015 BETA,

available on our website (www.osisoft.com) under Resources � Webinars � Webinars on demand

(http://www.osisoft.com/Templates/item-abstract.aspx?id=11985)

Page 7: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

7 | P a g e

2. Challenge

You have been hired as a consultant by Sunshine Corp, LLC to help them take advantage of the new

future data features of the PI System 2015.

On your first day, you’re provided with weather data from weather stations in the following airports, all

in the beautiful state of California:

o Bakersfield Meadows Field Airport (KBFL)

o Los Angeles International Airport (KLAX)

o Palo Alto Airport (KPAO)

o Porterville Municipal Airport (KPTV)

o San Francisco International Airport (KSFIO)

o San Jose International Airport (KSJC)

o Oakland International Airport (KOAK)

For each one of the above airports, the following PI Points are available

Real-time data tags

Future data tags

• NWS_<Airport Code>_PressureIn

• NWS_<Airport Code>_RelativeHumidity

• NWS_<Airport Code>_Temp

• NWS_<Airport Code>_Visibility

• NWS_<Airport Code>_Weather

• NWS_<Airport Code>_WindDirection

• NWS_<Airport Code>_WindSpeed

• <City>.ChanceOfFog.Forecast

• <City>.ChanceOfFrost.Forecast

• <City>.ChanceOfHighTemp.Forecast

• <City>.ChanceOfOvercast.Forecast

• <City>.ChanceOfRain.Forecast

• <City>.ChanceOfRemDry.Forecast

• <City>.ChanceOfSnow.Forecast

• <City>.ChanceOfSunshine.Forecast

• <City>.ChanceOfThunder.Forecast

• <City>.ChanceOfWindy.Forecast

• <City>.CloudCover.Forecast

• <City>.DewPoint.Forecast

• <City>.FeelsLike.Forecast

• <City>.HeatIndex.Forecast

• <City>.Humidity.Forecast

• <City>.Precipitation.Forecast

• <City>.Pressure.Forecast

• <City>.Temperature.Forecast

• <City>.Visibility.Forecast

• <City>.WeatherDescription.Forecast

• <City>.WindChill.Forecast

• <City>.WindDir16Point.Forecast

• <City>.WindDirDegree.Forecast

• <City>.WindGust.Forecast

• <City>.WindSpeed.Forecast

Page 8: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

8 | P a g e

After discussing with your customer, you decide to take the following approach:

o Look at some of the raw data points using PI Coresight

o Put some context around the data by creating a structure in PI Asset Framework (PI AF)

o Build a few PI AF analyses to compare forecasts with simulated process data, and create

aggregated calculations using future data.

o Use PI Coresight to create a display showing significant weather data for different sites

o Create an event report using PI DataLink to keep track of significant weather events

Page 9: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

9 | P a g e

3. Use PI Coresight to visualize raw data

First we want to build a PI Coresight display holding all forecasted temperature.

The display should look as follows:

Play around with this display and explore PI Coresight functionalities. Try to answer the following

questions:

• How is the current time represented?

• What does the Now button do? Do you notice any particular behavior? (Hint: Navigate in the

past until the current time is not displayed on the trend, then do the same in the future)

Page 10: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

10 | P a g e

Step-by-step instructions:

◊ Open Internet Explorer, navigate to the PI Coresight landing page (http://localhost/Coresight),

and create a new display.

◊ In the Search Pane, search for all temperature forecast tags on the PI Data Archive Server.

◊ Drag all the forecast PI tags returned by the search onto the display, and display them as value

symbols.

◊ Build a trend underneath the values showing all forecasted temperatures.

◊ Using the Timebar control, change the time range of the trend to show exactly 1 day in the past

and 1 day in the future. Notice the dotted line representing the current time.

◊ Modify the trend to show one scale for all traces and compare the temperature forecasts

between them.

◊ Navigate in the past/future. Do the values displayed by the Value symbols change? When?

◊ Change the trend to a Table symbol, and note the Maximum/Minimum values of the forecasted

temperature over 48 hours periods.

◊ PI Coresight automatically saves your work. Change the table back to a trend and modify the

display with the name of your choice.

Page 11: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

11 | P a g e

4. Integrate future data in PI AF

Our customer has a PI AF Structure that already holds real-time data.

Take some time to familiarize yourself with the database (how is it organized, what are the templates,

which data references are used, etc.). Pay close attention to the template NWS_WeatherStation, as it is

the one we are going to use the most throughout the rest of the lab.

Page 12: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

12 | P a g e

4.1. Associate future tags with PI AF Attributes

We now need to integrate the future data tags into our PI AF Structure. There are several ways to do

this. We could, for example, create an element template that only holds forecast data and have our

forecasted and observed weather live in separate elements. Instead, we will simply extend the

NWS_WeatherStation element template, and use AF Categories to discriminate forecasted weather

from actual observations. This approach is simpler, and will also be very convenient when we get to use

the PI Coresight Element-Relative features to compare forecasted and observed weather conditions

across different cities.

An Excel file called NWS_WeatherStation+FutureData.xlsx is available under C:\TechCon_Lab\ and has

references to Future Data tags. That file can be used in conjunction with the PI Builder Excel add-in to

integrate future tags in the CalifornoaWeather_Lab PI AF Database

Would you have taken a different approach? Why?

Page 13: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

13 | P a g e

Step-by-step instructions:

◊ Open the file C:\TechCon_Lab\NWS_WeatherStation+FutureData.xlsx.

◊ Review the configuration of the template, especially the AttributeConfigString (Note: You can

consult the list of PI AF Substitution parameters annexed to this document to figure out whether

the configuration strings created used make sense?).

◊ Using the PI Builder Excel add-in, edit the NWS_WeatherStation Element Template.

o Make sure the CaliforniaWeather_Lab AF database is selected as your destination

database in the Connections pane on the left-hand side of the PI Builder Ribbon

o Click on the Publish button in the PI Builder Ribbon.

o In the Publish Options dialog that appears, select Edit Mode: Create and Edit and check

the Automatically create missing categories option.

(Bonus question: Why don’t you need to select the option to Create or Update PI points

in this case?)

◊ Back in PI System Explorer, validate the NWS_WeatherStation Element Template was

successfully edited and that you can now see the forecast data associated to your weather

stations.

Page 14: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

14 | P a g e

Page 15: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

15 | P a g e

4.2. Create asset-based analytics to leverage future data in PI AF

Next, we are going to create analyses based on the future data we just brought into PI AF.

4.2.1. Create an analysis to calculate the difference between an observed value and a forecasted

value

Create an analysis template that calculates the difference between the forecasted temperature and its

actual observed value. This analysis needs to be triggered every time the real-time temperature gets a

new value and they need to use a specific Analysis category named Weather Analysis (Note: there is

more info on AF Categories in Annex B).

Page 16: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

16 | P a g e

Step-by-step instructions:

◊ In PI System Explorer’s Library pane, select the NWS_WeatherStation Element Template.

◊ Navigate to the Analysis template tab.

◊ Create an expression analysis calculating the difference between the forecasted and the observed

values, and storing them in attribute templates. This calculation needs to be triggered whenever the

measured temperature or wind speed gets a new value.

o Create a new Expression analysis called ‘Temperature Delta Calculation’.

Note: You can create Categories as needed.

o Select one of your airports as an Example Element.

This will allow us to use the ‘Evaluate’ button to test your analyses, and also to take

advantage of the ability to add attributes in expressions from the Attributes panel on the

right of the expression as we will see in a moment.

o Create an expression calculating the difference between the measured temperature and its

corresponding forecasts, and map the result to an output attribute (Hint: the latter can be

created on the fly, and modified later on).

Note: you can use the Attributes panel on the right of the expression to insert the relative

references to attributes in the expressions.

o Click the Evaluate Button to test the expressions you created.

Page 17: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

17 | P a g e

o You can also preview your results will be like by right-clicking on the analysis and clicking

“Preview Results” � “Generate Results”.

o Under ‘Scheduling’, choose ‘Event-Triggered’.

o Set the analysis to trigger on the observed temperature.

o Navigate to the Attribute Templates tab, and select the ‘Temperature Delta’ Attribute just

created.

o Set it its default UOM to delta degree Fahrenheit (delta °F) and add the Weather Analysis in

the categories (Hint: you will likely need to create that category! This should be pretty

straightforward, but if you’re not sure how, refer to Annex B).

o Check in your changes.

Page 18: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

18 | P a g e

4.2.2. Create an analysis to calculate the maximum and minimum forecasted temperatures over a

24h period

We are now interested in calculating, every day around midnight, the forecasted maximum and

minimum temperatures over the upcoming 24 hours.

The calculation must be run every day at 12:30 AM, but the result must have a timestamp at 12:00 AM.

Page 19: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

19 | P a g e

Step-by-step instructions:

◊ Navigate to the Library pane in PI System Explorer and select the NWS_WeatherStation Element

Template.

◊ Create an expression analysis called ‘Min-Max. Temperatures’ and select, as you did before, an

example element.

◊ Create expressions calculating the maximum and minimum values for the forecasted temperature ,

over a 24h period starting at 12:00AM every day.

◊ Configure the analysis to run every day at 12:30 AM (Note: our forecast data is updated every day at

12:15 AM).

◊ Override the output timestamp so that it shows at 12:00 AM although calculations are performed at

12:30 AM.

o In the Scheduling section at the bottom of the Analysis Management window, click

Advanced…

o Check the Override output timestamp option and enter t (PI Time abbreviation for Today) as

your output timestamp.

Page 20: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

20 | P a g e

Note: Could this timestamp have been in the future? Absolutely! Just make sure your output

attribute is mapped to a future tag, and override the output timestamp with a time in the

future such as *+24h, t+48h, etc.

◊ Check in your changes.

As before, let’s make sure our output attributes have the correct unit of measure and AF category.

◊ Navigate to the Attribute Templates pane.

◊ Set the default UOM to degree Fahrenheit and the category to Weather Analysis for the Forecasted

Minimum Temperature and Forecasted Maximum Temperature attributes.

◊ Check in your changes.

Page 21: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

21 | P a g e

4.2.3. Create the PI Points holding the results of the analyses and perform backfilling

Now that our weather analyses were properly created, we will create the PI Points holding the results.

This will increase performance a lot when clients request for historical data for those analyses. If we did

not write the calculations results in PI Points, they would be performed on the fly every time a client

asks for them, which would result in greater overhead.

Page 22: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

22 | P a g e

Step-by-step instructions:

◊ Navigate to PI System Explorer’s Elements pane, select one of your weather stations. Notice how

our analyses are complaining that the PI Points they are supposed to write to do not exist.

◊ Right-click on the root element in your PI AF Database and select Create or Update Data Reference.

◊ Verify that data references were properly created.

Note that we could have created the data references element by element, but that, of course, would

have taken longer.

Page 23: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

23 | P a g e

Let’s now backfill our weather analyses in order to have some past data to work with.

◊ Navigate to PI System Explorer’s Analyses pane.

◊ Check the newly created analyses, and click on Backfill checked analyses.

◊ Set the start and end times to *-7d and * respectively, then click the Queue button. This will backfill

a week of data into our analyses.

Page 24: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

24 | P a g e

◊ Wait until our backfilling is completed and verify that our weather analyses now have data for the

last 7 days.

You can verify that the timestamps for our forecasted maximum/minimum temperatures were

properly set by right clicking on one of them and selecting Time-Series Data.

Page 25: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

25 | P a g e

5. Create an element relative PI Coresight display

Note: At this point, your AF Database should be ready to work with. If it is not, don’t worry, we have

your back! Simply switch to the AF Database called CaliforniaWeather_Completed, and use that one for

the rest of the exercises.

We now want to build a weather dashboard for data using PI Coresight. For this exercise, you will not be

provided with a step-by-step solution. Instead, we want you to explore the features of PI Coresight

related to PI AF and build a display that would be useful in your opinion.

Here’s an example display:

◊ Explore different features such as:

o Switching between assets using the PI Coresight Related Assets features

o Locking the time range for a specific trend

o Etc.

◊ Reflect on the different ways future data (be it weather data or other type of data) can be used in

your industry

Page 26: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

26 | P a g e

6. Create a PI DataLink Report to Schedule Maintenance Teams (Time allowing)

Every two weeks, you need to send a maintenance team to each of the weather stations to check on the

equipment, check calibration, gather samples, etc. Historically, the productivity and thoroughness of

maintenance teams is dependent on weather conditions such as temperature, humidity, and

precipitation. Sending the teams out during favorable weather conditions will save the company a

significant amount of money, and will also keep the maintenance workers happy. After all, would you

want to be outside when it is freezing cold and pouring rain?

Your goal is to use the forecast weather data and PI DataLink to generate a report that makes it easy to

determine the best day(s) out of the next two weeks to send a maintenance team to each site. You can

decide on your own “ideal” conditions, but if you want guidance, let’s assume 70⁰F, no precipitation, no

wind, and no humidity are ideal conditions. You can choose to include as few or as many of these items

in your report as you want. Also, to avoid clutter on the spreadsheet, it would be great if you only need

to look at one site at a time, but can easily switch between the various sites in the same spreadsheet.

As always, you can try to complete this task on your own first, but the next page has instructions for one

possible way to complete this task.

Page 27: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

27 | P a g e

Step-by-step instructions

◊ Open Microsoft Excel

◊ Create fields for the start and end time, and fill in “t” and “t+14d” respectively:

◊ From the PI DataLink ribbon, select Calculated Data.

◊ For Data Items, browse for the Bakersfield Temperature forecast

(\\PISRV1\CaliforniaWeather_Lab\California\Bakersfield\Bakersfield Meadows Field

Airport|Forecasted Temperature).

◊ As shown in the image above, also set the Start time and end time to the cells you set up before.

◊ Set the time interval to 1d, the Calculation mode to average, and check Show start time.

◊ Click OK to display daily temperature averages for the next two weeks at Bakersfield Airport:

Page 28: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

28 | P a g e

This shows the temperatures for one site, but we want to be able to easily switch between sites, so let’s

set that up next.

◊ Select the cell two rows above Avg. Temp. (cells D4:D5), then from the PI DataLink ribbon, select

Search:

◊ Using the element California as the root of your search, search for “forecasted temperature”

and select all of the “Forecast Temperature” results (hold shift to select all attributes or just hit

Ctrl + A

◊ Move the “Root path length” slider all the way to the right to Maximum, and choose Drop-down

list for “Insert root paths in”.

Page 29: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

29 | P a g e

◊ Click OK, and you spreadsheet should look like:

Now let’s reorganize it a little bit!

◊ Type “Root Path” in Cell A3, and move the contents of the cell holding the root path (D4) to cell

B3.

◊ Click in any of the cells holding the average temperatures. The Calculated Data Pane should

open on the right hand side.

◊ Change the Root Path to Cell B3 and the Data Item to cell D5.

Page 30: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

30 | P a g e

◊ Click OK and you should be able to choose any site from the root path drop-down list, and the

daily average temperatures will update to the selected site.

Page 31: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

31 | P a g e

Now that this is done for temperature, it should be fairly easy to add other calculated values, such as

total precipitation, maximum wind speed, average humidity, and/or any other attributes you want to

use. Let’s start by adding Total Precipitation:

◊ In the cell to the right of Temperature (E5), type Forecasted Precipitation (this is the name of the

attribute for forecasted precipitation).

◊ From the PI DataLink ribbon, select Calculated Data.

◊ For the Root path, choose the cell that has the root path drop-down list, for Data Items choose

the Precipitation cell.

◊ Set the start and end times to the corresponding cells. Set Time interval to 1d, and calculation

mode to Total.

◊ Set the Output cell to where you want it (to the right of the first Avg. Temp. results is ideal, cell

E7 in this example). It should look like:

◊ If desired, repeat this process for the Maximum WindSpeed, Average Humidity, and any other

forecasted weather attributes you want to include.

Page 32: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

32 | P a g e

◊ Finally, cleaning it up some and applying conditional formatting to make visual comparisons

between days easy:

With something like this, it should be fairly easily to pick the best day(s) to send a maintenance crew to

each site.

Page 33: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

33 | P a g e

7. Create a PI ProcessBook Display to show anticipated production from solar panels

(Time allowing)

For this exercise will have to download the file forecastxml.zip on the website

http://learning.osisoft.com/2015uc.aspx (no login needed) and do the following:

• Unzip the file and drop the XML file in the directory C:\Weather_UC15\SolarAnyWhere_XML.

• Wait for about 1 minute, until the PI UFL Interface processes the file. You should see the name

change to EdwardsAirForceBase_output_<Date and Time>._OK

• In PI System Explorer, navigate to the Analysis tab and open the PV Forecast database

• Navigate to the Analyses tab and select all analyses: California\OSIsoft\San Leandro\24H

Forecasted Power and select “Backfill checked analyses”

• Set the start to “t” and the end to “Explicit End Time” � “*”, then hit the Queue button

• Wait for backfilling to complete and proceed with the exercise

Page 34: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

34 | P a g e

For this exercise, we are going to use the database PV Forecast, which is holding forecast data for solar

panels that your company owns.

The main attribute we are interested in is the Forecasted Power. The latter is calculated using the

Temperature Forecast and the Global Horizontal Irradiance 2(GHI).

You are provided with the following PI ProcessBook display as your work base:

C:\TechCon_Lab\SolarOutput.PDI.

You are asked to integrate the forecasted temperature, GHI and power so that it looks as follows:

Here is a more detailed view of the trends that should be in the PI ProcessBook displays:

2The total amount of shortwave radiation received from above by a horizontal surface. This value is of particular interest to

photovoltaic installations and includes both Direct Normal Irradiance (DNI) and Diffuse Horizontal Irradiance (DIF)

Page 35: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

35 | P a g e

Once the PI ProcessBook display is created, you can try answering questions such as:

• What is the forecasted Global Horizontal Irradiance for tomorrow at this time?

• What is the corresponding output power for our solar plant?

Page 36: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

36 | P a g e

Step-by-step instructions

◊ Open the PDI file C:\TechCon_Lab\SolarOutput.PDI

◊ If needed, switch to Build mode by clicking the icon

◊ In the PI ProcessBook toolbar, click on View and make sure the AF Browser and AF Property

windows are enabled.

◊ In the AF Browser window, select the PV Forecast database and navigate to the San Leandro

element located under California\OSIsoft

Page 37: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

37 | P a g e

◊ In the AF Property window, group the attributes by Category and navigate to the Forecast

category

◊ Drag the GHI Forecast attribute in the PI ProcessBook display.

◊ Double click on the value symbol created and check “Show Units”.

◊ Create a Textbox (Navigate to Draw � Text or click the button.

Page 38: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

38 | P a g e

◊ Type “Forecasted Global Horizontal Irradiance” in the text box.

Note: The size of the text can be adjusted by using from the PI ProcessBook toolbar, or by

dragging the handles around the text. Use Arial, Bold, 20 as your font.

◊ Align the text box and value symbol, then group them.

o Select the Textbox and Value Symbols (either by selecting one after another holding the

Ctrl button, or by holding the left button on the mouse and selecting an area containing

both symbols)

o In the PI ProcessBook Toolbar, navigate to Arrange � Align and choose Center

o With the 2 symbols still selected, navigate to Arrange � Group

o The result should look like this:

Page 39: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

39 | P a g e

◊ Create a trend going from yesterday until tomorrow (*-24h to *+24h). You do not need to

specify a data item for now.

o Choose Draw � Trend or click the button.

o Enter the following specifications for the trend.

� Name: Forecasted GHI

� Start: *-24h

� End: *+24h

o Change the Tag Search Data Reference for AF2.

o In the Select AF Attribute window that appears, select the PV Forecast database,

navigate to the San Leandro element and choose the GHI Forecast Attribute.

Page 40: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

40 | P a g e

o Here’s what your configuration should look like:

o The resulting trend should be similar to this:

Page 41: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

41 | P a g e

◊ Perform the same steps as before to create a textbox, value, and trend showing the forecasted

output power and place them near the upper right corner of the display.

◊ Add a value symbol showing the temperature:

o Drag and drop the Temperature Forecast attribute on the display

o Double click the resulting value symbol and make sure to show the units of measure

o Add a text box to label the forecasted temperature

◊ Switch to Run mode by clicking the icon.

◊ Double click on the Forecasted GHI trend, and it will open it in Full Screen.

◊ Insert a Trend cursor marker by clicking the Trend Cursor button . A cursor appears at the

right edge of the trend.

◊ When the mouse pointer changes to a double-headed arrow over the trend cursor, click the

vertical line and drag left to position the trend cursor to 24 hours from now and take note of the

value.

◊ Close the trend by double clicking on it and switch to the Forecasted Power trend. Use the trend

cursors to find the forecasted power corresponding to the value previously noted.

Page 42: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

42 | P a g e

Annex A: List of PI AF substation parameters

The following table lists the substitution parameters that PI AF supports. That list is extracted from the

PI AF User Guide, and can also be found by visiting https://livelibrary.osisoft.com and navigating to “PI

Server 2014 R2 » PI Asset Framework » Designing and implementing PI AF asset models » Associating

data with assets » Configuring data references » Using parameters in data references » List of PI AF

substitution parameters”.

Parameter Name Substitution

%Analysis% Name of analysis, if obtainable from the context.

%Attribute% Name of the attribute that holds this data reference.

%AttributeId% ID of the attribute that holds this data reference.

%Database% Name of the PI AF database in which the attribute resides.

%Description% Description of the attribute that holds this data reference.

%Element% Name of the element in which the attribute resides. For event

frames, this refers to the name of the primary-referenced element.

%..\Element%

Name of the parent element of the element in which the attribute

resides. To retrieve further ancestors, use the ..\ notation, such as

%..\..\Element%.

%\Element% Name of the root element in which the attribute resides.

%ElementDescription% Description of the element in which the attribute resides.

%ElementId% ID of the element in which the attribute resides. For event frames,

this refers to the ID of the primary referenced element.

%EndTime% Local end time, if obtainable from the time context.

%EventFrame% Name of the event frame in which the attribute resides.

%<Environment Variable>%

Value of the matching system-environment variable. For example

%COMPUTERNAME% is replaced with the name of the computer on

which the data reference is executing.

%..\EventFrame%

Name of the parent event frame of the event frame in which the

attribute resides. To retrieve further ancestors, use the ..\ notations,

such as %..\..\EventFrame%.

%\EventFrame% Name of the root event frame in which the attribute resides.

%EventFrameId% ID of the event frame in which the attribute resides.

Page 43: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

43 | P a g e

Parameter Name Substitution

%Model% Name of the model, if obtainable from the context.

%Server%

Name of the default PI Server for the computer on which you create

the attribute. When creating the attribute in PI System Explorer, this

is the default PI Server for the computer on which PI System Explorer

is running.

Note: The %Server% parameter does not resolve to the computer on

which the PI AF database resides. The %Server% parameter can

resolve to a different PI Server depending on the default in PI AF

Client.

%Source% Name of the source element for the transfer in which the attribute

resides.

%StartTime% Local start time, if obtainable from the time context.

%System% Name of the PI AF server or collective where the attribute resides.

%Template%

Name of the template on which the element is based. For example, if

you created element Valve101 from a template called Valve, then

the substitute text would be Valve.

%Time% Local time, if obtainable from the time context.

%Transfer% Name of the transfer in which the attribute resides.

%TransferId% ID of the transfer in which the attribute resides.

%UtcEndTime% Coordinated universal (UTC) end time if it can be obtained from the

time context.

%UtcStartTime% Coordinated universal (UTC) start time if it can be obtained from the

time context.

%UtcTime% Coordinated universal (UTC) time if it can be obtained from the time

context.

Page 44: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

44 | P a g e

Annex B: PI AF Categories

The PI System Explorer allows you to organize objects into categories. Categories are essentially object

groups that you define yourself. Their purpose is to help you find objects more easily. When you search

for an object, you can use the category as a filter to reduce the list of results. Define as many categories

as you like. Objects can belong to multiple categories.

For example, suppose you have a set of elements representing tanks. Half of the tanks are

manufactured by ACME Company, and the other half are manufactured by EMCA Company. To locate

tanks by manufacturer, create an ACME category and an EMCA category.

Each object type has its own categories. You cannot apply categories from one object type to an object

of another type. For example, you cannot apply an element category to a table. PI AF supports the

following category types:

• Analysis

• Attribute

• Element

• Reference Type

• Table

Categories can be created on the fly when creating an instance of the above types. Say, for example, you

are creating an element template holding an attribute template that you want to categorize, you can

create a new category by doing the following:

1. In PI System Explorer, select the Library tab (bottom left pane) and then select that element

template in the tree under Element Templates (upper left pane).

Page 45: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

45 | P a g e

2. On the right pane, locate the Categories line

3. Click on the Browse button on the right hand side of that line.

4. On the “Categorize” window that appears, click “New Category”.

5. Enter a name for your category, and click OK.

Page 46: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

2015 TechCon Session

46 | P a g e

6. Add more categories as needed, and click OK.

7. Check in your changes.

8. Your attribute is now categorized.

Categories can also be created in the PI AF Library before creating your elements instances by using the

procedure below:

1. Open PI System Explorer.

2. Click the Library tab in the bottom left pane.

3. In the Browser, under Categories, right-click on the category object type and choose New

Category from the resulting menu.

4. The Category Properties dialog box appears.

5. Name the category and, optionally, type in a description.

6. Click OK. The category appears in the Viewer.

7. Check in your work.

Alternatively, you can use PI Builder to create multiple categories from an Excel worksheet.

For more information on categories, you can visit https://livelibrary.osisoft.com/LiveLibrary, navigate to

PI Server 2014 R2 � PI Asset Framework”, and search for “categories”.

OSIsoft Virtual Learning Environment

Page 47: Using Future Data to Predict your process - OSIsoftcdn.osisoft.com/learningcontent/pdfs/Using Future Data to Predict... · Using Future Data to Predict your Process 5 | Page 1. Introduction

Using Future Data to Predict your Process

47 | P a g e

The OSIsoft Virtual Environment provides you with virtual machines where you can complete the

exercises contained in this workbook. After you launch the Virtual Learning Environment, connect to

PISRV1 with the credentials: pischool\student01, student.

The environment contains the following machines:

PISRV1: a windows server that runs the PI System and that contains all the software and configuration

necessary to perform the exercises on this workbook. This is the machine you need to connect to. This

machine cannot be accessed from the outside except by rdp, however, from inside the machine, you can

access Coresight and other applications with the url: http://pisrv1/, (i.e. http://pisrv1/coresight).

PIDC: a domain controller that provides network and authentication functions.

The system will create these machines for you upon request and this process may take between 5 to 10

minutes. During that time you can start reading the workbook to understand what you will be doing in

the machine.

After you launch the virtual learning environment your session will run for up to 8 hours, after which

your session will be deleted. You can save your work by using a cloud storage solution like onedrive or

box. From the virtual learning environment you can access any of these cloud solutions and upload the

files you are interested in saving.

System requirements: the Virtual Learning Environment is composed of virtual machines hosted on

Microsoft Azure that you can access remotely. In order to access these virtual machines you need a

Remote Desktop Protocol (RDP) Client and you will also need to be able to access the domain

cloudapp.net where the machines are hosted. A typical connection string has the form

cloudservicename.cloudapp.net:xxxxx, where the cloud service name is specific to a group of virtual

machines and xxxxx is a port in the range 41952-65535. Therefore users connecting to Azure virtual

machines must be allowed to connect to the domain *.cloudapp.net throughout the port range 41952-

65535. If you cannot connect, check your company firewall policies and ensure that you can connect to

this domain on the required ports.