Posted Wed, 04 Sep 2024 14:17:59 GMT 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:
from labinstruments.instruments import Keithley2700
import numpy
import sys
from time import sleep

def main():
    keithley = Keithley2700(
        Serial_kwargs = dict(
            port = '/dev/ttyUSB0',
            timeout = 1,
            xonxoff = True,
            baudrate = 9600,
            write_timeout = 1,
        ),
        reset_upon_connection = False,
    )
    print('Connected with', keithley.idn)
    keithley.reset() # Sends the `*RST` command.

    keithley.write('CONFIGURE:RESISTANCE')
    keithley.write('SENSE:RESISTANCE:RANGE:UPPER 99e3') # Fixed range, as suggested in the user manual, section "Optimizing measurement speed".
    keithley.write('SENSE:RESISTANCE:NPLCycles 0.01') # Value reported in the datasheet to reach 2500 readings per second.
    keithley.write('SENSE:RESISTANCE:DIGITS 4.5') # Value reported in the datasheet to reach 2500 readings per second.
    keithley.write('SENSE:RESISTANCE:AVERAGE:STATE off') # Disable the filter, as suggested in the user manual, section "Optimizing measurement speed".
    keithley.write('SYSTEM:AZERO:STATE off')


    keithley.write('INIT:CONTINUOUS off') # Stop the DMM.
    keithley.write('TRAC:CLEAR') # Clear the buffer.
    keithley.write('TRAC:CLE:AUTO on') # Enable buffer.
    keithley.write(f'TRAC:POINTS 1000') # Set number of samples to be stored.
    keithley.write('TRAC:FEED sense') # Set source of data to store in the buffer.
    keithley.write('TRAC:FEED:CONTROL next') # Set the buffer to store the next N incoming data samples, then stop storing.
    keithley.write('INIT:CONTINUOUS on') # Start the DMM, so it begins to fill the buffer, hopefully at 2500 readings per second.

    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.

    keithley.write('FORMAT:ELEMENTS reading, tstamp') # Configure the instrument to return the value and timestamp of each sample.

    data = keithley.query('TRAC:DATA?') # Read the data from the instrument into the PC.
    data = [float(_) for _ in data.split(',')]
    t = data[1::2] # Odd elements are the timestamps.
    R = data[::2] # Even elements are the measured values.

    print(numpy.diff(t))
    print(f'Number of points received: {len(R)}')
    print(f'R = {numpy.mean(R)} ± {numpy.std(R)} Ohm')
    average_sampling_rate = numpy.mean(numpy.diff(t))
    print(f'Sampling frequency = {1/average_sampling_rate} Hz')

if __name__ == '__main__':
    main()
and this code prints:
[0.001 0.016 0.003 0.006 0.003 0.017 0.015 0.004 0.003 0.003 0.004 0.003
 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
 0.003 0.004 0.014 0.003 0.004 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004
 0.003 0.003 0.004 0.003 0.003 0.004 0.014 0.004 0.003 0.003 0.004 0.003
 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003
 0.004 0.003 0.014 0.004 0.003 0.003 0.004 0.003 0.004 0.003 0.014 0.004
 0.003 0.004 0.003 0.003 0.004 0.003 0.014 0.004 0.003 0.004 0.003 0.003
 0.004 0.003 0.014 0.004 0.003 0.004 0.003 0.003 0.004 0.003 0.014 0.004
 0.003 0.004 0.003 0.003 0.004 0.003 0.014 0.004 0.003 0.004 0.003 0.003
 0.004 0.003 0.015 0.003 0.003 0.004 0.003 0.003 0.004 0.003 0.015 0.003
 0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004
 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003
 0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004
 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003
 0.003 0.004 0.003 0.004 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.004
 0.003 0.003 0.015 0.003 0.003 0.004 0.003 0.005 0.005 0.004 0.019 0.004
 0.004 0.005 0.003 0.006 0.014 0.015 0.005 0.004 0.006]
Number of points received: 442
R = 74881.35412579186 ± 11.688024207233193 Ohm
Sampling frequency = 205.11627906976744 Hz
If the sleep(2) of line 37 is changed to sleep(6), then it prints:
...
Number of points received: 1000
R = 74863.632661 ± 11.792219736100387 Ohm
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 Wed, 25 Sep 2024 12:56:30 GMT 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:
*RST

:SENSE:FUNC 'VOLT:DC'

:SENSE:VOLT:NPLC 0.01

:SENSE:VOLT:RANGE 10

:SENSE:VOLT:AVER:STAT OFF

:SAMPLE:COUNT 1000

:TRIG:DELAY 0.0

:SYSTEM:AZERO:STAT OFF

:DISPLAY:ENABLE:STAT OFF

:READ?

Now read the data...

To check for maximum speed apply a 1V RMS at 2Hz to the input. Run the above command sequence.

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.