5 Replies Latest reply on Nov 2, 2018 11:04 AM by VCampus-METCO

    Calc Failed for AF Analysis



      As part of migrating PECalcs to AF Analysis I have a simple analysis that does a daily average calculation.


      When I Preview the results from this calculation I get Calc Failed. The output is mapped to the existing PECalc tag.



      If I do the same analysis but don't map the output to the PI tag, the preview works.


      Does anyone have any ideas why the simple analysis writing to a PI point does not work?

        • Re: Calc Failed for AF Analysis
          John Messinger

          Hi Simon,


          Data access permissions is often a factor in cases like this, but not always. Firstly though to correct something - running the Preview function in PI System Explorer is not the same as the actual Analysis writing to the output. When you run the Preview, the results are evaluated client-side and the evaluation is done using the credential of the user running PI System Explorer (you). When the actual analyses are run online, the PI Analysis Service is running the analyses and thus the credential of PI Analysis Service dictates whether you can read/write data. So it could be a case that the Preview is giving you an unexpected result when your output is mapped to a PI point but that actually running the analysis could be perfectly fine. If you actually run this as a backfill for the target time window you previewed, what are the results that are written to the output PI point?


          Now, Calc Failed is a pretty generic error message and can be the result from a number of different factors. Whilst debugging Analysis service related issues isn't my area of expertise, I suspect there is a permissions thing going on here for you. You may find that the quickest resolution is to open a ticket with tech support as debugging these kind of issues is their thing.

          2 of 2 people found this helpful
          • Re: Calc Failed for AF Analysis

            When resolving any calculation issue, I like to break it down into smaller pieces.

            So, something like:

            Val1          if hour('*') >= 2 then "N/A" else "Continue"

            Val2          if hour('*') = 1 and minute('*') > 1 and minute('*') < 10 then "Continue" else "N/A"

            Val3          tagavg('WHP','y+1h','t+1h')

            ValNow     tagval('WHP','*')

            Result       if val1 = "Continue" and val2 =  "Continue" then val3 else nooutput()


            The 'ValNow' will confirm access to the tag and the other pieces show the steps of each calculation

            1 of 1 people found this helpful
            • Re: Calc Failed for AF Analysis

              Hi Simon,


              What's your version of Asset Analytics and PI Data Archive?


              I think the issue may be with authentication as mentioned by the others, can you double check the permissions on the point?


              Edit: You can also try increasing the logging level and see if you get more information in the logs. For reference: OSIsoft: Troubleshooting Analysis When Outputting Calc Failed (AF 2018) - YouTube




              1 of 1 people found this helpful
              • Re: Calc Failed for AF Analysis

                Thank you all for your advice. The cause was down to a schoolboy error.


                The case where the analysis failed was due to the fact that some of the input/output attributes were defined as a string type when they should have been a single. PSE must have 'remembered' that the last time I created an attribute it was of string type and I had not noticed this when I built this analysis.


                The case where the same calculation worked the output attribute had been built in a separate instance of PSE so probably defaulted to single and worked.

                1 of 1 people found this helpful