Dear Tektalk community,
I have a few technical questions concerning the connexion between the Keithley current source model 6221 and the Keithley nanovoltmeter 2182A. I am trying to interconnect both instruments to remotely perform an IV curve measurement of my DUT using a basic sweep function. I interconnect both instruments using an RS232 and Tlink cable, as explained in the manual, using a GPIB connector to connect the 6221 model and the computer. I am using python 2.7 in a Windows 10 computer, and the python library pyvisa to communicate with the instruments. Attached you’ll find the python code that I have written.
In my code, I made sure that the Baud rate of both instruments is 19.2k using the following command:
I also make sure that the instrument setup is the one I intend with the following instructions:
:SYST:COMM:SERIal:SEND "SYST:FFIL ON"
Following that first section of the code, the rest of it consists of a copy of the ‘DC current sweep and measure’ and ‘DC current meas. Data collect’ scripts from the KI6221 example software provided by Keithley. When I run the code, everything seems to work nicely, the 2182A resets and readjusts the voltage range (hence I know the communication between 6221 and 2182A works), the sweep is armed in 6221 and it is performed. However, when I use keithley.query('SYST:COMM:SERIal:SEND "TRAC:DATA?"') command, as suggested in the keithley example script, the 6221 always shows an ERROR -420, which from the manual it consists of an attempt to read data from an empty output queue. Would this mean that the buffer from 2182A is empty? Furthermore, I have realised that this error message is displayed every time I try to do a query from 2182A, e.g., keithley.query(':SYST:COMM:SERIal:SEND ":TRAC:POIN?"'). It looks to me that the information flow between 6221 and 2182A is for some reason unidirectional, only working from 6221 to 2182A but not the other way around.
In order to overcome this issue, I decomposed the query instruction in two commands. First I write 'SYST:COMM:SERIal:SEND "TRAC:DATA?"' and next I read the state of the RS232 bus received by 6221 using keithley.query_ascii_values('SYST:COMM:SER:ENTer?', separator=','). Using these two commands, I manage to get the values of the voltage measured for a sweep provided that the number of points in the sweep is smaller than 16. This makes me believe that the 2182 can actually send information to 6221A, hence I don’t understand the nature of the ERROR -420 when using a query function as explained before.
Would you have any suggestions to solve this issue? I have been stuck with it for a few days now…
Let me know if more information is required.
P/S: the commented lines in the code are the tests that I performed described above. The parameters in the ‘Input parameters section’ are the values that I use which allow me to accurately measure a 18 Ohms resistor in a 4-wire measurement configuration.
Thank you very much,