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