forked from microsoft/Qcodes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add channelized Lakeshore Model336 Driver
Add a driver for the Lakeshore Model 336 temperature controller using new channelization implementation.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
import numpy as numpy | ||
from qcodes import Parameter, VisaInstrument, InstrumentChannel, ChannelList | ||
from qcodes.utils.validators import Numbers, Enum, Strings | ||
|
||
class SensorChannel(InstrumentChannel): | ||
""" | ||
A single sensor channel of a temperature controller | ||
""" | ||
|
||
_CHANNEL_VAL = Enum("A", "B", "C", "D") | ||
|
||
def __init__(self, parent, name, channel): | ||
super().__init__(parent, name) | ||
|
||
# Validate the channel value | ||
self._CHANNEL_VAL.validate(channel) | ||
self._channel = channel # Channel on the temperature controller. Can be A-D | ||
|
||
# Add the various channel parameters | ||
self.add_parameter('temperature', get_cmd='KRDG? {}'.format(self._channel), | ||
get_parser=float, | ||
label='Temerature', | ||
unit='K') | ||
self.add_parameter('sensor_raw', get_cmd='SRDG? {}'.format(self._channel), | ||
get_parser=float, | ||
label='Raw_Reading', | ||
unit='Ohms') # TODO: This will vary based on sensor type | ||
self.add_parameter('sensor_status', get_cmd='RDGST? {}'.format(self._channel), | ||
val_mapping={'OK': 0, 'Invalid Reading': 1, 'Temp Underrange': 16, 'Temp Overrange': 32, | ||
'Sensor Units Zero': 64, 'Sensor Units Overrange': 128}, label='Sensor_Status') | ||
|
||
self.add_parameter('sensor_name', get_cmd='INNAME? {}'.format(self._channel), | ||
get_parser=str, set_cmd='INNAME {},\"{{}}\"'.format(self._channel), vals=Strings(15), | ||
label='Sensor_Name') | ||
|
||
|
||
class Model_336(VisaInstrument): | ||
""" | ||
Lakeshore Model 336 Temperature Controller Driver | ||
Controlled via sockets | ||
""" | ||
|
||
def __init__(self, name, address, **kwargs): | ||
super().__init__(name, address, terminator="\r\n", **kwargs) | ||
|
||
self.channels = ChannelList(self, "TempSensors", SensorChannel) | ||
for chan in ('A', 'B', 'C', 'D'): | ||
self.channels.append(SensorChannel(self, 'Chan{}'.format(chan), chan)) | ||
self.channels.lock() | ||
|
||
self.connect_message() |
Empty file.