1 Reply Latest reply on Jul 15, 2014 9:38 AM by Gregor

    Programmatically adding PI Unit Batches to a Batch Trend


      I have a Batch Trend control in a ProcessBook display. I would like to programmatically do the following things:
      - Search and find Unit Batches
      - Add Unit Batches to the Batch Trend Display.
      - Remove Unit Batches from the Batch Trend display
      - If possible, control the pen color of the individual batches on the Batch Trend Display.


      Does anyone have any example code of performing these tasks in Processbook? The 'PI Batch View Programming Help' document does not contain anything useful.

        • Re: Programmatically adding PI Unit Batches to a Batch Trend

          Hello Roland,


          There are answers to your questions but I am doing hard bringing them into a context because I don't really understand what you are trying to achieve. The functionality you are asking for is built in with the Batch Group symbol.


          For the Unit Batch search, are you intending to use the built in SearchDialog or what is your use case? PI SDK Programming Reference has an example about how to search for Unit Batches. Please lookup the manuals index for "PIModule.PIUnitBatchSearch".


          PI BatchView Programming Reference has sample code on using the FixedBatches property of PIBatchTrendDef. Adding / Removing Batches from the Trend means modifying PIBatchTrendDef.


          For your last question, please search PI BatchView Programming Reference for "color".