Overview of the Python Collector

Using the Python collector, you can execute Python scripts and store the resulting values in Historian tags. You can retrieve this data from the Historian archive, perform the calculations written in Python script, and store the resulting values in new Historian tags. Also, you can run multiple Python scripts simultaneously.

Features:
  • You can perform data calculations on values that are already in the archiver.
  • You can run the Python-based scripts to compute values.
  • You can retrieve the resulting values stored in Historian using any of the Historian clients.
  • You can run multiple Python scripts at the same time.
  • You can verify a Python script and check for errors before executing it.
  • The supported timestamp resolution is 1ms.
  • Each tag can have its own Python script stored under the tag source address. The computed value for the Result variable within the Python script is stored in the associated Python tag.
  • You can run scripts using the current values of other historian tags in the same archiver.
    The following syntax is used to retrieve the current value of Historian tags in a Python script:
    CurrentValue('<tag name>')
    The CurrentValue function returns bad if the source tag quality is bad.
  • Both the polled and unsolicited data collection are supported.
  • Integer and string data are supported.
  • The collector accepts device timestamps.
  • The collector reads data and tags.
Limitations:
  • Historian tags used in the CurrentValue function cannot contain % in the tag name. For example, CurrentValue(‘Simulation.Sin_1%Noise’) will result in an error. Therefore, before using a tag in a Python script, rename it so that it does not contain %.
  • The tag wizard in Historian Administrator adds built-in function as: Result=CurrentValue(“Simulation_Sim.Step”). This syntax is not valid for Python scripts. Therefore, you must update the script to pass the tag name with single quotes instead of double quotes.

    Example: Result=CurrentValue(‘Simulation_Sim.Step')