AddPIUnitBatchWithGUID Method (PIModule3)

             

Creates and adds a PIUnitBatch to the server for this PIModule with an optional GUID.

 

Syntax

object.AddPIUnitBatchWithGUID strBatchID, varProduct, varStartTime, [varEndTime], [varGUID]

The AddPIUnitBatchWithGUID method syntax has these parts:

Part

Description

object

An object expression that evaluates to the PIModule object.

strBatchID

A string containing the batch identifier (BatchID).

varProduct

A VARIANT containing the Product assigned to the PIUnitBatch.

varStartTime

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

varEndTime

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

varGUID

Optional VARIANT for the GUID for to the PIUnitBatch 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)

 

If successful, this method returns the created PIUnitBatch object. If a GUID was passed, the object will have that GUID for its UniqueID. The PIModule must be configured as a PIUnit for this method to work; see the IsPIUnit property.

 

PIUnitBatch objects represent activity on specific equipment, therefore, they are always created on a PIModule.

 

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