PIUnitBatchSearch Method (PIModule object)

             

Searches for PIUnitBatch's created on this PIModule.

 

Syntax

object.PIUnitBatchSearch varSearchStartTime, varSearchEndTime, bstrBatchIDMask, bstrProductMask, bstrProcedureMask, bstrSubBatchMask, [pAsynchStatus], [varUnitBatchUniqueID]

 

The PIUnitBatchSearch method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIModule object.

varSearchStart

A VARIANT containing the search start time. The VARIANT may be a PITime, DATE, String, or numeric. Interpretation of DATE, strings and numerics is consistent with PITime's interpretation. NOTE:  The minimum start time passed should be PITime.UTCSeconds = 1. 

varSearchEnd

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

strBatchIDMask

Wildcard string of BatchID to match. Defaults to “*”.

strProductMask

Wildcard string of Product to match. Defaults to “*”.

strProcedureMask

Wildcard string of ProcedureName to match. Defaults to “*”.

strSubBatchMask

Wildcard string of PISubBatch name to match. Defaults to “*”.

pAsynchStatus

Optional asynchronous status object (PIAsyncStatus ).

varUnitBatchUniqueID

Optional UniqueID of PIUnitBatch. Used to find a specific unit batch. Overrides all masks.

 

Remarks

Returns a PIUnitBatchList of matching PIUnitBatch objects. PIUnitBatch objects have a primary index on time and PIModule, so specifying small ranges of time and a specific PIModule name will result in fastest performance. This method is similar to the PIModuleDB.PIUnitBatchSearch method except the search is confined to a specific module.

 

Any PIUnitBatch which has an EndTime on or after the search start and a start time on or before search end matches the search time criteria. Running PIUnitBatch's (PIUnitBatch's with no end time set) always match search times which include current time.

 

All five masks default to the wildcard character "*". Therefore just specifying search start and end returns all PIUnitBatch objects over that time range.

 

The pAsynchStatus argument is used for performing asynchronous calls. If this argument is passed, the method returns immediately with an empty list. This list is protected against access (an error of pseASYNCHMODEERR will be returned) until the call is complete.

 

The argument varUnitBatchUniqueID is used to retrieve a specific PIUnitBatch object. This argument, if set, overrides the search masks including the start and end time. The search start and end time are used as a hint for where to find the object, but it is possible that the matching object may have start and/or end times outside of the time range of the search.

 

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