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

AF SDK Reference

PIConnectionException Class

  • Last UpdatedNov 18, 2025
  • 5 minute read
PIConnectionException Class
Represents a connection error attempting to communicate with the specified PIServer.

Inheritance Hierarchy

SystemObject
  SystemException
    SystemSystemException
      System.ServiceModelCommunicationException
        OSIsoft.AF.PIPIConnectionException
          OSIsoft.AF.PIPIAuthenticationException
          OSIsoft.AF.PIPITimeoutException

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

[SerializableAttribute]
public class PIConnectionException : CommunicationException
<SerializableAttribute>
Public Class PIConnectionException
	Inherits CommunicationException

Dim instance As PIConnectionException
[SerializableAttribute]
public ref class PIConnectionException : public CommunicationException
[<SerializableAttribute>]
type PIConnectionException =  
    class
        inherit CommunicationException
    end

The PIConnectionException type exposes the following members.

Constructors

  NameDescription
Public method
PIConnectionException
Initializes a new instance of the PIConnectionException class with a specified error message, server host address, and an optional reference to the inner exception that is the cause of this exception.

Properties

  NameDescription
Public property
Data
Gets a collection of key/value pairs that provide additional user-defined information about the exception.
(Inherited from Exception.)
Public property
HelpLink
Gets or sets a link to the help file associated with this exception.
(Inherited from Exception.)
Public property
HResult
Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.
(Inherited from Exception.)
Public property
InnerException
Gets the Exception instance that caused the current exception.
(Inherited from Exception.)
Public property
IsSecurityException
Indicates if the error indicates the user did not connect due to insufficient privileges.
Public property
Message
Gets a message that describes the current exception.
(Inherited from Exception.)
Public property
Server
The PIServer associated with the current exception.
Public property
Source
Gets or sets the name of the application or the object that causes the error.
(Inherited from Exception.)
Public property
StackTrace
Gets a string representation of the immediate frames on the call stack.
(Inherited from Exception.)
Public property
StatusCode
The status code indicating the cause of the current exception that was returned from the PIServer.
Public property
TargetSite
Gets the method that throws the current exception.
(Inherited from Exception.)

Methods

  NameDescription
Public method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public method
GetBaseException
When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
(Inherited from Exception.)
Public method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method
GetObjectData Obsolete.
Populates a SerializationInfo with the data needed to serialize the target object.
(Overrides ExceptionGetObjectData(SerializationInfo, StreamingContext).)
Public method
GetType
Gets the runtime type of the current instance.
(Inherited from Exception.)
Public method
ToString
Creates and returns a string representation of the current exception.
(Inherited from Exception.)

Extension Methods

  NameDescription
Public Extension Method
IsRetryable
This extension method will indicate if the Exception is considered retryable.
(Defined by AFSDKExtension.)

Remarks

Robust client and service applications handle CommunicationException objects that may be thrown during communication. There are also two CommunicationException-derived exception types, PIAuthenticationException and PITimeoutException that clients also often expect. Therefore, in order to prevent the generic CommunicationException handler from catching these more specific exception types, catch these exceptions prior to handling CommunicationException.

Version Information

AFSDK


See Also

TitleResults for “How to create a CRG?”Also Available in