To retrieve the "Current Value" of a PI tag
use this "Current Value" function. You'll find it on the ribbon.
Now, when we use this we typically want to put
the cursor where we want the output to appear. So let's say I want
the output to appear in cell B2, I'll go
ahead and select that first. I'll choose "Current Value" and then I'll
fill out this field. I can type in the name of a tag
or use a cell reference, and then specify some options
here. I can specify what server it comes from,
etc. And that's how we
create this "Current Value" function. Now,
let's actually start building something. I'll go ahead and
close this. Let's just start building a little
report. We'll say that our report
tag name is going to be in Column B and
and let's put the "Current Value" right here.
Let's make this, dress this up as a
report. Now for the tag name I can type the name of a tag
or go out and do a tag search. Just do a
tag search. I'll find all the tags
that begin with the letters "C", "D."
And I'd like to look at these three.
Now, I'd like
to put the "Current Value" for each of these three right here in this
column: C3, C4 and C5.
So I'm going to go ahead and put my cursor where I want that output to
appear. Okay, that's an important first
rule when you're working with these functions. By default
whatever you choose, you know, as the current cell,
when you click on this dialog box that's going to be
your output cell. So I'll go ahead and click,
and as you can see,
over here in the output cell we have
that currently selected active cell. That cell's
C3. So that's where my output's going to
go. For my inputs I can either type
the name of a tag or I can do a cell reference.
I can do one, or I can actually do as many
as I need to, and that will generate a "Current Value" for each
one of these. We'll just start with one though.
I can choose to put the timestamp at the left or
at the top. In this case I want to put it at the left so we'll have
timestamp here, value here.
And then, as you can see, there is a choice here of server. If you have
different PI servers you can indicate what the server
is here. You could also make a cell reference to the server
if you prefer.
I'm going to go ahead and just leave that to default PI server.
And, with everything configured properly, it looks like
I'm ready to get a "Current Value." Again, make sure
your output cell is correct so you don't
overwrite one of your inputs. I'll go ahead and choose "OK"
and this is showing me the, now the
timestamp and the value of this PI tag
right here. If I double click
you can see the cell reference is only a reference to the name of the tag.
And,
if I change this for example, as you might guess,
make a change to that, that's going to change what we end up showing
here because the cell reference has been changed.
Okay, let's demonstrate that again. Let's just add
some more tags. I'll go ahead and do another tag search.
Let's look for some tags that begin with the letter
"BA." I'll click on "Search."
We'll look at the concentration, the level
and the temperature.
As you can see, it's depositing
those search results wherever my cursor had
been. So, my cursor was right there and
now, similarly, I'm going to go ahead and bring in "Current Values"
and I want that output to appear right here.
So, I'll go ahead and click on "Current Value."
For the tag names
I'm going to go ahead and select a range instead of just
a single one, and then I'll choose the time at the left.
And, there we go. Here are
our snapshot values, here are the timestamps of those snapshot values.
Now, probably, the most common mistake we see
people is make, is to accidentally select an output
cell that somehow overwrites your input cells. So
watch out for that. That's a common mistake.
Another thing I did want to point out, is notice when I close this
out, the "Current Value," and then I select anything that
contains one of these functions, that function
definition just pops back up there. That's
a behavior that you can change if you don't want that
to keep jumping up at you like that.
You know, as you're moving around in the cell, you may not want that to
be available for editing at that point.
There's an option you'll find in "Settings."
It's called this "Disable Automatic Task Pane,
Display On, Click." I'll go ahead and select that, and
now we've got something that's a little more of the traditional user
interface that we've had over the years in which
you select this, but you don't retrieve
that dialog box unless you explicitly right
click and specify that you'd like to see it.