In this lesson we'll examine the role of asset analytics for creating event
frames and also calculating other quantities that we want included for
analysis in the event frame record. We'll be using the outputs at close expressions
to calculate two additional variables that we want added to our event frame
record and those are the drying cycle barrels and the drying cycle duration.
The barrels will be the total number of barrels that has gone through the dryer
during its previous drying cycle and also the duration of that drying cycle. One more
variable we're going to add is the total barrels of the hot vapor flow that goes
through the dryer during its regenerating step and this is the material that removes the water
out of the molecular sieve getting it ready to go back into service. So we're going to
be calculating a total of this quantity and we'll be using some other features of event
frames that we want to make you aware of. The event frame generation analytic type in asset
analytics has three different classifications of expressions. The first one we'll talk about is
the start and end trigger. Now in this case we're only going to need a start trigger to
start and end the event frame. So the way that will work is we will base the start trigger on
the best operating state attribute that we've calculated in previous lessons, when it has a
value of regenerating the event frame we'll start and when it goes to any other value the event
frame will close or end. We'll be using variable expressions to determine the start time of the
dryers previous drying cycle and we have to come up with this time stamp in a two-step approach.
So first what we'll do is we'll use the find equal to function of asset analytics to search
back your words in time to the timestamp of the last regenerating event which will correspond
to the start time of the event frame. And then starting with that time and going back previously
to that we'll ask to get the timestamp of the last drying event and this will be the
start time of the last drying cycle for this dryer. Which is what we need to calculate the
quantities that we need to add to our event frame. Those are these output expressions.
So you'll see we're going to calculate the drying cycle barrels and the drying cycle
duration using the tag max and tag week equal to functions and the time range we're using is
the previous drying event which again is the start time of the last drying cycle to the current time.
And finally we're going to calculate the total regen cycle vapor during the event
frame itself. This is the function we wanted to point out and that's the event frame function,
so you can see there that for output expressions the function event frame is available and you
can refer to the start and end time of the event frame in any calculation here.
So that's what we're doing and that's why we've added this calculation to point that
out. Okay now let's take a look in PI System Explorer of how to implement this analytic.
Back in PI System Explorer we're on the library view to look at the templates for everything and
we have the dryer element template selected at the top of the page and we're looking at
the analysis templates tab to look at all the analytics we have configured for this element
template. What we're going to want to do is take the existing dryer regeneration events
analytic we have created and make a copy of it that we're going to call my dryer regeneration
events and sometimes it's a lot easier to start from an existing analytic making a copy of it
and then modifying it to be what you want. Saves you a lot of time so that's what we're going to
do here. And the way you copy an analytic is fairly simple we will just select it and then
right click copy and paste. So we'll copy it and then right-click again and then paste it.
Okay so we have a new analytic called dryer regenerations event 1 but like everything
else in this course we want it to be named my so we'll go ahead and change the name here and
there's only a few other things to do. First we'll want to point this analytic to use the my
dryer regeneration cycle template that we've been using so this is the event frame template that we
just looked at called my dryer regeneration cycle and then we need to map the calculations in the
outputs that close that to go to the placeholders in the my dryer regeneration cycle template. So
this is very similar to the way we mapped output attributes using a regular analytic,
an expression based analytic and AF analytics we've done this before except this time we're
mapping them to the placeholders in our event frame template. So for the regeneration cycle
vapor we'll go ahead and pick that one which is this guy down at the bottom
and we'll map the other two. So the drying cycle barrels and the drying cycle duration.
Okay and then lastly you might want to click on the evaluate button just to sort of see if you get
any errors and we don't getting some timestamps in there some calculated values. One thing that
is different is under the regen cycle vapor you see the term use preview listed there and that's
because since we're not actually executing or in the middle or at the end of an event frame we
don't really have a way of evaluating the event frame functions for start time and end time. So
if you want to be able to test that out you'll have to go back and use the preview function
of AF analytics to calculate these event frames over a time period, that's a feature that we used
earlier in one of the lessons before. So if you'd like to do that please free feel free to do so.
Okay so we're pretty much done here except the last step is to check the analytic in so we can
actually backfill our event frame records, which we'll be doing in the next lesson.