Re: problem with usbtmc-communication

2012-12-12 Thread Jean Dubois
On 12 dec, 01:49, Jerry Hill wrote: > On Tue, Dec 11, 2012 at 1:58 AM, Jean Dubois wrote: > > > I found examples in theusbtmckernel driver documentation (the > > examples there are given in C): > >http://www.home.agilent.com/upload/cmc_upload/All/usbtmc.htm?&cc=BE&l... > > Thanks for that link.  

Re: problem with usbtmc-communication

2012-12-11 Thread Jerry Hill
On Tue, Dec 11, 2012 at 1:58 AM, Jean Dubois wrote: > > I found examples in the usbtmc kernel driver documentation (the > examples there are given in C): > http://www.home.agilent.com/upload/cmc_upload/All/usbtmc.htm?&cc=BE&lc=dut Thanks for that link. I think it explains how the driver works pr

Re: problem with usbtmc-communication

2012-12-11 Thread wrw
On Dec 11, 2012, at 3:48 PM, Jean Dubois wrote: [byte] >> >> OK - I see where the examples came from, and I notice - >> >> int my_inst; >> my_inst=open(“/dev/usbtmc1”,O_RDWR); >> write(my_inst,”*RST\n”,5); >> close(my_inst); >> >> and similarly in another place

Re: problem with usbtmc-communication

2012-12-11 Thread Jean Dubois
On 11 dec, 15:34, w...@mac.com wrote: > On Dec 11, 2012, at 1:58 AM, Jean Dubois wrote: > > > > > > > > > > > On 10 dec, 16:34, w...@mac.com wrote: > >> On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote: > > >> [byte] > >>> As you can see this approach suffers from the same "buffer problem" as > >>>

Re: problem with usbtmc-communication

2012-12-11 Thread wrw
On Dec 11, 2012, at 1:58 AM, Jean Dubois wrote: > On 10 dec, 16:34, w...@mac.com wrote: >> On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote: >> >> [byte] >>> As you can see this approach suffers from the same "buffer problem" as >>> the approach with readline did. One now good argue as a workaro

Re: problem with usbtmc-communication

2012-12-10 Thread Jean Dubois
On 10 dec, 16:34, w...@mac.com wrote: > On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote: > > [byte] > > > > > > > > > > > As you can see this approach suffers from the same "buffer problem" as > > the approach with readline did. One now good argue as a workaround: > > get rid of the first data pair

Re: problem with usbtmc-communication

2012-12-10 Thread wrw
On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote: [byte] > As you can see this approach suffers from the same "buffer problem" as > the approach with readline did. One now good argue as a workaround: > get rid of the first data pair and add an extra measure command for > the missing data pair, how

Re: problem with usbtmc-communication

2012-12-10 Thread Jean Dubois
On 7 dec, 14:46, Jean Dubois wrote: > On 6 dec, 21:15, w...@mac.com wrote: > > > On Dec 6, 2012, at 2:41 PM, Jean Dubois wrote: > > > > On 6 dec, 15:50, w...@mac.com wrote: > > >> On Dec 6, 2012, at 8:50 AM, Jean Dubois wrote: > > > >> [byte] > > > >>> It seems there is some misunderstanding her

Re: problem with usbtmc-communication

2012-12-07 Thread Jean Dubois
On 6 dec, 21:28, Terry Reedy wrote: > On 12/6/2012 10:44 AM, Jean Dubois wrote: > > > > > > > > > > > I followed your suggestion an now the code looks like this: > > #!/usr/bin/python > > import time > > import os > > import sys > > measurementcurr='' > > measurementvolt='' > > timesleepdefault=2

Re: problem with usbtmc-communication

2012-12-07 Thread Jean Dubois
On 6 dec, 21:15, w...@mac.com wrote: > On Dec 6, 2012, at 2:41 PM, Jean Dubois wrote: > > > > > > > > > > > On 6 dec, 15:50, w...@mac.com wrote: > >> On Dec 6, 2012, at 8:50 AM, Jean Dubois wrote: > > >> [byte] > > >>> It seems there is some misunderstanding here. What I meant with  how > >>> to

Re: problem with usbtmc-communication

2012-12-06 Thread Terry Reedy
On 12/6/2012 10:44 AM, Jean Dubois wrote: I followed your suggestion an now the code looks like this: #!/usr/bin/python import time import os import sys measurementcurr='' measurementvolt='' timesleepdefault=2 filename ='mydata.txt' usbkeith = open('/dev/usbtmc1','r+') usbkeith.flush() usbkeith.

Re: problem with usbtmc-communication

2012-12-06 Thread wrw
On Dec 6, 2012, at 2:41 PM, Jean Dubois wrote: > On 6 dec, 15:50, w...@mac.com wrote: >> On Dec 6, 2012, at 8:50 AM, Jean Dubois wrote: >> >> [byte] >> >> >>> It seems there is some misunderstanding here. What I meant with how >>> to "do the equivalent in Python" refered to "reading charac

Re: problem with usbtmc-communication

2012-12-06 Thread Dave Angel
On 12/06/2012 02:41 PM, Jean Dubois wrote: > On 6 dec, 15:50, w...@mac.com wrote: >> >> 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)" wh

Re: problem with usbtmc-communication

2012-12-06 Thread Jean Dubois
On 6 dec, 15:50, w...@mac.com wrote: > On Dec 6, 2012, at 8:50 AM, Jean Dubois 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 wr

Re: problem with usbtmc-communication

2012-12-06 Thread Jean Dubois
On 4 dec, 20:55, Terry Reedy wrote: > On 12/4/2012 7:14 AM, Jean Dubois wrote: > > > > > > > > > > > The following test program which tries to communicate with a Keithley > > 2200 programmable power supply using usbtmc in Python does not work as > > expected. I have connected a 10 ohm resistor to

Re: problem with usbtmc-communication

2012-12-06 Thread wrw
On Dec 6, 2012, at 8:50 AM, Jean Dubois 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 > RS23

Re: problem with usbtmc-communication

2012-12-06 Thread Jean Dubois
On 4 dec, 20:55, Terry Reedy wrote: > On 12/4/2012 7:14 AM, Jean Dubois wrote: > > > > > > > > > > > The following test program which tries to communicate with a Keithley > > 2200 programmable power supply usingusbtmcin Python does not work as > > expected. I have connected a 10 ohm resistor to it

Re: problem with usbtmc-communication

2012-12-06 Thread Jean Dubois
On 5 dec, 23:21, w...@mac.com wrote: > On Dec 5, 2012, at 3:38 PM, Jean Dubois wrote: > > [byte] > > > > >> I note that in your Octave example you are reading characters rather than > >> lines.  It seems to me that you have two choices here, either do the > >> equivalent in python or dig through

Re: problem with usbtmc-communication

2012-12-05 Thread wrw
On Dec 5, 2012, at 3:38 PM, Jean Dubois wrote: [byte] >> >> I note that in your Octave example you are reading characters rather than >> lines. It seems to me that you have two choices here, either do the >> equivalent in python or dig through the Keithley documentation to find the >> hex

Re: problem with usbtmc-communication

2012-12-05 Thread Jean Dubois
On 5 dec, 16:26, w...@mac.com wrote: > On Dec 4, 2012, at 11:12 AM, Jean Dubois wrote: > > > On 4 dec, 15:33, w...@mac.com wrote: > >> On Dec 4, 2012, at 7:14 AM, Jean Dubois wrote: > > >>> The following test program which tries to communicate with a Keithley > >>> 2200 programmable power supply

Re: problem with usbtmc-communication

2012-12-05 Thread wrw
On Dec 4, 2012, at 11:12 AM, Jean Dubois wrote: > On 4 dec, 15:33, w...@mac.com wrote: >> On Dec 4, 2012, at 7:14 AM, Jean Dubois wrote: >> >> >> >>> The following test program which tries to communicate with a Keithley >>> 2200 programmable power supply using usbtmc in Python does not work a

Re: [newbie] problem with usbtmc-communication

2012-12-04 Thread Terry Reedy
On 12/4/2012 7:14 AM, Jean Dubois wrote: The following test program which tries to communicate with a Keithley 2200 programmable power supply using usbtmc in Python does not work as expected. I have connected a 10 ohm resistor to its terminals and I apply 0.025A, 0.050A, 0.075A en 0.1A, I then me

Re: problem with usbtmc-communication

2012-12-04 Thread Jean Dubois
On 4 dec, 15:33, w...@mac.com wrote: > On Dec 4, 2012, at 7:14 AM, Jean Dubois wrote: > > > > > The following test program which tries to communicate with a Keithley > > 2200 programmable power supply using usbtmc in Python does not work as > > expected. I have connected a 10 ohm resistor to its t

Re: [newbie] problem with usbtmc-communication

2012-12-04 Thread wrw
On Dec 4, 2012, at 7:14 AM, Jean Dubois wrote: > The following test program which tries to communicate with a Keithley > 2200 programmable power supply using usbtmc in Python does not work as > expected. I have connected a 10 ohm resistor to its terminals and I > apply 0.025A, 0.050A, 0.075A en 0

[newbie] problem with usbtmc-communication

2012-12-04 Thread Jean Dubois
The following test program which tries to communicate with a Keithley 2200 programmable power supply using usbtmc in Python does not work as expected. I have connected a 10 ohm resistor to its terminals and I apply 0.025A, 0.050A, 0.075A en 0.1A, I then measure the current and the voltage en write