PIBatchSearch Method (PIBatchDB object)

             

Searches the PI Batch Database for matching PIBatch objects.

 

Syntax

object.PIBatchSearch varSearchStart, varSearchEnd, bstrBatchIDMask, bstrProductMask, bstrRecipeMask, [pAsynchStatus], [varPIBatchUniqueID]

The PIBatchSearch method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIBatchDB 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.

bstrBatchIDMask

Wildcard string of BatchID to match; defaults to "*".

bstrProductMask

Wildcard string of Product to match; defaults to "*".

bstrRecipeMask

Wildcard string of Recipe name to match; defaults to "*".

pAsynchStatus

Optional asynchronous status object (PIAsyncStatus ).

varPIBatchUniqueID

Optional exact Unique ID of PIBatch object.

 

Remarks

Returns a PIBatchList of matching PIBatch objects. The PIBatch primary index is time; specifying small ranges of time will result in fastest performance.

 

Any PIBatch 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 PIBatch's (PIBatch's with no end time set) always match search times which include current time.

 

All three masks default to the wildcard character "*". Therefore just specifying search start and end returns all PIBatch 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 varPIBatchUniqueID is used to retrieve a specific PIBatch 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.

 

If no PIBatch's are found that match the search criteria, an empty list is returned.

 

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