Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

PIServer.Connect Method (String)

  • Last UpdatedNov 18, 2025
  • 2 minute read
PIServer.Connect Method (String)
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

ExceptionCondition
PIConnectionExceptionA connection to the PI Data Archive server cannot be made.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0

See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in