I am trying to built an app that dumps the PI Tags data to a Sql table. The aplication polls the data at every 2 mins interval. Is there a way to detect out-of-order events for a particular tags via AFSDK?
Gregor Beck AFDataPipeType.Snapshot is fine for ooo so there is no need for two pipes.
You could use the PIDataPipe or AFDataPipe to signup for changes. For each AFDataPipeEvent look at the Action property and if it equals AFDataPipeAction.Insert then the point is out of order.
You can read more about the AFDataPipeAction here:
Raw PI archive data usually doesn't fit very well into relational tables. Will your application push archived data to the SQL table or are you foreseeing some kind of aggregation?
What's the background of your question to detect out-of-order (ooo) events? Is your application supposed to replace certain records in case of ooo events?
I wouldn't know any other option than Data Pipes. Because you are planning to work with PI Tags, my idea would be to go with the PI Data Pipe and to create one pipe for snapshot events (AFDataPipeType.Snapshot) and another one for archive events (AFDataPipeType.Archive). Because ooo events don't cause a snapshot update, each event reported by the archive pipe which is not reported by the snapshot pipe, can be considered out of order.
There exist PI system admin tools which allow finding out about ooo events. One example is the piartool.exe -as command which reports PI Archive subsystem statistics in a command prompt updating every 5 seconds. There is a single counter for ooo events which allows to evaluate if there currently is arriving data out of order but you don't get any details. Piartool.exe -ooo returns a list of PI Points which has ooo events but does not include any information about the timestamps or values of the ooo events.
Out of order events are not illegal even we recommend to avoid them because a) compression cannot be applied and b) they have a negative impact on the PI Archive Subsystem performance. Even late arriving data like lab data can theoretically be inserted in order but because lab data usually is not sampled at high frequency, the expected performance impact if it arrives ooo is very low.
We have Alarms and Events tag which is collecting data via PIAE Interface.
Since the AE Tags has string values with a "|" separator in it, we have a requirement of spliting them via "|" symbol and storing them in to Sql. While build an application for it i was just concerned about "ooo" events if any from AE Interface and the way to tackle it.
If you are running Asset Analytics 2018 SP2, you could use the new Split() function to split certain strings out of your alarm and events data. Asset Analytics as of 2017 R2 supports auto-recalculation so you wouldn't need to worry about out of order data. We had a few customers with the same use case!
Retrieving data ...