Closed cpagravel closed 1 year ago
Thanks for the detailed report. This is reminiscent of https://github.com/pyusb/pyusb/discussions/432
Could you try fiddling with the call to set_configuration (https://github.com/pyvisa/pyvisa-py/blob/main/pyvisa_py/protocols/usbtmc.py#L216) ? Commenting it out/making it conditional on the device not being configured yet ?
Since I do not have the hardware to reproduce locally, I will need you to test possible fixes, sorry for the inconvenience.
@MatthieuDartiailh thanks for pointing me in the right direction. I have a PR to address this which works on in my environment: https://github.com/pyvisa/pyvisa-py/pull/352
Issue details
I run into an error every second time I try to run a script that accesses a pyvisa device. The first time I run the script, it works; the second time I run the script, it fails with the following error:
I modified the script to open and close the device twice to demonstrate the issue without needing to run the script twice.
My script:
Traceback:
Test without using USB
I only run into the issue if I'm using communication over USB. If I use a different communication method, such as
TCPIP
, then I don't have any problems.Environment Details
Output of
pyvisa-info