Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Keithley_2400 READ? format may be inconsistent #1876

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions qcodes/instrument_drivers/tektronix/Keithley_2400.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from qcodes import VisaInstrument
from qcodes.utils.validators import Strings, Enum
from qcodes.utils.helpers import create_on_off_val_mapping


class Keithley_2400(VisaInstrument):
Expand Down Expand Up @@ -73,9 +74,9 @@ def __init__(self, name, address, **kwargs):
label='Sense mode')

self.add_parameter('output',
get_parser=int,
set_cmd=':OUTP:STAT {:d}',
get_cmd=':OUTP:STAT?')
set_cmd=':OUTP:STAT {}',
get_cmd=':OUTP:STAT?',
val_mapping=create_on_off_val_mapping(on_val="1", off_val="0"))

self.add_parameter('nplcv',
get_cmd='SENS:VOLT:NPLC?',
Expand All @@ -97,6 +98,20 @@ def __init__(self, name, address, **kwargs):
docstring="Measure resistance from current and voltage "
"Note that it is an error to read current "
"and voltage with output off")

self.write(':TRIG:COUN 1;:FORM:ELEM VOLT,CURR')
astafan8 marked this conversation as resolved.
Show resolved Hide resolved
# This line sends 2 commands to the instrument:
# ":TRIG:COUN 1" sets the trigger count to 1 so that each READ? returns
# only 1 measurement result.
# ":FORM:ELEM VOLT,CURR" sets the output string formatting of the the
# Keithley 2400 to return "{voltage}, {current}".
# Default value on instrument reset is "VOLT, CURR, RES, TIME, STATUS";
# however, resistance, status, and time are unused in this driver and
# so are omitted.
# These commands do not reset the instrument but do the minimal amount
# to ensure that voltage and current parameters can be read from the
# instrument, in the event that output formatting of the instrument was
# previously changed to some other unknown state.
self.connect_message()

def _get_read_output_protected(self) -> str:
Expand Down