Is this AFAttribute (tempAtt in the code) a PIPointDR? Can you show a screenshot how it was configured to retrieve the hourly average? What is the range of MyTimeRange? It might help to write this to the debugger or Console. Prior cases in which the error appeared indicated issues with the passed in time range. Looking at the full PIPointDR configuration would help us troubleshoot additionally though. Could you also post more of the code?
An alternative (and preferred) mechanism for getting 1hr averages over a 12 hr period would be to use the AFAttribute.Data.Summaries() method.
public IDictionary<AFSummaryTypes, AFValues> Summaries( AFTimeRange timeRange, AFTimeSpan summaryDuration, AFSummaryTypes summaryType, AFCalculationBasis calcBasis, AFTimestampCalculation timeType )
The timeRange would be 12hr and the summaryDuration would be 1hr. The summaryType enum would be AFSummaryTypes.Average. I believe Summaries() is what Datalink also uses to grab the averages.
Did Barry’s proposed solution worked for you?
If so you can mark it as correct answer, otherwise please let us know if you if you have more questions or what you did to solve your problem.