6 Replies Latest reply on Jul 12, 2016 2:20 PM by Rose

    Best possible way in C# to calculate the amount of time, a tag value was within a given range


      Hi Everyone,


      I am new to PI and looking for best possible solution to calculate how long a tag value(possibly in mins) was within certain range. It should also consider the Start and End time range selected.

      So, just to be clear, my input parameters would be :

      • Tag
      • StartTime and EndTime
      • Lower and Upper Bound values. (Eg 0 and 100 respectively)


      I found couple approaches using PI DataLink but I am looking for doing the same using C#. Product version of OSISoft.AFSDK I am using is


      Please let me know if any more details required and apologies if anything above is wrong.

      Any help would be highly appreciated.