|
|
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 !!!
|
|
|
|
|
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.
|
|
|
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. Cheers. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Member Groups: Member
Joined: 7/7/2010 Posts: 11 Location: France
|
Thanks a lot, you've been really helpful !!!
|
|
|
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 !!!
|
|
|
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
|
|
|
Rank: Member Groups: Member
Joined: 7/7/2010 Posts: 11 Location: France
|
Hey very clever !!! Thanks a lot !!!
|
|
|
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".
|
|
|
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...
|
|
|
|
Guest
|