/* Pseudo-Code Keithley 6430 or 2400 Series IV */ /* Bill Tompkins 8-20-15 */ /* Use code at your own risk */ /* Initial Keithley Meter Setup */ Write(AddLineFeed("T4,1X")); //Trigger, Sweep on Front Panel (program pushes button via software) Write(AddLineFeed("*RST")); Write(AddLineFeed(":SENS:FUNC:CONC OFF")); Write(AddLineFeed(":SOUR:FUNC CURR")); Write(AddLineFeed(":SENS:VOLT:PROT 1")); Write(AddLineFeed(":SOUR:CURR:START 0.1E-3")); Write(AddLineFeed(":SOUR:CURR:STOP 10E-3")); Write(AddLineFeed(":SOUR:CURR:STEP 0.1E-3")); Write(AddLineFeed(":SOUR:CURR:MODE SWE")); Write(AddLineFeed(":SOUR:SWE:RANG AUTO")); Write(AddLineFeed(":SOUR:SWE:SPAC LIN")); Write(AddLineFeed(":TRIG:COUN 100")); Write(AddLineFeed(":SOUR:DEL 0.01")); Write(AddLineFeed(":OUTP ON")); If(SerialPoll() And SRQ_BIT5){ //SQR Error Trap Write(AddLineFeed("U1X")); //Read ERROR String Read(RemoveLineFeed(ReadString(5000))) } Write(AddLineFeed("*CLS")) Write(AddLineFeed(":READ?")) Write(AddLineFeed("STAT:MEAS?")) for(;;){ TimeDelay(0.1); //delay in Sec if (SerialPoll() And SRQ_BIT6) //SQR Sweep Done exitfor; } Write(AddLineFeed("*ESR?")) Read(RemoveLineFeed(ReadString(5000))) Write(AddLineFeed(":READ?")) /* Set IV Measurement */ Write(AddLineFeed("G4X")); //No Prefix, No Suffix, Number of Data Points Write(AddLineFeed("W1, 0.1, 1, 0.1X")); //Waveform - Single Staircase, Start Dwell Time, Stop Bleed Time, Step Delay Write(AddLineFeed("V 0,1, 0.025, 0X")); //DC Sweep If(SerialPoll() And SRQ_BIT5){ //SQR Error Trap Write(AddLineFeed("U1X")); //Read ERROR String Read(RemoveLineFeed(ReadString(5000))) } /* Actual IV Measurement */ Write(AddLineFeed(":OUTP ON")); Write(AddLineFeed(":READ?")); If (SerialPoll() And SRQ_BIT6){ //SQR Error Trap Write(AddLineFeed(InsertLF("U1X")); //Read ERROR String Read(RemoveLineFeed(ReadString(5000))); } Write(AddLineFeed("B3X")); //Transfer Current Data to Buffer 'B' Write(AddLineFeed("N0X")); //Bias Off Write(AddLineFeed("B2, 1, 300X")); //Read Buffer 'B' - 3 times the size for Capacitance, Resistance, and Voltage Data Read(RemoveLineFeed(ReadString(5000))); If (SerialPoll() And SRQ_BIT6){ //SQR Error Trap Write(AddLineFeed(InsertLF("U1X")); //Read ERROR String Read(RemoveLineFeed(ReadString(5000))); }