Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Did you mean: 

Sweep not measuring nanoAmps or microVolts

Go to solution

Hi everyone.

I apologise if this is a straightforward question.


I'm using a Keithley 2410. I have a vi (modified from the NI example IV sweep code, labview 15) that performs a logarithmic sweep between -1e-6 and -400 Volts, and back again. The results are then sent to an external file, using the Write Measurement to File subVI, the data is converted using Convert to Dynamic Data.

The code executes successfully.

However: the sweep only records the current to the microAmp, and the Voltage to 10mV (it records 0 until the sweep reaches these values). I need it to measure to nanoAmp, and to microVolt.

I could get the precision I need manually, but I'm hoping there is a setting I've overlooked that means I can still use the labview code.


The instructions sent to the Keithley are:



:_CURR:_PROT 5E-6 






:_SOUR:_DEL 1;








The instructions are repeated on the downwards sweep, with the exception :_SOUR:_SWE:_DIR DOWN

Thanks for your help

0 Kudos
Message 1 of 8

You should attach your code if you want help debugging it!  Without the LabVIEW code we can only guess.


Here's my guess.  Your printout of the SCPI commands shows that you have set a manual range for current measurement (5E-6Amps), but its doesn't show that the autorange feature is turned on. (SCPI like ":SENS:CURR:RANG:AUTO")  If you look at the code for the "Configure" you should have it setup with Enable Auto Range=True.  


If that doesn't work for you then there's more going on with your modifications and we need to see the code.





0 Kudos
Message 2 of 8

Hi Craig,


I tried SCPI autorange like you suggested, however it doesn't seem to have made a difference.

I've attached my code, and the output file so you can see what's happening in more detail.

The sensor has a strict 1microAmp compliance level, so I really need the setup to measure the nanoAmp range!

I would also like to have the measurements to 2 significant digits if possible, though that's a secondary concern at the moment.


thanks for your help


Download All
0 Kudos
Message 3 of 8

Your code is quite messy and hard to follow, making it neater will help you debug in future.


I think your code is missing two things:


1) You don't turn the output of the SMU ON before you do the Ascending sweep, only before the Descending half.


2) I don't see where you set a compliance limit.  You try to set a range limit, but that's not the same.  Compliance limits physically limit the voltage or current during test while Range limit simply ignores any voltage or current above its measurement range.  Better check you didn't fry what you are testing.


Here's a good example of how to do what  you are trying to do -


Hope that helps.


0 Kudos
Message 4 of 8

Oops, my bad.  Looking at the code again I see compliance and output are both there just quite obfuscated by messy wires.  Not sure what's wrong exactly, and I can't test until tomorrow. 


A suggestion would be to try the previous mentioned example.  Then implement saving the file.  I wouldn't use the dynamic data conversion before saving the file like you did, just use "Write delimited" -


As you can see you have the option to limit the precision using the "format" input.  Use ".%2f","%.2e" or "%.2g" in your case to get 2 digits of precision.  See this for more formatting options -





Message 5 of 8

Hi Craig


Changing dynamic data to Write Delimited Spreadsheet has improved the situation,

Using "%.2e" or "%.2g" records the current properly.

Unfortunately it's still not recording Voltage below 50mV.


0 Kudos
Message 6 of 8

I've just had a chance to look at your Excel file.  Are you taking logarithmic steps?  If so I think the SMU is not autoranging the source range but using the 1000V range, which has a limited 50mV resolution.  You should run your code again and look at the settings for range after its finished.


Did you try the code I suggested?  Using a "List Sweep" and autoranging source and measure features you should be able to set the exact source value you want and measure on the most sensitive scale range as well.  Let me know if that works for you. 



0 Kudos
Message 7 of 8
Accepted by topic author ac20g13

Ok, I did a few tests with a ~100kOhm resistor. 


I wrote 3 programs;

  • one like yours using 2 internal sweeps (
  • one like I suggested using the "list sweep" feature (
  • one explicitly setting the voltage and then doing the measurement. (



  • I was always able to measure nA.  If I used 4 wire "Remote Sense Mode" I could get lower current readings.  But I'm using BNC so nA is about as accurate as you can get with these cables. 
  • The pt-by-pt sweep worked just fine, but was slow.
  • The built in sweeps (internal sweep and list sweep) as shown in the examples that come with the driver have a limitation.  They use compliance and max voltage to FIX the source and measurement scale before the measurement starts.  This means that if you span mV - kV you are limited to the kV scale resolution.  In my case I had a K2400 handy so limited to 100V scale which limits Vout to 5mV. Any point that should be less than 5mV was 0V and it resulted in a nA reading.


This seemed wrong for the internal sweep method.  At first I thought it was the Log pts, so I RTFM.  Of course there's a SCPI command buried in there for :SOUR:SWE:RANG <BEST,AUTO,FIXed> which fixes the problem I was seeing.  I implemented a VI for it, since the K24xx driver doesn't have it.


Attached are all 3 versions of the code with default K2400 data saved as defaults.  Different model K24xx SMUs will have different scale range limits, and will result in different measured values.








Message 8 of 8