AFCollective.SwitchMember Method (AFConnectionPreference)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
The SwitchMember method is used to change the currently connected
member of the collective using default credentials.
Namespace: OSIsoft.AF.Collective
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void SwitchMember( AFConnectionPreference preference = AFConnectionPreference.Any )
Public Sub SwitchMember ( Optional preference As AFConnectionPreference = AFConnectionPreference.Any ) Dim instance As AFCollective Dim preference As AFConnectionPreference instance.SwitchMember(preference)
public: void SwitchMember( AFConnectionPreference preference = AFConnectionPreference::Any )
member SwitchMember : ?preference : AFConnectionPreference (* Defaults: let _preference = defaultArg preference AFConnectionPreference.Any *) -> unit
Parameters
- preference (Optional)
- Type: OSIsoft.AFAFConnectionPreference
The connection preference to use when determining which member of the AFCollective is selected for the connection. The current connection failover behavior is not modified. Use Any to switch to the next collective member based upon the current connection's failover behavior.
Remarks
This method will change the currently connected member of the collective based upon the
specified preference and the current
Priority settings of the collective members
for the current connection. This method will not modify the current failover behavior
of the AFCollective established with the initial connection to the collective.