2 Replies Latest reply on Jan 11, 2018 1:13 AM by lmantei

    Time Stamping a Less Than Value in from a PI Tag In Excel

    lmantei

      How do I insert a time stamp in excel when a PI Tag hits a given level?

       

      I am trying to work out a historical downtime report to automatically add the time stamp to a excel report. When a PITag fell below a certain level I would like it to flag the downtime event, then once the level has increased put up a second time stamp to flag the line was back up. Is there a clean way to do it. We deal with tonnages, so when the line is run and it falls below a given low level of production it is considered down time.

       

      I have been trying PEs and the FindLE "Find the first time, within a range, when a point is less than or equal to a given value." may work but I would have to have some time span to work with in. If it was a day it would only return the time stamp 1st time. If the line went down three times that day it would only return on time stamp.

       

      I understand moving forward I can create a PI Tag to do this. I am trying to recreate this function on the historical data for the last few years. Going forward we will add in the new PI Tag to do this function.

       

      I hope this kind of makes sense

       

      Larry

        • Re: Time Stamping a Less Than Value in from a PI Tag In Excel
          kwinnike

          Hi Larry,

          You can do this in DataLink by adding a filter expression to the compressed data function such as:

          'Tag'<20 and prevval('Tag','*')>20

           

          This means that it will return every time the tag falls below the limit (20 in this example). Here are some results for sinusoid:

           

          If you want to return the times when the tag falls both below and above the limit, you can use a filter expression such as:

          ('Tag'<20 and prevval('Tag','*')>20) or ('Tag'>20 and prevval('Tag','*')<20)

           

          Let me know how this works and if you have additional questions.

           

          Kristen

          1 of 1 people found this helpful