Changing the measured magnitude with PyVISA in a Keithley multimeter

117 Views Asked by At

I am using the pyVISA python library pyVISA to read resistance and current values with a Keithley 2100 multimeter. However, I am not able to set the quantities to be measured with pyVISA, but have to set it manually on the multimeter.

I have prepared this python script for it:

from time import time, sleep
import pyvisa
from datetime import datetime

rm = pyvisa.ResourceManager()
multimeter = rm.open_resource('USB0::0x05E6::0x2100::1408095::INSTR')

multimeter.write("SENS:FUNC 'RES'")
multimeter.write("SENS:RES:RANG:AUTO ON")

multimeter.write("INIT")
resistance = multimeter.query("FETC?")
print(resistance)
sleep(1)

multimeter.write("SENS:FUNC 'CURR:DC'")
multimeter.write("SENS:CURR:DC:RANG:AUTO ON")

multimeter.write("INIT")
current = multimeter.query("FETC?")
print(current)
sleep(1)

multimeter.close()

What this script actually does is to trigger two measurements of the magnitude that is set in the multimeter, and it is not able to change that magnitude. why does this happen?

0

There are 0 best solutions below