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

AF SDK Reference

AFVersion.FindVersion Method

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFVersion.FindVersion Method
Gets a version of the owning object by query date and retrieval type.

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

Syntax

public AFVersion FindVersion(
	Object queryDate,
	AFQueryMode queryMode
)
Public Function FindVersion ( 
	queryDate As Object,
	queryMode As AFQueryMode
) As AFVersion

Dim instance As AFVersion
Dim queryDate As Object
Dim queryMode As AFQueryMode
Dim returnValue As AFVersion

returnValue = instance.FindVersion(queryDate, 
	queryMode)
public:
AFVersion^ FindVersion(
	Object^ queryDate, 
	AFQueryMode queryMode
)
member FindVersion : 
        queryDate : Object * 
        queryMode : AFQueryMode -> AFVersion 

Parameters

queryDate
Type: SystemObject
The query date to be used when retrieving the version of the owning object. Specify or AFTime.MaxValue for most recent versions of the objects. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on AFTime.Now.
queryMode
Type: OSIsoft.AF.AssetAFQueryMode
Determines how the queryDate parameter is treated when querying for an object version to be returned.

Return Value

Type: AFVersion
Returns the version of the owning object based upon the specified date and retrieval type. A is returned if a version cannot be found for the object.

Remarks

This method is used to find a specific version of the owner object based upon the specified query criteria.

Version Information

AFSDK


See Also

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