11 Replies Latest reply on Oct 29, 2014 12:54 PM by Marcos Vainer Loeff

    PI Web Services or PI AF SDK

    jorgewong

      Hello,

       

       

       

      I'm looking at building some sort of web based form that will allow users to send manually captured data to PI.  We have looked at PI Manual Logger but the users want something that is more of a spreadsheet type format instead of one value entry at a time.  I'm considering building something that would either use the PI AF SDK or PI Web services to send data back to PI so the users can do trending and analysis on the data.  What is the recommended approach?  Should I look at one or the other technology or something else?

       

       

       

      Thanks,

       

      Jorge

        • Re: PI Web Services or PI AF SDK
          Marcos Vainer Loeff

          Hello Jorge,

           

          I see three major options for you to develop your web based application:

           

          1).NET Web Application -  In this case you would use ASP.NET WebForms or ASP.NET MVC (which I personally prefer) and PI AF SDK. As PI AF SDK is a .NET library, you can add it as a reference to your ASP.NET web application project.  The information contained on the web form can be used to start PI AF SDK calls against the PI Server.

           

          2)Non .NET Web Application as Java or PHP: In this case I would use PI Web API to process the values of the form and send it to the PI Server. PI Web API is a RESTful web service on top of the PI System that wraps PI AF SDK. This means that the main features provided by PI AF SDK, could be used in PI Web API.

           

          3)Static HTML5 pages: this option uses static HTML5 pages and not dynamic pages as the other two options. In order to send the values to the PI System, you must use JavaScript/jQuery. The problem arises if JavaScript is disabled on the browser, making it impossible for the end-user to connect to PI Web API.

           

          If you are going to start a new project, we recommend you to use PI Web API instead of PI Web Services because the REST technology is commonly used by the market and it is easier to integrate with non .NET technologies.

           

          Hope it helps,

            • Re: PI Web Services or PI AF SDK
              jorgewong

              This definitely helps and gives me some direction.  I'm leaning towards option #1 but the mobility aspect is going to be a future requirement down the line where this application needs to be able to run on any device possibly through a browser.  Would that sway you towards #3?

                • Re: PI Web Services or PI AF SDK

                  If you are considering devices, even if it is 2 years away, please start with WebAPI now.

                    • Re: PI Web Services or PI AF SDK
                      Marcos Vainer Loeff

                      Hello Jorge,

                       

                      So, it really depends. Do you want to create a web application or an app for iOS or Android? The difference is that the app you need to download from the Google Play or iTunes. The web application, you just access the web site.

                       

                      Option number 1 can also be used to develop mobile application. The pages would be the same when accessing from the desktop. The difference is adjusting the CSS files to be viewed on the mobile/smart phone.

                       

                      If you are developing an app, then PI Web API is the best option. Nevertheless, the app and the Web Application are separate projects. Hence, you can use PI AF SDK for the web application (desktop and mobile) and PI Web API for the app. There is also Option 4, which is using PI Web API within a .NET Web Application but the performance won’t be the same.

                       

                      Hope it helps!

                        • Re: PI Web Services or PI AF SDK
                          jorgewong

                          We are looking for a web application.  Something that can run desktop, mobile, any device really  Thanks for the advice.

                            • Re: PI Web Services or PI AF SDK
                              jorgewong

                              One more questions, if that web app were to have a requirement to be able to run in an offline mode and be device agnostic, should we build using HTML5 or something with .net MVC?

                                • Re: PI Web Services or PI AF SDK
                                  Roger Palmen

                                  HTML5 currently looks like the way to go, as the built-in capabilities of HTML5 are far more powerful than anything ajax. Even microsoft is steering away from MVC.

                                    • Re: PI Web Services or PI AF SDK
                                      Marcos Vainer Loeff

                                      Hi Jorge,

                                       

                                      I am not sure what do you mean by running in off-line mode. If the customer is accessing a web application, he is supposed to be online. Developing off-line applications is more interesting for smartphone apps like Android or iOS. The app would connect to the server online only to sync data, for instance.

                                       

                                      Developing against ASP.NET MVC takes advantage of the same built-in capabilities of HTML5. The question is if you want to develop a web application with server-side or cliente-side rendering.  Each option has advatanges and disadvantages. I personally prefer the server-side rendering because I feel that I have more control over the application. Please refer to this article for more information about this topic.

                                       

                                      One question you need to ask is where are you getting the dynamic data? Would you have to develop a web service to send dynamic data to your web site? If so, it would be easier to use ASP.NET MVC, since you would only have to develop one project. Nevertheless, if you already have a web service like PI Web API, then it might be interesting to choose cliente-side rendering.

                                       

                                      I don’t agree that Microsoft is steering away from the MVC. Microsoft has released ASP.NET MVC 5 together with Visual Studio 2013 and it is currently developing ASP.NET MVC 6 with Visual Studio 14 CTP taking advantage of all the cool features provided by HTML5. I would say that Microsoft is steering away from ASP.NET Web Forms.

                                       

                                      I personally love ASP.NET MVC as it is extremely powerful!

                                       

                                      Hope it helps!

                                        • Re: PI Web Services or PI AF SDK
                                          Lonnie Bowling

                                          I agree, ASP.NET MVC is a good choice and is well supported in future road maps. We are actively doing projects using MVC.

                                           

                                          Jorge, your questions are pretty broad about what you want to do. Web-based, write to PI, off-line mode, run on any device. There is really no "best" way to do this, and it depends a lot on what features truly matter and what technologies you are familiar with. I think you will get better direction if you can narrow down the choices. Like if you said you want to work with Microsoft products, or we only want to use native HTML/Javascript, or we want to create native applications. Anyway, not sure if that helps or not.

                                           

                                          Good luck,

                                           

                                          Lonnie

                                            • Re: PI Web Services or PI AF SDK
                                              jorgewong

                                              Appreciate all the feedback, you guys are great.  Maybe I wasn't too clear.  :)  I'm currently evaluating PI Manual Logger but there are some limitations to it that are making us consider something custom built.  So I guess I'm asking what I should start off with if I wanted to build a custom solution.  Its looking like ASP.net MVC is a good solution.

                                               

                                              We pretty much want PI Manual Logger (caching ability, integration into PI with manual data entry, device agnostic (HTML5)) along with a some other features that our business wants like: multiple entry points on one page (PI ML allows only one at a time), trends that could display some of the previous values for evaluation.

                                               

                                              Thanks,

                                               

                                              Jorge