9 Replies Latest reply on Jun 13, 2012 10:07 PM by Ahmad Fattahi

    PI WS sample code to get data for trends...

    schugh@nalco.com

      Hi ,

       

      We want to use PI WS to pull data for our reporting..some of our reports are trend based...we want to call plot values WS calll.. I am doing it using the code below and its not working.. The result set is only giving 500 events....it shouldn't be same as archive data call.. If you have any sample code to call for plot values data call kindly share ...

       

       

       
      PIWebServiceRef.PIArcManner SelectedManner_Plot = new PIWebServiceRef.PIArcManner();
      
                  SelectedManner_Plot .RetrievalType = PIWebServiceRef.PIArcMannerRetrievalType.PlotValues;
      
                  //SelectedManner_Interpolated.Boundaries = PIWebServiceRef.PIArcMannerBoundaries.Inside;
      
       
      
      PIWebServiceRef.PIArcDataRequest Request = new PIWebServiceRef.PIArcDataRequest();
      
       
      
                      Request.Path = dr["TagName"].ToString();
      
                      PIWebServiceRef.TimeRange RequestTimeRange = new PIWebServiceRef.TimeRange();
      
                      RequestTimeRange.Start = dr["NewstartDate"].ToString();
      
      RequestTimeRange.End = dr["NewendDate"].ToString();
      
                      SelectedManner_Interpolated.NumValues = 500;
      
      
       
      
          Request.TimeRange = RequestTimeRange;
      
                      Request.PIArcManner = SelectedManner_Plot ;
      
      
      RequestsList[0] = Request;
      
      Resultset = PIWebServiceObject.GetPIArchiveData(IRequestsList);