1 of 1 people found this helpful
For the record, it looks like you are using this particular overload:
I'm not a Python expert by any stretch of the imagination but the error message "No method matches given arguments" clearly indicates that something is wrong with the type of at least one of the passed arguments. You are receiving this error because the type an argument doesn't match the method signature. The likely culprit is searchroot. I suggest changing its assignment to:
searchroot = None
Your original assignment of searchroot=() creates an empty tuple, which is not None (or null). There is no matching FindElements overload where the 2nd parameter is a tuple. Hence, the exception. As Thyag states below, AF SDK is not officially supported with Python. AF SDK is written in C#, which is a statically typed language, whereas Python is dynamically typed. Many errors you encounter will be due to how they each handle variables and typing. A well known issue is that C# allows a params array. Method signatures using params array will cause issues for Python coders.
Again as Thyag already mentioned, we recommend PI Web API for use with Python apps.
The recommended method of accessing the PI System through non .NET programming languages (like Python) is via PI Web API.
Scripts in Python, which uses CLR and AFSDK.dll, become difficult to debug/troubleshoot and also with the Python language you will not be able to take full advantage of the .NET Framework features.
I see PI Web API is still under development for python. I am unable to install that library for python. When i try to access below url
it is showing 404 (page not found). can you please help me with this ?
PI Web API is a RESTful interface to the PI system. It gives client applications read and write access to their AF and PI data over HTTPS. It is a released product with the current version being PI Web API 2018. It is not tied to any particular programming language as long as you are able to make REST calls over HTTPS
As far as the link being broken is concerned, please refer to: https://pisquare.osisoft.com/community/developers-club/blog/2018/11/06/important-update-to-osisofts-github-policy-november-2018
Keep in mind that the client libraries were an aid to access PI Web API. You can employ any of Python's modules/methods to make REST calls to PI Web API.