problem with usbtmc-communication

Dave Angel d at
Thu Dec 6 21:10:17 CET 2012

On 12/06/2012 02:41 PM, Jean Dubois wrote:
> On 6 dec, 15:50, w... at wrote:
>> <snip>
>> 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 "" 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
> but this leads to trouble with the usbtmc-thing:
> Measured current 1:
> Traceback (most recent call last):
>   File "./", line 26, in <module>
> IOError: [Errno 110] Connection timed out
> and hereafter I need to restart the Keithley...:-(
I can't see why you used a count of 10000.  Isn't the whole problem
supposed to be because it doesn't produce a whole line at a time?  So
after requesting a measurement, if you know the size, use that in the
read() method.  And if you don't know the size, read it one byte at a
time till it make sense.



More information about the Python-list mailing list