3 Replies Latest reply on Apr 9, 2013 7:21 AM by hanyong

    SDK - Under the hood?


      Back in the day, I developed a class module that I could import into VBA-enabled applications (Excel and PI Processbook) that was essentially a wrapper around the PI Win32 API.  It allows me to do the stuff like get PI archive or snapshot values etc.  This was before the SDK existed.


      The class still works fine, and does what I want it to do.  However I was wondering if there would be any value at all in updating it to use the SDK instead of the API.  I was wondering if fundamentally the SDK is also just a wrapper around the API.  I presumed it was, and therefore if my class still works, there is no need / case to update it at all.













        • Re: SDK - Under the hood?

          Hi Andrew,


          OSIsoft SDK and API are the two different things.  If changing the API to SDK, your class structure might not need to change, but the functions in it have to be changed into SDK way.  When you installed PI SDK, there is the help file in the ../pipc/help folder, and also PI API's help file in there.  You could compare them, and it should be not difficult to find how to change your API function into SDK.


          OSIsoft will suggest customers to use SDK instead of API in the future.  Currently, the new SDK, named AF ADK, is coming.  If interested in this, you could go to v-Campus download center to download one to test, and I believe you will like this as it is more easy to use with the good performance.

            • Re: SDK - Under the hood?

              Hi Andrew,


              As Xi mentioned, PI SDK and PI API are completely different and PI SDK is in no way a wrapper around PI API. In terms of value of updating it to use PI SDK, I would consider if the new features in PI SDK will be useful for you, for example

              • PI SDK is HA aware whereas PI API isn't.
              • PI SDK can utilize Windows Integrated Security to authenticate with PI Server, but PI API is limited to using PI Trust.
              • PI SDK is object oriented and probably easy for further development compared to sticking to PI API
              My personal view is if you have a need to add on new features in your library, I would recommend starting with PI SDK instead of continuing with PI API.
              AF SDK is another option that has equivalent feature as PI SDK, in terms of reading data from the PI Server. But it is writing in .NET, which means the output library that you get is also a .NET dll. This might be a problem if you are primarily writing this library for use in VBA environment.
                • Re: SDK - Under the hood?

                  Just to add on to my own statement, it is possible to write a .NET library  with a COM wrapper such that it is possible to be used in VBA, but obviously there are some additional handling required. (hint, see the AF Wrapper for PI ProcessBook example in the Download Center)