GPIBInstrument.wait_for_srq() raises NotImplementedError
See original GitHub issuepyvisa.resources.gpib.GPIBInstrument.wait_for_srq()
calls enable_event()
, wait_on_event()
, and discard_events()
of the underlying visalib. However, PyVisaLibrary
does not implement those methods so NotImplementedError
is raised.
One way to go about this is to delegate the missing methods to underlying pyvisa-py session objects and implement event support there.
Another possibility is to notice that wait_for_srq()
is quite universal - in particular, VISA Service Request events should be supported by GPIB INSTR, GPIB INTFC, GPIB-VXI INSTR, TCPIP INSTR, USB INSTR, and VXI INSTR. So, wait_for_srq()
could be moved to pyvisa.highlevel.VisaLibraryBase
. This would make it easier to implement an overload in PyVisaLibrary
before full-blown event support in pyvisa-py is ready.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
Could you open a [WIP] PR to make the changes easier to review and comment on ? I should be able to review it tonight.
@MatthieuDartiailh, I’m slowly hacking away on this. The GPIB-events branch is still not ready but event-related calls from PyVisaLib to Session objects have been wired through. Also, some preliminary support for GPIB events is in with some timeout-related bugs left to squash. Next is making events proper objects with .close(), .get_attribute() etc.
This seems to be a good time to ask for some feedback.
In particular, I wonder about storing event objects in its separate dict, PyVisaLibrary.events, as opposed to .sessions with which they share the pool of handles: https://github.com/tivek/pyvisa-py/blob/9f19bc992e89ae9c16f0a8af1090027cbb54edbd/pyvisa-py/highlevel.py#L103.
Also, I would like to hear your thoughts on ways to implement Attribute.in_resource() for event-related attributes. As it is now, attributes seem to expect sessions only.