PIPoint.FindPIPointsAsync Method (PIServer, String, Boolean, IEnumerable(String), AFSearchTextOption, CancellationToken)
- Last UpdatedNov 18, 2025
- 4 minute read
- PI System
- AF SDK 2024 R2
- Developer
Find an enumerable list of PIPoint objects that match the specified query string.
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static Task<IEnumerable<PIPoint>> FindPIPointsAsync( PIServer piServer, string query, bool searchNameAndDescriptor, IEnumerable<string> attributeNames = null, AFSearchTextOption searchOption = AFSearchTextOption.ExactMatch, CancellationToken cancellationToken = default )
Public Shared Function FindPIPointsAsync ( piServer As PIServer, query As String, searchNameAndDescriptor As Boolean, Optional attributeNames As IEnumerable(Of String) = Nothing, Optional searchOption As AFSearchTextOption = AFSearchTextOption.ExactMatch, Optional cancellationToken As CancellationToken = Nothing ) As Task(Of IEnumerable(Of PIPoint)) Dim piServer As PIServer Dim query As String Dim searchNameAndDescriptor As Boolean Dim attributeNames As IEnumerable(Of String) Dim searchOption As AFSearchTextOption Dim cancellationToken As CancellationToken Dim returnValue As Task(Of IEnumerable(Of PIPoint)) returnValue = PIPoint.FindPIPointsAsync(piServer, query, searchNameAndDescriptor, attributeNames, searchOption, cancellationToken)
public: static Task<IEnumerable<PIPoint^>^>^ FindPIPointsAsync( PIServer^ piServer, String^ query, bool searchNameAndDescriptor, IEnumerable<String^>^ attributeNames = nullptr, AFSearchTextOption searchOption = AFSearchTextOption::ExactMatch, CancellationToken cancellationToken = CancellationToken() )
static member FindPIPointsAsync : piServer : PIServer * query : string * searchNameAndDescriptor : bool * ?attributeNames : IEnumerable<string> * ?searchOption : AFSearchTextOption * ?cancellationToken : CancellationToken (* Defaults: let _attributeNames = defaultArg attributeNames null let _searchOption = defaultArg searchOption AFSearchTextOption.ExactMatch let _cancellationToken = defaultArg cancellationToken new CancellationToken() *) -> Task<IEnumerable<PIPoint>>
Parameters
- piServer
- Type: OSIsoft.AF.PIPIServer
The PIServer to search for the desired PIPoint objects. - query
- Type: SystemString
A query string specifying the conditions to be used to find the desired PIPoint objects. See PIPoint Query Syntax for more information. - searchNameAndDescriptor
- Type: SystemBoolean
This parameter is effective if there is a query filter without a name, and the Tag attribute filter name as well as the Descriptor attribute filter name are not specified. Otherwise, this parameter will be ignored. If then both of these attributes will be searched using the query value without a name. If then only the Tag attribute will be searched using the query value without a name. - attributeNames (Optional)
- Type: System.Collections.GenericIEnumerableString
The list of PIPoint attribute names to be loaded from the server as the PIPoint objects are found. The list of PIPoint attribute names can be obtained from the PIPointClass.GetAttributes method or the PICommonPointAttributes class. The GetAttribute(String) method can be used to access the loaded attribute values. If , then no attribute values are loaded for the returned PIPoints. - searchOption (Optional)
- Type: OSIsoft.AF.SearchAFSearchTextOption
The search option to be applied to the Tag query filter. If the Tag attribute name is not in the query, then this parameter will be ignored. - cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
A cancellation token used to abort processing before completion. Passing the default CancellationToken.None will run to completion or until the PIConnectionInfo.OperationTimeOut period elapses.
Return Value
Type: TaskIEnumerablePIPointReturns a task whose result is the enumerable list of PIPoint objects matching the specified query.
Exceptions
| Exception | Condition |
|---|---|
| AggregateException | Asynchronous methods throw AggregateException on failure which will contain one or more exceptions containing the failure. |
Remarks
This method finds an enumerable list of PIPoint objects from the specified query string. The query string is parsed to generate query conditions to be passed to the FindPIPoints(PIServer, IListIEnumerablePIPointQuery, IEnumerableString) method. If the conditions are mutually exclusive, then nothing will be returned. See PIPoint Query Syntax for a complete description of the query syntax.
The points are returned from the server in blocks as the client is iterating through the list. When you stop iterating the returned list, the remaining points are not retrieved from the server.
| A PI Point attribute may only be referenced one time per FindPIPoints call. Referencing a PI Point attribute multiple times will result in an error. |
| This call might use a background task to complete some of its work. See the Threading Overview for some matters to consider when execution transitions to another thread. |