PIServer.Connect Method (String, String)
- Last UpdatedJan 12, 2026
- 2 minute read
- PI System
- AF SDK 3.2.0
- Developer
Connects to the server using the specified credentials to allow sending and retrieving data.
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.2.0.7
Syntax
public void Connect( string clientID, string clientSecret )
Public Sub Connect ( clientID As String, clientSecret As String ) Dim instance As PIServer Dim clientID As String Dim clientSecret As String instance.Connect(clientID, clientSecret)
public: void Connect( String^ clientID, String^ clientSecret )
member Connect : clientID : string * clientSecret : string -> unit
Parameters
- clientID
- Type: SystemString
The Client Id to use when requesting an Access Token from the Identity Server. - clientSecret
- Type: SystemString
The Client Secret to use when requesting an Access Token from the Identity Server.
Exceptions
| Exception | Condition |
|---|---|
| PIConnectionException | A connection to the PI Data Archive server cannot be made. |