2 Replies Latest reply on May 26, 2016 9:09 PM by statsoft

    PIUnitBatchSearch in the PI-SDK

    statsoft

      In the PI-SDK, as a method of the PIModuleDB object, is a method called PIUnitBatchSearch.  This method appears to be the method used in PI-SMT PIUnitBatch Search.  The SDK method has more parameters than the dialog has fields.  The search dialog in PI-SMT has a field called "PIUnit".  The search method does not contain a parameter that seems to indicate that it maps to the PIUnit field on the search dialog.

       

      How do the fields on this search dialog map to the fields of the method?  Most of them are obvious but others are up for interpretation.  Thanks!

       

      PIUnitBatchSearch Method (PIModuleDB object)

       

      The PIUnitBatchSearch method syntax has these parts:

       

      Part

      Description

      object

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

      bstrModuleNameMask

      Wildcard string of a PIModule name to match. Defaults to
      “*”.

      bstrBatchIDMask

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

      bstrProductMask

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

      bstrProcedureMask

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

      bstrSubBatchMask

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

      AsynchStatus

      Optional asynchronous status object (PIAsyncStatus).

      varUnitBatchUniqueID

      Optional unique id of PIUnitBatch. Used to find specific unit batch.
      Overrides all masks.

      varModuleUniqueID

      Optional unique id of PIModule. Used to find unit batches created on a
      specific module. Overrides the module name mask.

        • Re: PIUnitBatchSearch in the PI-SDK
          asorokina

          PIUnit is matching bstrModuleNameMask (I guess the naming is coming from the fact that PI Units are based on PI Modules).

           

          There are two overloads of the PIUnitBatchSearch Method:

          PIUnitBatchSearch Method (PIModuleDB object), and

          PIUnitBatchSearch Method (PIModule object)

           

          Based on the Search for PIUnitBatches chapter of the PI Server documentation, it looks like the way this search is implemented in PI SMT is that the first overload method is used if the PI Server name is set and PIUnit parameter is set to a name mask. The latter overload method is used if the PIUnit parameter contains a full path to the module that represents PIUnit.

          3 of 3 people found this helpful