7 Replies Latest reply on May 10, 2017 1:58 PM by AndyBantly

    How can I use PI data link to specify the AFCalculationBasis of Summary Data?

    AndyBantly

      How can I use PI data link to specify the AFCalculationBasis of Event Weighted, Event Weighted Exclude Earliest Event, and Event Weighted Exclude Most Recent Time, Event Weighted Include Both Ends, Time Weighted, Time Weighted Continuous, and Time Weighted Discrete?  When I use Calculated Data of PI Data Link, I see two options for specifying the calculation basis.  It shows “time-weighted’ and “event-weighted”. If I click the button to the right of the option it lets me key something in.  The documentation doesn’t explain this option; it only shows time-weighted and event-weighted.

        • Re: How can I use PI data link to specify the AFCalculationBasis of Summary Data?
          gregor

          Hi Andy,

           

          The answer is similar to the one to your other question here. AFCalculationBasis Enumeration is not sufficient because PI DataLink builds on the RDA AF SDK. 

            • Re: How can I use PI data link to specify the AFCalculationBasis of Summary Data?
              AndyBantly

              Hi Gregor, is RDA AF SDK the Rich Data Access SDK that is built with .Net 4.0?  I am writing my code using the same 4.0 .Net?  If PI DataLink is built with the rich data access then why is the enumeration missing from the UI?

               

              Is there anyway to verify the data returned from the Summaries and Summary methods other than PI DataLink.   I will have to pull these features from the final code if we can't verify the numerical results that come out of the query.  We have to verify every result for each combination of settings we give the end user.  In this case we give the end user all of the capabilities of these functions.  They can select population standard deviation with different calculation basis and timestamp calculations.  Is there any product in existence that can verify these results?  Certainly OSIsoft was audited after the functionality was added and had to demonstrate to the auditor that the values calculated were correct.  This is a huge problem for us and we can't release the software the customer wants without being able to verify the numerical results.

                • Re: How can I use PI data link to specify the AFCalculationBasis of Summary Data?
                  gregor

                  Hi Andy,

                   

                  Same as with your other question. AFCalculationBasis Enumeration should be sufficient because it's used with RDA summary methods. I beg your pardon once more!

                   

                  I've reached out to the PI DataLink product specialists meanwhile and hope somebody can clarify how AFCalculationBasis is coded into the Calculated Data dialog in PI DataLink.

                   

                  For all stumbling across this thread in future, I also like to share the link to PI SDK/AF SDK Equivalents for DataLink Functions

                  • Re: How can I use PI data link to specify the AFCalculationBasis of Summary Data?
                    jaroberts

                    Hello Andy,

                    For the Calculated Data function, PI DataLink uses a switch statement to map user input to either AFCalculationBasis.TimeWeighted or AFCalculationBasis.EventWeighted.  I had created a UserVoice idea earlier this year to expand this to all available options in the AFCalculationBasis enumeration, thus matching PI System Explorer's behavior.  Clearly, you are aware of that idea, considering you commented on it yesterday.

                     

                    I will mention this to the devs so it's on their radar (in addition to it being on UV, which means it will be reviewed at some point anyway).  In the meantime, to verify the data returned from AF SDK Summary and Summaries methods, I suggest using Time Series Data | Summary | Weighting options in PSE, available by right-clicking an attribute.

                      • Re: How can I use PI data link to specify the AFCalculationBasis of Summary Data?
                        AndyBantly

                        Thank you!  As a 3rd party commercial entity that sells enterprise software to pharmaceuticals we are legally required to have outside software development lifecycle process audits.  And we have had them a number of times in the past.  If the auditor doesn’t have a way to verify the results then we have to make them inert in code, despite how awesome and perfect they work.

                         

                        I would like to suggest broadening your suggestion.  The methods in the data namespace should have a 1 to 1 mapping to Data link; not just for this one item regarding calculation basis.

                          • Re: How can I use PI data link to specify the AFCalculationBasis of Summary Data?
                            jaroberts

                            <This functions as my reply to your other two PI Square threads as well>

                             

                            As Rick mentioned in one of the other PI Square threads, not all AF SDK features or parameters are implemented in PI DataLink, so it is not necessarily a good candidate for what you are trying to do.  DataLink is meant to provide the most benefit to the most users, not exhaustively utilize the AF SDK in an Excel environment.

                             

                            For each of the three specific examples you've cited in PI Square threads (AFCalculationBasis enumeration options, AFTimestampCalculation enumeration options, and the Population Standard Deviation summary type), the motivation behind their exclusion was to simplify the DataLink function for the benefit of the average user who does not need them and would be confused or distracted by them.  Avoiding choice overload, if you will.

                             

                            DataLink is not intended to be used to verify the results of the AF SDK for an audit; its primary goal is to enable you to retrieve information from your PI System directly into a spreadsheet.  Excluding some AF SDK options furthers this goal by simplifying the DL function without removing significant functionality.  However, if our customers want a certain option in the AF SDK to be implemented in PI DataLink, then we certainly want to be aware of that and react accordingly.  Thus, UserVoice.

                             

                            While I see you created a generic request to implement all AFData methods in DL, I went ahead and created two additional (and easier to implement) UserVoice ideas to cover your specific remaining examples:

                            Add Population Standard Deviation to Calculated Data as a calculation mode

                            Add AFTimestampCalculation options to Calculated Data

                             

                            But to be honest, I'm not sure I entirely understand your audit verification requirement.  It sounds like the auditor requires a tool not made by your company (thus from this perspective, DL is a third-party tool) to verify the accuracy of your product.  However, our product (DL) is using the same underlying technology (AF SDK) that yours is, so I'm not sure what this test accomplishes.  I guess it tests that you called SomeMethod.SomeMember from the AF SDK correctly (or at least in the same manner we did), but it does not test the accuracy of the underlying logic used by the AF SDK.  Would you mind clarifying your audit requirements, as they seem to be the driving force behind your questions/enhancement requests across multiple PI Square threads/UserVoice ideas?

                             

                            Also, if you would prefer to make this into a tech support case, we can do that as well.

                            3 of 3 people found this helpful
                              • Re: How can I use PI data link to specify the AFCalculationBasis of Summary Data?
                                AndyBantly

                                “But to be honest, I'm not sure I entirely understand your audit verification requirement.  It sounds like the auditor requires a tool not made by your company (thus from this perspective, DL is a third-party tool) to verify the accuracy of your product.  However, our product (DL) is using the same underlying technology (AF SDK) that yours is, so I'm not sure what this test accomplishes.  I guess it tests that you called SomeMethod.SomeMember from the AF SDK correctly (or at least in the same manner we did), but it does not test the accuracy of the underlying logic used by the AF SDK”

                                 

                                Hello, this is precisely the reason.  When we are audited, we aren’t audited for the underlying logic of the technology.  It is largely assumed that OSIsoft was audited when they released their SDK’s.  We are precisely audited to make sure that we are calling the SDK correctly.  That is why we need a 3rd party tool to verify the results we are getting.  We’ve already had to pull summary values from the UI because we don’t have a 100% ability to duplicate the SDK results with another tool.