problem with usbtmc-communication

Jean Dubois jeandubois314 at gmail.com
Thu Dec 6 14:41:56 EST 2012


On 6 dec, 15:50, w... at mac.com wrote:
> On Dec 6, 2012, at 8:50 AM, Jean Dubois <jeandubois... at gmail.com> wrote:
>
> [byte]
>
>
>
>
>
>
>
>
>
>
>
> > It seems there is some misunderstanding here. What I meant with  how
> > to "do the equivalent in Python" refered to  "reading characters
> > rather than lines".
> > I have written working code myself for another Keithleu which does use
> > RS232 for communication. The problem now is specifically for the new
> > Keithley which doesn't allow RS232 but only USB-communication over
> > usbtmc. So if the "buffer-problem" could be changed by reading
> > characters that would be great.
>
> > regards,
> > Jean
>
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> Sorry about the misunderstanding (and subsequent waste of bandwidth).  However, if you will look at the serial reads and writes in that handler, you will see that it does things like "serial.read(n)" where "n" is an explicit number, the number of bytes to be read from the serial buffer.
>
> -Bill
I tried changing measurementcurr=usbkeith.readline() to
measurementcurr=usbkeith.read(10000)
but this leads to trouble with the usbtmc-thing:

Measured current 1:
Traceback (most recent call last):
  File "./keith2200rev2.py", line 26, in <module>
    measurementvolt=usbkeith.read(10000)
IOError: [Errno 110] Connection timed out

and hereafter I need to restart the Keithley...:-(

regards,
Jean



More information about the Python-list mailing list