Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFCalculation.CalculateAtTimes Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFCalculation.CalculateAtTimes Method
This method returns an AFValues collection that contains the result of evaluating the passed expression over the passed points in time.

Namespace:  OSIsoft.AF.Data
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static AFValues CalculateAtTimes(
	Object target,
	string expression,
	IList<AFTime> times
)
Public Shared Function CalculateAtTimes ( 
	target As Object,
	expression As String,
	times As IList(Of AFTime)
) As AFValues

Dim target As Object
Dim expression As String
Dim times As IList(Of AFTime)
Dim returnValue As AFValues

returnValue = AFCalculation.CalculateAtTimes(target, 
	expression, times)
public:
static AFValues^ CalculateAtTimes(
	Object^ target, 
	String^ expression, 
	IList<AFTime>^ times
)
static member CalculateAtTimes : 
        target : Object * 
        expression : string * 
        times : IList<AFTime> -> 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 using attribute names in place of tag names in the equation.
times
Type: System.Collections.GenericIListAFTime
A list of timestamps at which to calculate the expression.

Return Value

Type: AFValues
Returns an AFValues collection containing the results of the expression calculated at the specified timestamps.

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.

Version Information

AFSDK


See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in