Compatible AF version for PIconnect 0.10.4 #682
Replies: 2 comments 2 replies
-
That is some weird behaviour, so here's a couple of things I want to check:
According to the documentation, the |
Beta Was this translation helpful? Give feedback.
-
Could you try this code: import importlib.metadata as impmeta
import PIconnect
import pythonnet
print(f"PIconnect version: {PIconnect.__version__}")
print(f"PI AF SDK version: {PIconnect.AF_SDK_VERSION}")
print(f"pythonnet version: {impmeta.version('pythonnet')}")
from System import DayOfWeek
print(int(DayOfWeek.Sunday)) It appears there was a bug in pythonnet that conversion from a .NET enum to integer does not work (see pythonnet/pythonnet#1810). This should have been fixed some time ago, but this looks suspiciously a lot like that bug. Therefore the code above also tries to convert a simple .NET enum, which is also explicitly tested by the |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks a lot for the 0.10.4 version upgrade. I'm able to pull
summaries
data but it doesn't work for my colleague's computer. It threw aTypeError error: int() argument must be a string, a bytes-loke object or a number, not 'AFSummaryTypes'
. The code we run is:Our environments are pretty much the same except for minor version of AF SDK:
Python==3.9.13
PIconnect==0.10.4
Colleague's OSIsoft(r) AF SDK Version: 2.10.8.440 (not working)
My OSIsoft(r) AF SDK Version: 2.10.5.9050 (working)
Thanks
Beta Was this translation helpful? Give feedback.
All reactions