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

AF SDK Reference

AFCalculation.CalculateAtRecordedValues Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFCalculation.CalculateAtRecordedValues Method
This method returns an AFValues collection that contains the result of evaluating the passed expression at each point in time over the passed time range where a recorded value exists for a member of the expression.

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

Syntax

public static AFValues CalculateAtRecordedValues(
	Object target,
	string expression,
	AFTimeRange timeRange
)
Public Shared Function CalculateAtRecordedValues ( 
	target As Object,
	expression As String,
	timeRange As AFTimeRange
) As AFValues

Dim target As Object
Dim expression As String
Dim timeRange As AFTimeRange
Dim returnValue As AFValues

returnValue = AFCalculation.CalculateAtRecordedValues(target, 
	expression, timeRange)
public:
static AFValues^ CalculateAtRecordedValues(
	Object^ target, 
	String^ expression, 
	AFTimeRange timeRange
)
static member CalculateAtRecordedValues : 
        target : Object * 
        expression : string * 
        timeRange : AFTimeRange -> 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.

Return Value

Type: AFValues
Returns an AFValues collection containing the results of the expression calculated at times that match the times of recorded values of attributes and points within the expression.

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