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

AF SDK Reference

AFAttribute.GetValues Method (Object, AFTimeRange, Int32, UOM)

AFAttribute.GetValues Method (Object, AFTimeRange, Int32, UOM)

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFAttribute.GetValues Method (Object, AFTimeRange, Int32, UOM)

Note: This API is now obsolete.

This method gets a collection of AFValue objects for an attribute based upon the data reference configuration within the specified AFTimeRange context.

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

Syntax

[BrowsableAttribute(false)]
[ObsoleteAttribute("This method has been replaced by GetValues(AFAnalysis,IList<AFCase>,UOM) or GetValues(AFTimeRange,int,UOM).")]
public AFValues GetValues(
	Object context,
	AFTimeRange timeRange,
	int numberOfValues,
	UOM desiredUOM
)
<BrowsableAttribute(false)>
<ObsoleteAttribute("This method has been replaced by GetValues(AFAnalysis,IList<AFCase>,UOM) or GetValues(AFTimeRange,int,UOM).")>
Public Function GetValues ( 
	context As Object,
	timeRange As AFTimeRange,
	numberOfValues As Integer,
	desiredUOM As UOM
) As AFValues

Dim instance As AFAttribute
Dim context As Object
Dim timeRange As AFTimeRange
Dim numberOfValues As Integer
Dim desiredUOM As UOM
Dim returnValue As AFValues

returnValue = instance.GetValues(context, 
	timeRange, numberOfValues, desiredUOM)
public:
[BrowsableAttribute(false)]
[ObsoleteAttribute(L"This method has been replaced by GetValues(AFAnalysis,IList<AFCase>,UOM) or GetValues(AFTimeRange,int,UOM).")]
AFValues^ GetValues(
	Object^ context, 
	AFTimeRange timeRange, 
	int numberOfValues, 
	UOM^ desiredUOM
)
[<BrowsableAttribute(false)>]
[<ObsoleteAttribute("This method has been replaced by GetValues(AFAnalysis,IList<AFCase>,UOM) or GetValues(AFTimeRange,int,UOM).")>]
member GetValues : 
        context : Object * 
        timeRange : AFTimeRange * 
        numberOfValues : int * 
        desiredUOM : UOM -> AFValues 

Parameters

context
Type: SystemObject
The list of AFCase objects from which get the attribute's value.
timeRange
Type: OSIsoft.AF.TimeAFTimeRange
The time-range to be used when getting the attribute's collection of values.
numberOfValues
Type: SystemInt32
The number of values desired. he behavior of GetValues varies based on the value of this parameter:
  • If 0, then all recorded values within the timeRange will be returned with an interpolated value at the start and end time, if possible.
  • If the number of values requested is less than zero, then if supported, the Data Reference will return evenly spaced interpolated values across the timeRange, with a value returned at both end points of the time range. For example, specifying -25 over a 24 hour period will produce an hourly value.
  • If the number of values requested is greater than zero, the method will behave like the PlotValues method. This method is designed to return a set of values over a time period that will produce the most accurate plot while minimizing the amount of data returned. The number of intervals specifies the number of pixels that need to be represented in the time period. For each interval, the data available is examined and significant values are returned. Each interval can produce up to 5 values if they are unique, the first value in the the interval, the last value, the highest value, the lowest value and at most one exceptional point (bad value and/or annotated value). If no data is available in an interval, then no value is generated for that interval. As a result, the method may return more or fewer values than the number of values requested, depending on the distribution of recorded values over the time range. For Data References which use multiple PI Point sources, the list of values returned in each interval may be greater than 5 depending upon the data reference implementation.
desiredUOM
Type: OSIsoft.AF.UnitsOfMeasureUOM
The desired unit of measure for the returned values. If not specified or , then the values are returned in the unit of measure specified by the DefaultUOM property.

Return Value

Type: AFValues
Returns the collection of values for the attribute sorted in increasing time order if the StartTime of the timeRange is less than or equal its EndTime. Otherwise the order is reversed. If a AFDataReference is not configured for this attribute or the configured data reference does not support the AFDataReference.GetValues method, then this method defaults to returning a single value in the returned collection for each of its versions. These are the values returned by the GetValue Overload methods for each of its versions.

Remarks

This method obsolete and has been replaced by the GetValues(AFAnalysis, IList<AFCase>, UOM) and GetValues(AFTimeRange, int, UOM) methods.

Version Information

AFSDK

Obsolete (compiler warning) in 3.1.1
Obsolete (compiler warning) in 3.1.0
Obsolete (compiler warning) in 3.0.2
Obsolete (compiler warning) in 3.0.1
Obsolete (compiler warning) in 3.0.0
Obsolete (compiler warning) in 2.10.11
Obsolete (compiler warning) in 2.10.5
Obsolete (compiler warning) in 2.10.0
Obsolete (compiler warning) in 2.10
Obsolete (compiler warning) in 2.9.5
Obsolete (compiler warning) in 2.9
Obsolete (compiler warning) in 2.8.5
Obsolete (compiler warning) in 2.8
Obsolete (compiler warning) in 2.7.5
Obsolete (compiler warning) in 2.7
Obsolete (compiler warning) in 2.6
Obsolete (compiler warning) in 2.5
Obsolete (compiler warning) in 2.4

See Also

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