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

AF SDK Reference

AFValues.Summaries Method

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFValues.Summaries Method
Returns several summaries for this set of values over a time range for each interval within the range.

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

Syntax

public IDictionary<AFSummaryTypes, AFValues> Summaries(
	AFTimeRange timeRange,
	AFTimeSpan summaryDuration,
	AFSummaryTypes summaryType,
	AFCalculationBasis calcBasis,
	AFTimestampCalculation timeType
)
Public Function Summaries ( 
	timeRange As AFTimeRange,
	summaryDuration As AFTimeSpan,
	summaryType As AFSummaryTypes,
	calcBasis As AFCalculationBasis,
	timeType As AFTimestampCalculation
) As IDictionary(Of AFSummaryTypes, AFValues)

Dim instance As AFValues
Dim timeRange As AFTimeRange
Dim summaryDuration As AFTimeSpan
Dim summaryType As AFSummaryTypes
Dim calcBasis As AFCalculationBasis
Dim timeType As AFTimestampCalculation
Dim returnValue As IDictionary(Of AFSummaryTypes, AFValues)

returnValue = instance.Summaries(timeRange, 
	summaryDuration, summaryType, calcBasis, 
	timeType)
public:
IDictionary<AFSummaryTypes, AFValues^>^ Summaries(
	AFTimeRange timeRange, 
	AFTimeSpan summaryDuration, 
	AFSummaryTypes summaryType, 
	AFCalculationBasis calcBasis, 
	AFTimestampCalculation timeType
)
member Summaries : 
        timeRange : AFTimeRange * 
        summaryDuration : AFTimeSpan * 
        summaryType : AFSummaryTypes * 
        calcBasis : AFCalculationBasis * 
        timeType : AFTimestampCalculation -> IDictionary<AFSummaryTypes, AFValues> 

Parameters

timeRange
Type: OSIsoft.AF.TimeAFTimeRange
The bounding time range over which the summary intervals are computed.
summaryDuration
Type: OSIsoft.AF.TimeAFTimeSpan

The duration of each summary interval. If specified in hours, minutes, seconds, or milliseconds, the summary durations will be evenly spaced UTC time intervals. Longer interval types are interpreted using wall clock rules and are time zone dependent. For example, an interval created with the string "24h" means using an evenly spaced 24 UTC hour interval between each event. On the other hand, an interval created with the string "1d" would return an interval shorter or longer than 24 hours if the interval encompasses a Daylight Savings Time change.

When a positive duration is specified, the summary calculation begins at the earliest bounding time in the timeRange and applies the duration repeatedly in time ascending direction to generate the summary intervals.

If a negative duration is specified, the summary calculation begins at the latest bounding time in the timeRange and applies the duration repeatedly in time descending direction to generate the summary intervals. Note that the order of values returned will still be reflected by the timeRange, regardless of the summary duration sign.

summaryType
Type: OSIsoft.AF.DataAFSummaryTypes
A flag which specifies one or more summaries to compute for each interval over the time range
calcBasis
Type: OSIsoft.AF.DataAFCalculationBasis
Specifies the method of evaluating the data over the time range.
timeType
Type: OSIsoft.AF.DataAFTimestampCalculation
A flag indicating what how to calculates a timestamp for each interval.

Return Value

Type: IDictionaryAFSummaryTypes, AFValues
A dictionary of AFValues, indexed by the specific AFSummaryTypes.

Remarks

The following table illustrates the interaction between timeRange and summaryDuration with the timestamp summary calculations and order of returned values for each summary type.

Time RangeSummary DurationSummaries returned in AFValues
Ascending (Y to T)Positive (5h)Y to Y+5h, Y+5h to Y+10h, Y+10h to y+15h, Y+15h to Y+20h
Descending (T to Y)Positive (5h)Y+15h to Y+20h, Y+10h to Y+15h, Y+10h, Y+5h to Y+10h, Y to Y+5h
Ascending (Y to T)Negative (-5h)T-20h to T-15h, T-15h to T-10h, T-10h to T-5h, T-5h to T
Descending (T to Y)Negative (-5h)T-5h to T, T-10h to T-5h, T-15h to T-10h, T-20 to T-15h

Time-weighted totals are computed by integrating the rate tag values over the requested time range. If some of the data are bad in the time range, the calculated total is divided by the fraction of the time period for which there are good values. Mathematically, this approach is equivalent to assuming that during the period of bad data, the tag takes on the average values for the entire calculation time range. The use can use the PercentGood summary to determine if the calculation results are suitable for the application's purposes. Floating point values with a value of "NaN" are treated as bad data in the calculation.

For time-weight totals, if the time unit rate of the values cannot be determined, then the value will be totaled assuming a unit of "per day" and no unit of measure will be assigned to the value. If the measured time component of the tag is not based on a day, the user of the data must convert the totalized value to the correct units. For example, if the rate tag was gallons/minute, the conversion can be accomplished using UOMDatabase.UOMs["minute"].Convert(value, UOMDatabase.UOMs["day"].

Note Notes to Callers
This method, property, or class is not available in the legacy .NET 3.5 version of the SDK.

Version Information

AFSDK


See Also

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