Currently I am working on the acquisition of electrical contact resistance, for which I will be using a Keithley 2400 sourcemeter and a Keithley 2182a nanovoltmeter. Both of the instruments are connected to a desktop computer via USB with a Keithley KUSB-488b adapter.

I am working with Python, the Pyvisa module, and the National Instruments backend (NI VISA) to create a script that will allow me to conduct the measurements needed. However I am running into trouble communicating with the instruments. I have run a couple of simple scripts, based on the official documentation provided by the developers of Pyvisa, but am unable to connect with either instrument. The following simple block of code may aid my explanation:

(1) >>> import pyvisa (2) >>> rm = pyvisa.ResourceManager() (3) >>> rm.list_resources() (4)  ('ASRL3::INSTR', ASRL4::INSTR', 'ASRL8::INSTR', 'ASRL14::INSTR') (5) >>> inst = rm.open_resource(' # Instrument address here # ') (6) >>> print(inst.query("*IDN?")

The result in line (4) should give me a list of the addresses of my instruments. However, none of these are correct, hence I get a timeout error (VI_ERROR_TMO) when I try the four addresses provided by line (4). The expected output in line (4) of this simple code block would be the GPIB addresses of both instruments, as per the documentation. I tried using the KI-488 Diagnostics Tool to communicate with both devices. Both of which I successfully communicated with. The SMU's address is GPIB::24 and the nanovoltmeter is GPIB::7.

I also tried passing the GPIB addresses that I obtained from the diagnostic tools in more complex scripts (current sweep). However this resulted in pyvisa.errors.VisaIOError: VI_ERROR_LIBRARY_NFOUND (-1073807202). I searched online for similar errors, most of which are an outcome of missing dll or incorrect bitness. However this is not my case, since a simple python -m visa info proves that the backends implemented are correct.

Additionally I tried installing Keithley I/O Layer, but I was unsuccessful nonetheless. Also, in the Keithley communicator both devices do in fact appear with their corresponding GPIB address. The issue is working with Python and the proper address.

I would really appreciate any help that could be provided. Thanks in advanced.

-Bruno

More Bruno Alderete's questions See All
Similar questions and discussions