PyConfig.md

pyconfig: on-prem PI data upload to Academic Hub

Last update: Mon Jan 27 15:41:33 EST 2020

Overview

pyconfig.exe is a Windows console application to extract data from an on-prem PI System, compress the result data file and then upload it to the Academic Hub for (manual) deployment. It should be run on the same computer where the PI Data Archive is running, with the PI administrative tool piconfig.exe.

NOTE: Windows and/or anti-virus software may ask you for permission to execute and/or communicate pyconfig.exe. In all cases you must accept for the application to function properly.

Installation

On the computer where PI Data Archive is installed:

  1. Start a browser and go to https://academic.osisoft.com/upload
  2. Click on the green button to download pyconfig.exe
  3. Move file pyconfig.exe to the directory where piconfig.exe is installed, usually C:\PI\adm

Follow the steps below to select and upload the data you'd like to transfer on the Academic Hub.

pyconfig

pyconfig is a command-line console application. It should be run in cmd window in the same directory where the PI administrative tool piconfig.exe is installed, usually C:\PI\adm.

In more detail:

  • Click 'Starticon, typecmd` and hit RETURN
  • In the cmd window, change directory to where piconfig.exe is installed, e.g. cd C:\PI\adm

Here is the minimal sequence of pyconfig commands:

pyconfig select
pyconfig list
pyconfig extract
pyconfig compress
pyconfig upload

If you accept all the default values, the recorded values for the last 10 days of all the tags of your PI Data Archive will be transferred to the Academic Hub.

We describe next those different commands in more details.

pyconfig select

This command is to find the list of sensor names, or tags, of interest. The filter syntax is the same one as on the PI System, e.g.:

*: matches all tags

Engine*: matches all tags starting with Engine

*Engine*: matches all tags containing Engine

Answer the prompts or type ENTER to accept the default value between brackets.

pyconfig list

This command displays the list of tags saved with pyconfig select. The default file with this tag list is taglist.txt. If the list has tags you're not interested in to transfer to the Academic Hub, open the file in the editor of your choice (e.g. Notepad) and remove the lines with those tags.

pyconfig extract

This command extracts recorded values from PI Data Archive for the list of selected tags, between a start and end time. The time syntax is the same as PI time. To see some examples, execute:

pyconfig extract --help

with the following output:

F:\PI\adm>pyconfig.exe extract --help
Usage: pyconfig.exe extract [OPTIONS]

  Copy values from PI System to an output file for upload on Academic Hub

  Examples of start/end time:

  *                       means now

  *-10d                   10 days ago

  12-dec-2016             December 12th, 2016 at midnight

  28-mar-2018 15:32:15    March 28, 2018 at 3:32:1

Options:
  --input TEXT   Filename with tag infor
  --start TEXT   Start time for values
  --end TEXT     Start time for values
  --output TEXT  Filename for results
  --clean TEXT   Remove existing output file (otherwise append to it)
  --help         Show this message and exit.

pyconfig compress

This command compresses the data dump CSV (compression is required) before the upload step. Execute:

pyconfig compress 

and pick default values unless you need to do otherwise.

pyconfig upload

This is the last step to upload the extracted data to the Academic Hub. A confirmation ID will be displayed once upload completes successfully. Please note it down since you need to communicate this info to mailto:hubsupport@osisoft.com and ask for this data to be deployed on the Academic Hub.