Controlling a Rigol DP1308A with python-ivi

256 views
Skip to first unread message

Miguel Jiménez López

unread,
Nov 12, 2014, 10:22:10 AM11/12/14
to pytho...@googlegroups.com
Hi,

I am testing python-ivi project to control a Rigol DP1308A power source. I use a Ubuntu 12.04 (64 bits) operating system.
I tried to use the class driver (ivi/Rigol/DP1308A.py) but I got  a "Pipe error" (Errno 32).

I have performed other tests with python-usbtmc directly but with the same result. I can create the Instrument object but
when I try to send anything with "ask", "write", "read", etc methods, I got the same error.

Can anyone help me?

Thanks in advance.

Best regards,

Miguel Jiménez López

unread,
Nov 13, 2014, 4:28:25 AM11/13/14
to pytho...@googlegroups.com
Hi again,

In my last post, I forgot to include the source code:

With python-ivi:

import ivi
i = ivi.rigol.rigolDP1308A("USB0::0x1ab1::0x0e10::INSTR")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ivi/rigol/rigolDP1308A.py", line 35, in __init__
    super(rigolDP1308A, self).__init__(*args, **kwargs)
  File "ivi/rigol/rigolDP1000.py", line 35, in __init__
    super(rigolDP1000, self).__init__(*args, **kwargs)
  File "ivi/rigol/rigolBaseDCPwr.py", line 43, in __init__
    super(rigolBaseDCPwr, self).__init__(*args, **kwargs)
  File "ivi/scpi/dcpwr.py", line 48, in __init__
    super(Base, self).__init__(*args, **kwargs)
  File "ivi/extra/common.py", line 33, in __init__
    super(SerialNumber, self).__init__(*args, **kwargs)
  File "ivi/scpi/common.py", line 104, in __init__
    super(SelfTest, self).__init__(*args, **kwargs)
  File "ivi/dcpwr.py", line 56, in __init__
    super(Base, self).__init__(*args, **kwargs)
  File "ivi/ivi.py", line 1691, in __init__
    self.initialize(resource, id_query, reset, **kw)
  File "ivi/scpi/dcpwr.py", line 89, in _initialize
    self._clear()
  File "ivi/ivi.py", line 2000, in _clear
    return self._interface.clear()
  File "/usr/local/lib/python2.7/dist-packages/usbtmc/usbtmc.py", line 477, in clear
    self.write("*CLS")
  File "/usr/local/lib/python2.7/dist-packages/usbtmc/usbtmc.py", line 441, in write
    self.write_raw(str(message).encode(encoding))
  File "/usr/local/lib/python2.7/dist-packages/usbtmc/usbtmc.py", line 374, in write_raw
    self.bulk_out_ep.write(data)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 349, in write
    return self.device.write(self, data, timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 878, in write
    self.__get_timeout(timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 768, in bulk_write
    timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 864, in __write
    _check(retval)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 560, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 32] Pipe error


With python-usbtmc:

import usbtmc
usbtmc.list_devices()
# Response [<DEVICE ID 1ab1:0e10 on Bus 001 Address 004>]
i = usbtmc.Instrument(0x1ab1,0x0e10)
i.ask("*IDN?")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "usbtmc/usbtmc.py", line 461, in ask
    self.write(message, encoding)
  File "usbtmc/usbtmc.py", line 441, in write
    self.write_raw(str(message).encode(encoding))
  File "usbtmc/usbtmc.py", line 374, in write_raw
    self.bulk_out_ep.write(data)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 349, in write
    return self.device.write(self, data, timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 878, in write
    self.__get_timeout(timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 768, in bulk_write
    timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 864, in __write
    _check(retval)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 560, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 32] Pipe error

Thanks in advance,

Best Regards.

Miguel Jiménez López

unread,
Jan 26, 2015, 9:11:44 AM1/26/15
to pytho...@googlegroups.com
Can anyone help me?

Alex Forencich

unread,
Jan 26, 2015, 7:42:16 PM1/26/15
to pytho...@googlegroups.com
Can you try it again with the latest version of python-usbtmc from github?  Some changes have been made wrt. resetting the interface that may or may not solve the problem. 

Alex Forencich

On 01/26/2015 06:11 AM, Miguel Jiménez López wrote:
Can anyone help me?
--
You received this message because you are subscribed to the Google Groups "python-ivi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-ivi+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Miguel Jiménez López

unread,
Feb 10, 2015, 4:03:23 AM2/10/15
to pytho...@googlegroups.com
Hello,

I have tried with the lastest version of python-usbtmc but the error is the same. Can you give any suggestions more?

Thanks in advance,

Best Regards.
Reply all
Reply to author
Forward
0 new messages