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

Help with PE required - compensating for a reset value Options · View
straighteight
#1 Posted : Monday, March 29, 2010 11:55:33 AM
Rank: Newbie
Groups: Member

Joined: 3/29/2010
Posts: 3
Location: UK
Hello there. Great site, finding a lot of useful tips and nice to see others working in PI.

Wondering if anyone has come across this situation before and has any tips?

I have a totaliser instrument that is nothing but a simple counter that runs on and on. I have a PE set up to subtract the value *-24h from the current value so we can have a daily total tag.

We run into problems when the instrument team need to reset the totaliser, so for example it could end up looking like this

TAG001 28-Mar-10 00:00:00 134051
TAG001 29-Mar-10 00:00:00 234

You can see the problem this will create when we go to subtract those two values.

Is there any smart way of checking for this in PE? I think if I could determine what the last big value was in the archive, subtract the value at 28-Mar-10 00:00:00 from the biggest value, then add that number to the current value, this should find the difference....does this sound right? Can I determine the max value within PE or should I create a complimentary totalizer tag with the Max value to assist? Unfortunately we don't have ACE or AF etc. so are stuck with just the bare tools PI provides us with to solve this one? Interested to hear anyones ideas!!
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 : Monday, March 29, 2010 12:28:55 PM
Rank: Administration

Groups: Administration

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

Welcome to the forum.

So in direct response to your answer, you would need a PE similar to:

Code:

if tagval('sinusoid','t') > 'sinusoid' then ((tagmax('sinusoid','t','*') - tagval('sinusoid','t')) + 'sinusoid') else ('sinusoid' - tagval('sinusoid','t'))


You could use the tagmax PE function to find the maximum value for a time period.
There may be issues if you find the instrument is reset multiple times per day, you won't total the spikes during the day correctly using the above.

Have a look at the TagTot PE function - see manual at "..\PIPC\help\PEReference.chm". Maybe the Totaliser sub system is an option for you too.

Cheers.
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.