3 Replies Latest reply on Sep 6, 2018 2:40 PM by tramachandran

    PIServer.UpdateValuesAsync Method don't use PI Buffer subsystem

    Noga

      I am using AF-SDK 2016 and in my code I call the method PIServer.UpdateValuesAsync with the 'BufferIfPossible' and 'Buffer' options to update AFValues to a data archive PI-Server.

      I configured the server buffering using the 'Buffering Manager' and verified the buffer health is good.

      I also tested that the buffering works fine by stopping the buffer with the command 'pibufss -bc stop' while manually updating values (= by using 'Edit value' in the Archive Editor of the PSM) , and using the command 'pibufss -qs' to see that the Total event read/Total event write are not synchronized and only after starting the buffering with the command: 'pibufss -bc start' . the events synced.

       

      The problem is that the buffering works fine and registers events in the 'Buffering Manager' only when I update values manually. But when I update values using the PIServer.UpdateValuesAsync method or PIServer.UpdateValues method, the values doesn't use the buffer -> when using 'pibufss -bc stop' command: the ''Buffering Manager" doesn't show any events accumulating in queue, and the 'pibufss -qs' command show no update of the Total event read/Total event write parameters.

       

      I am not sure if this information is relavant for figuring the problem, but- when running the command 'pibufss -creg' the applications listed as running in my machines are:  SMTHost.exe, PISDKUtility.exe and PIBaGen.exe

       

      I wonder what can be the reason that the function call from my application won't use the configured buffer?

        • Re: PIServer.UpdateValuesAsync Method don't use PI Buffer subsystem
          tramachandran

          The method PIServer.UpdateValuesAsync returns a task whose result is null if there are no errors. Otherwise the result is an AFErrors<TKey> instance containing error information.

          For successful data write through Buffer, this method requires that PI Buffer Subsystem (PIBufSS) needs to be correctly pre-configured with Buffering Manager. Buffering data through PIBufSS has a limitation where error feedback from PI Data Archive cannot be returned to the caller.

           

          1. Set the AFBufferOption to Buffer. Ensure that there are no errors in either of the places(AFErrors or PI SDK logs). If you see errors you can try fixing them

          2. The next thing to do is trace if the value is going through the buffer. The easy way to do it is using pibufss –trace which shows events processed by PIbufss.

          3. Check for errors in the the PI Server message logs

          2 of 2 people found this helpful
            • Re: PIServer.UpdateValuesAsync Method don't use PI Buffer subsystem
              Noga

              Thank you Thyagarajan for your suggestions.

              I followed your steps and ensured that there are no errors in either of the places(AFErrors or PI SDK logs).

              I also used pibufss –trace command but saw no events registered to any point.

              Eventually, I ran this command on the machine where my application is running and not on the pi-server machine where I ran all the other testing commands, and only then I saw that the buffer does work and points trace show events registration to buffer.

              So somehow it seems that running the tests on the pi-server machine was the problem.

               

              Thanks.

                • Re: PIServer.UpdateValuesAsync Method don't use PI Buffer subsystem
                  tramachandran

                  Buffering is implemented as a local service that stores and forwards events to a PI Data Archive server or collective. Buffering is always configured on the same machine where the application is executing and having it on a another system, especially the PI Data Archive would be contrary to its intended purpose.

                  PI DA can have it's own instance of buffering but it does not in any manner affect the behavior of other instances connecting to the server.

                  Also, when testing event flows I would recommend the use of  pibufss -trace command instead of the other which you had tried. 

                  Refer to: Buffering User Guide