Hello,
I am trying to send SCPI (text) commands to an Agilent U2100A Digital IO via
USB. I have used Python to send SCPI commands to other equipment successfully
in the past using the parallel port or over ethernet. However this is my first
time working with a USB device and Python.
I can successfully run usbenum.py and the results are shown at the bottom for
the device of interest.
I then add the following lines within the 'for dev in devices' loop:
if dev.idVendor == 2391:
handle=dev.open()
handle.setConfiguration(1)
handle.setAltInterface(0)
handle.interruptWrite(2, "*IDN?\n")
handle.releaseInterface()
(*IDN? is a standard IEEE-488 command to return the instrument's identification
string. I'm just using this to test the ability to send a command)
and I get the following error:
Traceback (most recent call last):
File "usbenum.py", line 46, in <module>
handle.interruptWrite(2, "*IDN?\n")
usb.USBError: Unknown error
Do you have any suggestions for what I am doing wrong?
I tried using bulkWrite instead but that also gives the same error.
Previously when sending SCPI commands over the LPT I had to add \n after each
command. I also tried removing that here, but I get the same error.
I would greatly appreciate any suggestions you have.
Thank you!
Chris
Output from usbenum.py:
Device: /dev/ugen2.3
Device class: 0
Device sub class: 0
Device protocol: 0
Max packet size: 64
idVendor: 2391
idProduct: 2328
Device Version: 01.00
Configuration: 1
Total Length: 39
selfPowered: 1
remoteWakeup: 0
maxPower: 0
Interface: 0
Alternate Setting: 0
Interface class: 254
Interface sub class: 3
Interface protocol: 1
Endpoint: 0x2L
Type: 2
Max packet size: 64
Interval: 0
Endpoint: 0x86L
Type: 2
Max packet size: 64
Interval: 0
Endpoint: 0x81L
Type: 3
Max packet size: 2
Interval: 1
------------------------------------------------------------------------------
_______________________________________________
pyusb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyusb-users