To configure a simple report
in PI DataLink, you will have to go to the
manual and, as usual, you can follow
the Step-by-Step Solution in this
manual, or you can go to the
end of the manual. Let me go to the last
page where you have an
Executive Overview that shows you the location
of the completed Solution.
If you want to follow
the manual, you have here the
Objectives that you will learn
during the Lab, and you will also have
a Step-by-Step Solution to this Lab.
Let me go ahead and show you where you can find the
Solution in the Virtual Machine. If you go to the C: Drive,
Labs Folder, Clients' Tool,
Create a Simple RtReport Solution,
you can open the
completed report where you can
see what we are going to build today.
So, this is the completed report with all the
data already filled in. What we are going to do
is work with a Template
that is found in the folder
right next to it, Workspace, Activity
Report Template. And here what we
have is a Template of a Daily
Report that we are going to
use the DataLink Plug-in
to populate with data from the
PI Server. This is a
Template that collects data
every day at the same time,
7:00 am. You can see here the Time
at which data is collected, and it's very useful
because everybody will be able to see the same
report with the same numbers, real-time
data coming from the PI Server.
We have here on the
A Column on the left, a number of
tags for which we are going to collect this data.
And what we want to collect is some
Attributes for the tags. We want the description
which is very useful to have as part of the tag
when you build tags -- a useful
description that will
help users identify what these tags are
referring to. We are going to collect Units
and then the Current Values of each one of
those tags. So
what we want to do is go to the PI Menu
and click on Tag Attributes.
That will open our Tag Attributes Window
and here we can select the PI Server
from which we are going to retrieve
this data. We can enter here the Tag
Names and it is recommended
to use other cell references
as Tag Names. I can enter
one cell as a reference. I
can choose the Attribute that I want to
retrieve from the PI Server,
and in this case the Attribute is going to be the
Descriptor and the Output is going
to be my B7 Cell, and I can go
ahead and apply
the formula, and I can see that
the, the description was retrieved from the PI Server.
As an alternative, if you do not want to use
the Tag Attributes Window, you can always type
the formula that you see here in the
Formula Tab, and that will
also retrieve the data for you.
You can do
this one tag at a time for the rest of
the tags, or you can do a complete
array at once. So,
for instance, if I want to now
select
Tag Names, Active One, all the way
down to Sinusoid and
retrieve the Descriptor Attribute, I can
say that the Output Cell is going to be now
Cells B7 through 11,
and apply my formula.
And I can see that all
Descriptions are retrieved from the PI Server at once.
In a similar way, I am going
to use the same array of Tag
Names, A7 through A11,
to now get the
Engineering Units which I can find right here,
and the Output now is going to be
my Cells C7
through C11. I can go
ahead and apply my formula, and I
can see that the Units were
retrieved for those tags that had Units as
associated with them.
When it comes to the Values,
I like to retrieve the Current Values for
these tags, and what I need to do now is
select the Current Values Function
from the Menu, and in a similar way
I am going to select the PI Server, which is
optional. If I do not select a Pass -- Pi Server,
PI DataLink will retrieve
data from the Default PI Server.
The Tag Names -- I can select my
array of Tag Names
from Cells A7 through A11.
And I am going to Output
those numbers
to Cells D7 through D11.
And what I want to do is select
time at left. And what that will do
is will -- it will populate
the Cells D7 through D11
with timestamps, and then
Cells E7 through E11
with the actual Values. So, it's
interesting because I am selecting the
timestamp to be at the
left side of the Value, so that means
that the column that I select will have
the timestamps, and the one right next to it to the right
will have the actual Values for the
tags. I click Apply, and I can see that
all the Values were retrieved.
Looking at the timestamp, I can
see that these are the Current Values of those
Tags in the PI Server. But now, what I would like
to do is retrieve some Archive
Values
at the specified time this morning. That's
at 7:00 a.m. That's when I want to have the
report. And there are a number of different
ways in which I can retrieve
those Values depending on how
I will compute that time.
I can select an
Interpolated Retrieval,
Previews or Next.
So let's go ahead and
select the Archive Value Function which
opens our window here on the right,
the Archive Value Dialog Window. We have our
PI Server. The Tag Names -- we are going
to select the same Tag Names. Now
they are displayed on Cells A19
through A23, and the
timestamp -- the time at which I want
to retrieve these Values, these Archived
Values from the PI Server, will be
7:00 am this morning when the --
when I want to run the report. And
this is the Retrieval Mode that we are referring
to in each one of these cells. The
Default Mode is Auto. What we want to do
first is retrieve those Values in
a Interpolated Mode, and the
Output Cell is going to be Cells
B19 through B23
with the time at left
which is going to, when we hit
Apply, is going to apply
our timestamps on Column B
and the Actual Values on Column C,
Cells C19 shrew, through
C23. I can do
the same for
the same tags now, A19 through A23,
the tags on the left.
The timestamp will remain the same but
the Retrieval Mode now will be Previous,
and the Output Cell will now be
Cells D19 through D23,
with a timestamp at the left.
I click apply and I see how the --
all the timestamps and the values are populated.
And, at last,
for my Retrieval Mode of Next,
I keep the same Tag Names, the same
timestamp, I select Next for Retrieval Mode,
and for the Output Cells I select
Cells F19 through F23.
I click Apply,
and I have retrieved all those
Values. There is one last column that we will
like to populate, and that is the Exact Time
Value column. And what I am going to do
is keep the same Tag Names, timestamp,
and select Exact
Time. And for the Output Cells
I am going to select H19
through H23.
And I am going to say No
Timestamp, click Apply,
and we see that we have no events
found because there were no values
for any of these tags that
were saved in the PI Server at
that exact time. In order
to understand, or if you want to refresh,
what is the difference between each one of these
Retrieval Modes, you can go to the
Help Section. From PI DataLink
go to PI Functions,
Archive Value, and in here, you
have a small section on the Retrieval Mode
that explains the difference of each
one of those Retrieval Modes. Auto is the Default
and what all of that is
it, it interpolates the value
from the PI Server. So, when I retrieve
a value from the PI Server at
a specific time, if there is no value
at that exact time, the
PI Server will take the previous and
the next value, and interpolate in a
linear fashion between the two. You can see
that some of the other
Modes that we tried
was Previous, which retrieves
the value matching the
proceeding value in PI.
You have one for Next, which will
retrieve the next value.
We see here Exact Time which
retrieves only a value that exactly matches
the timestamp, and if there is no value at that
exact timestamp, then it will --
the PI Server will display an
event -- no events found
warning. And that's why we have
this no events found display
here because there were no PI Values at that
exact time of today at
7:00 a.m. So very
useful report. We can change
this Excel time here
to -- let's say we wanted a report
from yesterday at 7:00 a.m. --
all we have to do is subtract 24 hours.
So instead of doing it today plus
seven hours, we can do it today minus
17 hours,
and we can see that all of the values are
updated to correspond to the,
to the new timestamp in Excel.