YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Averages Options · View
bailesjm
#1 Posted : Sunday, May 01, 2011 4:42:59 PM
Rank: Newbie
Groups: Member

Joined: 12/10/2010
Posts: 3
Hi All

I am expanding the capability of our emission monitoring screen I set up last year with great help from this forum. I am struggling to figure out how to get an accurate average for a monitored emission from a piece of equipment that is switched on and off several times during any 24hr period.

Currently the daily average is calculated using the performance equation below (the average must be between 12:00-12:00).

TagAvg('TAG',(if Hour('*')<12 then ('t-12h') else ('t+12h')),'*')

Obviously this average includes all the time when the equipment is off and the emission is 0. I need to calculate the average only when the equipment is on. We already have a tag that describes if the equipment is on or off.

Any ideas?

Thanks

Jon

Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
RJK Solutions
#2 Posted : Tuesday, May 03, 2011 11:04:23 AM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 617
Location: Cheshire, United Kingdom.
Hi Jon,

Do you have PI ACE available? Or the option of implementing some PI SDK code?
I don't think you can do that conditional check inline of a Performance Equation. The options I see for you would be:

1. Create an additional Performance Equation that first filters out irrelevant data for the avergaes.
You would have "Raw Tag" then a "Filtered Tag" with a PE like:
Code:
if ('equipmentTag' = "Off" then nooutput()) else (if badval('rawTag') then nooutput() else 'rawTag')
*Note, this is from memory and you would need to evaluate it first.

Finally, your average PE will reference the "Filtered Tag" not the "Raw Tag":
Code:
TagAvg('filteredTag',(if Hour('*')<12 then ('t-12h') else ('t+12h')),'*')


2. Create the averaging in either PI SDK code or using PI ACE. There are calls to filtered summaries that you can use.

Principal Consultant
Real-Time Data Management @ Wipro Technologies
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.