Another way with HeartBeat tags is to check timestamp difference between the tag and *.
Upd. And you can set up it as a trigger direct in PI Notifications, without the need in a PE tag. Just configure the Notification on a clock-based, set up a PE formula as a trigger and that should do the trick.
I believe what is happening here is that both sides of your comparison return the snapshot value. You would want to keep the right hand side as the snapshot but go back in the chain of events to get some older archive values to compare against. The nth most recent compressed value can be retrieved by nesting PrevEvent functions. For example:
will return the second most recent compressed value. Hope this helps.
Thank Alex and Ahmad!
So how do you work with the timestamp? I looked at the PE functions and didn't see anything that would allow the operation that Alex mentions.
The function ParseTime will allow you to get a timestamp from a time string like "*".
And PrevEvent that Ahmad included in his post is can return you the timestamp of the closest event before the timestamp you indicate as a parameter like:
This may not be what Alex was thinking of exactly, but his response I would guess it is an equation like:
IF ParseTime("*") - PrevEvent('cdt158', '*') < 2 THEN "NORMAL" ELSE "STALE"
You can also use the PI Interface Status Utility and Use PI Notifications to monitor the interface status tag. This works very well.
@Jon - Thanks for the suggestions, actually I am doing that in addition to monitoring the heartbeat.
So I have it all working, here is what I did:
Monitored the interface creating a notification trigger like this:
'Interface Status' <> "Good"
Monitored the heartbeat by setting up a notification like this:
Round((ParseTime("*") - PrevEvent("Heartbeat",'*')) > 60
Monitored ACE calculation by comparing the time stamp of a value used in the calculation with the time stamp of the output value:
Round(((PrevEvent('Meter_Reading','*') - PrevEvent('Usage','*'))/60)) > 'ACETimeOutSP'
Note that I used the round function, otherwise it would not work as a notification trigger. I suspect it has to do with data typing and that round function forces it from a time value to a numeric value.
Thanks for everyone's input, vCampus Rocks!