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

How do I return start and end times of an event?? Options · View
caffreys_col
#1 Posted : Friday, October 07, 2011 10:34:16 AM
Rank: Advanced Member
Groups: Member

Joined: 4/6/2011
Posts: 40
Location: Grimsby UK
Hi All,

I have been asked to develop a way of returning the start and end time (and therefore duration) of an event, in Excel. Anyone know how to do this??

Example;
A PI value has a range of 0-100. I need to know the start and end time of any periods where the value went above 60 for more than 3 minutes over the course of a day. I've tried filtered calculated data, advanced filtered data, but can't find a way to combine everything I want into one Datalink call.

My current idea is to find the first time the value goes above 60 (using the findge function), then use the time returned as the start point for finding when the value drops below 60. I'd then repeat this for the rest of the day. However I can't get Datalink to return a timestamp, it says the data type is incorrect. Anybody got any ideas how to get round this??

Thanks
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.
squatty
#2 Posted : Monday, October 10, 2011 8:18:04 AM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
I used sinusoid as an example. The first part of this filter expression will filter results when sinusoid is above 20, or the UP leg as I call it
TagVal('sinusoid')>20 and PrevVal('sinusoid')<20

The second part will filter result when sinusoid goes below 20, DOWN leg.
TagVal('sinusoid')<20 and PrevVal('sinusoid')>20

Now you combine these two filters and use compressed data with this filter.
TagVal('sinusoid')>20 and PrevVal('sinusoid')<20 or TagVal('sinusoid')<20 and PrevVal('sinusoid')>20

Give this a try and let us know. I'm sure there are much better ways to calculate this using PI-ACE.
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.