Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Keithley2400 programming in PyVISA: issues and questions

Post Reply
Posts: 1
Joined: March 15th, 2020, 7:28 pm
Country: United States

Keithley2400 programming in PyVISA: issues and questions

Post by Hsurdi » March 15th, 2020, 7:34 pm


I am trying to program the Keithley2400 in python using the pyvisa library via a usb-to-serial rs232 cable. My measurement is a IV sweep of a diode done every 10min for a total of 5days. So what I am trying to do is perform a IV sweep, source current and sense voltage in a 4-wire config, store the measured sweep data in the Keithley2400 buffer and read the buffer once it is finished measuring on to my laptop and store it with a timestamp. I could program a part of this but I am stuck and cannot complete the entire code and I have the following issues and questions:

1] The python code is attached (ki2400_IVsweep.py). After the "Ki2400.read()" statement, I get an error as

Code: Select all

"VisaIOError: VI_ERROR_ASRL_OVERRUN (-1073807252): An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived."
I have tried increasing the baud_rate of both, laptop and Keithley2400, together and individually but no luck.
2] I want to sweep the measurements from reverse bias to forward bias, therefore source negative current to positive current and hence sensing negative voltage to positive voltage respectively. How do I do that?
3] How do I add a software trigger so that when the measurement of one sweep is done, the ":FETCh?" command is written and then the Ki2400.read() statement is executed?
(12.51 KiB) Downloaded 65 times

Andrea C
Keithley Applications
Keithley Applications
Posts: 1481
Joined: October 15th, 2010, 10:35 am
Country: United States

Re: Keithley2400 programming in PyVISA: issues and questions

Post by Andrea C » April 8th, 2020, 3:42 am

The VISA error for the overrun on the RS-232 connection could mean you have a mismatch in settings (baud, etc.). Basically the communication is getting mangled.
What are the flow control settings? If none, try setting it to something (both 2400 and your COM port). XON/XOFF or hardware are typical values.

COM ports derived from low cost usb dongles can be quite dodgy sometimes depending on chipset/driver, so try a different one of those if visa errors persist.

Post Reply

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests