I am fairly new to Proficy Historian and Python. The purpose of my application is to start extracting data from Proficy.
GE (Proficy) Historian is installed on a Virtual Machine Server A
while my python is installed in an other VM Server B
.
Both servers are under the same firewall and in the same VLAN, so they can communicate.
I have tried to look around but I am not sure which is the easiest method to extract data... Any help?
You can use the OLE DB API included with the proficy iHistorian, see the manual of iHistorian. In the manual you can find the available tables and some examples on SQL code. Check whether the API is correctly installed with the 'Historian Interactive SQL' program included with iHistorian.
I used the python package 'PyADO' in order to connect to the OLE DB API (got this from GitHub Gist, also requires the packages 'win32com' and 'pythoncom'). The module is not available on PyPi, so just download it, extract it and put it in the 'site-packages' folder (or your current working directory). There are some errors in the code, fix this in the 'PyADO.py' file by replacing all the '<>' symbols for 'not equal' with '!='. For python 3 usage also update all print statements from 'print blabla' to 'print(blabla). In order to extract the data the following should suffice (I included 'prettytable' in order to get a decent print of the data):
Resulting in:
I also tried to use the package 'adodbapi', but I was not able to make it work. It seems that ODBC doesn't work at all with iHistorian, which makes the package 'pyodbc' not suitable for this as well. If anybody has a solution to connect to an OLE DB API with a well maintained python package I would be glad to hear about it.