2 Replies Latest reply on May 14, 2018 2:09 AM by Nandan

    How to display PI Trend with start time as 00:00:00 Hrs?

    Nandan

      I have a pdi file with many trends. Whenever I open it it should display the trend with the beginning time as 00:00:00 for that day for all trends.How to go about it?

      I am using PI Process book 2015 ver 3.5.0.284

        • Re: How to display PI Trend with start time as 00:00:00 Hrs?
          knightk

          00:00 of the current day can be expressed as t (today at midnight) in PI time. So you can simply set the start time of your trends to t, then each time you open it, the start date will be 00:00 of the current day. If you have a load of trends and don't want to click through each of them, this macro will do it for you.

           

          Sub trendDate()
          
          Dim s As Symbol
          Dim t As trend
          
          For Each s In ThisDisplay.Symbols
          
              If s.Type = pbSymbolTrend Then
             
                  Set t = s
                 
                  t.SetStartAndEndTime "t", "*"
             
              End If
          
          Next s
          
          End Sub
          

           

          You could also call this from the Display_Open event to make sure its reset every time you open the PDI.

           

          Private Sub Display_Open()
          Call trendDate
          End Sub
          
          2 of 2 people found this helpful