PyVISA and Kethley 2701 can only get results from one channel

1.5k Views Asked by At

I am using PyVISA to access channels on my Keithley 2701 DMM, I have TC's on channels 102 and 103. When using the "READ?" I am only getting values from one of my channels not both: Bellow is my code:

from pyvisa.vpp43 import visa_library
visa_library.load_library("/Library/Frameworks/Visa.framework/VISA")
import visa
import time

keithley = visa.instrument("ASRL1")
keithley.write('*RST')
print keithley.ask('*IDN?')

keithley.write('TRAC:CLE')
keithley.write("INIT:CONT OFF")
keithley.write("TRIG:sour IMM")

keithley.write("SENSE:FUNC 'TEMP', (@102)")
keithley.write("TEMP:TRAN TC, (@102)")
keithley.write("TEMP:TC:TYPE K, (@102)")
keithley.write("TEMP:RJUN:RSEL INT, (@102)")

keithley.write("SENSE:FUNC 'TEMP', (@103)")
keithley.write("TEMP:TRAN TC, (@103)")
keithley.write("TEMP:TC:TYPE K, (@103)")
keithley.write("TEMP:RJUN:RSEL INT, (@103)")

keithley.write('TRAC:CLE')
keithley.write("INIT:CONT OFF")
keithley.write("TRIG:sour IMM")

keithley.write("TRIG:COUN INF")
keithley.write("ROUT:SCAN (@102,103)")
keithley.write("ROUT:SCAN:TSO IMM")
keithley.write("ROUT:SCAN:LSEL INT")

print keithley.ask("READ?")

And My results are: +2.24654121E+01 C,+61.898106SECS,+00239RDNG#

Which is correct for one of my channels but I want to see the results from both...Any help will be appreciated.

2

There are 2 best solutions below

0
On BEST ANSWER

I'm not sure how READ? is supposed to work with multiple channels. I would think there are a couple of possibilities:

print keithley.ask("READ?")
print keithley.ask("READ?")

or possibly:

keithley.write("READ?")
print keithley.read()
print keithley.read()
0
On

From the 1999 SCPI Command Reference paragraph 3.3

READ[:<function>]? <parameters>[,<source list>]

I haven't used it before, but I guess you have to specify a <source list>

So to read channels 1,3,4,5 and 9 you would write

print keithley.ask("READ? (@1,3:5,9)")