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

Functions in PI-API Options · View
Vana
#1 Posted : Thursday, July 15, 2010 3:31:22 PM
Rank: Member
Groups: Member

Joined: 7/7/2010
Posts: 11
Location: France
Hi,

Sorry to disturb again, I'd like to know 2 functions (I am creating an interface between PIServer and C++ thanks to piapi32.dll) :
1) To compute the average with tag and 2 dates
2) To get a value knowing the tag and a date I fixed.

Thanks a lot in advance !!!
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 : Thursday, July 15, 2010 7:38:49 PM
Rank: Administration

Groups: Administration

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

The details of the PI-API functions are detailed in the PISDK.chm help file, the functions are grouped for ease.

For your questions:
1) piar_summary
2) piar_value

However, I would recommend sticking to PISDK instead of PIAPI. Smile

Cheers.
Principal Consultant
Real-Time Data Management @ Wipro Technologies
Vana
#3 Posted : Friday, July 16, 2010 9:23:57 AM
Rank: Member
Groups: Member

Joined: 7/7/2010
Posts: 11
Location: France
Thanks a lot, you've been really helpful !!!
Vana
#4 Posted : Monday, July 26, 2010 12:10:42 PM
Rank: Member
Groups: Member

Joined: 7/7/2010
Posts: 11
Location: France
Hello everyone,

I have an other question. I'm wondering if it exists a function in PI-API to know the first time a given PI-point was archived.
Thanks a lot for your answers !!!
RJK Solutions
#5 Posted : Monday, July 26, 2010 12:47:21 PM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 617
Location: Cheshire, United Kingdom.
You can use the "piar_value" function but set your timestamp as "01-Jan-1970 00:00:00" and pass the mode as 2 (value after given time and date). The value (if it exists) will be the "oldest" archived in the available online archives.
Principal Consultant
Real-Time Data Management @ Wipro Technologies
Vana
#6 Posted : Monday, July 26, 2010 1:17:21 PM
Rank: Member
Groups: Member

Joined: 7/7/2010
Posts: 11
Location: France
Hey very clever !!!
Thanks a lot !!!
satisfire
#7 Posted : Thursday, August 25, 2011 9:22:21 AM
Rank: Newbie
Groups: Member

Joined: 8/24/2011
Posts: 2
Location: Thailand
I have tried as your suggest but the return value is "Pt Create".
jhcoxx
#8 Posted : Thursday, August 25, 2011 2:06:32 PM
Rank: Member
Groups: Member

Joined: 7/5/2010
Posts: 27
Location: Texas
Well, technically, "Pt Create" is the first value for the PI point - but obviously not what you wanted. There may be more elegant ways to do this, buy you could take the timestamp returned with the "Pt Create" value and re-do the piar_value function, this time passing the returned timestamp instead of "01-Jan-1970 00:00:00". That would get you the next value.

Of course, the next value might be something like "Bad Val" so for greater rigor, make a loop that calls piar_value, checks to see if the returned value meets whatever criteria you have for a real value and then re-calls piar_value with the just-returned timestamp until you get a value that meets your critera...
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.