5 of 5 people found this helpful
You can use the AF SDK Overview with C#.
That is how we tend to build new data flows into the PI System where an OSIsoft built interface doesn't exist.
Thank you for your reply! I understand that the C# solution is advised today. However our application is not in C# so we would have to develop a bridge in between. For example I would need to encapsulate the C# methods in a library, to call them from the C. Maybe this is already done? Otherwise it looks more efficient for the development to go with the C PI API.
3 of 3 people found this helpful
I would not say we are advising to use C#. Rather we would advise using the correct PI Developer Technology. AF SDK is for Windows only, and PI Web API would be for cross platform or mobile. Those really are the only 2 technologies I would recommend for interfaces. And that would be only after you heed Gregor Beck 's advice to verify there is not an existing interface or connector. We have had other customers successfully use AF SDK with C.
Thank you for this clarification! It will be running on Windows, so the correct technology should be AF SDK.
Do you have some resources to help using it with C or Ada languages?
2 of 2 people found this helpful
Before you go build something custom, I suggest to verify if there is a PI Interface or PI Connector which would potentially work. Can you indicate what communication standards your custom system supports?
Thank you for your help. Our communication is using our own tools, especially for security requirements.
I worry that adding an additional communication layer may add more burden on configuration, speed and security.
However, I will take a look at the list and check if something can fit.
4 of 4 people found this helpful
Let me summarize your developer technology options you have and try to provide you direction with using C/Ada languages. As pointed out by Gregor and reiterated by Rick, you should first check to see if PI Interfaces (over 450+ are available) fit the bill.
PI API (deprecated)
- Implements ANSI C functions so that code written with the PI API is portable across multiple environments.
- Data access methods strictly restricted to PI Server (Point Database, the Archive, and PI Tables)
- PI API 2016+ implements Windows Integrated Security which provides enhanced security for communication
- Resources: PI-API Programmer's Help (contains only few code samples), sample code in ...\PIPC\examples install directory
PI AF SDK
- Microsoft .NET based programmatic library designed for easy access from languages like Visual Basic .NET (VB.NET), C#, and Managed C++
- Data access includes Assets(AF), Time series and event frames
- Resources: Developing Applications with PI AF SDK
PI Web API
- RESTful interface to the PI system
- Gives client applications read and write access to their AF and PI data over HTTPS
- Language and platform agnostic
- Resources: Programming in PI Web API
PI Web API seems to fit your mold and this is also something I recommend to partners/customers who are looking at re-writing their custom PI API interfaces.
- C language: libcurl is a free client-side URL transfer library which provides a C API to make HTTP calls. You can choose other similar libraries which provide a wrapper for making and receiving requests over HTTP.
- Ada: PI Web API includes OpenAPI 2.0 specification (also known as a Swagger specification) that describes the RESTful API. The document can be used to generate client libraries including Ada using code generators. Also refer: The Best APIs are Built with Swagger Tools | Swagger
Word of caution, both C and Ada are challenging languages for "modern" application development. You may want to ease your development effort by making use of existing libraries as much as possible.
Thank you very much for your detailed reply ! I will check those resources and consider the options.