3 Replies Latest reply on May 17, 2018 7:36 AM by gregor

    AF SDK vs PI Web API for specific application

    jmoretti

      Hello,

       

      I am writing a manual-entry application that will need allow inputs from the users on tank measurements, read existing tank measurement data from corresponding tank elements and tank strapping tables from AF, perform some calculations, and write the inputs and results of the calculations to PI Points (through the AF elements/attributes).  There will also be Event Frame creation to represent material transfers between the tanks.  I am familiar and comfortable with both PI Web API and PI AF SDK and have browsed PI Square on comparisons between using the two technologies.  Some of my requirements favor PI Web API, others favor AF SDK, and was hoping to get advice from the pros on which is more appropriate for my specific application.  Here are my requirements and architecture...

       

      1. I have chosen to write the application as an ASP.NET MVC application.  It will run on IIS on a server that is currently hosting PI Vision.  It seems PI Web API and AF SDK are prerequisites for Vision so both are installed on the same server.

      2. The users will typically use a web browser on a Windows PC on the same network as the PI system to enter this data, however, they do want the capability to access this web page on a mobile device that is OS-agnostic.

      3. Not very many users will be allowed to use this application so I am OK with authorizing at the application layer.

      4. The calculations in question don't involve much PI data.  For example, they need to input the current level of the tank, and I need to use predetermined tank strapping data (which will reside in a linked AF table) to calculate the volume, difference in volume from the last entry and current entry, and other similar calculations.

      5. Calculations will be done in the application as opposed to PI Analysis Service since I need to have control over the historized timestamp of the calculations.

       

      Thanks in advance!

        • Re: AF SDK vs PI Web API for specific application
          rborges

          You have an interesting set of requirements here and, from what I understand, PI Web API is more suitable for you. The (only) reason for this is because it will allow you to write a rich client-side web application based on [insert your favorite technology here like angular or pure html5] that runs detached from your web server. This will also make easier for you to handle data flow, as the mobile device will be responsible for fetching and sending data directly to the PI Web API.

           

          So, with this architecture in mind, let's check it against your original requirements:

          1) It can be hosted on IIS and served to the client as a stand-alone app.

          2) It's OS agnostic.

          3) You can do authorization as you want.

          4) A client-side js can easily handle this math.

          5) You will get the right timestamp.

           

          What do you think about this idea?

          2 of 2 people found this helpful