Custom Interface to connect a Backend Database

Hello everyone,

 

I'm currently facing a challenge that I'm not getting anywhere with.

 

We would like to use the PI Data Archive for long-term storage of low-resolution process data. At the same time, high-resolution data from a ring buffer (InfluxDB) should also be made available to users via the PI Server.

 

In concrete terms, this means that high-resolution data is stored in the backend system (InfluxDB) for 30 days. Low-resolution data is stored in the PI Data Archive. Both types of data should be accessible via PI products such as ProcessBook, PI Vision, etc.

 

Our current PI system is very old and maps this architecture using a COM connector. We currently use an “ECHO-DB”, which we would now like to replace with InfluxDB.

 

The desired infrastructure essentially looks as shown in the attached picture. The old infrastructure is almost identical, but uses the ECHO DB and the COM connector.

 

It is important to mention that we do not want to integrate the high-resolution data directly into the PI system, as this would take up too much storage space in long-term archiving. In addition, there is no ring buffer functionality in the PI system without adapting the license model.

 

Now to my question:

 

What possibilities are there to forward data requests to the PI server to a backend system, similar to what our old COM connector did? Is it possible to develop software using the PI SDK that integrates new PI classes and functions for data retrieval?

I look forward to your ideas and suggestions!

 


image.png

  • Hi

    I don't know how old your PI System is, but in addition to the PI Data Archive, it consists of PI AF Server (Asset Framework). Think of AF as the data model and integration layer on top of your tags. All PI clients are able to access AF attributes, so you could think about the options available in AF for the connection to the backend database system.

    AF has data references for misc. operations, and PI Point data reference is the most commonly used one. In addition you have a Table Lookup data reference, which you can set up to look up values from a linked AFTable. This is set up using a SQL query into the external system.

     

    There's also the option of creating your own custom data reference, and this is a potential entry point for obtaining data from other systems, f.ex. InfluxDB.

     

    PS! The COM-based PI SDK is deprecated, and you need to have a look at the AF SDK now. It has most of the functionality the older SDK had.

  • Thank you for your response.

    The PI system on which I intend to implement the mentioned data interface is up to date and consists of two PI Data Archive servers and an AF server. The old system that uses the COM Connector is significantly outdated.

    The approach with the custom data reference sounds very intriguing. However, I would like to understand how users can access the InfluxDB time series through this method.

    For instance, when I retrieve a time series in Processbook, I can only select tags, and the system automatically retrieves the time series from the PI system’s Data Archive.

    Is it possible to replace the "normal" data query with our own custom Data Reference? Or does the user then have to retrieve the data in another way?

     

  • I see your concern! PI ProcessBook was an old(er) application even back when the more modern AF (2.0) was released, and the main data source for ProcessBook remains PI tags.

     

    The AF support is implemented as a data set in ProcessBook, similar to how we could develop custom data set ourselves. In the Define Trend dialog, you can click the small arrow next to Tag Search to access it, and then it opens a dialog allowing you to access your AF database/elements/attributes. You can map your AF Attributes to a display the same was you add PI tags.


    image.png
    PS! There's also the Element Relative data set option, this allows you to pick template defined attributes and just swap element context so you don't have to have 10 separate displays to show information about 10 pieces of equipment. (In PI Vision, this feature is called asset swapping)

     

    So if you have an AF Attribute configured as your own, custom data reference, it's up to you to implement it using C# and AF SDK, and you can override the necessary methods (f.ex. GetValue and GetValues) to provide your own logic, which'll connect to the InfluxDB and obtain the data you're requesting.

     

    In Amitec, we have created lots of custom data references over the years, so we can most certainly help you out with this kind of work. We also have a product that might fit the bill directly, with our Amitec Data Reference for RestAPI's. (I expect InfluxDB exposes a RestAPI to query data). If you're interested, reach out through a PM or email me at asle.frantzen@amitec.no

  • Thank you again for the very quick and detailed answer.

    That's very interesting and I wasn't aware of it. I will certainly pursue the approach further and test how the performance looks when we retrieve larger amounts of data with a high resolution of 2 ms.

    Have you also had experience with high resolution? I assume that the AF server will then primarily carry the load.

     

    Just to make sure I haven't misunderstood you: Writing an extension (as is possible for the Custom Data Reference) that overrides the query function of the PI Data Archive for a certain PI Point Class is not easily possible with the AF SDK? This would perhaps enable me to define a different point class for data points that are not contained in the PI Data Archive, which would then contain the custom data query. This would give me the option of selecting the data points in the Tag Search.

     

    As far as I know, InfluxDB itself does not provide a REST API. It primarily uses its own API, which can be handled in a similar way. I will try to implement this logic by myself. If I don't succeed, I will gladly accept your offer and get back to you.

     

    Thank you very much for your time.

  • A simple custom DR will obtain the data for a given period and present it in the PI System. Doesn't matter if it's 2 or 2000 values, but naturally larger datasets will take longer to execute.

    You could choose to implement AF DataPipe for your CDR, this is a mechanism that'll allow PI clients to subscribe to updates to the data. If you f.ex. want a calculation to be triggered on updates from your InfluxDB, you'd need to implement this. (Otoh, if you're fine with time scheduled calculations, you don't need it).

     

    You have not misunderstood what you're asking for; It's not possible to create extensions for the PI Data Archive the way you describe. PI Data Archive supports tags stored in the data archive files, so the only way to have something inside the PI Data Archive is to use an interface to fill values into PI tags.

  • All right.

    Many thanks for the great answers.

    I will try to create a custom data reference and provide the data that way. I think that's the best way so far.

     

    Have a great weekend.