Comments (3)
There was some discussion about it recently: #628 but I haven't yet had the time to do the explicit casts to the .NET Enums. Why your summary isn't working using pythonnet 2.5 and python 3.9 I don't know, I cannot reproduce that, which version of the SDK is installed on your system? It appears that message comes from the SDK itself and not PIconnect or Pythonnet.
from piconnect.
Thank you for looking into this. I am on OSIsoft(r) AF SDK Version: 2.9.1.8106. In contrast to #628 recorded_value works and only the point summary fails. When I specify a date range explicitly points.summary('01.01.2021 10:00', '01.01.2021 11:00', SummaryType.AVERAGE)
it works.
So this is somehow related to the string parsing in time.py in the function to_af_time_range at return AF.Time.AFTimeRange(start_time, end_time)
I checked, the type of '-14h is str
The debugger throws this message
The 'h' token in the string '*-14h' was not expected.
bei OSIsoft.AF.Time.AFTimeSpan.FormatError(String input, String token, Boolean throwErrors, AFTimeSpan& result)
bei OSIsoft.AF.Time.AFTimeSpan.TryParseImpl(String input, Int32 startlocation, IFormatProvider provider, NumberFormatInfo numberFormat, DateTimeFormatInfo dateTimeFormat, Boolean throwErrors, AFTimeSpan& result)
bei OSIsoft.AF.Time.AFTime.TryParseImpl(String input, Nullable1 referenceTime, AFTimeZone timeZone, IFormatProvider provider, Boolean throwErrors, DateTime& result) bei OSIsoft.AF.Time.AFTime.TryParseRetryImpl(String parmName, String input, Nullable
1 referenceTime, IFormatProvider provider, Boolean throwErrors, AFTime& result)
bei OSIsoft.AF.Time.AFTimeRange.TryParseImpl(String startTime, String endTime, AFTime referenceTime, IFormatProvider provider, Boolean throwErrors, AFTime& startAFTime, AFTime& endAFTime)
bei OSIsoft.AF.Time.AFTimeRange..ctor(String startTime, String endTime)
I have found a potential workaround which I have not verified by calling return AF.Time.AFTimeRange.Parse(start_time, end_time)
Now my strings parese ok and also passing datetime objects works (still). So this is related to CultureInfo maybe?
from piconnect.
Version 0.10.x solves this issue. It is available on PyPI, and I'm working to getting it updated on conda-forge as well, but that has a few issues due to changes in importing the SDK that is not available on the conda build servers. Closing this issue for now.
from piconnect.
Related Issues (20)
- filtered_summaries does not appear to apply filter_expression arguement HOT 4
- write to tag HOT 1
- PIconnect shows "Testing" after connect to PI servers HOT 9
- Created property for PI point HOT 1
- Point update method does not work as expected (sometimes) HOT 7
- AttributeError: module 'PIconnect' has no attribute 'PIServer' or equivalent HOT 3
- How to download Audit Trails? HOT 1
- Trouble connecting to anything besides Testing HOT 3
- Question - how are servers discovered? HOT 2
- AttributeError: 'PIPoint' object has no attribute 'CurrentValue' HOT 1
- Open PI Connection without context manager HOT 3
- _time.to_af_time_range does not parse relative times correctly
- Search for attribute by providing entire Path as String in PIAF HOT 1
- Was able to connect for a while, until the server was migrated. HOT 4
- Create Point
- Get dataset from an event frame based on time period and choose attributes
- Search PI points by name and description using queries HOT 2
- Checking that status of Multiple PI Tag HOT 1
- Error when trying to fetch the highest value of the last 30 days
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piconnect.