Thank you, Ty. Below is my code for the reading buffer.<br>
<br>
inst.write('FORM:ELEM READ, TIME')<br>
inst.write('SYST:ZCH ON')<br>
<br>
inst.write('CURR:RANG 2e-9')<br>
inst.write('INIT')<br>
inst.write('SYST:ZCOR:ACQ')<br>
inst.write('SYST:ZCOR ON')<br>
<br>
inst.write('TRAC:CLE')<br>
inst.write('TRIG:COUN 100')<br>
inst.write('TRAC:POIN 100')   # Set no. of pt in the buffer<br>
inst.write('TRAC:FEED SENS')<br>
inst.write('TRAC:FEED:CONT NEXT')<br>
<br>
inst.write('SYST:ZCH OFF')<br>
time.sleep(2)<br>
<br>
inst.write('INIT')<br>
databuffer= inst.query('TRAC:DATA?', delay= 28)<br>
<br>
print(inst.query('SYSTem:ERRor?'))<br>
inst.write('*RST')<br>
-----<br>
<br>
I believe that I misunderstood TRAC:DATA. The statement asks the machine to return values stored in buffer to the computer's memory. I should have SYST:ZCH OFF' before TRAC:FEED SENS and TRAC:FEED:CONT NEXT because TRAC:FEED asks the machine to read current values to store in buffer (in the above case, 100 points in buffer).<br>
<br>
BTW, do I need TRAC:FEED:CONT NEXT, which seems to be redundant for reading current values to buffer?<br>
What about TRIG:COUN 100? TRAC:POIN 100 is the command to allocate 100 points in buffer for 100 current values in the later code.<br>
<br>
Below is my code for READ. It seems to be straightforward and has no problem.<br>
inst.write('SYST:ZCH ON')<br>
inst.write('CURR:RANG 2e-9')   # set to 2nA-range for ZCOR<br>
inst.write('INIT')<br>
inst.write('SYST:ZCOR:ACQ')<br>
inst.write('SYST:ZCOR ON')<br>
<br>
inst.write('CURR:RANG:AUTO ON')<br>
inst.write('SYST:ZCH OFF')<br>
<br>
inst.query(':READ?')