PISystems Class
- Last UpdatedNov 18, 2025
- 12 minute read
- PI System
- AF SDK 2024 R2
- Developer

Inheritance Hierarchy
OSIsoft.AFPISystems
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public sealed class PISystems : IList<PISystem>, ICollection<PISystem>, IEnumerable<PISystem>, IEnumerable, IAFList, IList, ICollection, IAFChangedEvent
Public NotInheritable Class PISystems Implements IList(Of PISystem), ICollection(Of PISystem), IEnumerable(Of PISystem), IEnumerable, IAFList, IList, ICollection, IAFChangedEvent Dim instance As PISystems
public ref class PISystems sealed : IList<PISystem^>, ICollection<PISystem^>, IEnumerable<PISystem^>, IEnumerable, IAFList, IList, ICollection, IAFChangedEvent
[<SealedAttribute>] type PISystems = class interface IList<PISystem> interface ICollection<PISystem> interface IEnumerable<PISystem> interface IEnumerable interface IAFList interface IList interface ICollection interface IAFChangedEvent end
The PISystems type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| PISystems |
Initializes a new instance of the PISystems collection.
| |
| PISystems(Boolean) |
Initializes a new instance of the PISystems collection with
an option to create an independent cache.
| |
| PISystems(ClaimsIdentity, Boolean) |
Initializes a new instance of the PISystems collection with
for the ClaimsIdentity user with an option to create an
independent cache.
| |
| PISystems(String, String, Boolean) |
Initializes a new instance of the PISystems collection with
for the specified client Id with an option to create an
independent cache.
|
Properties
| Name | Description | |
|---|---|---|
| Count |
Gets the number of items actually contained in the collection.
| |
| CurrentUserId |
Gets the Id for the PISystems current identity.
| |
| CurrentUserName |
Gets the name for the PISystems current identity.
| |
| DefaultPISystem |
The default PISystem configured in the AF SDK.
| |
| DirectoryOptions |
The directory options used when looking up a PISystem in the collection.
| |
| Identity |
This read-only property contains identity of the object.
| |
| ItemGuid |
Gets the item with the specified id.
| |
| ItemInt32 |
Gets or sets the item at the specified index.
| |
| ItemString |
Returns the specified object from the collection by name.
| |
| Version |
Read-only property contains a string that uniquely identifies the
current client version of the SDK.
|
Methods
| Name | Description | |
|---|---|---|
| Add |
Registers a new PISystem to the list of known systems on the local machine.
| |
| Clear |
Unregisters all existing PISystem entries from the list of known
PISystems on the local machine.
| |
| Contains(Guid) |
This method determines whether the collection contains a specific item referenced by id.
| |
| Contains(String) |
This method determines whether the collection contains a specific item referenced by name.
| |
| CopyTo |
Copies the entire collection to a compatible one-dimensional Array,
starting at the specified index of the target array.
| |
| DisconnectAll |
Disconnects all PISystems that are currently connected.
| |
| Equals |
Determines whether the specified Object is equal to the current object.
(Overrides ObjectEquals(Object).) | |
| GetEnumerator |
Returns an enumerator that iterates through the collection.
| |
| 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.
(Overrides ObjectGetHashCode.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| IndexOf |
Searches for the specified object and returns the zero-based index of the first
occurrence within the entire collection.
| |
| Refresh |
Refresh the collection to the list of known systems on the local machine
including disconnected systems.
| |
| Refresh(Boolean) |
Refresh the collection to the list of known systems on the local machine with
the option to refresh only connected systems.
| |
| Refresh(Boolean, Boolean) |
Refresh the collection to the list of known systems on the local machine with
the option to refresh only connected systems and/or database-level objects.
| |
| Remove(Guid) |
Unregisters an existing PISystem with the specified unique identifier.
| |
| Remove(String) |
Unregisters an existing PISystem with the specified name.
| |
| Remove(PISystem) |
Unregisters the specified PISystem.
| |
| RemoveAt |
Unregisters an existing PISystem by removing the entry from the list of known
PISystems on the local machine.
| |
| SetApplicationIdentity |
Set the client application identity to identify an application to the servers
to which it connects.
| |
| Sort |
Sorts the items in the entire collection using the default comparer.
| |
| Sort(IComparerPISystem) |
Sorts the items in the entire collection using the specified comparer.
| |
| Sort(Int32, Int32, IComparerPISystem) |
Sorts the items in a range of items in the collection using the specified comparer.
| |
| ToString |
Returns a String that represents the current object.
(Overrides ObjectToString.) |
Events
| Name | Description | |
|---|---|---|
| Changed |
Event is raised when the object or one of its sub-objects is changed.
|
Operators
| Name | Description | |
|---|---|---|
| Equality |
The equality operator (==) compares its operands to determine if they are equal.
| |
| Inequality |
The inequality operator (!=) compares its operands to determine if they are not equal.
|
Extension Methods
| Name | Description | |
|---|---|---|
| AggregatePISystem |
Performs all requested aggregates on the specified items.
(Defined by AFAggregate.) | |
| AggregateAsyncPISystem |
Performs all requested aggregates on the specified items asynchronously.
(Defined by AFAggregate.) | |
| BinnedSummaryPISystem, TBin |
Generates a summary broken down by the specified bins for items matching the search criteria.
(Defined by AFAggregate.) | |
| BinnedSummaryAsyncPISystem, TBin |
Generates a summary broken down by the specified bins for items matching the search criteria asynchronously.
(Defined by AFAggregate.) | |
| ChunkedByPISystem |
This extension method breaks up search results into chunks to make it easier to
page through and process IEnumerableT collections in chunks.
(Defined by AFSDKExtension.) | |
| FrequencyDistributionPISystem |
Generates a frequency distribution for the specified items.
(Defined by AFAggregate.) | |
| FrequencyDistributionAsyncPISystem |
Generates a frequency distribution for the specified items asynchronously.
(Defined by AFAggregate.) | |
| GroupedSummaryPISystem |
Generates a summary broken down by group for the specified items.
(Defined by AFAggregate.) | |
| GroupedSummaryAsyncPISystem |
Generates a histogram for the specified items asynchronously.
(Defined by AFAggregate.) | |
| HistogramPISystem, TBin |
Generates a histogram for the specified items with the specified weighting.
(Defined by AFAggregate.) | |
| HistogramAsyncPISystem, TBin |
Generates a histogram for the specified items with the specified weighting asynchronously.
(Defined by AFAggregate.) | |
| SummaryPISystem(String, AFSummaryTypes) | Overloaded.
Summarizes the specified items.
(Defined by AFAggregate.) | |
| SummaryPISystem(String, AFSummaryTypes, String) | Overloaded.
Summarizes the specified items with the specified weighting.
(Defined by AFAggregate.) | |
| SummaryAsyncPISystem(String, AFSummaryTypes, CancellationToken) | Overloaded.
Summarizes the specified items asynchronously.
(Defined by AFAggregate.) | |
| SummaryAsyncPISystem(String, AFSummaryTypes, String, CancellationToken) | Overloaded.
Summarizes the specified items with the specified weighting asynchronously.
(Defined by AFAggregate.) |
Remarks
This is the list of known PISystems on the workstation for client applications. This list of PISystems can be manipulated with the methods of this object. For example, the Add(String) method is used to add a PISystem to this workstation. This allows the client to connect to an existing PISystem that was previously installed on the network. Each PISystem also maintains a list of alias or alternate names (see PISystem.AliasNames) that can be used to lookup the PISystem in this collection. The DirectoryOptions controls the behavior when looking up items in the collection.
The PISystems list, as well as other AF SDK configuration information is stored in the file AFSDK.config, found in the OSIsoft\AF sub-directory located in the common application directory (location varies by operating system). Note that if the AFSDK.config file is first found in the current user's roaming application directory (location varies by operating system), this file will be used instead, and all operations on the PI Systems list will be specific for this user only. Note there is no provision in the AF SDK for creating a per-user configuration file. The creation of this file must occur manually via the file system.
The PISystems collection is the top level of the AF SDK hierarchy. Most accesses to AF SDK objects start with a reference to this object. Multiple instances of this object can be created in an application, but all instances within the same application reference the same collection of PISystem objects. This means that within the same application, changes made to an object within a PISystem will be seen by all other instances of the PISystems object. Other applications will not see the changes until they have been saved to persistent storage. The DisconnectAll method should be called before the application exits.
When programming in a .NET managed language, you must add a reference to the OSIsoft.AFSDK assembly to the project (from the 'Project/References' menu item). AF SDK objects are located within the OSIsoft.AF namespace (for example, OSIsoft.AF.PISystem), or one of its sub-namespaces (for example, OSIsoft.AF.Asset.AFElement).
Examples
PISystems myPISystems = new PISystems(); // Display information for Default PISystem AFConnectionInfo myConnectionInfo = myPISystems.DefaultPISystem.ConnectionInfo; Console.WriteLine("Name of Default PISystem = {0}", myPISystems.DefaultPISystem.Name); Console.WriteLine("Description of Default PISystem = {0}", myPISystems.DefaultPISystem.Description); Console.WriteLine("Host used to connect to Default PISystem = {0}", myConnectionInfo.Host); Console.WriteLine("Port used to connect to Default PISystem = {0}", myConnectionInfo.Port); Console.WriteLine("Protocol used to connect to Default PISystem = {0}", myConnectionInfo.Protocol); Console.WriteLine(); // Display the version of the PISystems Console.WriteLine("Version of the PISystems = {0}", myPISystems.Version); // Display the number of PISystems Console.WriteLine("PISystem count = {0}", myPISystems.Count); // Display PISystem information foreach (PISystem sys in myPISystems) { Console.WriteLine(" Name of PISystem = {0}", sys.Name); Console.WriteLine(" Description of PISystem = {0}", sys.Description); Console.WriteLine(" UniqueID of PISystem = {0}", sys.UniqueID); Console.WriteLine(); } // Add a new PISystem PISystem newSys = myPISystems.Add("NewPISystem"); newSys.ConnectionInfo.Host = "localhost";
Dim myPISystems As New PISystems() ' Display information for Default PISystem Dim myConnectionInfo As AFConnectionInfo = myPISystems.DefaultPISystem.ConnectionInfo Console.WriteLine("Name of Default PISystem = {0}", myPISystems.DefaultPISystem.Name) Console.WriteLine("Description of Default PISystem = {0}", myPISystems.DefaultPISystem.Description) Console.WriteLine("Host used to connect to Default PISystem = {0}", myConnectionInfo.Host) Console.WriteLine("Port used to connect to Default PISystem = {0}", myConnectionInfo.Port) Console.WriteLine("Protocol used to connect to Default PISystem = {0}", myConnectionInfo.Protocol) Console.WriteLine() ' Display the version of the PISystems Console.WriteLine("Version of the PISystems = {0}", myPISystems.Version) ' Display the number of PISystems Console.WriteLine("PISystem count = {0}", myPISystems.Count) ' Display PISystem information For Each sys As PISystem In myPISystems Console.WriteLine(" Name of PISystem = {0}", sys.Name) Console.WriteLine(" Description of PISystem = {0}", sys.Description) Console.WriteLine(" UniqueID of PISystem = {0}", sys.UniqueID) Console.WriteLine() Next ' Add a new PISystem Dim newSys As PISystem = myPISystems.Add("NewPISystem") newSys.ConnectionInfo.Host = "localhost"
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.