Could you please explain what do you mean by "if the value for a given tags has been updated from past 15 min"? Are you replacing some values? Are those tags inputs of your PI ACE calculation or not?
The property "Substituted" from each value which was replaced changes from false to true. So this is one way to detect replace values.
For every PI ACE project you can add a reference to PI SDK or PI AF SDK. You can make a RecordedValues calls to retrieve all compressed values from a selected list of PI Points for a given time range. This way you can check if there is a value on the PI Data Archive which satisfies some conditions that you will impose.
Is this what you are looking for?
Hope it helps!
Are you trying to detect stale tags?
If you ACE module using Natural (or Event) triggering, then it won't really perform as you want it to. If a tag is stale, then it won't be having an event coming in any time soon to fire off the trigger. If a new event does come in for the tag, then it's not stale anymore. Plus you would have a circular reference where your tag is both input and output.
Instead your ACE module must be Periodic. It's not as simple as grabbing the value at trigger time and the previous value. Why? Because the trigger value could be interpolated since it's Periodic, and the previous value to the trigger might actually be the snapshot value. That means your ACE module should do the following per tag:
- Get the tag's snapshot which should include the timestamp OR just get the event timestamp.
- Get the previous event prior to the snapshot timestamp
- See if the time delta is greater than your staleness duration of 15 minutes
One trick to get the actual recorded or snapshot value and not the interpolated trigger time would be to use something PrevEvent like:
Dim currentTime As PITime = PrevEvent(tagname, "*+1s")
This adds 1-second to the trigger time, and then finds the event previous to that. This effectively finds the recorded value or snapshot time. Once you have that you would issue yet another:
Dim prevTime as PITime = PrevEvent(tagname, currentTime)
And yes you would have to make both calls for every tag you care about monitoring.