7 Replies Latest reply on May 7, 2014 3:58 AM by Beth McNeill

    Scheduling of Custom Data Reference

    schutcw

      I have been implementing my own custom data reference in AF (with a lot of help from your feedback) using AFSDK v4.0 and the calculations are producing the expected values in AF. However, I have run
      into a few problems and I am hoping to get some feedback from other developers.

       

      An introductory note to my problem is that we use AF in almost all our applications. The custom data reference cannot be used in ProcessBook (RDA methods) and I am also having problems with all the data retrieval methods in DataLink except for CurrentVal(). (The DataLink compression retrieval is one problem I'd be happy to talk about).

       

      The other problem is that we are thinking of running the calculations at a scheduled time each day. I have implemented a windows service to do this, but this is just one more thing the department needs to keep track of. Instead, we were hoping of utilizing the PI Analytics scheduler. Not seeing a way to tie directly into the scheduler (please correct me if I'm wrong), we decided we could use an Expression Analysis with Scheduling in PI Analytics to trigger the attribute that has the custom data reference. Therefore, the Expression is simply the AFAttribute's name and the output gets mapped to a separate PI Point attribute. This solution, while it doubles the number of AF attributes, ensures proper scheduling and also saves the output of the custom data reference to a PI point which can be used in both AF and DataLink. However, when the PI Analysis runs it produces a 'CalcFailed' error. When designing the expression, on the other hand, I select an example element, press the Evaluate button and it produces the correct result. Does anyone have any idea as to why the expression properly Evaluates when designing the Analysis but produces a CalcFailed error when actually run?

        • Re: Scheduling of Custom Data Reference
          Rhys Kirk

          Is your Data Reference using a 32 bit component, or compiled for x86?

            • Re: Scheduling of Custom Data Reference
              skwan

              The "Evaluate" button gets executed by the client (and thus the client's security credentials) while PI Analysis Service is probably running as a different user.  You might want to check that.

                • Re: Scheduling of Custom Data Reference
                  schutcw

                  Rhys, the data reference is compiled for x86. Steve, thanks for idea. As a test I changed the PI Analysis Service to run on my account (client and Analysis service are same account) and I still received the same results (evaluation works but still receive CalcFailed from service). I checked the windows application log and it gives Information from PI Analytics at the scheduled calculation time but it doesn't help too much. It outputs "00:00:00.00". Assuming that doesn't help but I figured I'd mention it.

                    • Re: Scheduling of Custom Data Reference
                      dmoler

                      Hi Cory,

                       

                      If you data reference supports AFDataPipe, the Analysis Service will sign up for updates and get values from cache.  If you don't support data pipe, the Analysis Service will make a GetValue call with the execution time as the time context.

                       

                      In your case, it sounds like Rhys is onto the issue - the Analysis Service is a 64 bit process so it will be unable to load your 32 bit plugin.  When evaluate works, are you using the 32-bit version of PSE?  Does your data reference work in the 64-bit version of PSE?  Is it possible for you to compile as Any CPU?

                        • Re: Scheduling of Custom Data Reference
                          Rhys Kirk

                          David Moler

                          In your case, it sounds like Rhys is onto the issue - the Analysis Service is a 64 bit process so it will be unable to load your 32 bit plugin.  When evaluate works, are you using the 32-bit version of PSE?  Does your data reference work in the 64-bit version of PSE?  Is it possible for you to compile as Any CPU?

                           

                          Yeah, I've experienced this a couple of times so had to recompile and find an alternative to a 32 bit component. I don't particularly like this behaviour because to me PSE x86 should give the same error message as PSE x64 when being evaluated, or at least a warning that the Analysis Service won't be able to run the expression.