I have encountered the same issue on my unit. For me at least, the issue seems to be tied to the measurement range (even if a voltage is being set without actually measuring the current back).<br>
<br>
Andrea, I modified your script to sweep the voltage from 0 - 5V on each range, measuring the average time per setpoint do so. The script used either the time taken to successfully return the measured current, or, when not reading the current, by issuing the query "waitcomplete() print([[1]])" (significantly less elegant than the SCPI equivalent "*OPC?") following each voltage asserted to ensure the action had completed. <br>
 
<pre class="linenums prettyprint">my_instr.timeout= 50000;
measurements= 50;
measure_I = False;
check_complete = True;
I_ranges = [1, 100E-3, 10E-3, 1E-3, 100E-6, 10E-6, 1E-6, 100E-9, 10E-9]
#my_instr.write("reset()")
my_instr.write("status.clear()")
my_instr.write("errorqueue.clear()")
for MEAS_RANGE in I_ranges:
cmd_list = ["smu.source.func = smu.FUNC_DC_VOLTAGE",
"smu.source.autorange = smu.OFF",
"smu.source.range = 20",
"smu.source.ilimit.level = " + str(MEAS_RANGE),
"smu.source.delay = 0",
"smu.source.autodelay = smu.OFF",
"smu.source.readback = smu.OFF",
"smu.measure.func = smu.FUNC_DC_CURRENT",
"smu.measure.autorange = smu.OFF",
"smu.measure.range = " + str(MEAS_RANGE),
"smu.measure.nplc = 0.01",
"smu.measure.autozero.enable = smu.OFF"
]
for cmd in cmd_list:
my_instr.write(cmd)
#lets loop thru some source levels and measure speed with scope
debug = 1
voltage_list = {}
for i in range(0, measurements):
voltage_list[i] = i/10
#print(f'voltages:{voltage_list}')
my_instr.write("smu.source.output = smu.ON")
startTime = time.time()
for j in range(0,1):
for i in range( 0 ,len(voltage_list)):
my_instr.write("smu.source.level = " + str(voltage_list[i]))
if (measure_I):
my_instr.write("smu.measure.read()") #obtain a reading into the buffer
#print(my_instr.query("print(smu.measure.read())")) # this will slow you down!
if (check_complete):
my_instr.query("waitcomplete() print([[1]])") #confirm voltage is set before setting next value
#all done, turn output off
my_instr.write("smu.source.level = 0")
my_instr.write("smu.source.output = smu.OFF")
if (measure_I):
#bring the data back from the buffer
print(my_instr.query("printbuffer(1, defbuffer1.n, defbuffer1.readings)"))
endTime = time.time()
print(f'range: {MEAS_RANGE}')
print(f'avg time: {(endTime-startTime)/measurements} s')</pre>
<br>
When setting the voltage for each point and measuring the current:
<pre class="linenums prettyprint">measure_I = True;
check_complete = False;</pre>
<br>
and just setting each voltage but making no measurement:
<pre class="linenums prettyprint">measure_I = False;
check_complete = True;</pre>
<br>
I get a slowdown described by Jim, with a set-measure cycle of > 300 ms on the 10 nA range compared to ~ 5 ms on the higher ranges, and when just setting the voltages similar times of  ~300 ms and ~2 ms respectively<br>
<br>
Andrea, do you see the same behaviour on your unit, or have any idea how to optimise this when measuring on small current ranges?<br>
<br>