-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from ThorstenGroh/feature/Keithley_2000-SCAN
Feature/keithley 2000 scan
- Loading branch information
Showing
3 changed files
with
399 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
qcodes_contrib_drivers/drivers/Tektronix/Keithley_2000_Scan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
from functools import partial | ||
from typing import TYPE_CHECKING | ||
|
||
from qcodes.instrument import InstrumentChannel | ||
|
||
if TYPE_CHECKING: | ||
from .Keithley_6500 import Keithley_6500 | ||
|
||
|
||
class Keithley_2000_Scan_Channel(InstrumentChannel): | ||
""" | ||
This is the qcodes driver for a channel of the 2000-SCAN scanner card. | ||
""" | ||
def __init__(self, dmm: "Keithley_6500", channel: int, **kwargs) -> None: | ||
""" | ||
Initialize instance of scanner card Keithley 2000-SCAN | ||
Args: | ||
dmm: Instance of digital multimeter Keithley6500 containing the scanner card | ||
channel: Channel number | ||
**kwargs: Keyword arguments to pass to __init__ function of InstrumentChannel class | ||
""" | ||
super().__init__(dmm, f"ch{channel}", **kwargs) | ||
self.channel = channel | ||
self.dmm = dmm | ||
|
||
self.add_parameter('resistance', | ||
unit='Ohm', | ||
label=f'Resistance CH{self.channel}', | ||
get_parser=float, | ||
get_cmd=partial(self._measure, 'RES')) | ||
|
||
self.add_parameter('resistance_4w', | ||
unit='Ohm', | ||
label=f'Resistance (4-wire) CH{self.channel}', | ||
get_parser=float, | ||
get_cmd=partial(self._measure, 'FRES')) | ||
|
||
self.add_parameter('voltage_dc', | ||
unit='V', | ||
label=f'DC Voltage CH{self.channel}', | ||
get_parser=float, | ||
get_cmd=partial(self._measure, 'VOLT')) | ||
|
||
self.add_parameter('current_dc', | ||
unit='A', | ||
label=f'DC current CH{self.channel}', | ||
get_parser=float, | ||
get_cmd=partial(self._measure, 'CURR')) | ||
|
||
def _measure(self, quantity: str) -> str: | ||
""" | ||
Measure given quantity at rear terminal of the instrument. Only perform measurement if rear terminal is | ||
active. Send SCPI command to measure and read out given quantity. | ||
Args: | ||
quantity: Quantity to be measured | ||
Returns: Measurement result | ||
""" | ||
if self.dmm.active_terminal.get() == 'REAR': | ||
self.write(f"SENS:FUNC '{quantity}', (@{self.channel:d})") | ||
self.write(f"ROUT:CLOS (@{self.channel:d})") | ||
return self.ask("READ?") | ||
else: | ||
raise RuntimeError("Front terminal is active instead of rear terminal.") |
Oops, something went wrong.