2019 PI World Creating SPC Golden Batch Event Frames
2019 PI World Creating SPC Golden Batch Event Frames
OSIsoft, the OSIsoft logo and logotype, Analytics, PI ProcessBook, PI DataLink, ProcessPoint, Asset
Framework (AF), IT Monitor, MCN Health Monitor, PI System, PI ActiveView, PI ACE, PI AlarmView, PI
BatchView, PI Vision, PI Data Services, 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.
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.
2|Page
Table of Contents
Contents
Table of Contents .................................................................................................................................................................... 3
1. Introduction .................................................................................................................................................................... 6
1.1 Overview of Lab ...................................................................................................................................................... 6
1.2 Tasks ........................................................................................................................................................................ 6
1.3 Identify Breakdown of Lab Content ........................................................................................................................ 7
2. Directed Activity – Investigate Event Frames ................................................................................................................. 9
2.1 Objective of Activity ................................................................................................................................................ 9
2.2 Identify the Tasks .................................................................................................................................................... 9
2.3 Step by Step ............................................................................................................................................................ 9
3. Directed Activity – Publish Data using the PI Integrator for Business Analytics ........................................................... 10
3.1 Objective of Activity .............................................................................................................................................. 10
3.2 Identify the Tasks .................................................................................................................................................. 10
3.3 Select Data ............................................................................................................................................................ 10
3.4 Modify View .......................................................................................................................................................... 12
3.5 Publish ................................................................................................................................................................... 15
3.6 Notes on this Activity and Options ....................................................................................................................... 16
4. Directed Activity – Create SPC Event Frame Data ........................................................................................................ 17
4.1 Objective of Activity .............................................................................................................................................. 17
4.2 Identify the Tasks .................................................................................................................................................. 17
4.3 Step by Step – Calculate Statistics and place into PI............................................................................................. 17
5. Directed Activity – Create SPC Event Frames ............................................................................................................... 19
5.1 Objective of Activity .............................................................................................................................................. 19
5.2 Identify the Tasks .................................................................................................................................................. 19
5.3 Create Event Frames ............................................................................................................................................. 19
6. Directed Activity – Create a Bounded Event Frame Comparison view ......................................................................... 20
6.1 Objective of Activity .............................................................................................................................................. 20
6.2 Identify the Tasks .................................................................................................................................................. 20
6.3 Augment existing event comparison display ........................................................................................................ 20
7. Directed Activity – Create a PI Analysis comparing current runs to SPC limits ............................................................ 22
7.1 Objective of Activity .............................................................................................................................................. 22
7.2 Identify the Tasks .................................................................................................................................................. 22
7.3 Add PI Analysis to Template ................................................................................................................................. 22
8. Directed Activity – Create an Event Frame and Notification ........................................................................................ 24
8.1 Objective of Activity .............................................................................................................................................. 24
8.2 Identify the Tasks .................................................................................................................................................. 24
8.3 Create Event Frames ............................................................................................................................................. 24
8.4 Create Notifications .............................................................................................................................................. 25
9. Directed Activity – Backfill Data .................................................................................................................................... 26
9.1 Objective of Activity .............................................................................................................................................. 26
9.2 Identify the Tasks .................................................................................................................................................. 26
9.3 Backfill Analyses .................................................................................................................................................... 26
10. Self-Paced Activity – Repeat exercise for the Agitation Attribute ............................................................................ 28
10.1 Objective of Activity .............................................................................................................................................. 28
10.2 Identify the Tasks .................................................................................................................................................. 28
Save the Date! ................................................................................................................................................................... 30
4|Page
5|Page
1. Introduction
1.2 Tasks
We start this lab with our Event Frames for a batch run in a reactor, all beginning
with “WN:CHEM:RX.” The steps we will take are as follows:
1. Publish PI Event Frames to a statistical engine
o Using the PI Integrator for Business Analytics
2. Calculate Statistics
o Using Microsoft SQL Server Management Studio
o Output data to csv file and pipe data back into PI
3. Create Upper and Lower Limit Event Frames
o Manually using PI System Explorer or automatically with PI Builder
4. Visualize
o Create a PI Vision overlay display where we can track live batches against historical SPC
values
5. Alarm
o Create a PI Analysis that will trigger a notification if the values fall outside of control
6|Page
Introduction
Objective 1. Learn how to publish data using the PI Integrator for Business Analytics
Objective 2. Learn how to create statistical data with Microsoft SQL Server
Objective 3. Do basic modelling in PI Asset Framework and learn how to create
Event Frames
Objective 4. Visualize Event Frames in PI Vision
Objective 5. Create a PI Analysis to compare live running batches to the statistical
limits
Objective 6. Create a PI Notification based on the previous PI Analysis (if there’s
time)
7|Page
8|Page
2. Directed Activity – Investigate Event Frames
c. Click on events
✔ Make this display public so that others in the organization can also use it
Best Practice
9|Page
3. Directed Activity – Publish Data using the PI
Integrator for Business Analytics
d. Select any Event Frame from the list that starts with WN* and into the Event Shape
e. Click and drag the attributes Agitation and Temperature under the event
10 | P a g e
f. Select the button next to the Event Frame to Edit Filters
g. Change Event Frame name to search for WN:* and click save
h. We should now see “Found 100+ Matches” on the right. Click “Next” in the top
right
11 | P a g e
3.4 Modify View
a. Change the Start time and End Time to 1/1/2019 and 3/1/2019 and click Apply
b. Click
1. Add Column
2. Time Column
3. The Dropdown
4. Event Frame Relative Time
c. Select “Seconds” from the list on the left and click the button to add it
12 | P a g e
f. Click
1. Edit Row Filter
3. Use the drop downs to set a filter to Include rows where Event Frame Relative Time
Second is less than or equal to 3660
5. Click Close
13 | P a g e
g. Click
1. Edit Value Mode
2. Sampled Values
3. Set to Sample Every 10 Seconds
4. Save Changes
h. We should now see the Event Frame Relative Time Second incrementing by 10 for
each row
14 | P a g e
3.5 Publish
a. Use the Dropdown Under “Target Configuration” and Select “SQL Server”
c. Click “Publish”
d. This will take you back to the home screen where we can monitor the progress of our
publication
15 | P a g e
3.6 Notes on this Activity and Options
This Section focuses on getting our data to a point that we can do some analytics on the data.
We used the PI Integrator for Business Analytics because it is the easiest method to get our
batch data with relative timestamps and the associated temperature and agitation data into a
state where they can be calculated on. This is also possible to do with PI DataLink, although
there are more steps involved and it is more time consuming. In broad terms, the steps are:
1. Get the pertinent batches’ (Event Frames’) start time and end time.
2. Find the associated attributes
3. Do a ‘Sampled Data’ PI Data Link query using the start time, end time, and 10s as the
interval, being sure the check the box to Show Timestamps
4. Take the timestamps and subtract them by the batch’s start time in order to get Event
Frame Relative Time
Also, we are publishing this data to MS SQL in order to do statistical calculations. Once again,
this was chosen as the easiest tool with which to do these calcs, but there are also options for
this as well that are enumerated in the next section.
Filtering:
For this lab, we are getting data on all Reactors for all Products. In a more real-world scenario,
we would likely want to use more of the “Edit Row Filters” options on the Modify View page to
ensure that we are only publishing the appropriate batches. For instance, setting Product =
“Prod A” or Primary Element = “RX100” could be used. However, this can also be done in the
next section, when statistics are being created.
16 | P a g e
4. Directed Activity – Create SPC Event Frame Data
b. Find the publication that we just created under the Databases > PIData > Tables
h. TIP: Use Ctrl+H to find and replace. Click and View the results:
17 | P a g e
i. Select the tab titled “Temperature Upper…”and again replace “PublicationName”
with our publication name
j. Click Execute
k. In the Results Area, Right click and Select “Save Results As…” and give it a
unique name, like “Upper” to the Desktop
l. Repeat steps I, j ,and k for files “” and “”. When finished we should have 3 new
files saved to the desktop.
Click and drag these files into the folder on the desktop labeled
“SQL_Input_Files.” A PI UFL Interface has already been configured to take files from
this location and ingest them into the PI System. The file extension will change from
.csv to ._OK once the file has been read
💡 UFL was used to ingest this data into the PI Data Archive, but there are
certainly other ways to get the data into PI. The most prominent being
PowerShell tools for the PI System and piconfig
Tip
💡 Microsoft SQL was the chosen tool for this Lab, but many other tools can
be used to create this data, including Microsoft Excel
Tip
💡
From an Analytics point of view, we have made two critical choices for this lab:
We chose to use the Average as a midpoint for the data. In a real setting, we
may want to use the median instead, as this is considered more robust. Also, we
have chosen to use two standard deviations to create our upper and lower limits.
Tip The number of standard deviations to use is ultimately up to you.
18 | P a g e
5. Directed Activity – Create SPC Event Frames
a. Open PI System Explorer (pinned to taskbar) and see that we’re connected to
AF Server PISRV01 and AF Database OSIPharma
b. Expand out Calcs and investigate the 3 elements beneath it, and select the attributes tab
c. We can see that the tags we just created are mapped to the temperature attribute, but
other tags still have not been created
d. Now that we have data and AF Elements, we need to create the Event Frames around
the data
CHOICE 1: Create Manually in PI System Explorer’s Event Frames Section. Right
click, New Event Frame, set Wellness Rx UnitBatch as the EF Template, 2/1/2019
12:00:00 AM as Start Time, 2/1/2019 1:01:00 AM as End Time, and setting the reference
element to one of the 3 above. Repeat for the other two reference elements
CHOICE 2: Create Automatically by opening the folder on the desktop titled “Catch up
Files”, Opening “EF_Creation.xlsx”, and selecting PI Builder tab and Publish
19 | P a g e
6. Directed Activity – Create a Bounded Event Frame
Comparison view
c. Click on events
e. Click on “Event Name” and Filter using Wellness* or the name of the Event Frames
we just created
20 | P a g e
f. When the SPC Event Frames we created are in the search bar, right click and select
“Pin Event” for each of the three.
g. Once that is completed, erase the Event Name filter that we put into place in Step E.
h. We should now see real production batches and our SPC Event Frames on the same
display
21 | P a g e
7. Directed Activity – Create a PI Analysis comparing
current runs to SPC limits
b. Navigate to Library > Element Templates > Wellness Rx > Wellness Rx_Reactor
Template and select the Analysis Templates tab.
e. Click the “Add a new variable” button so there are two places for expressions
f. Open the desktop folder “Catch up Files” and open file “7_3_Analysis.txt”
22 | P a g e
h. Click Map on the second line and map it to a new attribute called “Batch SPC Status”
and set the Value Type to String
i. At the bottom left, change the scheduling so that it is set to event triggered only on the
attribute “Temperature”
j. Click Evaluate to test the Analysis Configuration and Check In once it is complete
23 | P a g e
8. Directed Activity – Create an Event Frame and
Notification
c. This time make the rule an “Event Frame Generation” Analysis Type
e. Set the equation to trigger if the attribute we just created is in the “Above Control” or
“Below Control” states:
‘Batch SPC Status’ = “Above Control” or ‘Batch SPC Status’ = “Below Control”
24 | P a g e
8.4 Create Notifications
a. While we’re still in PI System Explorer, Wellness RX_Reactor Template
f. Use the Dropdown and select “Batch SPC Excursion” as our Analysis Template
g. Click OK
25 | P a g e
9. Directed Activity – Backfill Data
b. Select the four “Batch Temp Deviation” Analyses for the Reactors by checking the
boxes next to them
c. In the upper right, select the “Backfill/Recalculate” link and set the start time for
1/1/2019 and leave the end time as *
26 | P a g e
d. Press the “Queue” button
e. Once that has completed Backfilling, uncheck the previous four Analyses and select the
four EF analyses labelled “Batch SPC Excursion”
f. Backfill these for the same amount of time, after clicking the Acknowledgement
h. Right Click > New Search and search for all events matching the Event Frame
Template “Batch SPC Deviation” to see which batches in the past were outside of
bounds
27 | P a g e
10. Self-Paced Activity – Repeat exercise for the
Agitation Attribute
28 | P a g e
29 | P a g e
Save the Date!
Register your interest now to receive updates and notification early bird registration opening.
https://pages.osisoft.com/UC-EMEA-Q3-19-PIWorldGBG-
RegisterYourInterest_RegisterYourInterest-LP.html?_ga=2.20661553.86037572.1539782043-
591736536.1533567354
30 | P a g e