AFAttributeSearch Constructor (AFDatabase, String, AFSearchMode, AFTime, AFTime, String)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Creates an instance of an AFAttributeSearch to search
for AFAttribute objects using the specified AFSearchMode,
times and optional search query string.
Namespace: OSIsoft.AF.Search
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFAttributeSearch( AFDatabase database, string name, AFSearchMode searchMode, AFTime startTime, AFTime endTime, string query = null )
Public Sub New ( database As AFDatabase, name As String, searchMode As AFSearchMode, startTime As AFTime, endTime As AFTime, Optional query As String = Nothing ) Dim database As AFDatabase Dim name As String Dim searchMode As AFSearchMode Dim startTime As AFTime Dim endTime As AFTime Dim query As String Dim instance As New AFAttributeSearch(database, name, searchMode, startTime, endTime, query)
public: AFAttributeSearch( AFDatabase^ database, String^ name, AFSearchMode searchMode, AFTime startTime, AFTime endTime, String^ query = nullptr )
new : database : AFDatabase * name : string * searchMode : AFSearchMode * startTime : AFTime * endTime : AFTime * ?query : string (* Defaults: let _query = defaultArg query null *) -> AFAttributeSearch
Parameters
- database
- Type: OSIsoft.AFAFDatabase
The AFDatabase to be searched by the query. This parameter will initialize the Database property. - name
- Type: SystemString
The SearchName associated with the created search object. This is only informational and does not affect the searches. - searchMode
- Type: OSIsoft.AF.AssetAFSearchMode
The AFSearchMode to be converted into a search query which indicates the direction in time from the StartTime or EndTime to proceed when returning event frames. - startTime
- Type: OSIsoft.AF.TimeAFTime
The starting time to be used in the generated search query. The startTime must be less than or equal to the endTime. The searchMode parameter will control whether the comparison will be performed against the event frame's StartTime or EndTime. - endTime
- Type: OSIsoft.AF.TimeAFTime
The ending time to be used in the generated search query. The endTime must be greater than or equal to the startTime. The searchMode parameter will control whether the comparison will be performed against the event frame's StartTime or EndTime. - query (Optional)
- Type: SystemString
The optional search query string. If specified, this will add additional search filters to the generated search query in addition to the ones for the specified mode and times. Strings will be interpreted with the Parse(String, AFTime, IFormatProvider) method so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the database's QueryDate.
Remarks
This constructor will create a search query based upon the specified searchMode
and times. The times in the query string will have the correct operators specified for the
Start and/or End filters. The optional
query will be used to add additional search filters to the search query.
These parameters will be used to create tokens and initialize the TokenCollection property.