PIServer.Connect Method (String)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Connects to the server using the specified Access Token to allow sending and retrieving data.
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void Connect( string accessToken )
Public Sub Connect ( accessToken As String ) Dim instance As PIServer Dim accessToken As String instance.Connect(accessToken)
public: void Connect( String^ accessToken )
member Connect : accessToken : string -> unit
Parameters
- accessToken
- Type: SystemString
The Access Token to use when connecting to the server.
Exceptions
| Exception | Condition |
|---|---|
| PIConnectionException | A connection to the PI Data Archive server cannot be made. |