PISystem.CreatePISystem Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Create a new PISystem instance based upon the specified host address.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static PISystem CreatePISystem( string host, bool forceNewInstance = false )
Public Shared Function CreatePISystem ( host As String, Optional forceNewInstance As Boolean = false ) As PISystem Dim host As String Dim forceNewInstance As Boolean Dim returnValue As PISystem returnValue = PISystem.CreatePISystem(host, forceNewInstance)
public: static PISystem^ CreatePISystem( String^ host, bool forceNewInstance = false )
static member CreatePISystem : host : string * ?forceNewInstance : bool (* Defaults: let _forceNewInstance = defaultArg forceNewInstance false *) -> PISystem
Parameters
- host
- Type: SystemString
The name of the host machine where the PI AF Server for this PISystem is executing. - forceNewInstance (Optional)
- Type: SystemBoolean
Set to to force the creation of an independent PISystem object for the current user with a separate cache.
Return Value
Type: PISystemReturns the PISystem instance based upon the specified host address for the current user.
Remarks
This method will return a PISystem instance based upon the specified host address for the current user. If the same user calls this method multiple times, the same instance of the PISystem is returned. If a different user calls this method, then a new instance of the PISystem is returned that is independent of the previous user's object.
It is important to call this method to acquire the correct PISystem for a user in a multi-user application before accessing SDK objects. This will ensure the correct object cache and connection to the server is used for the user.