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

AF SDK Reference

PICollective Class

  • Last UpdatedNov 18, 2025
  • 7 minute read
PICollective Class
The PICollective object is used to provide the information and status about the PIServer collective.

Inheritance Hierarchy

SystemObject
  OSIsoft.AFAFObject
    OSIsoft.AF.PIPICollective

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

Syntax

[SerializableAttribute]
public sealed class PICollective : AFObject, 
	IAFChangedEvent, IEquatable<PICollective>
<SerializableAttribute>
Public NotInheritable Class PICollective
	Inherits AFObject
	Implements IAFChangedEvent, IEquatable(Of PICollective)

Dim instance As PICollective
[SerializableAttribute]
public ref class PICollective sealed : public AFObject, 
	IAFChangedEvent, IEquatable<PICollective^>
[<SealedAttribute>]
[<SerializableAttribute>]
type PICollective =  
    class
        inherit AFObject
        interface IAFChangedEvent
        interface IEquatable<PICollective>
    end

The PICollective type exposes the following members.

Properties

  NameDescription
Public property
AllowWriteValues
Indicates whether values are allowed to be written to the currently active collective member.
Public property
ConnectedMemberType
Indicates the role of the currently connected collective member.
Public property
CurrentMember
The current active collective member.
Public property
ID
Read-only property that provides a unique identifier for the object to be used for quick access that is not dependent upon the index.
(Inherited from AFObject.)
Public property
Identity
This read-only property contains identity of the object.
(Inherited from AFObject.)
Public property
IsDeleted
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.)
Public property
Members
The collection of PICollectiveMember objects that are configured for the PICollective.
Public property
PIServer
This read-only property allows access to the PIServer associated with this object.
Public property
PISystem
This read-only property allows access to the PISystem associated with this object.
(Inherited from AFObject.)
Public property
UniqueID
Read-only property that provides the collective's unique identifier as a String.
(Overrides AFObjectUniqueID.)

Methods

  NameDescription
Public method
CompareTo(Object)
Compares this instance with a specified Object.
(Inherited from AFObject.)
Public method
CompareTo(AFObject)
Compares this instance with a specified AFObject.
(Inherited from AFObject.)
Public method
Equals(Object)
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.)
Public method
Equals(AFObject)
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.)
Public method
Equals(PICollective)
Indicates whether the current object is equal to another object of the same type.
Public method
FindPrimary
Finds the primary member of the collective.
Public method
GetHashCode
Gets the hash code for this instance of the object which is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from AFObject.)
Public method
GetPath
Returns the full path to the object, using just the names.
(Inherited from AFObject.)
Public method
GetPath(AFObject)
Returns the path to the object relative from another object.
(Inherited from AFObject.)
Public method
GetPath(AFEncodeType, AFObject)
Returns the path to the object relative from another object, using the name and/or id as specified by encodeType.
(Inherited from AFObject.)
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
Persist
This method returns the persistence string for the object.
(Inherited from AFObject.)
Public method
SwitchMember(AFConnectionPreference)
The SwitchMember method is used to change the currently connected member of the collective using default credentials.
Public method
SwitchMember(PICollectiveMember)
The SwitchMember method is used to change to the specified member of the collective using default credentials.
Public method
SwitchMember(NetworkCredential, AFConnectionPreference)
The SwitchMember method is used to change the currently connected member of the collective using the specified PI User credentials.
Public method
SwitchMember(NetworkCredential, PICollectiveMember)
The SwitchMember method is used to change to the specified member of the collective using the specified PI User credentials.
Public method
SwitchMember(Boolean, IWin32Window, AFConnectionPreference)
The SwitchMember method is used to change the currently connected member of the collective with a credential prompt if necessary.
Public method
SwitchMember(Boolean, IWin32Window, PICollectiveMember)
The SwitchMember method is used to change to the specified member of the collective with a credential prompt if necessary.
Public method
SwitchMember(NetworkCredential, PIAuthenticationMode, AFConnectionPreference)
The SwitchMember method is used to change the currently connected member of the collective using the specified credentials.
Public method
SwitchMember(NetworkCredential, PIAuthenticationMode, PICollectiveMember)
The SwitchMember method is used to change to the specified member of the collective using the specified credentials.
Public method
ToString
Returns a String that represents the current object.
(Overrides AFObjectToString.)

Events

  NameDescription
Public eventCode example
Changed
Event is raised when the object or one of its sub-objects is changed.

Remarks

A PIServer collective is a group of physical PIServers (member servers) that maintain consistent configuration. A collective is accessed by a PIServer object that represents the entire collective. When a program is connected to a collective and its connection to a particular member is lost, the AF SDK will failover to another member in the collective. This behavior supports high availability of data stored in AF.

PIServer access functions are intended to work seamlessly between server collectives and single servers. However, the PIServer collective members have some behaviors that may vary between the members. The choice of member server during a connection may be influenced through the AFConnectionInfo.Preference property and properties of the PICollectiveMember. If a call is made to a method which is only supported on the primary, and the current member is a secondary, the AF SDK will attempt to open a connection to the primary for the duration of the call. The connected member will not be switched, however.

A connection to a specific server can be created using one of the PICollectiveMember.Connect Overload methods. In this case, the AF SDK will not dynamically switch the connection if a call is made to a method not supported on the member (for example, creating or modifying a point definition on a secondary)..

Note Notes to Callers
This method, property, or class is not available in the legacy .NET 3.5 version of the SDK.

Version Information

AFSDK


See Also

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