Click or drag to resize
OSIsoft, LLC

AFCalculationCalculateSummaries Method

This method evaluates the specified expression over the passed time range. The passed time range is first divided into a number of summary intervals. The method then computes the specified summaries over each interval.

Namespace:  OSIsoft.AF.Data
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.8.440
Syntax
public static IDictionary<AFSummaryTypes, AFValues> CalculateSummaries(
	Object target,
	string expression,
	AFTimeRange timeRange,
	AFTimeSpan summaryDuration,
	AFSummaryTypes summaryType,
	AFCalculationBasis calcBasis,
	AFSampleType sampleType,
	AFTimeSpan sampleInterval,
	AFTimestampCalculation timeType
)

Parameters

target
Type: SystemObject
The target can either be a PIServer, an AFDatabase, or any derived objects of AFBaseElement. References to attributes or points within the expression 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.
summaryDuration
Type: OSIsoft.AF.TimeAFTimeSpan
The length of the summary interval. A value will be returned for each interval within the specified time range.
summaryType
Type: OSIsoft.AF.DataAFSummaryTypes
A flag which specifies one or more summaries to compute over the time range.
calcBasis
Type: OSIsoft.AF.DataAFCalculationBasis
Specifies the method of evaluating the data over the time range.
sampleType
Type: OSIsoft.AF.DataAFSampleType
Together with the sampleInterval, specifies how and how often the filter expression is evaluated.
sampleInterval
Type: OSIsoft.AF.TimeAFTimeSpan
When the sampleType is Interval, it specifies how often the filter expression is evaluated when computing the summary for an interval.
timeType
Type: OSIsoft.AF.DataAFTimestampCalculation
An enumeration value that specifies how the timestamp is calculated.

Return Value

Type: IDictionaryAFSummaryTypes, AFValues
Returns a dictionary of AFValues, each collection of values corresponds to one summary type.
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.
Note Notes to Callers
Due to the limitations of the PI Data Archive, expressions with discrete PI Points will not respect the step attribute at all times.
Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5
See Also
Enabling Operational Intelligence