AnsweredAssumed Answered

RecordedValuesByCount Including the Snapshot?

Question asked by Steve Boyko Champion on Mar 16, 2015
Latest reply on Mar 17, 2015 by Steve Boyko

I am calling the PI-SDK function RecordedValuesByCount from ProcessBook VBA. I am calling it like this:

   Set sSrv = PISDK.Servers(sServer)

   Set pt = sSrv.PIPoints(sTag)

   Set pivals = pt.Data.RecordedValuesByCount("*", 5, dReverse, btAuto)   ' load last 5 values


   For Each pival In pivals

      If (pival.IsGood) Or (pival.Value <> "No Data") Then


         lstLast5Values.List(lstLast5Values.ListCount - 1, 0) = pival.TimeStamp.LocalDate

         lstLast5Values.List(lstLast5Values.ListCount - 1, 1) = pival.Value

      End If



The PI data for this tag, as shown by the the Archive Editor plugin of PI-SMT, has a Pt Created event at 2015/3/11 4:53:42 PM and nothing else. However, the PIValues collection returned by RecordedValuesByCount contains two events: that Pt Created event and another Pt Created event at the current time. What gives?


I tried using btInside or btOutside instead, and both of them return what I expect (just one value), but why does btAuto invent an event?


Thanks in advance for any help you can provide.