when bringing the archive value to our report we saw that that timestamp needs to be specified
and the archive value will be retrieved for that timestamp however there may or may not
be a value archived at that specified timestamp so how does pi datalink decide what data is retrieved
to answer this question let's have a look at this graph
it shows the row archived values for the internal temperature of mixing tank 1.
we can see a data value here and here and here and so on and if we interpolate between these points
we can see what was going on in our process at any particular time so let's say we want to see
the values of the internal temperature at 9 am today what exactly is going to be returned by
pi datalink and the answer is it depends it depends on what retrieval mode we choose
the default mode is auto it interpolates the value at the exact timestamp provided unless the points
store discrete values such as digital state points or step points and how is the behavior
different for step points pi datalink will always return the previous point instead of interpolating
and retrieving the value which could not be appropriate for a step function the interpolated
retrieval mode always interpolates the value at the exact timestamp provided again unless we have
step points if a compressed event doesn't exist at the exact timestamp and you use the previous
or next modes the previous or next compress event from the timestamp will be retrieved
for the previous only and next only the difference is that pi datalink will ignore any event at the
exact timestamp specified and will always retrieve the previous or next archived value and the last
mode the exact time retrieves the value if and only if an archive value exists at that
exact timestamp down to the second it returns no events found if no value exists at that timestamp
alright it's time to practice your manager needs a report they can open each afternoon to see the
current values of kpis for mixing tank 2. your manager also needs to see the kpi's values at
midnight today she also wants to be able to type in a timestamp and see if there is an
archive value at that exact time we already have a template prepared for this exercise
it is the activity report sheet in the pi data link exercises file so let's open it first
now let's bring the af attributes to our report click on cell a8 and go to search
navigate to osisoft plant database and then select the mixing tank two to bring its attributes you
can hold the control key on your keyboard and select all four attributes in one go
so let's select external temperature internal temperature level and flow rate make sure the
data item length is set to full path and now click on ok now select the current value function
select the four attributes as your data items as you can see it is possible to select multiple data
items at the same time so let's do it to save up some time select time at left and click ok
now we want to see the kpi's values at midnight today
although it is not specified in the exercise let's use the archive function and bring
up the values from midnight today using the interpolated previous and next retrieval modes
so first let's copy and paste the attribute names
now click on cell b19 select the archive value function now select the attributes
as our data items remember that we can select all of them in a single step select cell d14
as timestamp retrieval mode interpolated and time at left option for the timestamp
we will repeat it twice but now choosing the previous and next retrieval modes and here i
want to show you a trick keep the configuration wizard open and just modify the output cell as
well as the retrieval mode from interpolated to previous instead of doing everything from scratch
always make sure you select the correct output cell to not overwrite any of your existing data
okay now let's do the same for the next retrieval mode
the last step is to be able to type in a timestamp and see if there is
data available at that exact time so let's use the exact time mode for that i will again use
the existing function and only modify the output cell as well as the retrieval mode
now try typing in different timestamps and see how the function updates