AnsweredAssumed Answered

RecordedValuesByCount does not work in Python

Question asked by FeiFei on May 6, 2020
Latest reply on May 7, 2020 by Rick_Davin_3.0

Hi All,


I'm new to using PI AF SDK in Python, and a bit confused about the following error message when I tried to use 'RecordedValuesByCount' method in the PiPoint instance.

TypeError: No method matches given arguments for RecordedValuesByCount

What I'm trying to do:

  • Given a start time, retrieve the previous 1 event (compressed value) for a tag 


What I tried to do:

  1. Used PiPoint.RecordedValuesByCount -> didn't work, got the above error message
  2. Then tried to use the PiPoint.RecordedValues method instead where I constructed AFTimeRange in a way such that start time of the range > end time of the range, and used maxCount = 1 to retrieve the latest information. However this method gives me the next value, what I need is the previous value. 



Any ideas why I'm getting the above error message? Are there any other ways of solving this problem?