Context Variables (PIGlobalRestorer object)

              

 

The RestoreObject and RestoreServers methods of PIGlobalRestorer object allow the passing of a collection of context variables to assist in restoring the object or severs from the persistence string. These variables are passed in a NamedValues collection. The Name of each NamedValue is the Context Variable name. The Value is the Context Variable value.

 

Below is a table of the supported context variables names and their values.

Name

Value

SDK

PISDK object. You should pass this if you want to use a PISDK object other than one associated with your thread.

Server

Server object. You should pass this if you want to override the server in the persistence string.

PreferName

Pass this with a value of True if you want to prefer the name for objects (like Server and PIPoint) that have both the name and the ID stored in the persistence string.

TopLevelServerOnly

Pass this with a value of True if you want to only return the Server for the the parent object from a persistence string (for RestoreObject) or the object itself (for RestoreServers). This useful when an object like a PIAlias can have references to tags from another server as its DataSource. To restore the PIModule parent of the PIAlias, you only need the Server for the PIModule even if the PIAlias has a DataSource that comes from a different server.

QueryDate

Pass this to retrieve a specific value of a PIModule. The value at or before the QueryDate will be returned. If this variable is not passed, the current value of the PIModule will be restored.

  

 

 

Enabling Operational Intelligence