5 Replies Latest reply on Nov 23, 2018 9:24 AM by gregor

    AFDataPipe and Compression


      I am using AFDataPipe to retrieve updates. Does AFDataPipe.GetObserverEvents retrieve events before or after compression ? Is there a way to control this so that we only obtain compressed values ?

        • Re: AFDataPipe and Compression

          Hi Arun,


          It will depend on how you create your AFDataPipe. In case of retrieving PI Point values, you can do so via PIDataPipe, which is a specialized type of AFDataPipe.

          Initializing the PIDataPipe, you can specify the pipe type as below.


          var piDataPipeArchive = new PIDataPipe(AFDataPipeType.Archive)
          var piDaaPipeSnapshot = new PIDataPipe(AFDataPipeType.Snapshot)
          var piDaaPipeTS = new PIDataPipe(AFDataPipeType.TimeSeries)


          Snapshot type will give you before compresssion, Archive type will give you compressed version.

          The GetObserverEvents will be applied in the same way however.

          You can look in this LiveLibrary documents for the detail description: AFDataPipeType Enumeration

          TimeSeries type is only supported if your PI Data Archive is 2015 or later (3.4.395+) and also used only via PI Connectors.

          1 of 1 people found this helpful
            • Re: AFDataPipe and Compression

              Thanks Jinmo.


              I would like more clarification on TimeSeries type.


              In this presentation, it says

              • TimeSeries (PI Server 2015 and later)
                • Initial events are consistent with updates
                • Includes snapshot and archive events in order


              But, both the sub bullets are not super clear to me. Also, if it includes both snapshot and archive events, how would I be able to identify which ones are archived events and which ones are time series events ?

                • Re: AFDataPipe and Compression

                  For timeseries type datapipe, Live library explains the best below. And I copy it here.

                  PIDataPipe Constructor



                  The TimeSeries pipe type is only supported by PI Data Archives at or later than 3.4.395. It is a new pipe that combines the features of snapshot and archive pipes. The event action will indicate the correctly whether the event is Added to the end of the series, Inserted in the middle of the series, Deleted from the Series or Updated(edit of existing event) in the series, unlike the snapshot pipe where all the events have action of Update. The timeseries pipe events also contain information about whether the event is archived (persisted), in the form of the PreviousEventAction property of the data pipe event. So application can signup for just one pipe instead of both snapshot and archive pipes to get full time series information of the points.

                  1 of 1 people found this helpful
                    • Re: AFDataPipe and Compression

                      There is still one thing that is not completely clear to me.


                      In case of AFDataPipeType.Snapshot, is every single datapoint forwarded? Would there be any difference if I set ExcDev to 0? I always thought the ExcDev compression would take place on the interface before the datapoints reach the PI Server.

                        • Re: AFDataPipe and Compression

                          Hi Sebastian,


                          You are correct. Exception Reporting (exdev, exdevpercent) is a task to be done by the data source and usually performed by PI Interfaces. The Snapshot subsystem can only share new events with PI Update Manager that it has received. It doesn't know those events which have been filtered out by the data source.


                          Compression (compdev, compdevpercent) traditionally is applied by the Snapshot subsystem. It applies the compression algorithm and forwards only the events outside the compression band (swinging door). PI Buffer Subsystem is also capable of doing the compression and it than sends the events marked compressed to avoid PI Snapshot subsystem applies the compression algorithm once more.