you might be wondering what can the current value function do for me let's say you are interested in
knowing what's the internal temperature in your tank right now you will use the current value
function for that so this function returns the snapshot value so that the value that currently
represents your process of your data item be it either a pi point or af attribute so let's see
how to add this function to our report as you will see it's very easy and it only takes three steps
i will first add a new sheet and now select the current value function from the functions menu
you can see that a configuration wizard opens up on the right side of the window so great news to
get the data with pi datalink you don't need to memorize anything you just need to fill in the
information required by the function using the configuration wizard and the data will appear
in your excel worksheet so let's explore what are the pieces of information that we need to provide
at this stage the important information for us are the output cell and the data item don't worry
about the root path at this point output cell is where in the sheet we will be putting our data
and here you have to be careful if you select a cell before you open the function task pane
pi datalink inserts the selected cell info into the output cell field so always double check it
to make sure you are not overwriting any of your existing data data item is the name of your pi
point or af attribute for which you want to get the data so let's click on the magnifier glass
to open up the search pane as you can see it looks like any classic search in the pi system you can
search available data archives and asset framework servers let's click on the data archive pisrv01
as you can see there is a number of information you can provide to find the pi points
you can also type in the pi tags names directly if you are familiar with the naming convention
and don't forget that the wild card characters can be used in the search
ok let's go back to the home page and click on the af server pisrv01
we can select the af database that we want to search for let's choose the osisoft plant database
as you can see you can easily drill through the af database and find the data items that you need
or type in the names directly in the search box let's select one of the attributes and click ok
you can see that it's put now in the data item field there are also different options
for a timestamp if you select no timestamp the function will return only values the timeout
left and time on top options return two columns with a different positioning of the timestamp in
regards to the value now let's have a look at the archive value function let's say you need to know
the flow rate of your tank yesterday at 10 am you will use the archive value function for that
if you select the data item option the archive value function returns the value of a pi point
or af attribute at a specified timestamp don't worry for now about the expression option
we will explore it later in the course as well as the different retrieval modes
all right time to practice let's prepare a report that shows the current value of external
temperature pressure and flow rate of mixing tank 2. we are also interested in knowing the value of
these measurements at 7 am yesterday we will begin by getting the current values into our report
so let's open excel if you haven't done it already and in cell a1 type current values as a heading
now click on cell a2 and select the current value function
click on the magnifying glass next to data items box search for the external
temperature of mixing tank two i will type ext asterisk temp asterisk in the search box
as you can see the search found four attributes for our four tanks we are interested in mixing tank 2
so let's click on it and select ok now select time at left and click ok
now we have to repeat these steps for a pressure and flow rate in cells
a3 and a4 respectively now instead of typing the name of the attribute in the search box i
will navigate to the mixing tank two in our af hierarchy and select the pressure attribute
again i select time at left and click ok and now i'll do the same for the flow rate attribute
now let's add archive values of our measurements from 7 am yesterday
so in cell c1 type archive values as a heading
click on cell c2 and select the archive value function
click on the magnifying glass next to the data items box search for the external temperature
of mixing tank 2 here we see a new field for the timestamp since we are interested in knowing the
value of this measurements at 7 am yesterday i will type y plus 7h in the timestamp box
as you remember y translates to yesterday at midnight plus 7 hours so yesterday at 7 00 am
now select time at left and click ok repeat these steps for
pressure and flow rate in cells c3 and c4 respectively
this concludes our video on single value queries in pi datalink thanks for watching