AddWithGUID Method (IPIBatchDB2 interface)

             

Adds a PIBatch object to the server PIBatchDB  with an optional passed GUID. A PIBatch object is returned.

 

Syntax

object.AddWithGUID strBatchID, varProduct, varRecipe, varStartTime, [varEndTime], [varGUID]

The AddWithGUID method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIBatchDB object.

strBatchID

BatchID assigned of PIBatch.

varProduct

A VARIANT containing the Product assigned to the PIBatch.

varRecipe

A VARIANT containing the Recipe assigned to the PIBatch.

varStartTime

A VARIANT representing the start time of the PIBatch. The VARIANT may be a PITime, DATE, String, or numeric. Interpretation of DATE, strings and numerics is consistent with PITime's interpretation.

verEndTime

Optional VARIANT representing the end time of the PIBatch. The VARIANT may be a PITime, DATE, String, or numeric. Interpretation of DATE, strings and numerics is consistent with PITime's interpretation. Normally a PIBatch is created at the start of the batch therefore the end time is not known.

varGUID

Optional VARIANT for the GUID for to the PIBatch being added.

 

Remarks

WARNING: Using this interface improperly can cause data corruption on the Server. The GUID passed must not be the same as any other GUID used by the Server

 

Here are two Windows methods for properly creating a GUID:

CoCreateGuid (COM: unmanaged code)

System.Guid class (.NET)

 

PIBatch objects, as well as the time series batch objects, PICampaign, PIUnitBatch and PITransferRecord, are stored in the PI Data Archive. Therefore creation requires that the target archive be the primary archive or the target archive was created after the installation of PI 3.3.

 

Trappable Errors

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

Error

Description

pseNOGENSERVER

The underlying server abstraction layer could not be accessed.

 

Enabling Operational Intelligence