Python Expression Tags in Historian

A Python® expression is typically a single line of Python code which, when executed, evaluates to a single value. It can also be thought of as the right-hand side of a Python assignment operation.

Python Expression Tags are used in cases where you do not want to store a raw data value, but wish to store only derived or calculated values. Historian allows raw data to be pre-processed with Python expressions during collection, so that the data collected for the expression tags contain these derived values.

See for complete Python documentation.

Note: This functionality is available only for the Enterprise edition of Historian.

To use a Python Expression Tag in Historian, you must configure a tag as a Python Expression Tag using either Historian File collector or Historian Excel Add-in. You can then use the Python expression on this tag to pre-process raw data before the result is inserted into Historian.

The following collectors support Python Expression Tags:
  • Simulation Data Collector
  • iFix Data Collector
  • OPC Data Collector
  • OSI PI Collector
  • Windows Performance Collector
  • Collector Toolkit
To enable Python Expression support for toolkit-based collectors, copy the following files to the collector executable path:
  • python34.dll
  • ihcpprest140_2_8.dll.dll
  • PythonExpressionExtension.dll
For 32-bit collectors, these files are located at C:\Program Files\Proficy\Proficy Historian\x86\Server. For 64-bit collectors, these files are located at C:\Program Files\Proficy\Proficy Historian\x64\Server.