In this course, we make use of PI Unit Batches in a query, but the query won't return anything if batches don't exist. Rather than set up a batch interface for this example, you can manually add a PI Unit Batch to your Data Archive for a quick test.
In PI System Management Tools, we'll first make the module that will represent the unit, add a temperature alias, then make the unit batch.
Make the module:
- Connect to the correct data archive
- Navigate to Operation > Module Database
- Right click on Modules and select New
- Name the module
- Select that it's a "PIUnit" so that it becomes eligible for unit batches
- Click OK
Confirm that the icon for the module is a tank and not a block M
Create the temperature alias:
- Right click on the newly created module and select New > Alias
- Fill in the alias name, tag name, and server name
Expand the module and confirm that alias is added (you may need to right click on any white space and select Show > Alias and Property Values
Create the Unit Batch:
- Connect to the PI Data Archive that you will be querying
- Navigate to Batch > Batch Database
- Expand the Modules list; right click on the module you would like to attach the unit batch to and select "New PIUnitBatch"
- Enter Batch ID, Product, and Recipe information
- Enter a start and end time
- Click ok
Confirm that the unit batch appears in the batch search immediately
The batch should appear in SMT's batch search immediately, but to confirm that the permissions are correct from PI SQL Commander, let's query for the batch at this point.
Navigate to the pibatch catalog and right click on the piunitbatch table. Select "Execute Predefined Query" and set the batchid to what was entered in the previous step. Execute the query and confirm that the output contains the unit batch that was just created.