AFEventFrame.FindEventFrames Method (AFDatabase, AFEventFrame, Object, Int32, Int32, AFEventFrameSearchMode, String, String, AFCategory, AFElementTemplate, AFElementTemplate, Boolean)
- Last UpdatedNov 18, 2025
- 6 minute read
- PI System
- AF SDK 2024 R2
- Developer
Note: This API is now obsolete.
Retrieves a paged list of AFEventFrame objects limited to the specified
count beginning at the requested time in the specified direction that match the
specified filtering conditions including referenced element template filter.
Namespace: OSIsoft.AF.EventFrame
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[BrowsableAttribute(false)] [ObsoleteAttribute("This method has been replaced by the 'AFEventFrameSearch' class using the 'Root', 'Start', 'Name', 'ElementName', 'Category', 'Template', and 'ElementReferenceTemplate' filters.")] public static AFNamedCollectionList<AFEventFrame> FindEventFrames( AFDatabase database, AFEventFrame searchRoot, Object startTime, int startIndex, int maxCount, AFEventFrameSearchMode searchMode, string nameFilter, string referencedElementNameFilter, AFCategory eventFrameCategory, AFElementTemplate eventFrameTemplate, AFElementTemplate referencedElementTemplate, bool searchFullHierarchy )
<BrowsableAttribute(false)> <ObsoleteAttribute("This method has been replaced by the 'AFEventFrameSearch' class using the 'Root', 'Start', 'Name', 'ElementName', 'Category', 'Template', and 'ElementReferenceTemplate' filters.")> Public Shared Function FindEventFrames ( database As AFDatabase, searchRoot As AFEventFrame, startTime As Object, startIndex As Integer, maxCount As Integer, searchMode As AFEventFrameSearchMode, nameFilter As String, referencedElementNameFilter As String, eventFrameCategory As AFCategory, eventFrameTemplate As AFElementTemplate, referencedElementTemplate As AFElementTemplate, searchFullHierarchy As Boolean ) As AFNamedCollectionList(Of AFEventFrame) Dim database As AFDatabase Dim searchRoot As AFEventFrame Dim startTime As Object Dim startIndex As Integer Dim maxCount As Integer Dim searchMode As AFEventFrameSearchMode Dim nameFilter As String Dim referencedElementNameFilter As String Dim eventFrameCategory As AFCategory Dim eventFrameTemplate As AFElementTemplate Dim referencedElementTemplate As AFElementTemplate Dim searchFullHierarchy As Boolean Dim returnValue As AFNamedCollectionList(Of AFEventFrame) returnValue = AFEventFrame.FindEventFrames(database, searchRoot, startTime, startIndex, maxCount, searchMode, nameFilter, referencedElementNameFilter, eventFrameCategory, eventFrameTemplate, referencedElementTemplate, searchFullHierarchy)
public: [BrowsableAttribute(false)] [ObsoleteAttribute(L"This method has been replaced by the 'AFEventFrameSearch' class using the 'Root', 'Start', 'Name', 'ElementName', 'Category', 'Template', and 'ElementReferenceTemplate' filters.")] static AFNamedCollectionList<AFEventFrame^>^ FindEventFrames( AFDatabase^ database, AFEventFrame^ searchRoot, Object^ startTime, int startIndex, int maxCount, AFEventFrameSearchMode searchMode, String^ nameFilter, String^ referencedElementNameFilter, AFCategory^ eventFrameCategory, AFElementTemplate^ eventFrameTemplate, AFElementTemplate^ referencedElementTemplate, bool searchFullHierarchy )
[<BrowsableAttribute(false)>] [<ObsoleteAttribute("This method has been replaced by the 'AFEventFrameSearch' class using the 'Root', 'Start', 'Name', 'ElementName', 'Category', 'Template', and 'ElementReferenceTemplate' filters.")>] static member FindEventFrames : database : AFDatabase * searchRoot : AFEventFrame * startTime : Object * startIndex : int * maxCount : int * searchMode : AFEventFrameSearchMode * nameFilter : string * referencedElementNameFilter : string * eventFrameCategory : AFCategory * eventFrameTemplate : AFElementTemplate * referencedElementTemplate : AFElementTemplate * searchFullHierarchy : bool -> AFNamedCollectionList<AFEventFrame>
Parameters
- database
- Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects. - searchRoot
- Type: OSIsoft.AF.EventFrameAFEventFrame
The root object to start the search. If , then the search starts at the AFDatabase. - startTime
- Type: SystemObject
An object representing the starting time to begin the search. The search may compare against either the StartTime or EndTime of the event frame based on the searchMode parameter. 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 the object's QueryDate. - startIndex
- Type: SystemInt32
The starting index (zero based) of the items to be returned. - maxCount
- Type: SystemInt32
The maximum number of event frames to be returned. - searchMode
- Type: OSIsoft.AF.EventFrameAFEventFrameSearchMode
Indicates the direction in time from the StartTime or EndTime to proceed when returning event frames. - nameFilter
- Type: SystemString
If not an empty string, only event frames which match the supplied filter on their name property will be returned. - referencedElementNameFilter
- Type: SystemString
The name filter string of an AFElement in the event frame's ReferencedElements collection. Uses same filtering rules as specified for the nameFilter parameter. To obtain an exact match to a specific element, specify the element's ID using a format that includes the opening and closing braces, such as ID.ToString("B"). - eventFrameCategory
- Type: OSIsoft.AFAFCategory
Specify that returned event frames must have this category. To not filter by event frame category, then specify for this parameter. - eventFrameTemplate
- Type: OSIsoft.AF.AssetAFElementTemplate
Specify that returned event frames must have this template or a template derived from this template. To not filter by event frame template, then specify for this parameter. - referencedElementTemplate
- Type: OSIsoft.AF.AssetAFElementTemplate
Specify that returned event frames must have an AFElement in the event frame's ReferencedElements collection must have this template or a template derived from this template. To not filter by a referenced element template, then specify for this parameter. - searchFullHierarchy
- Type: SystemBoolean
Specifies if the search should include objects nested further than the immediate children of the searchRoot.
Return Value
Type: AFNamedCollectionListAFEventFrameReturns the list containing the specified page of AFEventFrame objects which match the search criteria.
Exceptions
| Exception | Condition |
|---|---|
| NotSupportedException | If the referencedElementTemplate parameter is not , then this exception will be thrown when searching on a version of the PI AF Server before 2.6. |
Remarks
An event frame must be saved to the server using ApplyChanges or CheckIn before it will be returned by this find method. This method will return all event frames from the specified time up to the specified maximum count.
This will only return objects of type AFEventFrame. Types of event frames that inherit from AFEventFrame will not be returned. Use the specific find methods to return types of event frames that inherit from AFEventFrame.
Version Information
AFSDK
Supported in: 2.8.5, 2.8, 2.7.5, 2.7, 2.6Obsolete (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