Posted 7 months ago by Porta, Noteim
I have a Keithley 2700 which, according to the datasheet table "DC MEASUREMENT SPEEDS", should be able to measure up to 2500 readings per second. However, I don't seem to get higher than about 200 readings per second. I would really appreciate some guidance to know what am I configuring wrong. These are the commands that I am sending to the instrument:
  1. from labinstruments.instruments import Keithley2700
  2. import numpy
  3. import sys
  4. from time import sleep
  5.  
  6. def main():
  7.     keithley = Keithley2700(
  8.         Serial_kwargs = dict(
  9.             port = '/dev/ttyUSB0',
  10.             timeout = 1,
  11.             xonxoff = True,
  12.             baudrate = 9600,
  13.             write_timeout = 1,
  14.         ),
  15.         reset_upon_connection = False,
  16.     )
  17.     print('Connected with', keithley.idn)
  18.     keithley.reset() # Sends the `*RST` command.
  19.  
  20.     keithley.write('CONFIGURE:RESISTANCE')
  21.     keithley.write('SENSE:RESISTANCE:RANGE:UPPER 99e3') # Fixed range, as suggested in the user manual, section "Optimizing measurement speed".
  22.     keithley.write('SENSE:RESISTANCE:NPLCycles 0.01') # Value reported in the datasheet to reach 2500 readings per second.
  23.     keithley.write('SENSE:RESISTANCE:DIGITS 4.5') # Value reported in the datasheet to reach 2500 readings per second.
  24.     keithley.write('SENSE:RESISTANCE:AVERAGE:STATE off') # Disable the filter, as suggested in the user manual, section "Optimizing measurement speed".
  25.     keithley.write('SYSTEM:AZERO:STATE off')
  26.  
  27.  
  28.     keithley.write('INIT:CONTINUOUS off') # Stop the DMM.
  29.     keithley.write('TRAC:CLEAR') # Clear the buffer.
  30.     keithley.write('TRAC:CLE:AUTO on') # Enable buffer.
  31.     keithley.write(f'TRAC:POINTS 1000') # Set number of samples to be stored.
  32.     keithley.write('TRAC:FEED sense') # Set source of data to store in the buffer.
  33.     keithley.write('TRAC:FEED:CONTROL next') # Set the buffer to store the next N incoming data samples, then stop storing.
  34.     keithley.write('INIT:CONTINUOUS on') # Start the DMM, so it begins to fill the buffer, hopefully at 2500 readings per second.
  35.  
  36.     sleep(2) # Wait 2 seconds, should be more than enough for the buffer to be completely full, if the instrument were sampling at 2500 readings per second.
  37.  
  38.     keithley.write('FORMAT:ELEMENTS reading, tstamp') # Configure the instrument to return the value and timestamp of each sample.
  39.  
  40.     data = keithley.query('TRAC:DATA?') # Read the data from the instrument into the PC.
  41.     data = [float(_) for _ in data.split(',')]
  42.     t = data[1::2] # Odd elements are the timestamps.
  43.     R = data[::2] # Even elements are the measured values.
  44.  
  45.     print(numpy.diff(t))
  46.     print(f'Number of points received: {len(R)}')
  47.     print(f'R = {numpy.mean(R)} ± {numpy.std(R)} Ohm')
  48.     average_sampling_rate = numpy.mean(numpy.diff(t))
  49.     print(f'Sampling frequency = {1/average_sampling_rate} Hz')
  50.  
  51. if __name__ == '__main__':
  52. main()
and this code prints:
  1. [0.001 0.016 0.003 0.006 0.003 0.017 0.015 0.004 0.003 0.003 0.004 0.003
  2.  0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
  3.  0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
  4.  0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
  5.  0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
  6.  0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  7.  0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
  8.  0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  9.  0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
  10.  0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  11.  0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
  12.  0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  13.  0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
  14.  0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  15.  0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
  16.  0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  17.  0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
  18.  0.003 0.004 0.014 0.003 0.004 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  19.  0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
  20.  0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
  21.  0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
  22.  0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
  23.  0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
  24.  0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
  25.  0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
  26.  0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
  27.  0.003 0.004 0.003 0.003 0.004 0.003 0.014 0.004 0.003 0.004 0.003 0.003
  28.  0.004 0.003 0.014 0.004 0.003 0.004 0.003 0.003 0.004 0.003 0.014 0.004
  29.  0.003 0.004 0.003 0.003 0.004 0.003 0.014 0.004 0.003 0.004 0.003 0.003
  30.  0.004 0.003 0.015 0.003 0.003 0.004 0.003 0.003 0.004 0.003 0.015 0.003
  31.  0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004
  32.  0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003
  33.  0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004
  34.  0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003
  35.  0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004
  36.  0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.005 0.005 0.004 0.019 0.004
  37.  0.004 0.005 0.003 0.006 0.014 0.015 0.005 0.004 0.006]
  38. Number of points received: 442
  39. R = 74881.35412579186 ± 11.688024207233193 Ohm
  40. Sampling frequency = 205.11627906976744 Hz
If the sleep(2) of line 37 is changed to sleep(6), then it prints:
  1. ...
  2. Number of points received: 1000
  3. R = 74863.632661 ± 11.792219736100387 Ohm
  4. Sampling frequency = 208.25515947467167 Hz
How can I reach 2500 readings per second?
Note: The class Keithley2700 is a simple wrapper around the serial port.
Posted 7 months ago by C, Andrea
You can try turning off the display:   :DISPLAY:ENABLE:STAT OFF

I found an FAQ on tek.com for this topic.  It is indicating that the TRACE buffer is not the fastest one.

Max Reading Rate from 2700, 2701 or 2750

Alternate commands:
  1. *RST
  2.  
  3. :SENSE:FUNC 'VOLT:DC'
  4.  
  5. :SENSE:VOLT:NPLC 0.01
  6.  
  7. :SENSE:VOLT:RANGE 10
  8.  
  9. :SENSE:VOLT:AVER:STAT OFF
  10.  
  11. :SAMPLE:COUNT 1000
  12.  
  13. :TRIG:DELAY 0.0
  14.  
  15. :SYSTEM:AZERO:STAT OFF
  16.  
  17. :DISPLAY:ENABLE:STAT OFF
  18.  
  19. :READ?
  20.  
  21. Now read the data...
  22.  
  23. To check for maximum speed apply a 1V RMS at 2Hz to the input. Run the above command sequence.
  24.  
  25. The 1000 readings should show one complete cycle or less. This shows the meter is taking data at least at a rate of 2000 readings per second.

You must be signed in to post in this forum.