cooking with the pi systemcdn.osisoft.com/learningcontent/pdfs/cooking with the pi system.pdfpoint...
TRANSCRIPT
1 | P a g e
2015 OSIsoft TechCon
Cooking with the PI System
1 | P a g e
Table of Contents
Exercise 1 - Overall Equipment Efficiency ...................................................................................................................... 4
Exercise 2 - Condition-based Maintenance (CBM) ...................................................................................................... 18
Exercise 3 - Electrical Power Usage ............................................................................................................................. 31
Exercise 4 - Downtime analysis with Event Frames ..................................................................................................... 45
Exercise 5 - Tank Transfers with Event Frames............................................................................................................ 55
OSIsoft Virtual Learning Environment ......................................................................................................................... 64
2 | P a g e
Introduction
The Asset based PI Cookbook offers “recipes” that can help you apply PI AF to simple, commonly used tasks that might be appropriate in many environments.
Note – You will only be able to complete one of the following exercises during the time allowed – please start with the one you want and not necessarily the first one.
These recipes cook from “scratch” - PI Points for a simulated process are provided –but you begin with an empty PI AF database.
Prerequisites The PISrv1 computer you will be using has
• PI Server 2010 R2 • PI AF 2014 / 2.6 with PI AF Analysis • PI System Explorer • PI Builder (2.6) & PI Datlaink 2014 for Microsoft Excel & Excel • PI Coresight 2014 on IIS • PI ProcessBook 2014 • Microsoft Internet Explorer (for PI Coresight)
In addition there are two PI AF Databases
• Cookbook – an empty PI AF Database for you to work in • Cookbook Simulation – operates the simulation using PI AF Analysis. There is no need
to spend any time working with or analyzing this database. And 39 PI Points – All of which start with RX* and are updated by PI AF Analysis Connect to your computer in the Microsoft Azure cloud with the Remote Desktop Link provided User: \\PISchool\Student01 Pswd: student If you do two exercises – create a second database called Cookbook 2– and work in that one. Although it is great to integrate PI AF work and not build so many databases – the recipes aren’t designed to be easily combined. Please note that the cookbook was designed to be used back in your workplace plant with your points!
3 | P a g e
About the simulation Our simulation includes three continuous (non-batch) bioreactors or chemostats such as might be used in the production of ethanol. Each one has a handful of components and thirteen points.
Bioreactor Temperature Level Status
Degrees F % 0 = off 1 = running
Feed Pump Feed Flow Current
U.S. GpM Amperes
Agitator Speed Current
RPMs Amperes
Effluent Pump Effluent Flow Current
U.S. GpM Amperes
Cooling Pump Cooling Water Temp Current
DegF Amperes
Lab Ph Concentration
%
4 | P a g e
Exercise 1 - Overall Equipment Efficiency
OEE is a simple performance monitoring methodology that evaluates the effectiveness of
equipment operations based on three ratios:
Availability: Runtime vs. Total Time (% of how much time the equipment was running)
Quality: Good output vs. Total output (good product can be total product minus waste)
Efficiency: Key source material or Fuel vs. Total Output any measure of efficiency
Note that the idea is that all three ratios are stated in a percentage. An overall, OEE ratio can
be computed by averaging the ratios. If any of the parameters are unavailable you can omit it
and still compute the ratio based on the other two.
Ingredients:
PI System – Although the calculations are generally simple – and PI AF (pre-Analysis) versions
before PI System 2014 could be used – any PI configured application with calculations will
benefit from PI Analysis. This recipe is written for PI System 2014 with PI AF Analysis.
Equipment – It would be best to find several pieces of comparable equipment – like pumps,
motors, heat exchangers etc.. This doesn’t have to be the biggest, most important piece of
equipment in the plant – thinking smaller can be better. However – something as simple as a
tank – may not be appropriate as efficiency and quality may not apply. Ideally – we’d like to
find two or more pieces of equipment that have a somewhat sophisticated function and are
supported by instrumentation described by PI Points.
Constants – if we have an idea about what targets for availability, quality, or efficiency would
be – those would be very useful. But we can get started with 100% for the targets and set our
goals after we have some experience.
Points
• Availability - we need some indication of when the equipment is running and when it is
not, this can be a discrete/digital on/off or running/stopped point, but it could also be a
current/amps (most things that run on power won’t be running if they aren’t getting
current), output (flow, etc..) may be used (there can be flow from a pump even if the
pump isn’t running though). Temperature and pressure may not be good indications –
as it can take these some time to decline after a unit is taken from service. Note that
some pieces of equipment are in parallel and therefore there is intentional downtime.
And if the system is not the primary system, it may or may not be appropriate to
calculate the availability as an abstract % against all available time. But whatever
calculation you start with is a start at looking at availability.
5 | P a g e
• Quality – this measurement requires some indication of the quality of the output. This
can be good product (total product – waste) / total product or quality measurement like
concentration compared to a standard. This value can be the hardest to find in
continuous processes – you may need to use a lab sample if available or omit this
measurement.
• Efficiency – there are two ways to reflect efficiency – either the output of the
equipment divided by the primary or total input materials if there is material
transformation, or the output of the equipment divided by the energy put into the
equipment. Either measurement can work. Again for one type of efficiency evaluation
we need at least one input flow and one output flow (both generally a volume over time
like gpm or similar). For the other we would use some measurement of energy used like
current or kwh or lbs/hour of steam etc.. and total output of the system (which will
often be in in a volumetric flow).
Steps
1) Open PI System Explorer and create a new database or use this to enhance an existing
database. If this is a new database create a new element to represent the collection of
equipment like this (“heat exchangers”, “Bioreactors”). To create an element – right mouse
click on the top line “Elements” in the element browser and select “New Element” or click
the “New Element” button on the button bar. This will give our data some structure. If
you are using an existing database – select an appropriate place to put your first piece of
equipment or create a parent element as appropriate.
At UC 2015:
• Your PI system Explorer should open to the empty Cookbook database provided
• Right mouse click on “Elements” in the top Left and select New Element. click OK
• Name this at the top of the general tab in the middle Bioreactors
2) Create an element as a child of your first element above (Right mouse click on the element
you selected or created above and select “New \New Child Element”). We don’t have any
templates that are relevant yet – so just click “OK” with no template selected. Name your
element on the general tab appropriately with a good name for the equipment (mixed case,
blanks, commonly used names with no abbreviations are good). Let’s go ahead and “Check
In” our work (saving it and publishing it for other users) by clicking on the Check In button
on the button bar and click “OK” at the next panel.
6 | P a g e
• Right mouse click on Bioreactors and select New \ New Child Element . Click OK
• Name this (as above in the general tab near the top center) Bioreactor 1
• Check in your work with the Check In button (clck Ok)
3) Let’s collect the appropriate PI point data reference attributes for this piece of equipment –
these would likely include a measure of whether the equipment is running or not, a
measure of quality, a measure of output or product quantity, and a measure of input or
energy applied. For each attribute – we can click on the new attribute button or right
mouse click\New Attribute in the attributes tab for our element. We can give the attribute
a name at the upper right or on the new attribute line in the attributes tab central pane.
Then we’ll pull down the menu on the right for data references and select PI Point Data
Reference. Click on the settings button and then click on the magnifying glass / Tag Search
icon in the resulting PI Point data reference configuration pop up panel. From this you will
select the appropriate point for this asset and attribute. Keep the default values for the PI
Point Data Reference.
For each attribute – set the Units of Measure and value type. The value type is simple a pull
down menu on the right hand side. Value types should match the PI Point data types –
Floating point values (Float16, Float32, Float64s) will generally be doubles in PI AF, integers
will match to PI AF Integer types. Digital states can be strings. The Units of Measure can be
set from the two step pull down menu on the right or just start typing the Unit of Measure
and let PI AF try and find it for you.
7 | P a g e
• Click on the attribute tab and the New Attribute button to create a new attribute
• Name it Status (top of the right hand panel)
• select PI Point as the Data Reference (from the pull down on the right)
• click on the settings button and then the tag search button (magnifying glass)
• search for RX001* and select the point RX001ACT.PV click OK
• select “Int16” as the value type (pull down menu on the right, no unit of measure)
• Repeat this process for: (your search should be preserved) All are value type double
Attribute PI point Unit of Measure Class/U-o-M
Effluent Flow RX001EPF.PV Volume Flow / US Gal/Min
Feed Flow RX001FPF.PV Volume Flow / US Gal/Min
Concentration RX001LAB.Conc Ratio / Percent
(set the Units of Measure on the right – pull down the menu or just type)
• (optional) repeat this for all are value type double
Temperature RX001RXT.PV Temperature/Degrees Fahrenheit
Level RX001RXL.PV Ratio / Percent
Ph RX001ph.pv (none)
4) Let’s apply a PI AF category for this source PI point data and as we build more attributes it
will help us group and identify those coming directly from process data. You can sort the
attributes by category by clicking the “Group on: Categories” check box.
• Select all of the attributes by holding down the shift key
• Right mouse click on this selection and select “Categorize”
• create a new category (with the button) and name it “Source PI Values”
• click “OK”
• Click the Group by: Categories click box (upper right)
• Check in your work with the Check In button
8 | P a g e
5) Next, we are going to convert our element into an element template – this does two things –
it creates a new element template based on the data definitions in our element and it also
subjects this element – to the management of our new template – so that we won’t be
editing it for the most part – we’ll be changing the template. Then right click on our element
and select convert and then convert to template. The next screen will try to generalize the PI
point naming for these attributes when applied to a new element. This probably won’t work
well, but we’ll set these another way, so just go ahead and accept whatever it suggests and
click ok. Now we will work with the template – so let’s click on the library tab on the left (in
the navigation pane) and look for Element Templates and open this up to reveal our new
Element Template. If you don’t like the name you can rename it by right mouse click rename
– or just change the name on the General tab at the name.
• Select your element Bioreactor 1
• Right mouse click and select Convert \ Convert to Template
• Just click “OK” in the resulting dialogue (trying to generalize the PI points)
• Click on Library in the lower left navigation menu
• Open up Element Templates by clicking to the left of it in the tree. You should see a
new element template with the name Bioreactor Template.
• Click on this to select it.
6) With our new element template selected we are ready to add the attributes for our OEE
calculations. These attributes will be assigned to PI Points – which we’ll create with PI AF –
and the PI AF Analysis will fill those PI points with values calculated in real-time by the PI AF
Analysis service. If we can do all four of the OEE calculations – we’ll need four attributes –
and they are easy because they are all doubles, all have percentage as their unit of measure
(found under ratio in the U-o-M list) and are all PI Point Data References.
Before we build these, let’s think a minute – rather than compare availability, efficiency,
and quality to a 100% standard, it would be more flexible and powerful to have the option
to compare them to a target value in %. In this way our overall value might better reflect
our overall effectiveness because it could compare each value to a target value and not
abstractly to 100%. Fortunately – these are easy too – they are also doubles, and ratio/%
(but not PI points - we’ll just enter the targets into PI AF as constants). So let’s go ahead and
9 | P a g e
build the seven attributes – four PI points and the three target values. Let’s set the target
values to 100% for now (unless you or have a better value). To set the values – enter them
into the Value field in the middle table – or the value on the right – don’t worry about
“entering around” or damaging the U-o-M, PI AF will put it back. It might be handy to
categorize these to collect these attributes together as a category – so let’s group them as
we did above with PI points into a category named OEE.
Hint: you can configure multiple assets at once by selecting them with shift held down or
control held down and then making the configuration.
• Create seven attributes in the Element Template as we did above (new attribute button)
Attribute value type U-o-M Data Reference Value
• Availability double Ratio / % PI Point (none)
• Availability Target double Ratio / % (none) 100
• Efficiency double Ratio / % PI Point (none)
• Expected Yield double Ratio / % (none) 100
• OEE double Ratio / % PI Point (none)
• Quality double Ratio / % PI Point (none)
• Quality Target double Ratio / % (none) 100
Set the values for the targets by entering them into the default value field
You can hold the shift key down to select all of the attributes and with that set the U-o-M
at once – and you can also do this and
• Use the right mouse button menu / Categorize to create and group these into a new
category called OEE
• Check in your work with the Check in button
7) The next step is to define how PI AF will build the PI points. PI AF can only build PI Tags if
they are defined in a template. This step will only effect the four attributes we just made
that we plan to write to PI points: Availability, Efficiency, Quality, & OEE. Because our PI
tags are so similar they are going to be easy to setup. Select your first PI Point attribute
and click on the settings button under the selection of the PI Point Data Reference. This is
a form that we’ve seen before to select Pi points. This time, we’ll click the “Tag Creation”
box and click the “…” button to the right of that. Because our values vary from zero to one
hundred – the default for PI points – this is very simple. We might make only one optional
10 | P a g e
change - setting the point source to “PI AF Analysis” so that end users will know where this
data came from. Close the form. The resulting configuration is held in a configuration string
below the settings button. And it is a text string – you can copy this string and paste it into
the same location for the other three PI Point Data references (associated with the
calculations not the targets). Note that the PI points will be created with the name:
ElementName.AttributeName in the default PI server. If your element name is not specific
enough to assure a unique PI point – say if it is “tank” or “heat exchanger” this isn’t a good
point name and perhaps you should refine your element name or add .%ID% to the end
of the string after the %attribute% and PI AF will add a unique character string after the tag
name (the GUID of the attribute).
• Select the Availability attribute and click on the settings button on the right
• Click the “Tag Creation” box and click the “…” button to the right of that.
• Scroll down and change the point source to PI AF Analysis (you have to type this)
• Close the form with OK (and OK again)
• Copy the entire string below the settings button with mouse & Ctrl-C or right mouse copy
• Paste this string into the similar location for the Efficiency, Quality, and OEE attributes
8) We are ready to build the PI points to receive our PI Analysis calculation results. To do this
we can go to our element tab (where we started – the one for our equipment) – right
mouse click on our element and select “Create or Update Data Reference”. This will build
our PI points and if we open the attributes of our element – we should see “Pt Created”
next to our calculation PI points – meaning they are created but not yet updated.
• Select Elements from the lower left navigation menu
• Select the Bioreactor 1 element
• Right mouse click and select Create or Update Data Reference
• Look at the four OEE PI point attributes – they should say “Pt Created”
9) Now we are ready to build the Analysis calculations. Go back to the element template
(Library \ templates \ element templates \ our element template) and select the Analysis
tab at the top. Note that Analyses are associated with an element or element template and
not with an individual attribute. You will assign the result of an analysis to a specific
attribute (and through it to a PI point) a bit later. Create a new Analysis Template by right
mouse clicking in the analysis box and selecting New Analysis Template (or clicking on the
button on the button bar). You can name it OEE and make sure it is an expression analysis
by checking that selection and then select an example element of the element you’ve
created.
11 | P a g e
• Select Library in the lower left navigation menu
• Open Element Templates and select the Bioreactor Template
• Select the Analysis tab at the top right
• Create a new Analysis Template by clicking the blue text with that message
• Name this analysis OEE (top right)
• Click on the Select Example Element highlight text and select Bioreactor 1
10) On the first line of the expressions enter the name Availability. In the expression next to it
we’ll enter our calculation in PI Performance Equation Syntax. You may already be familiar
with the syntax, but here are some reminders:
• PI AF attributes are specified in by wrapping them in single quotes / apostrophes
• Similarly dates/times can be specified using PI formats wrapped in apostrophes
• PI PE functions are listed to the right and available using the function name immediately
followed by an open parenthesis, with appropriate arguments separated by commas
and the closing parenthesis. TimeEQ(‘attribute’,’starttime’,’endtime’,value)
For the Availability we’ll calculate the amount of time that we were running for the day, and
then compare that (in percent) to the target availability and state the result in percent.
We’ll use a function called TimeEQ() which takes the arguments – attribute, start time, end
time, comparison value and returns the number of seconds the condition is true during the
time period. Note the terrific intellisense that helps you find and enter the attributes,
operators, and functions by trying to guess what you are trying to type and gives you
choices (like texting on a phone).
Here’s the expression I came up with for my availability, evaluating availability for today:
((TimeEq('Bioreactor Status','t','*',1)/((Hour('*')*3600)+(Minute('*')*60)+(Second('*')))*100)
/ ‘Availability Target’) * 100
the last argument in the TimeEq function is a 1 which the status point says is “running”
A simpler version might look like this to look at the last “rolling” 1 day availability:
((TimeEq('Bioreactor Status' ,'*-1d','*',1)/86400 *100) / ‘Availability Target’) * 100
What if my status point is not 1 or zero but is a PI Digital state assigned to a string PI AF
attribute? – or if I set my attribute to an enumeration set?
((TimeEq('Bioreactor Status','*-1d','*',”Running”)/86400 *100) / ‘Availability Target’) * 100
What if I don’t have a clear start/stop from a point and I need to evaluate based on current
(for example)?
((TimeGT(‘Current','*-1d','*',3)/86400 *100) / ‘Availability Target’) * 100
As you have an example element selected – you can evaluate the results using the evaluate
button. If this looks good –assign this result to the ‘Availability’ output attribute by
selecting from the list produced on this line. As this is a PI Point Data Reference attribute,
the Analysis results will be recorded into a PI point.
• Click under Name and name this Availability
• Click under Expression and a box should open up below enter the follow equation:
((TimeEq('Status' ,'*-1d','*',1)/86400 *100) / ‘Availability Target’) * 100
12 | P a g e
• Click Click to Map and assign this to the Availability attribute (should be in a list)
• Click on the Evaluate button (above to the right) to see if you get a result
11) Next, we’ll build an expression for quality. As we’ve discussed, ideally quality will compare
some measurement of process quality. In my example, my quality measure – Concentration
– was already in percent – so I just need to evaluate it compared to the target for a
specified period. I’ve decided to average it over the last day. The function TagAvg() takes
the attribute, start time, and end time and returns a PI time weighted average. So we’ll
make a new expression called Quality and then here’s my formula:
TagAvg('Lab Concentration','*-1d','*') / 'Quality Target' * 100
We’ll need to assign this to the Quality attribute to write it to the new PI point.
• In the OEE analysis, click on Add New Expression and name it Quality
• Enter the follow equation: TagAvg('Concentration','*-1d','*')
• Click Click to Map to assign this to the Quality attribute
• Click on the Evaluate button to see if you get a result
12) Then we’ll build an expression for efficiency. This will divide the amount produced by one
of two inputs – either the volume of input or feedstock (to get yield) or by the energy
consumed (to get energy efficiency) – whichever is appropriate. Make a new expression
called Efficiency and then enter a formula like:
((TagTot('Effluent Flow','*-1D','*') / TagTot('Feed Flow','*-1D','*')) / ('Target
Efficiency’/100)) * 100
Which is the one day flow of output divided by the one day flow of input and compared to
the target. Note that because the output flow and input flow are in the same units (GPM)
or – if they are volumetric flows could be brought by PI AF into the same units – the division
produces a ratio which is directly comparable to a target in percentage. If I was dividing my
output by total calculated kwh or thousands of pounds of steam, etc.. (i.e. energy) – I could
do this but my resulting number would be a ratio that wasn’t necessarily directly
comparable to a percent. In any case our target is going to need some adjustment.
• Click on Add New Expression and name it Efficiency
• enter the follow equation:
((TagTot('Effluent Flow','*-1D','*') / TagTot('Feed Flow','*-1D','*')) / ('Expected Yield’/100)) * 100
• With Click to Map – assign this to the Efficiency attribute
• Click on the Evaluate button to see if you get a result
13) The final expression is for the Overall Equipment Effectiveness KPI. To do this we can
average the percentages of each measure Enter a name of OEE and the expression
OEE Avg(Availability, Quality, Efficiency)
13 | P a g e
Note that usually we use names in apostrophes referring to attributes. In this case the
names without the apostrophes are not a mistake – those refer to the variables which hold
the results of each line of the expressions above and we can retrieve these and use them in
our calculations efficiently without going back to attributes (or PI points).
We also need to set a scheduling frequency for the Analysis Server to calculate these (and
write the results to our PI points). At the bottom of the page you can select “Event” and
this will calculate (and post) every time there Is a snapshot update to any PI point attached
to any of the referenced attributes (or you can pull the menu down and select which ones
should trigger the calculation). For this – I think calculating every minute (which is still 1440
times per day) should be sufficient – so please select Periodic and use the configure button
to select one minute calculations.
At this point, if we’ve done everything correctly and our Analysis server is installed correctly
and has appropriate security setup, we can go back to our element and check (and click if
needed) the green arrow “go” button and we should start getting results in our element
(within a minute or so).
• Click on Add New Expression and name it OEE on the left
• enter the follow equation:
Avg(Availability,Efficiency,Quality)
• With Click to Map – assign this to the OEE attribute
• Click on the Evaluate button to see if you get a result
• Select Periodic scheduling at the bottom and click Configure
• Select 1 minute scheduling 00:01:00 click OK
• Check in your work with the check in button ( and click OK)
• Return to the Bioreactor 1 element (Navigation menu Elements)
• On the analysis tab – check to see if the analysis is running (green). Select the attributes
tab and wait a minute and press Refresh.
14 | P a g e
14) We chose a piece of equipment that may have other, similar pieces of equipment that we
can apply our template to. We’ll use PI Builder – the PI AF (and PI point) building add-in for
Microsoft Excel. Open Microsoft Excel and confirm you have a PI Builder tab.
Make sure the right PI AF server is selected in the upper left hand corner of the PI Builder
ribbon and select the database you used below that (if you've had Excel open the whole
time you've been working - you may need to close it and open it again or disconnect/
reconnect from the server to see the new database).
Pull down the menu under Elements in the retrieve section of the PI Builder ribbon and
select "Find Elements". Select the pull down menu for template and select your template.
Then click the Search button and you should find your element. Select it and click ok.
From the next panel you can select the attributes or the elements you want to edit in Excel
columns in the element creation process. It's easier if you just click "clear all" and then
select just a few things including Template and scroll down to find the attribute columns
from your template and select source PI point attributes (only – there isn’t one button to
click – you need to identify and click on them). There is no reason to select the PI Point
attributes updated by the Analysis engine or the target.
Note the =\\server\tagname format of the PI point references. The equal sign indicates
that PI Builder will update the Data Reference Configuration String and not the value of the
attribute. At UC 2015 can see a pretty strong pattern that RX001 is for reactor 1 and there
are two more reactors that if I replace RX001 with RX002, RX003, etc.. it will work – the
point naming, though cryptic is strong. In an actual case – point naming is not often that
strong – but if you only have a handful of points for each of a handful of assets – it should
take too long to get the right points into the right fields. Note you do have to have the
=\\server\tagname format the point alone won’t work, and without the = (and a formatting
apostrophe in front of it) – it won’t work either.
With three reactors I just made a copy of the row and edited all of the columns such that
the name and PI point references were correct. (remember Ctrl-H for search and replace in
Microsoft Excel).
Clicking on “Publish” and selecting “Create” will build these in PI AF.
Back in PI System Explorer – if you select refresh – your new elements should be there –
complete with PI Analyses. You may need to select these elements and run the right mouse
click “Create or Update Data References” option to build the PI points for them – and soon
the Analysis engine should pick them up and start calculating for them. If it doesn’t check
the Analysis tab on the element and make sure the Analysis is started (green “go” arrow).
15 | P a g e
• Open Microsoft Excel (from the Start Menu or task bar)
• Click on the PI Builder tab at the top and make sure the Cookbook database is selected on
the left – if it is not – click on the Database and select it.
• Pull the menu down below Elements on the ribbon and select Find Elements
• Select Bioreactor Template from the Template menu
• Click on the Search button at the top
• Select your Bioreactor 1 element by clicking on it and click OK
• Click the Clear All button in the lower left of the column selection dialogue
• Scroll down if necessary and click the box next to Template (important)
• Scroll down and find the Attribute Columns option and select your source PI Points only:
Status, Effluent Flow, Feed Flow, Concentration
and Temperature, Level, & Ph if you built them
• Click OK
• Select and copy the row (ctrl-C or right mouse click copy) with your element in it (row 2)
• Paste it over the next empty row (row 3 - you’ll have two rows with the same reactor data)
• Change name of the first element (row 2 col C) to Bioreactor 2 and the name of the
second ( row 3 col C) to Bioreactor 3
• Select Row 2 and press Ctrl-H and change every occurrence of RX001 to RX002
• Select Row 3 and press Ctrl-H to change every occurrence of RX001 to RX003
• Click on the Publish button on the button bar and select Create as the menu option
• Click the “Create PI Tags” on the right side of the dialogue and click OK
• If there were no errors – minimize or close Excel and return to PI System Explorer
15) Now we can backfill our OEE Calculations into the tags we built and look at the
performance of our assets for as far back as we have PI Data. To do this we can go to each
element and the analysis tab for each piece of equipment right mouse click on the analysis
and select backfill. The resulting panel straightforwardly selects the dates to backfill. Note
you cannot backfill over other data and you may have to delete data or the whole tag to
“recalculate” over data you’ve previously calculated.
Alternatively you can go to the Analysis tab at the bottom left in the PI System Explorer
navigation pane and show all of the Analyses in this database and you can queue the backfill
16 | P a g e
for all checked analyses for the same time period. Queue correctly implies that the PI
Analysis scheduler service – not your local PI System Explorer session will do this backfilling
– you don’t have to wait for backfilling processes to finish to queue another one and you
can quit your program altogether and the service will run them.
Of course if you have a PI Data Archive 2012 or more recent, you don’t need to worry about
backfilling across archives. If you have an older PI Data Archive server – maybe instead of
worrying – it would be a good time to upgrade.
• Select the Analyses Manager at the bottom of the Navigation Menu (lower left)
If any are in error – debug (ask for help as necessary)
• For those that are green / working, click to select all of the available Analysis
• Click on the Backfill Checked Analysis active text on the right side
• Select a day two days ago from the calendar or enter *-2D as the start time
• Click the Queue button This shouldn’t take long
Serving Suggestions (Visualization)
PI Coresight is a great, easy to use way to display this data. Open PI Coresight in your browser
(http://server/coresight) and click on New Display (upper right). Click on Home (upper left) and
select your database by clicking on the triangle next to its name. If your database doesn’t
appear – you may need to enable this through the http://server/Coresight/admin page and
click the box next to the database name in the PI AF servers and database selection panel.
Walk down the tree either in the search pane on the Breadcrumb trail / pull down path menus
to your first piece of equipment/element. When you’ve selected the equipment – its
attributes should appear in the search pane. Select the four OEE attributes and drag them
onto the screen one at a time and select a radial gauge symbol as the representation. Select
some other highlights and trend them over 24 hours / 1 day. At the top in the center – name
your display and pull down the menu to make it public and read only.
Click on the “Related Assets / Events” button at the bottom of the search window on the left
to reveal the other elements tied to this template. Click on the “swapper” icon next to one of
these to swap out this element for the other and see the OEE statistics for that asset.
17 | P a g e
• Open the Internet Explorer browser from the start menu or task bar – it should go to PI
Coresight if you are asked to log on – user name is Student01 the password is student
• Click on New Display (at the upper right)
• Select the Cookbook Database in the search pane (click on the triangle next to it’s name)
• Select Bioreactors and then Bioreactor 1 walking down the tree to your first reactor
• Select the Availability attribute and drag it onto the display – select Radial Gauge as the
symbol from the menu
• Repeat this for Efficiency, Quality, & OEE – selecting radial guage for each
• Select Effluent Flow and Concentration (together – you can use the shift key) and drag
them onto the display and create a trend
• If you built them – select temperature, level, & Ph and trend them below the first trend.
• At the top in the center – name your display Bioreactors OEE and pull down the menu
to make it public and read-only.
• Click on the Related Assets / Events button at the bottom of the search window
• Click on the swapper icon next to Bioreactor 2 and/or Bioreactor 3 to see the OEE
statistics for them.
What’s for Dessert? (Expanding and developing this further)
As your OEE statistics get some history – it will be easier to set some reasonable targets and
better evaluate improvement.
As you develop other types of equipment with the OEE standard – you might consider copying
and pasting many of the attributes and analyses so that you use the same language and
calculations in those templates. Better yet, you could build an OEE template and use base and
derived templates so that you could have one OEE template standard.
Because the OEE statistics are usually expressed in terms of percentage – they are a great
candidate to be “rolled up” a hierarchy. Using a roll-up analysis would be the way to do this.
You can average all of the like pieces of equipment so that you can easily compare OEE KPIs.
The triggers you’ve used to identify availability could be used to generate downtime event
frames or production loss event frames.
An interesting way to present Key Performance Indicators (KPIs) like OEE is positive alarms.
You could build an analysis that recognized every time an OEE goal was maintained for more
than a certain number or hours. You could send a PI Notification or otherwise recognize when
KPI targets are not just exceeded but maintained. Positive alarms are a great way to move from
a “what went wrong” to a “what’s going right and how do we further improve” mentality.
18 | P a g e
Exercise 2 - Condition-based Maintenance (CBM)
Many facilities perform preventive maintenance or visual inspection procedures on equipment.
Without PI data, this is often performed on clock hours or the calendar (i.e. every 30 days or 90
days, etc..). Using PI data and PI Asset based Analysis – we can perform these tasks based on
runtime hours and starts (i.e. 2000 hours of operation and/or 300 starts) – two indicators of
usage. This allocates our human resource to the equipment that really needs it and doesn’t
waste our time performing PMs or inspecting equipment that hasn’t really been used much
since that last PM. You could also trigger PMs or visual inspections based on vibration or other
indications of distress.
For our CBM Asset based PI recipe, we’ll track daily run time and daily equipment starts.
Ingredients:
PI System – Our goal is to create data stored in PI points that will be usable by PI Datalink or PI
Notifications. For this reason, PI AF 2.6/2014 is important so that we can record our results in
PI Points.
Equipment – For this purpose we will be looking for equipment –
• For which preventive maintenance or visual inspections are scheduled
• Have some indication of “running” state – either a digital point – or current –
or some way to tell it’s on
It would also be great if there were several pieces of like equipment – of course in this case –
we could just templatize the equipment as CBM equipment and create the algorithm for even
unlike types of equipment – so long as we can tell if they are on and off in the same way.
Points - All we need is indication of when the equipment is running and when it is not, this can
be a discrete/digital on/off or running/stopped point, but it could also be a current/amps (most
things that run on power won’t be running if they aren’t getting current), output (flow, etc..)
may be used (there can be flow from a pump even if the pump isn’t running though).
Temperature and pressure may not be good indications – as it can take these some time to
decline after a unit is taken from service.
19 | P a g e
Steps
For this simple task, we’ll create a simple analysis that will run daily and capture the run time
hours and starts into PI points for the day.
1) Open PI System Explorer and create a new database or use this to enhance an existing
database. If this is a new database create a new element to represent the collection of
equipment. To create an element – right mouse click on the top line “Elements” in the
element browser and select “New Element” or click the “New Element” button on the
button bar. This will give our data some structure. If you are using an existing database –
select an appropriate place to put your first piece of equipment or create a parent element
as appropriate.
At UC 2015:
• Your PI System Explorer should open to the empty Cookbook database provided
• Right mouse click on “Elements” in the top Left and select New Element; take defaults and
select OK
• Name this at the top of the general tab in the middle Bioreactors
2) Create an element as a child of your first element above (Right mouse click on the element
you selected or created above and select “New \New Child Element”). We don’t have any
templates that are relevant yet – so just click “OK” with no template selected. Name your
element on the general tab appropriately (“Bioreactor 1”, “Heat Exchanger EX302”, etc..).
Let’s go ahead and “Check In” our work by clicking on the Check In button on the button bar
to save this and publish it to others.
• Right mouse click on Bioreactors and select New \ New Child Element; take defaults
and select OK
• Name this (as above in the general tab near the top center) Bioreactor 1
• Check in your work with the Check In button
3) In the next step we are going to build an attribute to know if the equipment is running or
not. It would be great if instead of using zero and one to represent “off” and “on” – we
could actually show “running” or “stopped”. For that we’ll use a PI AF enumeration set.
The enumeration set works like a PI Digital state set. You can refer to it as a string value or
20 | P a g e
an integer value – either way. In the PI System Explorer library tab, select Enumeration Sets
and create a new enumeration set called “Stopped & Running”. Enter a value of 0 and a
name of “Stopped” on the first row and a value of 1 and “Running” on the second.
• Select Library from the Navigation Menu (lower Left) and find Enumeration Sets.
• Right Mouse click on this select New Enumeration Set
• Enter Stopped and Running as the Name of this Set
• Under the Name Column in the first row type Stopped (press enter)
• In the next row type Running (the value should auto-increment – zero & one)
• Check In
4) For this analysis we need one PI point – the indication as to whether we are running or not.
We have a clear indication that the bioreactor is running in a status point that is zero when
it is not running and one when it is. So click on the attributes tab of your new element and
create an attribute (by right mouse click in the attributes panel or by clicking on the new
attribute button) named Status. Set the value type to Enumeration Set / “Stopped &
Running” and the Data Reference to PI Point Data reference. (note that your new
enumeration set was added to the attribute value type menu. Click on the settings button
and then click on the magnifying glass / Point Search icon in the resulting PI Point data
reference configuration pop up panel. From this you will select the appropriate point. Keep
the default values for the PI Point Data Reference.
There are several other ways to determine whether something is running or not. You may
have a PI Digital state point and not a zero/one integer point – and this won’t be very
different in PI AF. If you have a measurement that’s reliably only active when the
equipment is running you could build a PI AF analysis as we do below – just to test whether
the equipment is pulling amperes/current, or rotating with RPM, or producing flow. It
might be good to look at the history of PI point – and get an idea what a reasonable
threshold is for the equipment really running is (some equipment will show small values
near zero for process values even when it is not running). Then you can test for Amps > 2
or Flow > 5 etc…
21 | P a g e
• Return to your element Bioreactor 1 (Elements in the Navigation Menu )
• Select the attributes panel – click on the new attribute button on the button bar
• Name it Status at the top of the General tab
• On the right side set the Value Type to Enumeration Set / Stopped and Running
• Set the Data Reference to PI Point Data Reference (pull down menu)
• Click on the Settings button below this and the Point Search button (magnifying
glass). Enter RX001* in the search, select RX001ACT.PV and click OK
5) Next, we are going to convert our element into an element template – this does two things
– it creates a new element template based on the data definitions in our element and it also
subjects this element to the management of our new template – so that we won’t be
editing it for the most part – we’ll be changing the template. To do this, right click on our
element and select convert and then convert to template. The next screen will try to
generalize the PI Point naming for these attributes when applied to a new element. This
probably won’t work well, but we’ll set these another way, so just go ahead and accept
whatever it suggests and click ok. Now we will work with the template – so let’s click on
the library tab on the left and look for Element Templates and open this up to reveal our
new Element Template. If you don’t like the name you can rename it by right mouse click
rename – or just change the name on the General tab at the name.
• Select your element Bioreactor 1
• Right mouse click and select Convert \ Convert to Template
• Just click “OK” in the resulting dialogue (trying to generalize the PI points)
• Click on Library in the lower left navigation menu
• Open up Element Templates by clicking to the left of it in the tree. You should see
a new element template with the name Bioreactor Template select this.
• Check in your work with the check in button.
6) We are going to calculate two values with our analysis and write those to PI points. So
we’ll build two more attributes all as PI Point Data references in our template:
Attribute name Value Type U-o-M Data Reference
Run Hours (Daily) Double Time / Hour PI Point
Starts (Daily) Int16 PI Point
22 | P a g e
We will write the result of our calculations to PI Points – but these points don’t exist yet –
because PI AF hasn’t built them yet. We need to define how PI AF will build the PI Points.
Note – PI AF can only build PI Points if they are defined in a template. Click on the settings
button for your first attribute under the selection of the PI Point Data Reference. Click the
Tag Creation box and click the “…” button to the right of that. We might make a simple
optional change to change the point source to “PI AF Analysis”. This will help end users
identify where this data came from. Unless we expect to have more than a hundred starts
in one day – the zero to one hundred the default range for PI points is probably fine. Close
the form. The resulting configuration is held in a configuration string below the settings
button. And it is a text string – you can copy this string and paste it into the same location
for the other two PI Point Data references. Note that the Pi points will be created with the
name: ElementName.AttributeName to the default PI server i.e.
\\PISRV1\Bioreactor 1.Run Hours (Daily)
It’s appropriate for the starts and status to be int16 in PI and hours float32. If your element
name is not specific enough to assure a unique PI point name – say if it is “tank” or “heat
exchanger” this isn’t a good point name and perhaps you should refine your element name.
23 | P a g e
• Create two attributes in the Bioreactor Template (new attribute button)
Attribute name Value TYpe Unit-of-Measure Data Reference
• Run Hours (Daily) Double Time / Hour PI Point
• Starts (Daily) Int16 (none) PI Point
• Click on the settings button for the Run Hours (Daily) attribute (to the right)
• Click the “Tag Creation” box and click the “…” button to the right of that.
• Scroll down and change the point source to PI AF Analysis (you have to type this)
• Close the form with OK
• Copy the entire string below the settings button with mouse & Ctrl-C or right mouse copy
• Paste this string into the similar location for the Starts (Daily) attributes
• Click the Settings button for the Starts (Daily) attribute, click on the “…” button
• Select Int32 from the pull- down menus near the top
• Close the form with OK and return to the element attribute panel
7) Now we are ready to build the Analysis calculations. To do that – with our element
template (Bioreactor Template) selected and select the Analysis tab at the top. Note that
Analyses are associated with an element or element template and not with an individual
attribute. You will assign the result of an analysis to a specific attribute (and through it to a
PI Point) later. Create a new Analysis Template by right mouse clicking in the analysis box
and selecting New Analysis Template (or clicking on the button on the button bar); you can
name it CBM Daily Calcs We’ll make two expressions that run at midnight – the first
moment of the new day – so my first calculation will count the events from Yesterday until
today – and half of these are starts (the others are stops). So I’m going to take the total
number of events and divide it in two.
DailyStarts EventCount('Status','Y','*') /2
The other calculation will capture the time during the day that Status of the Status point
was equal to 1 or “running” – it returns seconds so we’ll divide that by 3600 to get the
number hours. DailyRunHours TimeEQ('Status','Y','*',1)/3600
After making the two expressions – we’ll want to associate them with the Starts and Run
Hours (Daily) attributes respectively in the Output Attribute on the Right. And then
Schedule this to run daily at Midnight by selecting Periodic and setting configure to daily at
midnight.
24 | P a g e
• With Bioreactor Template Selected click on the Analysis tab and create a new analysis
by clicking the highlighted text for that. Name it CBM Daily Calcs (upper right)
• Select the example element \Bioreactors\Bioreactor 1
• In the first row for expressions enter the following name & formula
DailyStarts Int((EventCount('Status','Y','t')) /2)
• At the right, map this to the Starts (Daily) attribute
• Click on the New Expression text and enter the following name & formula
DailyRunHours TimeEQ('Status','Y','t',1)/3600
• Map this to the Run Hours (Daily) attribute
• At the bottom, select Period scheduling and select daily at midnight.
8) We are ready to build the PI Points to receive our PI Analysis calculation results. Go to the
equipment element we created (in Elements), right mouse click on our element and select
“Create or Update Data Reference”. This will build our PI points and if we open the
attributes of our element – we should see “Pt Created” next to our calculation PI points –
meaning they are created but not yet updated.
,
25 | P a g e
• In the lower left Navigation menu – select Elements and find Bioreactor 1
• Right mouse click on it and click on Create or Update Data Reference; then Close
• Check in your work with the check in button.
• Click on the analysis tab to confirm that your analysis is starting…green checkmark
9) That’s all working – but we chose a piece of equipment that has other, similar pieces of
equipment we can apply our template and calculation to. This can be done in several ways.
We could import our singular element into PI AF Builder in Excel and easily build other
elements this way or we could just go build another element off of our element root in PI
System Explorer and as we only need one point we can build another asset very quickly.
The last thing we did was check our element so our root element should be handy in the
Elements Explorer. Select it with a right mouse click and select New Child Element
The resulting dialogue box asks you to select a template – please select our CBM template
the one we’ve been working on. PI System Explorer will try to guess at a good name, you
can rename this new element either with a right mouse click rename or on the General tab
of the new element.
When you go to the attributes tab – you’ll see we are missing a number of PI points – one
we’ve not identified and two we haven’t built yet. Select Status and the Settings box on
the right and the magnifying glass icon to use PI Point Search to find the right status point
for this asset.
The other two PI points we need to build. We’ve done this before. Right mouse click on
your element to left and select “Create or Update Data Reference” to create the other two
points. If these two elements are both children of the parent we made earlier then they
necessarily have different names, but if you’ve got a more complex hierarchy and both of
these elements have the same name – you may be about to use PI points that don’t have
unique names, which could return confusing results. Try to figure out a way to create
unique PI points in the template or the element to solve this.
26 | P a g e
Finally we should check on our analyses – when this element was created – it didn’t have all
of its points – so the analyses wouldn’t start – now that we have a complete set of points
we can click the “Go” button next to any analyses in an error state and try and start them.
• In the Elements Browser – select the Bioreactors (root / parent) element, and right
mouse click and select New Child Element.
• Select the Bioreactor Template from the template list and click okay
• Rename this new element (at the top of the General Tab – center top) Bioreactor 2
• Select the Status Attribute. Change the Point in the configuration string (under
settings) From RX001Act.PV to RX002ACT.PV (leave the server name) – or click the
setting box and search for RX002ACT.PV with the magnifying glass / search button
• Right mouse click on your new element Bioreactor 2 and select Create or Update
Data Reference (to build the other two points).
• Click on the analysis tab and restart the analysis if necessary to start it.
• Repeat these steps for Bioreactor 3 and RX003ACT.PV
10) Now we’ve done quite a bit here – but we’ve not seen any results – and this because our
calculations run only at midnight – and it’s not midnight. So it’s probably a good idea to
backfill a little and get some data here for analysis. Select Analysis Manager Icon at the
bottom of navigation menu at in the lower left. . We should see three analyses
there a daily calculation for each of three elements. So select all of them with the check
box at the top. Over on the right hand side – click backfill checked analyses. Select an
appropriate start time and click Queue.
As you might guess – queue – does exactly that – it asks the PI analysis scheduler to
calculate these for you. So if you have several calculations to request backfill for – you
don’t have to wait for them to finish. And if they are taking a while (and they can if you are
backfilling over months) – you can go ahead and quit PI System Explorer – the service will
still handle your queued requests.
27 | P a g e
To confirm you have results you can return to your elements and select one of them and in
the attributes panel you can trend the attributes. Select one or more attributes and with a
right mouse click select Trend and you can see them and set the time range at the top.
• Select Analysis Icon at the bottom of navigation menu at in the lower left.
• Select all of the analysis with the check box at the top.
• Click backfill checked analyses (on the right).
• Start the backfill two days ago (select the date or enter *-2d)
• Click on Queue
• Return to the elements in the navigation menu and select one of the bioreactors
• Select all of the attributes (use the shift key)
• Right mouse click and select trend to show these attributes.
• Check in your work with the Check In button
Serving Suggestions (Visualization)
PI Datalink 2014 is a great way to look at this. It works by defining a root path for the element
and a data item for the attribute we want to query. We’d like to see how many starts and how
many run hours we’ve had since a specific data for these two elements. So let’s open Excel
with PI Datalink 2014 (or PI Datalink 2013 will also work).
Firstly, we can search for our elements and attributes. Put your cursor in cell B3 and then select
the Datalink Ribbon and Search and select the appropriate PI AF server and database. Enter
*Daily* in the search field and press the search (magnifying glass) button. Slide the slider bar
all the over to the right to separate the elements from the attributes. Select the Daily
summary attributes from only one of the pieces of equipment, in my case Reactor 1 – by
Clicking and holding shift down and then click okay. This gave us a row for each of our
attributes Run Hours (Daily) and Starts (Daily) and a path to our element. What we are
interested in is those attributes – let’s use copy paste transpose or just copy one and paste it –
or just type them so they can be side by side in cells C2 & D2. One of the reasons to use
attribute “friendly” names in AF is that they are easy to remember and enter into spreadsheet
cells. Now let’s look over the elements name for our first element (repeated for attribute in B3
& down) – just clear those cells. And let’s search again, keeping our cursor in B3. This time
we’d like to find each unique asset that matches- so let’s search for one attribute *Starts* and
we should get one row per element – select them all and click okay. Now we can clear those
attribute names out of C3 and down (we already have the attribute names we need).
28 | P a g e
Our goal is to total these from the date of the last maintenance – we need a column for that so
let’s insert a new column over column C and title it in C2 “Last Maint Date”. Note our Run Hour
(Daily) and Starts (daily) are now in D2 & E2. For each of our elements, put a date in column C
next to it within the range of our backfill – eventually a maintenance planner or someone will
want to look up the accurate dates from the Maintenance system, but for now – let’s just enter
a valid date. Now in D3 we can click on Calculated Data in the PI Datalink Ribbon. The Root
Path is our first element (B3), the data item our first attribute (D2), the start time is just to the
left in cell C3. The end time can be an asterisk for now – select total from the calculation mode
and click OK. We didn’t select multiple columns and rows – because our dates are different by
row. If you look at the formula row of the Spreadsheet – you can decifer this string and you
might know that if you remove some of the dollar signs you can make this copyable to the other
cells around it. Remove the “$” before the first D in ($D$2 => D$2) (referring to the attribute
name) so we can get the other attribute. Remove the “$” before the 3 in ($C$3 =>$C3) as the
start time so we can pick up dates on other rows. And remove the row reference “$” before the
3 in the ($B$3 => $B3) on the end so we can get other elements. It should look like this:
=PIAdvCalcVal(Sheet1!D$2,Sheet1!$C3,"*","total","time-weighted",0,1,0,Sheet1!$B3)
Now you can just drag this to the other cells down and across to get the other calculations. If
we change the dates it will give us a new total.
Next – let’s clean up those row names. The root path PI Datalink 2014 gives us are really long.
So let’s go to cell A3 and select just the interesting part off of that with an =mid(B3, X, Y)
function. Mid will extract text from the string in B3 beginning with position X, for Y positions,
allowing us to just get the element name or other interesting part. Mine looked like:
=Mid(B3,42, 12) but depending on the length of the names of your server, database, and assets
in the path, you may need to adjust that. We can copy this down probably and do the same for
the rows beneath it and then hide column B altogether by clicking on the column header and
selecting “hide”. Some cell formatting would be nice too:
29 | P a g e
Introducing the triggering values into new columns would allow us to use conditional
formatting to highlight the equipment that needs PMs or inspections.
• Open Excel with PI Datalink 2014 (start menu or task bar)
• Select cell B2
• Click on the Search in the center of the PI Datalink Ribbon
• Enter *Daily* in the search field and press the search (magnifying glass) button.
• Slide the slider bar all the over to the right and select the Daily summary attributes
(Starts & Run Hours) from Bioreactor 1 only (shift key to select multiple attributes)
• Copy and paste or drag Starts (Daily) until it is in Cell D2 and your two attribute names
(Run Hours (Daily) and Starts (Daily) are side by side in cells C2 & D2
• In both Cells B2 & B3 you should have \\Cookbook\Bioreactors\Bioreactor 1. Clear
Cell B2 and click in the lower corner of B3 and drag it down two cells so that it will
auto-increment and produce \\Cookbook\Bioreactors\Bioreactor 2 &
\\Cookbook\Bioreactors\Bioreactor 3 in B4 & B5
• insert a new column over column C and title it in C2 “Last Maint Date”. Note our Run
Hour (Daily) and Starts (daily) are now in D2 & E2.
• For each of our elements, put a valid date in column C within the last two days
C3 = Now()-1.5 and C4 = Now()-2 would work
• Click in D3 and select Calculated Data from the PI Datalink Ribbon.
• In the menu on the right – for the Root Path – click on B3 and drag to B5.
• For the data item our first attribute (D2), the start time is just to the left in cell C3;
enter * for end time then. select total from the calculation mode and click OK.
• Repeat this Calculated Data Function for Column E and the Starts (Daily)
• In cell A3, enter =Mid(B3,31, 12) this should resolve to Bioreactor 1
• Copy this (down) to A4 & A5
• hide column B click on the column header and selecting “hide”.
What’s for Dessert? (Expanding and developing this further)
Aficionados of PI Datalink might observe “but actually, with clever use of the Time Filtered
function and the calculated data “count” feature I could have done this all in PI Datalink… PI AF
isn’t needed.” Great catch, but there are several reasons why PI AF is still serving us:
1) We have a template and can apply this to thousands of assets if we need to – much less
practical in Excel with PI Datalink
2) We can show these pre-calculated results in PI Processbook, PI Coresight and use them in
PI Notifications and PI OLEDB Enterprise. We aren’t limited to PI Datalink as a visualization
tool. And in PI Datalink we can use the more commonly known PI Calc Data functions and
not the obscure (and less efficient) Time Filtered and Count Functions, so more people can
figure out how to get the results and they’ll be less prone to error.
3) This is the first step to building a more automated way to doing this altogether.
30 | P a g e
Two things we need to further automate this – the date of last maintenance and the triggering
values of how many hours or how many starts should trigger a maintenance activity.
The PI AF Table Lookup Data Reference could go to a “View” in the Maintenance System read
into an external table and pull the last data of maintenance based on an equipment number
that you could put in a static attribute in the PI AF database. Every day we’d know which
values were over there run hour or starts limits and needed attention.
Once you had this working you could trigger a PI Notification and send an e-mail to initiate the
maintenance activity – or complete the circle by using the PI Notifications web services delivery
channel and enter a work order back into the maintenance system.
31 | P a g e
Exercise 3 - Electrical Power Usage
As the price of power rises, companies are becoming increasingly aware of energy costs and
they are looking for ways to control them. By assigning costs to each component in a process –
you can start to see where the source of your costs are, where to invest time or money to
achieve efficiencies and economies. Further you can “roll these costs up” and see how the
costs aggregate into areas of the process. With PI we say “If you can measure it you can
improve it” and “if it flows – you can analyze it with PI”. Asset Based PI can help you identify
the source of your energy costs of things by making dollar sense of the flow electrical current.
Ingredients:
PI System – We’re going to be using PI System 2014 / PI AF 2.6 Analysis roll-up feature.
Equipment – This example is built around electrically powered equipment for which we have a
tag showing the flow of current (generally in amperes). However – one could use this with a
piece of equipment that has a clear indication of its running state if you had a good estimate or
specification for the amount of electrical energy used while its running. If you have current on
one piece of equipment – you can likely find it for others as well.
Constants - to convert current to energy consumption – we need voltages (electric potential)
which is practically considered to be a constant for specific pieces of equipment. This is
generally information that will not be available in PI – but may be implied in circuit descriptions
or available in process and instrumentation drawings or other process documentation.
Another important constant is the price of power generally in $/kwh. This can be changed
easily later – so you can start with a broad estimate and refine this as you go.
Tags – all we need is amps. As mentioned above, if you don’t have dynamic electrical current
– you could use a standard energy consumption rate – but you might as well mathematically
convert it into kw/h and just sum it over time and roll it up.
Steps
1) Open PI System Explorer and create a new database or use this to enhance an existing
database. Create a new element to represent the collection of equipment you will be
evaluating. To create an element – right mouse click on the top line “Elements” in the
element browser and select “New Element” or click the “New Element” button on the
button bar. PI System Explorer will prompt you to select a template – which is a great idea
– but we don’t have one yet – so just click “Ok” and continue. This will give our data some
structure. If you are using an existing database – select an appropriate place to put your
first piece of equipment or create a parent element as appropriate. You can name an
element by right mouse clicking on it and selecting Rename or by changing the name at the
32 | P a g e
top of the General Tab on the right. Give this a good name like Bioreactors or Energy
Components.
At UC 2015:
• Your PI system Explorer should open to the empty Cookbook database provided
• Right mouse click on Elements in the top Left and select New Element. click OK.
• Name this at the top of the general tab in the middle Bioreactors
2) We are going to start by building an element template so go to the library in the navigation
panel and about halfway down you’ll find element templates. Right mouse click on Element
Templates and create one named “Electrically Powered Equipment Template”. Build an
attribute (click the new attribute template highlighted text), on the right side you can select
the value type with a pull-down menu, the default unit-of-measure by the two-part menu
(or just type it in) and select the data reference with the last menu (before the settings
button).
Name value type default unit-of-measure data reference default value
Current Double Electrical Current / Ampere PI Point (none)
PI System Explorer will give it a default PI tag format which is unlikely to be right – but that’s
okay just leave that for a while. We are going to need another attribute to hold the
constant for the voltage Create the attribute with the New Attribute Template button, set
the value types and default unit-of-measure – and enter the default value in the value field.
Name value type default unit-of-measure data reference default value
Voltage Double Electrical Potential / Volts (none) 220
• Select the Library from the Navigation Menu (lower Left)
• Right Mouse Click on Element Templates and Create a New Element Template
• Name this (at the top of the General tab – center section) Electrically Powered Equipment
Template
• Select the Attributes Tab, and create a new attribute template (button)
• Name this Current
• Set the value type to Double, the Default U-o-M to Electrical Current/Ampere and select PI
Point Data Reference with the menus on the right.
33 | P a g e
• Create a second attribute Voltage (New attribute button on the button bar) with value type
Double, U-o-m as Electrical Potential / Volt and no data reference
• Set the default value of Voltage to 220 (either the center pane or right pane).
3) In alternating current, we can determine the watts by multiplying the power factor (ratio of
apparent power to real power which varies from zero to one) by the current in amperes,
multiplied by the voltage. As we are unlikely for localized equipment to have data to
compute power factor accurately or dynamically and they are usually near one anyway – we
are going to assume it is one and we can eliminate it as a multiplier. So we are going to
assume our calculation for the instantaneous power (In watts) is volt (which is a constant
we provide) * the instantaneous current from PI in amperes.
That leads us to the analysis tab on this element template where we’ll create a New
Analysis Template (click on the highlighted text). We’ll name this Power. This is an
expression calculation and that’s the default choice we don’t need to change that. We
don’t have any elements yet – so we can’t pick an example (which means we can’t evaluate
quite yet).
It’s optional to name the variables if you aren’t planning on using them in a big multi-line
calculation – and this one is very simple – but let’s name it anyway. “Power” is good.
Now we’re going to get some help – because the expression entry field will pop down and in
this box we have intellisense working for us – which will help us type by reminding us of the
attribute names and functions names and almost anything else we’d type here. So we were
going to just multiply amps by voltage – so let’s do that. This is in PI Performance Equation
syntax – which means that attributes are wrapped in single quotes (apostrophes). As we
start to type – intellisense will help. So if you push down the apostrophe ‘ you’ll get a list
of attributes and you can keep typing or choose one with the mouse. The operator for
multiplication is an asterisk * (if you need a reminder or help there is some for functions
and attributes off to the right – and intellisense will tell you if you type something that’s not
understandable. Expression: 'Current' * 'Voltage'
So where are we going to put this? The analysis server is going to calculate this and put it
into a PI tag, which will be tied of course to a PI AF attribute. But we are in a template – not
an element. So we need to build a way for PI AF to help us build PI tags when we need
them and attach them to the attributes we are going to build from this template. To do
that click on click to map… and select New Attribute template. We’ll name this Power and
select a default U-o-M of watt, a value type of double, and a PI Point Data Reference. Note
that PI AF Analysis will give us a default name of %Element%.%attribute%.%ID% - this is a
good idea – the tag will be named after the element a period and then “Power” and then a
period and a unique string. Not all element names may be unique and we don’t want to risk
two different calculation results into the same PI Tag.
34 | P a g e
This is all sufficient and will work – but there are some optional steps we’ll do here and click
on the Settings button to do those. Note the tag creation box is checked – we are
defining templated rules on how to build PI tags and the attributes of those are defined in
the panel behind that “…” button on the right. Behind that button is a form with a few
optional suggestions I’d like to make.
Enter a PointSource of “PI AF Analysis” (so end users will know where this came from)
Set a reasonable zero, span, & Typical value – for this 0, 2000, and 0.
Again, all of this is optional – it will work without it. Click Ok and Ok to get back to our
analysis rule.
One more thing now – is the scheduling. As we only have one triggering value multiplied by
a constant – I’m going to set this up as event triggered on current. But if we wind up with
many tens of thousands of these and the current changes very often (which it can < 1
second)… we may want to think about slowing this down. Event triggered is the default. If
you pull down the trigger menu – you’ll see voltage is clicked too – we aren’t going to be
changing that – it won’t’ matter if you leave it clicked. We’ve finished this step and it’s back
to our attributes tab…
It’s probably a good time to check in our work.
• Click on the analysis tab of our Electrically Power Equipment Template
• Name this Analysis Power and Name the first expression Power
• Enter this formula into the Expression 'Current' * 'Voltage'
• Click to map and select New Attribute template.
• Name this Power and select a default U-o-M of watt and a value type of double and select
a PI Point Data Reference.
• Click on the “…” button next to Tag Creation.
35 | P a g e
• Scroll down to enter a Point Source of “PI AF Analysis”
• Set a reasonable zero, span, & Typical value – for this 0, 2000, and 0
• Click OK to return to the Analysis
• Check in your work with the Check In button
4) Ultimately – we are not interested in power (force units flow) - but rather in energy – the
total force units during a time period – typically an hour – typically in watt-hours or kilowatt
hours (kwh). This is because that’s how we measure energy for billing purposes. The
instantaneous flow value is of little use to us – we want the volume. PI happens to be very
good at doing time weighted totalizations of flows. To get from watts to kw/H we’ll need
to take that PI tag we just designed and create a running one hour total of it. But wait – we
haven’t even made those PI tags yet – and they are going to have a really nasty name with a
long GUID unique identifier (that we need) as part of them. How is this going to work? We
are going to define a new attribute with a PI Point Data Reference that “borrows” the tag
name off of the Power attribute we just made – so that we won’t have to recapture it – and
then totalizes it over the last “rolling” hour.
Create a new attribute named Energy and set it’s default U-o-M to kilowatt hour/kWh.
Then select PI Point Data Reference and Settings. Click on the Attribute radio button and
select the pull-down menu to select Power (this borrows the tag name from the other
attribute.. ). Now By Time Time Range and set your relative time to -1h (the last hour).
Select Total. When you do that – you’ll see a box pop up at the top where you’ll see
source units and time. Select Watts and second.
Note the “Min. Percent Good” box which defaults to 80%. This is not a bad idea – it rejects
any value which doesn’t have a “Good value” for at least 80% of the time, however it means
we won’t get a value for 80% of an hour – but as we are going to backfill – that won’t be a
problem.
• With our “Electrically Powered Equipment” template selected – select the attribute tab and
create a new attribute template (button) and name it Energy
• Set it’s default U-o-M to Energy / Kilowatt hour, and value type to double
• Select PI Point Data Reference and click on Settings
36 | P a g e
• Select the attribute radio button and pull-down the menu to select Power
• Select By Time to Time Range and set the relative time to -1h
• Select By Time Range to Total and notice that selection opens up above for Unit of Measure
• Set this to watts (ws) and seconds… and click OK
5) It’s likely we have quite a few pieces of equipment that are electrically powered – so it’s a
good idea to use PI Builder to build them. But it’s easier to use PI Builder when you have
one element to use as an example. So let’s go back to elements and create a new child
element off of our first element using our new template and select the attributes tab.
First we need to find a PI tag that represents current / amps - Select Current, Click on
Settings, Search for PI tags with the search button – find one with amps – click ok
Give our element a good name Base this on the PI Tag to identify the equipment
Correct the voltage if necessary
Create the two PI Tags for the analysis by selecting them and Right Mouse “Create or
Update Data Reference…”
Start / Check the Analysis go to the analysis tab – select your analysis – start it if necessary.
Remember when we learned about percent good – our totalization is trying to totalize an
analysis calculation that just started and doesn’t have 80% of an hour to work with – so
that’s likely to fail. Let’s keep that in mind and move on.
Check in your work.
• Click Elements in the Navigation Menu and select the Bioreactors element
• Right mouse click on this and select New Child Element
• Select our new “Electrically Powered Equipment” template
• Select the attributes tab on our new element and select the Current attribute
• Click on Settings and then the tag search (magnifying glass)
• Enter *J.PV in the search field this finds tags with J as the last character before the suffix
• Select the first tag – it is likely RX001CSJ.PV – the amps for the reactor 1 cooling pump
• Click OK
• Change the name of the element to Reactor 1 Cooling System (top of the general tab)
• Right click on the new element and select Create or Update Data References
• Check in your work with the Check In button
• Click on the analysis tab and make sure the analysis is started.
6) We can create more elements in PI Builder now. Open Excel (with PI Builder installed).
Confirm that the correct PI AF server is selected and select the Database you are working
with (upper left). Select Elements under retrieve in the PI Builder menu and select Find
Elements from the drop down menu. Select our template from the Template pull-down
menu and click Search. Select our Element and click OK. Click the “Clear All” button, then
select Template from the element group and Current and Voltage from the Attribute
Columns Group. Click OK
37 | P a g e
Search for more tags that have current and simply copy and edit the row with your element
to setup up these new attributes appropriately by changing the |Current column and give
them a good name under Name. Note the syntax in the |Current column – the “=” sign
indicates you are changing the data reference configuration string and not the value. The PI
Server name is required. Under the |Voltage column – any change would edit the value of
the attribute.
38 | P a g e
Clicking on Publish should build these elements in PI AF. Check on your new elements in
the PI System Explorer. PI Builder should have run the Create and Update method for you
and built the tags you need. The analyses should also be enabled and running.
• Open Microsoft Excel (from the Start Menu or task bar)
• Click on the PI Builder tab at the top and pull the menu down below Elements
• Select Find Elements
• Select Electrically Powered Equipment Template from the template menu
• Click on the Search button at the top
• Select your Reactor 1 Cooling System element by clicking on it
• Click ok
• For Column selection click the Clear All button in the lower left
• Scroll down if necessary and click the box next to Template (important)
• Scroll down and find the attribute columns options and select Current
• Click OK
• Select Cell F3
• Select the PI Datalink tab and select Search. Click on the Home button and select the PI
Server (blue icon) of PISRV1
• In the search field enter *j.PV (which will find all of the current / amp tags)
(don’t slide the bar over so we’ll get the server prepended on the tag)
• Select all of these tags and click Ok (Ctrl-A helps with selecting all)
• Click in G3 and select the Properties Button of the PI Datalink Ribbon (Tab)
• Click on F3 (your first PI Tag) and drag to the last tag for the Data Items
• From the Property menu select Description and click OK
• In cell C3 – we’ll want to remove “Current” from those descriptions – enter
=Left(G3,Find(“Current”,G3,1)-1) and copy this down to 14
• Copy Column C and Paste Special values (clipboard 123 icon) to “freeze” these values
• We need the Equal sign at the beginning of the tag references – select column F and enter
Ctrl-H - repl \\PISRV1 with =\\PISRV1
• Copy the X in Column A and the path Bioreactors in Column B down for all of the rows
(to row 14)
• Copy the ObjectType Element and the template Electrically.. down for all the rows too
• Copy the voltage all the way down (replacing those tag descriptions we don’t need
anymore)
• Rows 2 & 3 are duplicates of Reactor 1 Cooling System – which is already built – delete
both of them
• Click on the Publish button on the PI Builder button bar
• Select “Create” as the option and click the “Create PI Tags” on the right side of the
dialogue and click OK
• If there were no errors – minimize or close Microsoft Excel and return to PI System
Explorer, select Elements and press the Refresh button
39 | P a g e
7) To complete our project we want to convert our energy consumption into dollar cost and
roll those costs up.
First we need a cost to start with and place to put it. We made an element when we
started (Bioreactors). Let’s create an attribute for it:
Name value type default unit-o-m data reference default value
Standard Energy Cost Double <none> or Currency $ <none> $ .18
Not all systems have Money/U.S. Dollars in their U-o-M table – if you don’t leave it blank or
add one. Also if the base element is templated – we’ll need to add the standard energy cost
to the template and not directly to the element.
So next we go back to our powered equipment element template in the library to the
analysis tab and create a new analysis. We can call this Energy Costs and it’s also pretty
simple – we’ll multiply Energy by this standard cost. Energy is easy for intellisense to find –
but the standard energy cost is another element. In order to find this other element – we
need an example element. Select an example element. (right in the middle of the screen).
Now create a new analysis called Energy cost. Selecting the energy attribute easy – to
select the standard cost – we could go the attributes button in the lower right part of the
screen and navigate to our “Standard Energy Cost” and make an absolute reference to it.
As before we can have the Analysis server write this to a PI tag. Click to map. Select New
attribute template and name this Energy Cost. Select the Settings button, note the
“Create” button is clicked. Select the “…” Button and set the Point source = “PI AF
Analysis” (which you have to type in). Select Zero = 0, Span = 200
Now we have a little problem we need to fix with the triggering. If we trigger on Energy –
that’s not going to work. Energy is a real-time interpretation of another tag – the power
tag. But our Analysis processor wants to “sign up” with PI Data archive snapshot changes of
a tag – and Energy doesn’t have a snapshot in any PI Data Archive to do that with. So we
have two choices
• Choose a frequency of calculation – say 10 seconds – and calculate this 360 times an
hour which is probably accurate enough -or-
• Trigger off of Power directly
The former is pretty straightforward – just change to periodic and click on the box and set it
for ten seconds. To trigger off of Power, we need to include Power in the expressions so
40 | P a g e
that we can choose it – but we don’t need to use it. So add a new expression name the
variable Power and select the expression to the attribute Power – but don’t map it
anywhere. Now it should show up in the Trigger on menu. Now every time the Power is
calculated by Analysis and it writes to a tag – it will also trigger the energy cost calculation.
Please check in your work and go check on your elements – you may need to build some PI
tags with “Create or Update Method”. Note that you can do this once at a parent element
and PI AF will “walk down the tree” and create all of the PI tags it needs to all the way to the
bottom of the hierarchy.
• Select the Bioreactors Element (Navigation Menu / Elements)
• Select the Attributes tab / pane and create a new attribute (button)
• Name Value type default u-o-m data reference Value
Standard Energy Cost Double <none> <none> $ .18
• Select the Electrically Powered Equipment Template (Library \ Element Templates)
• Click on the Analysis tab and create a new Analysis (right click in top box \ new) named
Energy Cost (it is an expression and the default element should already be chosen)
• Enter the expression: ‘Energy’ * ‘..\|Standard Energy Cost’
• Click to map, select new attribute – name it Energy Cost. It should be created as a Double
and PI Point Data Reference with the tag creation box clicked.
• Optional: Click on Settings and the “…” button and change the Point Source to “ PI AF
Analysis”.
• Close these dialogues
• Select a periodic scheduling of every ten seconds (bottom of the analysis configuration)
• Check in this work
• Return to the Bioreactors element and right mouse click on it and select “Create or
Update Data References to build the PI Tags on all elements below it.
• Check on the Analysis tab for a few elements and see if they are green & running.
8) Because our data is most interesting as hourly data – we’ll definitely want to backfill – so we
can see what’s going on with this data. To backfill, we’ll go to the analysis manager and
find all of the many analyses under this template (select by template on the left and select
41 | P a g e
our template). We can select them all by clicking Select all. Then just select Backfill
checked analyses, set a start time, and click on queue. You can check the backfill by
selecting one or more of you elements, selecting the attributes and trending the results
with a right mouse click and show trend.
• Select Analyses Manager Icon at the bottom of navigation menu at in the lower left.
• On the left under choose a filter – select by analysis template
• Select your Power analysis Electrically Powered Equipment\Power
• Select all of the analyses with the check box at the top (should be 12)
• Click backfill checked analyses (on the right).
• Start the backfill two days ago (*-2d or use the calendar)
• Click on queue.
• Repeat this process for Energy Cost - choose the energy cost analysis template
• Select all of the analyses with the check box at the top (should be 12)
• Click backfill checked analyses (on the right).
• Start the backfill two days ago (*-2d or use the calendar)
• Return to the elements in the navigation menu and select one of the elements
• Select select the Power & Energy Cost attributes (use the ctrl key)
• Right mouse click and select to show these on a trend. You can select the trend start
time to *-2d if you like.
• Check in your work with the Check In button
9) The next step for this recipe is to “roll-up” the results. Currently, the only attribute we
have for our parent / root element is the cost. We’d like to make an attribute to hold total
energy cost and roll-up the components costs here. As there is only one of these – you
might think we won’t need a template, but there are several good reasons to make a
template:
� You can’t build tags without a template (that’s where the tag building definition is
held) and we need to build a tag – we could build the tag in PI-SMT Point Builder
and associate it – but it would be easier to just let PI AF build it for us.
� Later we are likely to have a more complex hierarchy and want to group these
elements and have subtotals, etc.. and having a template will help with that.
� It is really minimal trouble to build a template, so why not?
So we’ll convert our element to a template by right mouse clicking on it and selecting
convert to template. This will create a template – and put this element under the
management of that template. We can go to the library in the navigation pane and find our
template. We could give it a good name.
42 | P a g e
Select the Analysis Templates tab and add a new analysis. This time select the Rollup click
button and name it Total Cost of Energy. Select an Example element (there is only one to
choose at this point) so you can see attributes and children. Leave Child Elements selected.
Enter Energy Cost into the attribute name field and notice that it should confirm your
choice. Select “Sum” in the box below and map it to a new attribute template. We are
creating a template for building PI tags again, I would recommend at least changing the
Point source (to PI AF Analysis), and maybe the zero, and span. Note that it appends %ID%
on the end of the tag name – and this is a good thing as we need a guaranteed unique PI
Tag name.
Before we set the scheduling, let’s think a moment about what we are calculating. We are
calculating the total kwhs and the resulting cost of that on a “rolling” – one hour basis. So if
we write this once an hour at the parent level. That’s the number for the last hour – we can
just total those up for a day and we’ll have it. We should keep this in mind when using this
in visualization too. A snapshot on the hour is the total volume and the cost is the cost for
the last hour.
Select Periodic Scheduling and configure one hour with no offset.
Check in your work. Confirm that your parent element has the attribute and analysis and
that the analysis is scheduled to calculate.
• Right mouse click on the Bioreactors element and select Convert / Convert to template
• Find the new template ( Library \ Element Templates \ Bioreactors Template), right mouse
click on this template and rename it Area Rollup Template
• Click on the Analysis Tab and create a new analysis, call it Total Cost of Energy
• Select the Rollup option and select the Bioreactors element as the example element.
• Enter Energy Cost in the attribute field name - this should identify attributes from the child
elements
• Click on the box next to Sum
• Map it to a new attribute template and select PI Point Data Reference it will default to
%element%.%attribute%.%ID% for the tag name which is good.
43 | P a g e
• Click on the Settings button and the “…” button. Scroll down and enter “PI AF Analysis” as the
Point Source, click “OK” as needed to return to the analysis.
• Click the Period button at the bottom under scheduling and set it for 1 hour 00:01:00
• Check in your work.
10) We can backfill this too – and to do this – we can just go to our rollup / root element and
click on the analysis tab. Right mouse click on your Total Cost of Energy and select Backfill.
• Select the Bioreactors Element Elements in the navigation pane, top element
• Select the Analyses tab. Right mouse click on the Total Cost of Energy analysis. Select Backfill
• Start the backfill two days ago (*-2d or use the calendar)
• Click on queue.
• Select the attributes tab and
• Right mouse click on Total cost of Energy and select Trend
Serving Suggestions (Visualization)
For this we are going to use PI Processbook 2014. For some time now we’ve talked about
how to build “Element Relative Displays” that switch between elements – but for this
analysis there aren’t that many things of interest here. What would be great is to have a
way to show more elements in a standard way on the same display without having to copy
and paste and edit and build them over and over. Fortunately, PI Processbook has a great
way to do this in the 2014 version.
• Create a new PDI file in PI Processbook 2014 (File\New\ PDI file) you could name it
power costs.
• Select the Build mode (hammer icon).
• From the View Menu – open the AF Browser and select the appropriate server and
database at the top. This will give you a hierarchical representation of your PI AF database.
Select one of our (child) electrical powered equipment elements.
• Now go back to the View Menu (still in Build mode) and select PI AF property. This should
show you the attributes for the selected element.
• With the build mode cursor – draw a small trend. Don’t change anything about it – don’t
add any PI tags or attributes, just click okay (the build dialogue box will close). Now drag
the current attribute from the PI AF Property window on to this trend (it’s helpful to click
on the tag icon). Next drag the Energy Cost from the list of attributes to a place just under
the trend. This should appear as a process value.
• Select both objects (with the hammer cursor) go to the Arrange menu and select Group.
44 | P a g e
• Right mouse click on your new group and select Assign Symbol to Template. Select the
Cookbook database and the Electrically Powered Equipment Template.
• Now with the build mode / Hammer cursor selected – drag the other elements you’ve
identified onto the screen and arrange and label them appropriately. This small symbol set
is now readily available to anyone who wants to represent these elements.
• Save your display. (File menu Save and select the desktop and an appropriate name)
What’s for Dessert? (Expanding and developing this further)
Remember that Power Factor we dismissed earlier – with some engineering research – maybe
we could get that right.
Many industrial customers participate in a wholesale power market where their price is
changeable by the hour. You may be able to use the PI-HTML interface to lookup a base
hourly cost of power dollar figure from your grid operator’s website and use a dynamic PI
tag based cost of power and not a standard estimate. This would help you look at
management strategies that could move energy intensive operations to low power cost
times of the day.
For many industrial facilities tracking water usage and perhaps even bandwidth usage may
become as critical as electrical power usage. This same technology could be applied to
those interesting flows.
45 | P a g e
Exercise 4 - Downtime analysis with Event Frames
Downtime analysis with Event Frames – records every time a critical piece of equipment is
interrupted in its continuous operation – a sophisticated record that keeps the duration of the
event, and key variables to help you analyze and prevent downtime.
Ingredients:
PI System – Our goal is to create data stored in PI points that will be usable by PI Notifications
and use the power of templated event frames to track calculations. For this reason, PI AF
System 2014 is important so that we can record our results in PI Points.
Equipment – In general we are looking for equipment that is at least very occasionally
interrupted from our intention to have it in continuous operation, or where we know it will be
interrupted and we wish to minimize the interruptions to its continuous or nearly continuous
operation.
Points - All we need is indication of when the equipment is running and when it is not, this can
be a discrete/digital on/off or running/stopped point, but it could also be a current/amps (most
things that run on power won’t be running if they aren’t getting current), output (flow, etc..)
may be used (there can be flow from a pump even if the pump isn’t running though).
Temperature and pressure may not be good indications – as it can take these some time to
decline after a unit is taken from service.
Steps:
1) Open PI System Explorer and create a new database or use this to enhance an existing
database. Create a new element to represent the collection of equipment like this. To
create an element – right mouse click on the top line “Elements” in the element browser
and select “New Element” or click the “New Element” button on the button bar. This will
give our data some structure. If you are using an existing database – select an appropriate
place to put your first piece of equipment or create a parent element as appropriate. You
can name an element by right mouse clicking on it and selecting rename or by just
changing the name in the general tab for the element.
At UC 2015:
• Your PI system Explorer should open to the empty Cookbook database provided
• Right mouse click on “elements” in the top Left and select New Element.
• Name this at the top of the general tab in the middle Bioreactors
2) Create a child element of your first element above (Right mouse click on the element you
selected or created above and select “New \New Child Element”). We don’t have any
46 | P a g e
templates that are relevant yet – so just click “OK” with no template selected. Name your
element on the general tab appropriately for the equipment. Please note that PI points
will be based on this name so we should have a unique name for this element (and other
elements derived from this template).
For this analysis we need one PI point – the indication as to whether we are running or not.
For our purposes in this recipe – we are going to assume we have a clean indication from
the control system through PI, in PI, or written back to PI by PI AF Analysis as to our
operating state. So on our Element – let’s add an attribute as a PI Point Data Reference
and call it “Status”.
Let’s say we have an integer status point that is zero when the unit is down and one when
it is up. I’d like to improve that a little so let’s go to the library and build an enumeration
set called Status and enter Stopped into the name field and press enter and enter Running
and notice how the value field aggregates for us. 0 = Stopped 1 = Running
Back at our new Element – let’s set up our Status attribute with the Data reference PI Point
and select our point. To create an attribute right mouse click in the blank space on the
attributes tab or use the button on the button bar for new attribute. Set the PI Point Data
Reference on the pulldown menu. And then select the value type as enumeration set /
status. Click on the settings button and then the magnifying glass / point search button to
search for your PI point.
Now let’s think about this equipment – what causes downtime and what is lost when we
have downtime. For example – can excessive speed cause a trip? Do irregular pressures
cause it? We may not have done the analysis we are going to do – and we can enhance it
later, but identifying some of these is a good idea. Also – do we have a clear measurement
of production so we can start to calculate lost production during the downtime?
So let’s say – in our example that a trip can be caused by too much or too little in the vessel
or excessive temperatures. And that our production can best be estimated by taking an
hour’s average of our effluent flow. So let’s build attributes for these data items for this
piece of equipment as simple PI point data reference points getting the snapshot.
Great little PI AF element. We should make it a template. There will be others like this and
templates are very useful anyway – so Check in your work and then Right mouse click on
your element and select Convert / Convert to Template. The next step will try to
generalize the PI point names. This often won’t work. We’ll just accept this and move
along.
Check in your work (there is a Check in button on the button bar for this), then go the
library and check on your new template. It should be there with appropriate attributes.
• Right mouse click on Bioreactors and select New \ New Child Element. Click ok on the
next panel…
47 | P a g e
• Name this (as above in the general tab near the top center) Bioreactor 1
• Go to the Library (lower left navigation menu) and select Enumeration sets
• Right Mouse Click click New Enumeration Set .. name this Stopped and Running
• In the first row in the Name column enter Stopped press enter and enter Running
in the next row of the same column (note that the value column autofills).
• Return to your new Bioreactor 1 Element (Elements in the Lower Left Menu). Select
the Attributes tab – and use the highlighted text or button to create a new attribute.
Select the PI Point Data Reference on the pull down menu. Name this Status (top
right of the attribute properties panel) Select the value type as Enumeration Set /
Stopped and Running. Click on the Setting button and then the magnifying glass /
Point Search Icon and enter RX001* to search for the attribute and select
RX001ACT.PV
• Create Two more attributes (new attribute button – upper right)
Attribute U-o-M value type point
Temperature Temperature/Deg F Double RX001RXT.PV
Level Ratio/% Double RX001RXL.PV
• Create one more attribute Effluent Flow set the U-o-M Volume Flow Rate/ U.S.
Gallons per Minute and select a value type of double. Select PI Point Data Reference
and point RX001EPF.PV
Select Time Range for the By Time option -1h for the relative time and
Average for the By Time Range option. This will calculate the last hour’s average flow.
• Check in your work (Check in button on the button bar)
• Right mouse click on Bioreator 1 select Convert / Convert to Template. Click OK on
the next panel.
• Go to the Library (lower left Navigation Menu) and select Element Templates (it’s in
the middle) expand this to find your new template Bioreactor Template.
3) Before we ask Analysis to start generating Event Frames, we need an Event Frame
Template. You can create that in the library – right mouse on Event Frame Templates and
select New. The General tab has some important features. First the name – give your
event frame template the name Downtime
And then the naming pattern. If you select the menu to the far right of the naming
pattern you can select the name of the element which generated the event frame, the
name of this template and the start time. Let’s select all three – with spaces in between.
%ELEMENT% %TEMPLATE% %STARTTIME:yyyy-MM-dd HH:mm:ss.fff%
In this way each event will be named with these important features so we can identify
them readily.
48 | P a g e
Let’s add the attributes later. So check-in your work and return to the element template.
• In the Library – Right mouse click on Event Frame Templates and select New Template
(event frames) Name this Downtime (top of the general tab screen)
• At the bottom of this initial General screen is the Naming Pattern. Click in this field
and select the arrow – which opens a flyout menu – select %Element% press the space
bar, then select %Template% from this menu – press the space bar again, and finally
select %StartTime YYY etc…
• Check in your work (with the Check In button on the button bar).
4) Let’s return to our element template we made with the conversion a in step two. Click on
the Analysis templates tab and create a new analysis template. Name it Downtime. Select
Event Frame Generation. Select an example element (we have one). And select our Event
Frame Template - Downtime. For the StartTrigger – we need to name the condition that
begins the downtime event and for us – that’s the Status being “stopped” (or zero). I
entered ‘Status’ = “Stopped” (intellisense can help – and there is an evaluate button)
Other notes about this screen –
The EndTrigger is optional – if the reversal of the start trigger is the end trigger (as it is in
most cases and in mine – you don’t need it.
There is a “time True” test for the start trigger which requires that the start trigger remain
true for so many minutes or seconds in order to open an event frames. This can prevent
data spikes or anomalies from causing event frames. The original time will be preserved as
the start of the event frame.
49 | P a g e
Note the Child root cause Event Frame option. This generates a “child” or dependent
event frame which leads the event frame to make it easier to look at causal data. Let’s
click on the box and ask for one of these for five minutes before the event. We can keep
the name Root Cause.
Event Triggered Scheduling on the status should be fine.
Before we check in our work and return to the event frame template, let’s check our work.
If you right mouse click on the Analysis Downtime in the upper left window – you can
select preview results (we are in the template – this will use the selected example
element). Give a reasonable start and end time to get some downtime events and click
generate results. Did you get results?
Next – navigate to the element and see if your analysis is running. If it is, backfill it for a
short amount of time, by right mouse clicking on the analysis and selecting backfill, a start
time, and end time (suggest *-2d, *). This will queue a backfilling generation of your event
frames.
As your backfilling develops you can also search for the event frames in the Event Frames
search window – below the elements in the navigation menu (lower left). Just click on the
default Event Frame Search 1.
50 | P a g e
• Click back on the new Bioreactor Element Template (in the library) and click on the
Analysis tab (to the far right). Create a New Analysis template (click on the highlighted
text) and Name this Downtime (at the top right) and select Event Frame Generation.
• Select Bioreactor 1 as the example element and select Downtime for the Event
Frame template
• In the expression next to StartTrigger enter ‘ Status’ = 0
• Below this select “Generate Root Cause Event Frame” (click box) and select 5 minutes
• The Scheduling should be okay – Please Check in your work.
• Return to the Bioreactor 1 Element and select the Analysis tab – if it shows a green
arrow and appears to be running – right mouse click and select “Backfill” – set the
start time for midnight today (00:00:00 this morning).
• Select Event Frames (from the lower left Navigation Menu) and select the default
Search 1 ; right click properties, select element name, enter * select OK) – you should
get some results.
5) Back in the Event Frame Template. We’ve been building event frames – but they are a
“frame” – we can put thing in the frame with the template – even after we’ve created the
frames. We should select attributes that help us understand the downtime events – not
everything from the asset. Note that you can copy attributes from the element to the
Event Frame – you will need to reconfigure the PI Point Data Reference configuration, but
it will give you consistent naming and select the Unit of Measures for you.
We’ll be building event frames against other similar equipment and we don’t want to
specify the temperature and level points here in the template – and the event frames are
generated automatically – we don’t want to specify the points after they are generated
there (that would be a lot of work). We want to “borrow” the PI point from the associated
Element. And there is syntax for doing that. Open the settings box for Starting
temperature and click on Attributes and enter the following: Elements[.]|Temperature
Select Automatic for the By Time option and Start Time for the By Time Range option to
read the PI value at the beginning of the Event Frame and Automatic and End time to read
it at the end. To calculate averages or totals across the event frame you can use
Automatic and select the time range options of average or total. But in a downtime Event
– often the averages or totals during the event frame are not very interesting. – it is the
period before we are interested in.
For the Effluent flow we wanted a calculation: Elements[.]|Effluent Flow
Select Time Range for the By Time option -1h for the relative time and Average for the
By Time Range option.
For the Duration attribute – select the Status point as the point to borrow
Elements[.]|Status
Not Supported as the By time option and Count as the time Range option.
51 | P a g e
• Select the Downtime Event Frame Template (library \ Event Frame Templates) and the
attributes tab.
• Use the highlighted text or the button on the button bar to create four attributes:
Name unit-of-measure value type Data Reference
Starting temperature Temperature/DegF Double PI Point DR
Starting Level Ratio/% Double PI Point DR
Effluent Flow trend Volume Flow Rate/GPM Double PI Point DR
Duration Time/Seconds Int32 PI Point DR
• Click on the settings box for Starting temperature and click on Attributes and enter the
following: .\Elements[.]|Temperature Select Automatic for the By Time option
and Start Time for the By Time Range option.
• Repeat this for the Level tag .\Elements[.]|Level, Automatic & Start Time
• and repeat this again for the Effluent Flow Elements[.]|Effluent Flow
• For the Duration enter .\Elements[.]|Status for the attribute
Select Not Supported for the By Time option and Count for the By Time Range
6) Calculating the lost production. Finally we’d like to know what production we lost by
comparing the one hour average production before the downtime to the duration of the
downtime. This will create one more event frame template attributes:
Lost Production US Gallons Double Formula DR
The Effluent flow before the downtime was in U.S. Gallons per minute. The Duration is
returned in Seconds. If we multiply the duration (which is in seconds, but easily converted
to minutes) times the production we were experiencing before the downtime – we should
get an idea of how much production we lost.
We don’t have Analysis in Event Frames and can’t write to a PI point – but we have the
Formula Data Reference. Select the Formula DR & click on the Settings box.
For the Formula data reference – you select your Effluent Flow and Duration on the left as
variables and then divide the duration by 60 and multiply it by the One Hour Effluent Flow
average (in U.S. Gallons per minute).
So we should check on our Event Frames in the Event Frame Search in PI System Explorer.
Notice you can “rename” or “recapture” selected event frames. When event frames are
created or when the template is changed – they “capture” values and hold them, but if you
need to update the captured values – or update the name of the event frames based on
your format in the template you can.
• In the Downtime Event Frame Template create one more attribute template:
Lost Production US Gallons Double Formula Data Reference
• Click on the Settings button (associated with the Formula Data Reference)
• On the left add the input attributes you will use (use the yellow star button)
F = Effluent Flow
D = Duration
52 | P a g e
• On the Right hand side – click in the first row and add our formula: F * ( D / 60 )
• Set the result in U.S. Gallons
• Check in your work.
• Return to the Event Frames – (Lower left Navigation Menu) and the first search where
you previously found your event frames. Open one. By double clicking on it. Check the
attribute values. Use the Refresh button on the button bar if you need to.
7) We chose a piece of equipment that may have other, similar pieces of equipment that we
can apply our template to. We’ll use PI Builder – the AF (and PI point) building add-in for
Microsoft Excel. Open Microsoft Excel and confirm you have a PI Builder tab. Make sure
the right PI AF server is selected in the upper left hand corner of the PI Builder ribbon and
select the database you used below that (if you've had Excel open the whole time you've
been working - you may need to close it and open it again or disconnect/reconnect from the
server to see the new database).
Pull down the menu under Elements in the retrieve section of the PI Builder ribbon and
select "Find Elements". Select the pull down menu for template and you can select your
template. Then click the Search button and you should find your element. Select it and click
ok.
From the next panel you can select the attributes or the elements you want to edit in Excel
columns in the element creation process. It's easier if you just click "clear all" and then
select just a few things including "template" and scroll down to find the attribute columns
from your template and select source PI point attributes (only – there isn’t one button to
click – you need to identify and click on them). There is no reason to select the PI Point
attributes updated by the Analysis engine or any calculated or values.
Note the =\\server\tagname format of the PI point references. The equal sign indicates
that PI Builder will update the Data Reference Configuration String and not the value of the
attribute. Point naming is not often that strong – but if you only have a handful of points
for each of a handful of assets – it should take too long to get the right points into the right
fields. Note you do have to have the =\\server\tagname format the point alone won’t work
– and without the = (and a formatting apostrophe in front of it) – it won’t work either.
With three reactors I just made a copy of the row and edited all of the columns such that
the name and PI point references were correct. (remember Ctrl H for search and replace in
PI AF).
53 | P a g e
Clicking on “Publish” and selecting “Create” will build these in PI AF.
Back in PI System Explorer – if you select refresh – your new elements should be there –
complete with PI Analyses. The Analysis engine should pick them up and start capturing
Event frames. Check the Analysis tab on the element and make sure the Analysis is started
(green “go” arrow). Let’s check in our work.
• Open up Microsoft Excel and select the PI Builder Tab
• Confirm that PISRV1 is the selected PI AF server & Cookbook is the selected database
(upper left)
• Pull down the menu under Elements in the PI Builder ribbon and select Find Elements.
Select the pull down menu for template and select the Bioreactor template. Click the
Search button and find Bioreactor 1 select it and click ok.
• Click on the Clear All Button (lower left) and then select Template (you may have to
scroll just a bit). Then scroll down more to find the attribute columns and select Status,
Temperature, Level, and Effluent Flow (only). Click OK
• In the spreadsheet cells, copy your Reactor and by selecting the whole row (2) and paste
it over row 3.
• Select Row 2 again (the whole row) and press Ctrl-H, change all occurrences of
Bioreactor 1 with Bioreactor 2 repeat this (ctrl-H) and replace all RX001 with RX002
• Select Row 3 and with Ctrl-H, replace Bioreactor 1 with Bioreactor 3 & RX001 with RX003
• Click Publish on the PI Builder Ribbon and select Create and ok to build this in PI AF.
• Return to PI System Explorer and select Elements and Refresh
• Right mouse click on Bioreactor 2 and select the analysis tab – is the analysis running?
Right Mouse click and backfill the analysis for beginning with midnight this morning.
• Repeat the backfill for Bioreactor 3 Check in your work.
Serving Suggestions (Visualization) PI Datalink 2014 is always a good choice for Event Frames.
Note that Event Frame requests in PI Datalink 2014 are dynamic. On future days – you can get
the newest Event Frames by just recalculating the sheet.
• Open Microsoft Excel and click on Explore Events in the PI Datalink 2014 menu
• For the Database – enter our Server and Database e.g. \\PISrv1\Cookbook
• Set the Search start time to a reasonable time relative to your backfilling. (today at
midnight)
• Select Downtime as your Event Template (You should see Event Frames in your
preview window)
54 | P a g e
• Usually PI Datalink makes some great column choices for you too – but you can select
and deselect as you like and change the order with the blue arrows.
• click OK.
• You should get a great dynamic report of all the downtime events in this period.
We didn’t see any root cause events because they were filtered by the show child event frame
levels choice – that’s fine – let’s get all of the root causes at once.
• Select the plus sign at the bottom next to Sheet1 and get a Sheet2 and select it
• click on Explore Events in the PI Datalink 2014 menu
• Select the Server and Database again \\PISrv1\Cookbook
• Set the Search start time to today at midnight
• Select Root Cause as the Event Frame Name
• click OK at the bottom
• You should get a report of the root cause event frames
What’s for Dessert? (Expanding and developing this further)
You have a templated asset and templated event frame – you can build many more similar
elements and they’ll automatically generate templated event frames. Get the Elements right
and the Event Frames are all gravy.
Remember that in Excel – all data – even that from PI Points not in the Event Frame or asset are
“in the frame” if you have a start and end time. Do you want to know if Relative Humidity has
an effect on downtime but you don’t want to build PI AF for this one time analysis? Just put
the PI point in your Excel sheet and let the Event Frame provide the start and end times.
PI Data Access tools such as PI OLEDB Enterprise and the Web API or the PI Webservice can all
read Event Frames into SQL-style datasets or XML style datasets. These can be used to
integrate your downtime events into other reports, and PI will do the timeseries totalizations
for you.
55 | P a g e
Exercise 5 - Tank Transfers with Event Frames
Many types of processes have tanks. And what’s the point of having tanks if you aren’t putting stuff in
them and taking it out. Capturing the transfer of fluids from one vessel to another – is a good use of PI
Event Frames.
Ingredients:
PI System – In this recipe we’ll be recording the material transfer – the time and volume with an event
frame in PI AF analysis – which is a feature of PI System 2014.
Equipment – Any tank for which we want to record either the fill or drain event. Some tanks may be
less appropriate. For example it is very important to know the level of your lube oil. However, generally
the drain from the lube oil tank is often a slow continuous process and not an “event” and the fill is
sometimes performed by a vendor’s equipment entirely and may not be available in PI Points. Many
other types of tanks however do have interesting fill events, drain events or both.
Points – We are going to need some indication of whether a fill or drain event is taking place. This can
sometimes be a value open digital / state indication or percentage of value open. This can be flow is
greater than some small almost zero number. This could be amps on the pump that causes the flow.
From one of these sources we can trap the start and end time.
We’d also like to record the volume of the transfer. If we have a flow reading for the transfer we can
totalize this for the event frame. We can also record the levels of one of the vessels before and after the
transfer and calculate the differential volume of the tank and get the volume that way. However, if we
are filling, our result won’t be accurate using this method if we are simultaneously draining. (It is
possible to calculate for this but we won’t be doing that today). Also note that some levels are reported
in percentage – while others are reported in feet (or inches), or meters (or centimeters).
Other data might be very useful for this. If the same material is not always transferred and you have
that in a PI point or other addressable source – that would of course be very interesting. Filling in
particular, can change the chemical properties of whatever is in the tank – so if things like temperature
or pH are continuously captured – it would be great to include the value at the beginning of the event
frame and then again at the end.
Non PI Data - it would be great to know the volume of the transfer and the volume of the tank. In our
example we are going to take a percentage level and multiply this by the capacity to get the volume.
However there can be several other methods implied in the data. If the level is in feet or meters – we
may have to divide the level by the maximum and use that to multiply by the capacity. Some tanks are
spherical or they may have “strapping effects” or a “heel” (a quantity never used). An approach to
calculating the volume in some of these cases may be to build a level vs. volume lookup table in an
internal table in PI AF and use the “interpolate” function in the table lookup data reference to return the
volume.
56 | P a g e
Steps:
1) Open PI System Explorer and create a new database or use this to enhance an existing
database. Create a new element to represent the collection of equipment like this. To
create an element – right mouse click on the top line “Elements” in the element browser
and select “New Element” or click the “New Element” button on the button bar. This will
give our data some structure. If you are using an existing database – select an appropriate
place to put your first piece of equipment or create a parent element as appropriate. To
name your element right mouse click on it and select rename or enter the name at the top
of the general tab on the right.
At UC 2015:
• Your PI system Explorer should open to the empty Cookbook database provided
• Right mouse click on “elements” in the top Left and select New Element.
• Name this at the top of the general tab in the middle Bioreactors
2) Let’s start by creating an element template for the receiving tank. Select Library in the
navigation menu of PI System Explorer, select Element Templates under Templates and
right mouse click on this and select New Template or click on the New Template button on
the Button bar. Name this tank template (on the general tab at the top). Create three
attributes, level, feed flow, and capacity (attributes tab, right mouse click in the panel or
new attribute template button for each), and set the name (top of the properties panel, and
set the Units of measure, the value type, and the data reference.
U-o-M value type Data Reference
Feed flow Volume/ U.S. GPM double PI Point DR
Level Ratio/% double PI Point DR
Capacity Volume/ US gallons double none
• Select Library from the lower left Navigation Menu and select Element Templates
• Right mouse click and select New Element Template name this Tank Template
57 | P a g e
• On the attributes tab – select the highlight text or the button on the button bar to add
three attribute templates. Set the Unit of Measure, the value type, and the Data
Reference.
U-o-M value type Data Reference
Feed flow GPM double PI Point DR
Level % double PI Point DR
Capacity US gallons double none
• Set a default value of 2,000 U.S. Gallons for the capacity
3) Next – create the analysis to calculate the volume. Click on the Analysis tab on your
element template and create a new analysis template called Volume (expression is already
chosen). (We can’t choose an example element yet because we don’t have one). The
expression is simple (we can name it Volume too): ‘Level’/100 * ‘Capacity’
Click on “Click to Map” and New Attribute Template. Simplify the name to Volume. Set the
U-o-Ms appropriately (e.g. US gallons).
We will write the result of our calculations to PI Points – but these points don’t exist yet –
because PI AF hasn’t built them yet. We need to define how PI AF will build the PI Points.
Note – PI AF can only build PI Points if they are defined in a template. Click on the Settings
button. Click the “Tag Creation” box and click the “…” button to the right of that. We
might make only one optional change – setting the point source to “PI AF Analysis” so that
end users will know where this data came from. You could also set the span to the largest
capacity you expect from any tank. Close the form. Note that the PI points will be created
with the name: \\%Server%\%Element%.%attribute%.%ID% substituting in the default PI
Data archive server, the name of the element, the name of the attribute (“Volume”) and the
GUID Id of the attribute. That ID is important because PI AF elements don’t have to be
unique and we don’t want to write the volume for many tanks into the same tag.
Event Triggering is fine. Please Check In your work.
• Click on the Analysis Template Tab in your element template and using the highlight
text or button (on the button bar) create a new analysis template, name it Volume
• Name the expression variable Volume & enter the expression: ‘Level’/100 * ‘Capacity’
• Click on “Click to Map” and select New Attribute Template.
• Simplify the name to Volume. Set the U-o-Ms appropriate (e.g. US gallons).
• Click on the Settings button click the point creation box and then the … button
• Scroll down and change the Pointsource by entering PI AF Analysis click OK to
close the form (s).
• Check In your work.
4) Build a tank. As all of this has been in the template – we should build an element. Back to
Elements in the navigation menu and then click on the root element we made or where you
58 | P a g e
want to put your first tank. From the menu select Create New Child Element and select our
new template. On general tab – let’s give this tank a good name (try not to use too many
abbreviations and blanks are okay. Mixed case is good.)
On the attributes tab we have a few things to do: Select capacity and enter a good value
for the tank. Select Feed Flow and Level and click Settings and the magnifying glass / Point
search button to select the appropriate PI Points. Right mouse click on the volume and
select Create or Update PI Point to create the PI Point to receive the value from our
analyses.
• Click on the Elements in the Navigation Menu –
• Right Click on Bioreactors and select Create New Child Element. Select the new Tank
Template.
• On the General Tab, name the element Bioreactor 1
• On the attributes tab select Feed Flow, click on Settings, the magnifying glass/Point
search and search for RX001* from the resulting list select RX001FPF.PV (the feed
pump flow for Reactor 1)
• Select Level and find point RX001RXL.PV in the list.
• Right mouse click on the Volume attribute and select Create or Update Data Reference
5) Prepare for the event frames. Click on the Analyses tab and check to make sure your
analysis is running (green check mark). We’ll want to back fill this. Right mouse click on it
and select backfill. One note about selecting a start time – Analysis backfills won’t backfill
over a prior backfill. So if you want to backfill even further later – it might be good to pick
an even midnight you can remember to backfill from. (so you can end there later). Try
midnight 2 days ago. Click ok – and you should see the backfill running.
59 | P a g e
Go back to the Attributes tab. Select all three of the Feed Flow, Level, and Volume attribute
rows and (hold shift down). Right mouse click and select Trend. Note the start time and
end time at the top of the trend – use refresh/recycle to update. Try to identify one of the
feed flow (or drain flow) events we will be capturing with the event frame. This should
effect the level and volume. Does the volume look right? Sometimes in flow point there
may be “noise” in the signal such that even when we aren’t filling (or draining) we have
some small updating values in the flow point. What value can we use as a comparator for
flow to know that we are actually filling (always greater than…)?
• Go to the Bioreactor 1 element and select the Analyses tab and check for a green
indicator that our analysis is running
• Right mouse click on the analysis and select backfill. Select midnight this morning as
the start time and queue this.
6) Configuring the Event frames. Back in the Library, select Event Frame Templates and
create a new event frame template. On the general tab, name it Fill Transfer (or drain
transfer if appropriate – or another good name, please don’t add “template” to the end).
An event frame has a name, an associated asset, a start time, an end time, and a template –
which then defines attributes which are very similar to element attributes. Analysis is going
to provide our start time our start and end time. We have a few things to define here in
the template.
At the bottom of the general tab is the naming pattern. Note the arrow at the end of this
line. You can select default values here. Select the %Element% option (which will insert
the name of the element that triggered this event frame into the event frame name. Press
the space bar after this and then go back to the menu and select %Template% which will
insert the name of this template from above (e.g. Fill Transfer). Press the space bar again.
Select the Starttime substitution string. This will give each event frame a unique name
which can be useful to search against.
Next we’ll click on the attributes tab. We’d like to capture the amount of material
transferred.
Create a new attribute called Transfer Volume (Datatype Double, appropriate U-o-M e.g.
US Gallons, PI Point Data Reference).
We’d like our totalizer to work with many possible tanks. So we won’t be selecting a tank
here, instead we’d like to “borrow” the point from the associated element (it will be
associated through the template and the analysis template. In the settings box click on
60 | P a g e
Attribute and enter the following to bring the Feed Flow point .\Elements[.]|Feed Flow
(indicating to go to the primary referenced element and select the attribute Feed Flow). PI
AF will do a good totalization, but the configuration for this is a bit obscure. For the value
retrieval method, by time / select Not Supported. By Time Range select Total. When you
select Total – a units of measure menu will appear above the value retrieval method. Select
the Source units for the flow and the time basis (e.g. US gallons and minute), decon-
structing the unit of measure of the flow. When we generate the event frames this will
totalize the flow for the duration of the event frame.
• Return to the Library and Select Event Frame Templates and right mouse click to
create a new Event Frame template. On the General Tab name it Fill Transfer
• Set the naming pattern click in this field and use the flyout menu on the end to first
select %Element%, then press the spacebar, then select %Template% and press the
space bar again and finally select %starttime ….
• Click on the attributes tab. Create a new attribute and name it Transfer Volume
Set the value type to double, the U-o-M to U.S. Gallons, and select PI Point Data
Reference. Click on the settings button and select the “Attribute” option – in the
entry field next to it – enter .\Elements[.]|Feed Flow
Set the by time selection to Not Supported. And the By Time Range option to Total
Just above this – set the units to U.S. Gallons and minute for the flow and time basis.
• Click OK
7) Generating & Backfilling the event frames. Now that we have a good Event Frame Template
we can use analysis to generate the event frames. Select the element template Tank
Template and the Analyses tab. Create a new Analysis template – call it tank transfer and
select event frame generation. Now we have a tank and we can select an example
element. We should also select our event frame template as tank transfer.
The trigger is simple ‘Feed Flow’ > 5 (or whatever value you choose). The event
triggering is fine. Check in your work.
61 | P a g e
Return to your tank in the Elements tab in the navigation menu and select the analyses tab.
Right mouse click on your analysis for tank transfers and select Preview Results. Set an
appropriate start and end time. The event frame names will not reflect the appropriate
element, but should have the template and start time. Verify that the events are being
triggered appropriately for tank transfers.
It the preview seems correct – right mouse click and select backfilling and generate event
frames for a past period.
When it is complete – select Event Frames on the navigation menu and create a search
with a broad time range and select the tank transfer template to search for the generated
event frames. If you click on the attribute tab you’ll be able to see the volume of the
transfer.
• Select the Library from the lower left Navigation menu and the open the element
templates.
• Select the Tank Template and its Analyses tab.
• Create a new Analysis template with the highlighted text or the button bar and name
it – call it Tank Transfer and select event frame generation.
• select an example element Bioreactor 1
• Select the event frame template as Fill Transfer
• Set the Start trigger as ‘Feed Flow’ > 5 event triggering is fine.
• Check in your work.
• Select Elements in the Navigation Menu and select Bioreactor 1 and its analysis tab
62 | P a g e
• Right mouse click on the analysis Tank Transfer and select Backfill set the start time
for midnight this morning It should queue up backfilling of the event frames.
• Select Event Frames from the Navigation menu and select Search 1 – do you see tank
transfer event frames? Select an event frame and look at the attributes tab to
examine the volume transferred attribute.
8) Building more tanks. If you have one tank, you are likely to have more. Open Microsoft
Excel with PI Builder installed and select the PI Builder Ribbon.
Select the appropriate PI AF Server and Database on the left hand side of PI Builder.
Select Elements and Find Elements – select your tank element template and search
The tank should appear – select it and click OK
Clear all columns and scroll down until you see attribute columns and attributes from
your template. Select feed flow, Level, and capacity. (Volume is calculated and not
configured) and click ok.
Now you can copy this row to create more tanks. The name is the Name of your tank.
Under the Feed Flow and Level attributes search for PI points and enter them into
these cells note that the server name is required and that when specifying Data
Reference Configuration settings (and not values) you enter an apostrophe and an equal
sign before the string. Enter the capacity of each tank under the capacity (without
syntax)
Click on Publish to create the tanks
Verify by going back to PI System Explorer and selecting Elements and refresh to see
the new tanks. Check the tanks to see if the Volume attribute and Volume points were
created according to the template specifications, if they weren’t create them with
Create or Update PI Point Data Reference
Check the tanks to see if the analysis are green and running. Backfill the Volume and
Event Frame Tank Transfer Analyses as appropriate.
• Open up Microsoft Excel (from the task bar or start menu) and select the PI Builder Tab
• Confirm that PISRV1 is the selected PI AF server & Cookbook is the selected database
(upper left)
63 | P a g e
• Pull down the menu under Elements in the PI Builder ribbon and select Find Elements.
Select the pull down menu for template and select the Tank template. Click the Search
button and find Bioreactor 1 select it and click ok.
• Click on the Clear All Button (lower left) and then select Template (you may have to
scroll just a bit). Then scroll down more to find the attribute columns and select Feed
Flow, Level, and Capacity.
• In the spreadsheet cells, copy your Reactor and by selecting the whole row (2) and paste
it over row 3.
• Select Row 2 again (the whole row) and press Ctrl-H, change all occurrences of
Bioreactor 1 with Bioreactor 2 repeat this (ctrl-H) and replace all RX001 with RX002
• Select Row 3 and with Ctrl-H, replace Bioreactor 1 with Bioreactor 3 & RX001 with RX003
• Click Publish on the PI Builder Ribbon and select Create and ok to build this in PI AF.
• Return to PI System Explorer and select Elements and Refresh
• Right mouse click on Bioreactor 2 and select the analysis tab – are the analyses running?
Right Mouse click and backfill both analyses beginning with midnight this morning.
• Repeat the backfill for Bioreactor 3 Check in your work.
Serving Suggestions (Visualization) PI Datalink 2014 is always a good choice for Event Frames
• Open Microsoft Excel (start menu or task bar) and click on Explore Events in the PI
Datalink 2014 menu
• For the Database – enter our Server and Database: \\PISrv1\Cookbook
• Set the Search start time to a reasonable time relative to your backfilling: T is today at
midnight
• Select Fill Transfer Template as your Event Template (You should see Event Frames in
your preview window)
• Usually PI Datalink / Explore Events makes some great column choices for you
– but you can select and deselect as you like and change the order with the blue arrows.
• click OK.
• You should get a great dynamic report of all the downtime events in this period.
Remember – these are frames – every PI Point and PI AF attribute is “In the frame” If you have
a start time and end time in PI Datalink – and you just got a lot of start times and end times.
You aren’t restricted to what you put in the either template (element or event frame).
64 | P a g e
OSIsoft Virtual Learning Environment
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.