Raspberry Pi USBTMC Python to Power Supply Communication Issue

494 views
Skip to first unread message

Wei Tai

unread,
Jun 9, 2015, 7:49:11 PM6/9/15
to pytho...@googlegroups.com
Hello,

I have been trying to communicate with a Keithley 2200 power supply from a Raspberry Pi using a USB cable. I have installed USBTMC Python and was able to establish connection. The *IDN? command works as expected, along with any query commands I tested ("VOLTAGE?", "CURR?"). However, all the instr.write() commands simply don't go through. There is no error message given and the connection remains the same, but there is no reaction from the power supply. I'm not sure if this is a power supply setting issue (I am also asking Keithley Customer Support) or a programming problem on my end, and I was wondering if anyone ran into similar problems. I've tried changing the mode setting to 0660 or 064 in the usbtmc.rules file, I've also tried using write_raw() instead of just write(). Does anyone have any idea why this might be? Is the write() command simply not supported in usbtmc python?

Sample code:

import usbtmc
instr = usbtmc.Instrument(0x05e6, 0x2200)
print(instr.ask("*IDN?"))
>> Keithley Instruments, 2200-72-1, 9090016, 1.27-1.25
instr.write("SOURCE:VOLTAGE 3V") #no reaction on the part of the power supply nor error message in the terminal, the voltage remains the same


Thanks,

Wei

Wei Tai

unread,
Jun 16, 2015, 7:39:07 PM6/16/15
to pytho...@googlegroups.com
As it turns out, it was a settings problem with the Keithley power supply. The power supply was set to local instead of remote, which meant it only accepted voltage and current input from the keypad. I was able to change this through instr.write("SYSTEM:REMOTE"), which allowed me to change the voltage and current through the raspberry (then instr.write("SYSTEM:LOCAL") to change it back).

Ezequiel Gonzalez

unread,
Sep 13, 2017, 4:59:14 PM9/13/17
to python-ivi
Hi Wei, 
I am trying to use the DISPlay[:WINDow]:TEXT[:DATA]  but nothing happens... I tried both Local and remote mode...
have you ever tried?
Reply all
Reply to author
Forward
0 new messages