Hi,
2 things.
1. Read the USB TMC specification, it has a structure that must wrap the
commands to the device.
See test measurement class on this page
<http://www.usb.org/developers/devclass_docs#approved>
2. The Agilent USB DAQ devices I have used in the past use a cypress EZ-usb
chip. This means that when the device is first plugged into the computer it
gets it's firmware boot loaded.
What this means for you is that you need to boot load the firmware
first then you will get a USB-TMC device.
Also, neglecting the firmware boot loading issue, have a look at this.
<http://www.home.agilent.com/upload/cmc_upload/All/usbtmc.html>
Steve
On Jun 2, 2010, at 8:56 AM, Ct Chev wrote:
> 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
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users