-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to monitor #1
Comments
While at it, the basic |
Sorry, I forgot to update README to version 0.2. Updated now, thanks for pointing out. In 0.2 there are two distinct Pv types: monitoring and non-monitoring. Here is a new monitoring example: from pyepics_asyncio import PvMonitor
pv = await PvMonitor.connect("pvname")
async for value in pv:
print(value) |
You can create basic pyepics def callback():
...
raw = epics.PV(
"pvname",
form="native",
connection_callback=callback,
)
pv = Pv(raw) |
It's interesting. |
Thanks heaps for the update. Here's the example you requested from pyepics_asyncio import Pv, PvMonitor
from epics import PV
pv = await Pv.connect("SR11BCM01:CURRENT_MONITOR")
pv_ = PV("SR11BCM01:CURRENT_MONITOR")
print(await pv.get())
print(pv_.get())
>> None
>> 200.19154430039114 I'll play around with the PvMonitor today and let you know if there are any further questions. |
It's still unhappy with things. I did also update to version 0.2.1 from 0.2.0 (which I assume was only the recent readme updates). pv_async = await PvMonitor.connect("SR11BCM01:CURRENT_MONITOR")
async for value in pv_async:
print(value) with the error being: ----> 1 pv_async = await PvMonitor.connect("SR11BCM01:CURRENT_MONITOR")
AttributeError: '_ConnectMonitor' object has no attribute 'name' EDIT The following still results in a None: from pyepics_asyncio import Pv, PvMonitor
pv = await Pv.connect("SR11BCM01:CURRENT_MONITOR")
print(await pv.get()) |
Ah, the Pv class doesn't return the awaited value. |
Okay, I've write some tests with dummy IOC and found some issues:
Thank you for your assistance! It's nice to see that this library is used by someone. |
No, thank you for doing what I was about to try and do but wasn't sure I had the skill. I thinking I might try add a |
Feel free to open pull requests to this repo. If you need a feature, someone else may need it too. As for notification callback, maybe it's better to simply spawn a new task that iterates over monitor? It seems to be more |
Ah, yes, you're right, the notify is more an async/await thing so should be separate. |
Running the default example:
yields an error:
Also, is there any possibility of adding connection callbacks?
The text was updated successfully, but these errors were encountered: