AddWithGUID Method (IPITransferRecordDB2 interface)

             

Adds a PITransferRecord object to the server PITransferRecordDB with an optional passed GUID. A PITransferRecord object is returned.

 

Syntax

object.AddWithGUID Source, Destination, StartTime, [EndTime], [varGUID]

The AddWithGUID method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PITransferRecordDB object.

Source

An existing PIUnitBatch, PIBatch, or PIModule object which represents the source of material used in transfer.

Destination

An existing PIUnitBatch, PIBatch, or PIModule object which represents the destination of material used in transfer.

StartTime

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

EndTime

Optional VARIANT representing the end time of the PITransferRecord . The VARIANT may be a PITime, DATE, String, or numeric. Interpretation of DATE, strings and numerics is consistent with PITime's interpretation. Normally a PITransferRecord is created at the start of the transfer 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)

 

PITransferRecord objects, as well as the time series batch objects PIBatch, PICampaign, and PIUnitBatch 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