So I have selected Cell
A12. I will go ahead and choose PI, Batch
Search. So, let's go ahead and
configure some cell references in this
Dialog Box so that we are making reference to the fields
that are stored on this Excel spreadsheet.
One of the things we can do is we can make a cell reference to the name
of the PI Server. So, for example, by clicking here,
I can go ahead and select right
there, and that indicates that that's going to be the name of my PI
Server, the contents of that cell.
Now, likewise, or similarly, we are going to go through
and for all of these -- BatchID, Product, Unit Name, etc.,
we are simply going to make references to where you would find
them in the spreadsheet. So, the BatchID
is going to be this Unit that you
see -- or excuse me, this BatchID that you see right here.
For the
Product, I will go ahead and choose Product,
and for the Unit Name,
I will just choose this Unit Name right here. So, we have
essentially made cell references to these and,
in return, every time we make changes to this,
it's going to end up recalculating these Batch Results.
Now, for the Start and the End Time,
we are going to specify the Start and End Time that you see in the
spreadsheet. So, my End Time's going to be
back three days, minus
three days, and this
Start Time's going to be this right here.
That * stands for Current Time.
And then, finally, where, where are we going to put the results?
Well, the default is to go on the cell that you first
selected when you started this Dialog Box, and that is A12.
But, if for some reason you did not start there, you can specify that
now. There we go. We have got
just about everything that we need to make this set,
Batch Search work. If you go ahead and choose Search,
you will be able to see whether you are getting any Search Results or not.
In this case, I am getting a lot of Search Results.
But, I am, I am not ready to click on the OK Button yet.
I still need to specify exactly what we are going to
output out to the spreadsheet.
Oh, and one more thing. I could have easily
hard-coded things in here,
BatchID's. So, for example, I could have put in,
just typed in the name of my Unit,
Digester1. But I want to make this more of a
Search Engine. I want to use this cell reference
here so that when I make changes to this Unit, we are going to
see those changes populate the spreadsheet with a new
set of Results. Okay. Now, let's
determine how we are actually going to store or, or
put things on the display. We do that in the Settings
Option. First thing we need to specify
is how many levels deep we'd like to show.
Now, if I were to choose
to leave this just at UnitBatch, then what we would
see is essentially these UnitBatches here without any
of the layers underneath that, any of the SubBatches.
So, I want -- I do not want that. I want to put two different
PI SubBatch Levels there, or two SubBatches --
levels of SubBatches in
this particular example that we have
configured in the Learning Labs.
Now, in this part of the exercise, this is really rather
cheap, but what I am going to do is
ask you to specify that you put
the Levels, or Show the Levels Using Indentation.
And that is so that this will populate this
spreadsheet in a fashion that I have
already prepared it for. You will notice we are making
reference to some of the cells here, and if we do not
Show it Using Indentation then our little
exercise will not work. Well, it will work, it's just
that the references that we have made over here are not
going to be pointing to the right place. So,
we want to make sure that we are, you know, we are dumping this into the
spreadsheet in a format that's going to work well with
what, what's already there. Now remember, the only reason
we are doing this here is because I have already
prepped this template with some calculations
and I want to make sure that the output we have
fits into the calculations that I have already prepped.
If you were doing this from scratch, of course, you would choose
this depending on your own preferences, and then
build a spreadsheet around that. We are, we are doing it a little
bit opposite here. We are trying to retrofit
these results to fit the spreadsheet that already
exists. Now that's a little unrealistic,
but for the purposes of this example,
it will save you a lot of the formatting, and really the kind of
grunt work that's got nothing to do with Batch.
That's really got more to do with formatting and other
DataLink functions.
Now, hopefully, you will see what I mean once we click on
OK, because what we are going to see is
the Batch Results are going to execute, it's going to be
placed into this spreadsheet, you know, exactly
the way it works best for this particular spreadsheet
and the result is this wonderful
little Search Engine here where all
the configuration's already been done, all the calculations
have already been done, and it all works, you know, very
straightforward. So, what you were able to do right
now, is you did this retrieval right
here, starting at -- let's
start at this point right here, this cell, and
stretching all the way over here
to this cell right here. So that's where you
finished your retrieval. Now, all
the things that we see over here,
all these things, are things that were pre-configured
and we will explore those in just a second.
So here are our results. And the big finish to this
is, now that I have got these results, I can choose
different inputs
and by choosing different inputs, we are going to see
different Results. So now we are only looking at
Digester1 where now we are only looking at
Digester2. As you can see, the results change.
Or if I were to change this to a different Product,
let's say it's the Product that ends in --
we will go with *
202. I do not think we are going to see any results
for this. Let's see.
No, we did find some. Yeah, these are all those that
have a Product ending in 202 with a Digester2.
Okay. So, the idea here is
we have a nice little Search Engine, and we can use
that Search Engine to do some Restrictive Searches.
Let me scroll over now and
we will explore the rest of this. These two things right here. These two
Results. Now this right here
is a Function that's using an If-Then statement within
Excel, along with this PI Alias
To Tag Function, to result in either showing me
an Alias Name, or if no Alias Lookup works,
then just showing me a, a blank space.
But the PI Alias Tag -- to Tag -- is critical here.
What we are doing here, and we can look at this up here where it
says the PI Alias to Tag
Dialog Box -- what it's doing is it allows us to
provide an Alias Name and a Module Path
and what's going to be returned is a PI
Tag Name. So, in this case,
the Alias Name is going to be this right here, this Temperature.
The Module Name is going to be the Module that you
see right here under Unit. That's a Module
in the Module Database that's associated
with this particular BatchUnit.
Now, as I mentioned before, when we change things here,
it changes the Results. Watch what happens when the Search Results
change from Digester2 to Digester1. Watch
what happens to the Alias Lookup over here. I will
switch over to Digester1.
As you can see, this Module changed.
This changed over here as a result,
because with a different Module, it ends up finding
a different PI Tag. Now, I would
get similar results if I were to change the name of the Alias.
Instead of Temperature, if I were to look at Pressure, now we
are retrieving a different PI Tag. So,
we are mapping this Module Name to
this Alias name.
Now, at the risk of belaboring
the obvious, for those of you who get this already, let me show you
how we made those Alias connections. I am going to go
into the PI System Management Tools, and I would like
to open up the Module Database again
so that we can take at look at the -- where those Aliases,
Pressure and Temperature, were defined.
So here's
my Module Database Editor right here, under
Operation, Module Database,
and under these individual
Digesters --
oops -- R1 -- here we go. Under
the individual Digesters you will see Aliases, Pressure
and Temperature, and these actually point to these Tags,
PP.Digest1.Pressure --
oops -- and here's
PP.Digest2.Pressure.
So, that's -- it's the
definition of the Aliases here, you know,
that those Aliases are defined within specific
Digesters, these Units. It's that
mapping that produces this Tag that you see right
here. So, we are mapping this
Unit Name to this Alias Name here,
and, as a result, we get a PI Tag. Well,
once you have a PI Tag right here
in this column, and you have got a Start Time and an End Time for a
Batch, there's really no end to interesting calculations
you can do at that point 'cause now we can invoke some of our normal
DataLink functions like this
Calculated Data Function here that allows you to do a
Calculation, Tag Name, Start Time, End Time and, then,
Type of Calculation. For example, I can do a Total
on Average, a Minimum, a Max, etc. And once you have
got the Start Time, the End Time,
and the Tag Name, then we can do things like
calculate what the Average Temperature was or what the
Maximum Temperature was during that particular Batch or SubBatch.
And now, this -- let me scroll back
again here -- remember, this is the
UnitBatch. That UnitBatch went from 12:23
to 12:25, but as you can see, within that UnitBatch, they were
smaller SubBatches. This went from 12:23 to
12:24. Within that, from 12:23:15
to 23:00, from 12:23:45
to 24:45, etc. We are drilling down
through this hierarchy. Now, these are very, very
short SubBatches here because, again, for the sake of the
Learning Labs, we want these Batches to be coming in very, very,
very fast so you have a lot to work with. But,
normally, these would be things that might be hours or minutes or
days, just whatever fits your model.
But,
in any event, the combination -- we think this is a very
eff... -- very powerful combination -- the combination of a Start Time
and End Time, and a PI Tag Name,
gives you the ability to start doing calculations
and comparisons. So, I can look at the Maximum. I can look at what the Minimum
was during this period. I can look at what the Average was
during that period between the Start and the End
for each of these. So, what we have got here now
is a nice little analytical engine we can use
to find and compare things about Batches.
So, for example, you know, if you are, if you are
making widgets in batches,
there's probably -- and, and there's some kind of a problem
you want to research. Well, you probably know
enough about that problem to find
when you actually made that. You either know what Unit it was made
in, Digester1 or 2; you know what Product
was involved; you might know what the BatchID was. If the
customer calls and says, hey, this batch on the shipping label was bad,
you can know, you know that.
Or, you may simply just know what the Start and End Time or
wh... -- about when you made it. So, if you know any of those
things, and that -- any of these things can be
provided as Search criteria.
And, in addition, if you were to go back in here and
choose to look at this Batch Retrieval
again, as you can see, there are other things we could
search for. Instead of for BatchID or Product, we could have
searched for Procedure or for
Unit Heading. So, these are the things that we can,
you know, these are the types of things we can search for, using
this PI BatchView Add-In Into Excel.
So, to summarize, we have
got a nice little engine here where you can enter your Search Criteria
right here. I can specify I want to see just
those Products that end in 201, that in... --
are involved in Digester2,
and I get a set of Results,
these Results that you see right here. These Results
are coming from BatchView. Now,
the next step is you can then choose what it
is you'd like to actually see, using these DataLink Functions.
So, if I would like to see Pressure, it changes the
Alias which changes this Alias Lookup Result.
And, then, the DataLink Functions are going to return a different
Averages of Max or Mins depending
on, you know, what it is you have selected up here.