Batch controller example - creating templates, elements and writing values

Version 3



    Following on from the Webinar: PI Web API - Batch, recently had the requirement to put together an example using the batch controller.


    The process was useful in a couple of ways:

    1. explore the batch controller features, including:

    - minimizing the requirement to track the WebID (or even know them), by utilizing responses from previous sub-requests in the same batch request

    - reduce the level of programmatic effort thanks to support for multiple requests in the same HTTP POST

    2. use the jupyter application to code and document the example. The resulting content  - marked up as html in the attached zip - can be viewed and optionally run by anyone in their own environment that meet the software requirements.

    For example, the following screenshot shows the payload for a request, syntax for the request and the output from the PI Web API


    Also, as a bonus include one of the PI Asset Framework power features - automatically create points for elements based on a template.


    The example demonstrates using the batch controller to::

    1. Create element templates

    2. Create an element and populate values

    3. Create elements from templates and write time-series values

    4. Query using the RequestTemplate features


    The attachment includes:

    - html documentation showing input, commands, output and screenshots

    - jupyter notebook, supporting files and payload data files.