Discussion created by kjelavankal on Nov 7, 2014
Latest reply on Nov 17, 2014 by Gregor

HI I am creating a Java interface to PI from one of our distribution systems . I was looking through the sample statements provided in the OLEDB Tester  folder  PIPC\OLEDB\Tools64\PI OLEDB Tester.


I see the the OLEDB provider has options to query  interpolations with time step. like the example below


SELECT i1.tag, i1.time, i1.value, i1.status, i2.tag, i2.value, i2.status
FROM piarchive..piinterp i1 INNER JOIN piarchive..piinterp i2 ON i1.time = i2.time
WHERE i1.tag = 'sinusoid' AND i1.time BETWEEN 'y' AND 't'
AND i1.timestep = '1h'AND i2.tag = 'sinusoidu'
Returns yesterday’s "sinusoid" and "sinusoidu" interpolations with 1 hour time step.


The first instance of the "piinterp" table serves as a source of timestamps for the second one. Potentially, you can extend the join with unlimited number of the "piinterp" table instances.


How are these interpolations done ? are they integrated to a time interval by averaging values for all the time intervals in between ? or are these peak values in that time interval ?


like for example ( not actual values just generated by me ) 


intyerpolated vale from the above query

11/6/2014 11:00 PM              Value = 165.74

Actual points

11/6/2014 10:07 PM      - 176.78  
11/6/2014 10:36 PM    - 154.787  
11/6/2014 10:52 PM   - 165.67  

how is 165.74 derived ?


I am looking to get interpolations of Peak values like in the above case i would want the one hour step value to be 176.78  . How do i get it ?