cancel
Showing results for 
Search instead for 
Did you mean: 

Getting event weighted value from PI Historian

Former Member
0 Kudos

We have created a Tag Query in MII 12.1 with following details:

Server: PI Historian

Query: Tag

Mode: Statistics

Method: Total

The total function in PI is time weighted. It is adding up the raw values and then adjusting for the time period.

Is there a way that I can find event weighted value?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Harsh,

you can connect to PI using the oledb connector. You have to install PI SDK on .net then connect using an OLEDB Dataserver to a windows server/system datasource.

You'll then be able to run queries on the pimean and piavg table. with a defined timestep in your where close.

ex: select sinusoid.2hr from pimean where timestep = 500s and time > 'sthg'

Cheers,

Arnaud

Answers (3)

Answers (3)

Former Member
0 Kudos

Using PCo 2.1 to call the SUM function for getting the event-weighted values should help me.

API for PI Historian has a method to do this:

PIAdvCalcVal(<TAGNAME>,<Start Date>,<End Date>,"total","event-weighted", 0,1, 0,"xxxx")

Thanks for the help!

Former Member
0 Kudos

While the PI API does directly support a call that would return the EventWeighted value, there is no way to make this call using the old UDS products - you would need to use one of the alternative suggestions already made.

The new PCo 2.1 release includes a PI Agent which supports a lot of additional functionality including new aggregate methods. The 2 methods pertaining to this thread are: "Integral" which works the way the current UDS works performing the total as TimeWeighted and the new "Sum" which would give you the total performed as EventWeighted.

Regards,

John

agentry_src
Active Contributor
0 Kudos

Hi Harsh,

A simple way to get event weighted totals is to use Statistics - AVG and then multiply by the time period.

But I have to wonder why you would want to do such a thing? Time Weighted Averaging is not just industry standard when using process data via historians, it is also more correct in its representation of a process.

Regards,

Mike