8 Replies Latest reply on Jun 10, 2011 2:14 PM by spilon

    .Net Threads to access PI Archieve Data for mutliple tags using OLEDB\SDK

    schugh@nalco.com

      Hi Alll

       

      Currently the reporting solution used in our company is very slow the reason being is slowness in fetching the PI data. The reason behind that is a lot fo PI tags are being used in the report and data is being extracted for each tag using oledb.

       

      Inorder to fix those issues we thought of implementing a PI Data access layer dll which is using oledb to get PI data. We have written various custom functions in this dll which can read/write PI data.Now the problem is the funciton which is acessing PI Archive/Interpolated data can only do PI data call for each tag in a single query or SDK API. We can't pass multiple tags to SDK API's to get PI data so we thought of using Threading . I am trying to use threading but it seems to be  me a difficult task....

       

      What is the best way to pull archive data for around 8 tags in one shot ?

       

      What are the best practices used in the industry to pull  archive data for multiple tags.

       

      Kindly advise..

       

       

       

      Regards

       

      Sandeep chugh

        • Re: .Net Threads to access PI Archieve Data for mutliple tags using OLEDB\SDK
          Ahmad Fattahi

          Sandeep,

           

          Have you checked out the ArcValue() method of the ListData object? You can create a PointList collection (a collection of PI points) and use its Data property (a ListData object). In the PI SDK documentation there is an example of using the ListData.ArcValue() example under ListData. Something like this:

           
          Dim ptlist As New PISDK.PointList
          Dim nvError As New PISDKCommon.NamedValues
          Dim arcVal As PISDK.PointValues
          
          myserv.Open() //open connection to PI server
          
          ptlist.Add(myserv.PIPoints("cdt158"))
          ptlist.Add(myserv.PIPoints("BA:Active.1"))
          ptlist.Add(myserv.PIPoints("BA:Temp.1"))
          ptlist.Add(myserv.PIPoints("cdm158"))
          
          arcVal = ptlist.Data.ArcValue(System.DateTime.Today, PISDK.RetrievalTypeConstants.rtCompressed, nvError, Nothing)
          
          For Each val As PISDK.PointValue In arcVal
          ....
          Next
          

           

           

          More generally, please see this vCampus-exclusive webinar on how to optimize your PI SDK application.

           

          Another question: Is using PI Web Services an option for your organization?