15 Replies Latest reply on May 12, 2018 7:42 AM by Paurav Joshi

    Periodic AF Analyses, based on AF Attribute, not working

    Paurav Joshi

      Hello Folks,

       

      We have very simple case as follows:

      An AF Attribute is getting value through table-lookup dr. We want to save that value so created an analysis which is giving same value, as in attribute, to PI Point.

      Analysis has been made periodic and period has been set as 1 second.

      Attribute type is datetime.

       

      Problem arises now, whenever AF linked table updates, af attribute updates. But PI tag is not updaing.

      Analysis is running with green arrow, i..e no warning or error.

       

      Can anyone guide where am I missing something?

       

      AF Server: 2016 R2

      AF Analysis: 2016 R2

       

      Thanks,

      Paurav Joshi

        • Re: Periodic AF Analyses, based on AF Attribute, not working
          jowens

          Hi Paurav,

           

          For your linked table in AF, what is the Cache Interval? This is set at the bottom of the General tab for the linked table in PI System Explorer (PSE). The cache interval determines how often each client that accesses the linked table will update the values in the table. Note that this is client-specific, so you may refresh the values in one client (PSE) while another client (PI Analysis Service) still may not have refreshed the values, depending on what the cache interval is set to. The cache interval should be set to a value that is equal to or less than how often you want the linked table values to refresh (i.e. if you want your value to refresh every second, set the cache interval to 1 second). You can find more information on this from article KB00539.

           

          Regards,

          James

            • Re: Periodic AF Analyses, based on AF Attribute, not working
              Paurav Joshi

              Hi James,

               

              Thanks for reply.

              I have confirmed that my cache interval is 1 second only for the AF table.

              Can we force externally PI Analysis Service to refresh the values?

               

              Thanks,

              Paurav Joshi

                • Re: Periodic AF Analyses, based on AF Attribute, not working
                  jowens

                  Hi Paurav,

                   

                  If you have changed the table cache interval since the analysis was started, the analysis may still be using the old cache interval. Try disabling and then enabling your analysis that writes this value to a PI point. That should allow the analysis service to pick up the new cache interval and begin updating as expected. I confirmed this worked on my machine running PI Analysis Service 2017 R2 after initially setting a cache interval of '0 - Manual Refresh' and changing it to '10 seconds'.

                   

                  Regards,

                  James

                    • Re: Periodic AF Analyses, based on AF Attribute, not working
                      Paurav Joshi

                      Hi James,

                       

                      Thanks for taking time to test on your system. Scanning interval hasn't been changed, I have already tried restarting of anaylsis service also.

                      As I mentioned in problem statement, version is 2016 R2.

                       

                      Thanks,

                      Paurav Joshi

                        • Re: Periodic AF Analyses, based on AF Attribute, not working
                          jowens

                          Hi Paurav,

                           

                          I did some testing on a 2016 R2 system, and I believe you're running into an issue that was fixed in PI AF Client 2.9.0.8065. This issue involves Table Lookup attributes that have no time column defined. I was able to reproduce your issue on my 2016 R2 system, and the workaround was to define a time column for the Table Lookup attribute in AF.

                           

                          Since your attribute is a datetime format anyway, try changing your table lookup attribute Behavior Rule to "Table provided time series data", and select the Time Column to be the same as your Result column.

                          Having a time column defined on your input attribute should allow the PI Analysis Service to successfully get updates from the linked table and write them to your output PI point. Let me know if that works for you.

                           

                          Regards,

                          James

                          2 of 2 people found this helpful
                            • Re: Periodic AF Analyses, based on AF Attribute, not working
                              Paurav Joshi

                              Hi James,

                               

                              Thanks for creating same scenario in your system .

                               

                              I got till Behavior Rule and changed it as suggested. But after changing behvior, my Time Column is showing <None> value. I tried to put column name same as Result column in it and clicked on OK button. I found after re-opening setting that changes I did are not applied.

                               

                              Some queris:

                              1. How come AF Client is creating this problem ? and

                              2. Does upgrade of AF client solve this problem ?

                               

                              Thanks,

                              Paurav Joshi

                                • Re: Periodic AF Analyses, based on AF Attribute, not working
                                  jowens

                                  Hi Paurav Joshi,

                                   

                                  When selecting the Time Column, make sure to use the drop-down to select the column you want.

                                  Or you can just add the text ";TC=<time column name>" in the Settings window.

                                  Either of these methods should update the Behavior Rule and Time Column successfully. If you just type a name in the Time Column entry, it might not save when you click OK.

                                   

                                  The problem has to do with the way Table Lookup data references are handled by AF clients. This was changed in version 2.9 to allow periodic analyses based on Table Lookup data references to update according to the cache interval. Upgrading AF Client to at least version 2.9.0.8065 on your machine where PI Analysis Service is running should resolve this issue. Upgrading AF Client would be the best option, but hopefully this workaround works for you as well.

                                   

                                  Regards,

                                  James

                                  1 of 1 people found this helpful
                      • Re: Periodic AF Analyses, based on AF Attribute, not working
                        sraposo

                        Hi Paurav,

                         

                        As James Owens mentioned, I also believe the issue is with an improper table cache refresh interval.

                         

                        I'd also like to point out that if your goal is to get data from a relational database into a PI Point, a better alternative would be to use the PI Interface for Relational Database (RDBMS via ODBC): https://techsupport.osisoft.com/Products/PI-Interfaces-and-PI-Connectors/PI-Interface-for-Relational-Database-(RDBMS-via-ODBC)/.

                         

                        Using the analysis service to retrieve data from a relational database only should not cause any problems if done sparingly. However, Asset Analytics is not designed to be an interface but a calculation engine. Some major drawbacks of this approach are:

                         

                        1) The linked table is kept in memory by the Analysis Service. If the tables are large or refresh frequently, this can cause performance issues at scale.

                        2) Every computation requires resources. If you use Asset Analytics to do a lot of other calculations, there is an unnecessary load on the service to perform the duties an interface can do.

                        3) Configuring a proper caching interval can be tricky. What's important to understand here is that the analysis service will retrieve the table from AF, keep it in memory until the cache refresh interval is met and run the queries on the cached table for each attribute that is a table lookup data reference used as an input to an analysis. If the cache interval isn't properly set, then there may be some data mismatch between the data in PI Points and the data in your relational database. Customers try to work around this by setting a small refresh interval. This could be problematic for performance.

                         

                        The PI Interface for RDBMS is very performant at retrieving data from ralational databases. It was designed to do exactly that.

                         

                        Hope this helps,

                        Seb

                        3 of 3 people found this helpful
                        • Re: Periodic AF Analyses, based on AF Attribute, not working
                          Sidh

                          Hey Paurav,

                           

                          I faced this issue earlier in one of my project, where analysis was not able to keep up with the Table refresh rate.

                           

                          I resolved it by tuning the refresh rate and analysis trigger, you have to give analysis service some cushion to absorb changes, or try setting up offset.

                           

                          Rgds

                          Sid