Open spsmspsm opened 7 years ago
Can you connect directly and send commands like this?
instr = usbtmc.Instrument('USB::5784::2103::009000000571::INSTR')
print(instr.ask("*IDN?"))
The only thing that I can think of is the power supply may not implement the clear command correctly.
Hi,
Thanks for your answer, this is what I get. To me this looks like an overflow when handling a response
Thanks in advance
import usbtmc instr = usbtmc.Instrument('USB::5784::2103::009000000571::INSTR') print(instr.ask("*IDN?")) Traceback (most recent call last): File "
", line 1, in File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 629, in ask File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 609, in write File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 475, in write_raw File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 349, in open File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 699, in clear File "/usr/local/lib/python3.5/dist-packages/usb/core.py", line 1043, in ctrl_transfer self.__get_timeout(timeout)) File "/usr/local/lib/python3.5/dist-packages/usb/backend/libusb1.py", line 883, in ctrl_transfer timeout)) File "/usr/local/lib/python3.5/dist-packages/usb/backend/libusb1.py", line 595, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 75] Overflow
On Thu, Aug 10, 2017 at 12:12 AM, Alex Forencich notifications@github.com wrote:
Can you connect directly and send commands like this?
instr = usbtmc.Instrument('USB::5784::2103::009000000571::INSTR') print(instr.ask("*IDN?"))
The only thing that I can think of is the power supply may not implement the clear command correctly.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/python-ivi/python-usbtmc/issues/34#issuecomment-321395874, or mute the thread https://github.com/notifications/unsubscribe-auth/AcxqLS58xHSmd_dECgML1JbxsWBfDL7xks5sWi7MgaJpZM4OYA1g .
I tried some modification to the libusb library to get a bit further, but something else must be wrong. I have marked my modifications in BOLD. Basically, the overflow happens when the low level routines check the length field, increasing the data from 0x0001 into [0x0, 0x1], or incresing the length by 1 removes the first overflow, but then the failure occurs when waiting for the response to the IDN command. Basically we get a timeout.
@methodtrace(_logger) def ctrl_transfer(self, dev_handle, bmRequestType, bRequest, wValue, wIndex, data, timeout): addr, length = data.buffer_info() length *= data.itemsize
0
0
CTRL <usb.backend.libusb1._LibUSB object at 0x7f697030d0b8>
<usb.backend.libusb1._DeviceHandle object at 0x7f697030d518> 128 6 768 0
array('B', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0]) 1000
CTRL a 18822416 254
4
4
CTRL <usb.backend.libusb1._LibUSB object at 0x7f697030d0b8>
<usb.backend.libusb1._DeviceHandle object at 0x7f697030d518> 128 6 771 1033
array('B', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0]) 1000
CTRL a 18966592 255
26
26
0
0
0
0
0
0
0
0
CTRL <usb.backend.libusb1._LibUSB object at 0x7f697030d0b8>
<usb.backend.libusb1._DeviceHandle object at 0x7f697030d518> 161 5 0 0
array('B', [0]) 5000
CTRL a 18691216 1
2
2
CTRL <usb.backend.libusb1._LibUSB object at 0x7f697030d0b8>
<usb.backend.libusb1._DeviceHandle object at 0x7f697030d518> 161 6 0 0
array('B', [0, 0]) 5000
CTRL a 18691216 2
2
2
0
CTRL <usb.backend.libusb1._LibUSB object at 0x7f697030d0b8>
<usb.backend.libusb1._DeviceHandle object at 0x7f697030d518> 161 7 0 0
array('B', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0]) 5000
CTRL a 18630384 24
24
24
0
0
0
-7
CTRL <usb.backend.libusb1._LibUSB object at 0x7f697030d0b8>
<usb.backend.libusb1._DeviceHandle object at 0x7f697030d518> 162 1 1 2
array('B', [0, 0]) 5000
CTRL a 18691280 2
2
2
Traceback (most recent call last):
File "./testusb.py", line 5, in
On Fri, Aug 11, 2017 at 10:21 AM, Santiago Palomino Sanchez-Manjavacas < spssps@gmail.com> wrote:
Hi,
Thanks for your answer, this is what I get. To me this looks like an overflow when handling a response
Thanks in advance
import usbtmc instr = usbtmc.Instrument('USB::5784::2103::009000000571::INSTR') print(instr.ask("*IDN?")) Traceback (most recent call last): File "
", line 1, in File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 629, in ask File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 609, in write File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 475, in write_raw File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 349, in open File "/usr/local/lib/python3.5/dist-packages/python_usbtmc-0.8-py3.5.egg/usbtmc/usbtmc.py", line 699, in clear File "/usr/local/lib/python3.5/dist-packages/usb/core.py", line 1043, in ctrl_transfer self.__get_timeout(timeout)) File "/usr/local/lib/python3.5/dist-packages/usb/backend/libusb1.py", line 883, in ctrl_transfer timeout)) File "/usr/local/lib/python3.5/dist-packages/usb/backend/libusb1.py", line 595, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 75] Overflow On Thu, Aug 10, 2017 at 12:12 AM, Alex Forencich <notifications@github.com
wrote:
Can you connect directly and send commands like this?
instr = usbtmc.Instrument('USB::5784::2103::009000000571::INSTR') print(instr.ask("*IDN?"))
The only thing that I can think of is the power supply may not implement the clear command correctly.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/python-ivi/python-usbtmc/issues/34#issuecomment-321395874, or mute the thread https://github.com/notifications/unsubscribe-auth/AcxqLS58xHSmd_dECgML1JbxsWBfDL7xks5sWi7MgaJpZM4OYA1g .
Hi,
I am trying to run a simple example, but even if the device is enumerated properly with:
The initialization code fails with an overflow.
I Added some printout of the ctrl_transfers as they go, it is the last one that produces the overflow:
Thanks in advance