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

averaging Values using PI-SDK Options · View
cvasantrao
#1 Posted : Tuesday, March 01, 2011 12:03:16 PM
Rank: Newbie

Groups: Member

Joined: 1/24/2010
Posts: 1
Location: india
Hi everybody!
I am developing an application in VB 6.0 wherein I need to calculate the 15 min average of certain tags. I am using PI-SDK for this. Any help is appreciated.

Regards

Vasant
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.
ejyoungone
#2 Posted : Tuesday, March 01, 2011 3:54:43 PM
Rank: Member
Groups: Member

Joined: 11/30/2010
Posts: 15
Location: New York, USA
Hey Vasant:

I learned how to do that browsing these forums (i believe you can do something like below, with the proper pi-sdk library references).

There is a method/function called summary inside PIData that takes as arguments StartTime, EndTime, and SummaryType.

for e.g.

dim PiServerVar as pisdk.server
set PiServerVar = PISDK.Servers("Your_Server_Name")

dim myPiPoint as pisdk.pipoint
set myPiPoint = PiServerVar.PIPoints("Your_Tag_Name")

dim pval as pisdk.pivalue
set pval = myPiPoint.Data.Summary(StartTime, EndTime, astAverage)

' pval.value is a number representing the average value of your tag over the StartTime to EndTime interval


Wait for Rhys to truly help you :] but I think the Summary method will work for tag averages in pi-sdk

Edit:

http://www.rjksolutionsl..._Find-MinMax-Value.aspx

(scroll down to post #5 , by Rhys , and there's a nice function he wrote entitled GetSummary which should do the trick)
RJK Solutions
#3 Posted : Monday, March 14, 2011 9:44:55 AM
Rank: Administration

Groups: Administration

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

ejyoungone is right, there are built in Summary method as part of the PISDK. In addition to what has already been highlight, look up the "IPICalculation" interface in the PISDK help file, in particular the Calculate method.
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.