Add Method (PIModules collection)

             

Creates and adds a PIModule to the collection.

 

Syntax

object.Add bstrName, [EffectiveDate]

The Add method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIModules object.

bstrName

Name of module. Names must be unique within a PIModules collection.

EffectiveDate

An optional VARIANT representing the effective date of the module added. The VARIANT may be a PITime, DATE, String, or numeric. Interpretation of DATE, strings and numerics is consistent with PITime's interpretation. If not specified the effective date is set to 1-Jan-1970. 

 

Remarks

If successful, this call returns the newly created PIModule.

All PIModule objects have an EffectiveDate; the effective date is stored in the IPIVersion interface supported by the PIModule. This is the date the PIModule becomes effective. The default value of effective date, 1-Jan-1970, covers all valid PI timestamps, therefore is effective for all times.

The effective date is required to historized changes to PIModules. This allows modifications to modules while preserving the previous. PIModules retrieved from the server apply a passed QueryDate to find the proper value of the PIModule—this is the PIModule that is in-effect for the query date.

Modules added to a PIModules collection are sorted in alphabetical order by name.

 

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error

Description

pseNOGENSERVER

The parent underlying generic server object could not be retrieved.

 

Enabling Operational Intelligence