AFCalculation.CalculateAtIntervals Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
This method returns an AFValues collection that contains the result of evaluating the passed expression over the passed time range
at a defined interval.
Namespace: OSIsoft.AF.Data
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFValues CalculateAtIntervals( Object target, string expression, AFTimeRange timeRange, AFTimeSpan sampleInterval )
Public Shared Function CalculateAtIntervals ( target As Object, expression As String, timeRange As AFTimeRange, sampleInterval As AFTimeSpan ) As AFValues Dim target As Object Dim expression As String Dim timeRange As AFTimeRange Dim sampleInterval As AFTimeSpan Dim returnValue As AFValues returnValue = AFCalculation.CalculateAtIntervals(target, expression, timeRange, sampleInterval)
public: static AFValues^ CalculateAtIntervals( Object^ target, String^ expression, AFTimeRange timeRange, AFTimeSpan sampleInterval )
static member CalculateAtIntervals : target : Object * expression : string * timeRange : AFTimeRange * sampleInterval : AFTimeSpan -> AFValues
Parameters
- target
- Type: SystemObject
The target can either be a PIServer, an AFDatabase, or any derived objects of AFBaseElement. References to attributes or points are based on the target. - expression
- Type: SystemString
A string containing the expression to be evaluated. The syntax for the expression generally follows the Performance Equation syntax as described in the PI Data Archive documentation, with the exception that expressions which target elements use attribute names in place of tag names in the equation. - timeRange
- Type: OSIsoft.AF.TimeAFTimeRange
The bounding time for the evaluation period. - sampleInterval
- Type: OSIsoft.AF.TimeAFTimeSpan
Specifies how often the expression is evaluated.
Return Value
Type: AFValuesReturns an AFValues collection containing the results of the expression calculated at the specified sample interval.
Remarks
Calculations are limited to Attributes or PI Points which originate from a single PI Data Archive.
Attributes which resolve to a static value (no data reference configured), are also acceptable.