Skip to content

Commit

Permalink
feat: Add channelized Lakeshore Model336 Driver
Browse files Browse the repository at this point in the history
Add a driver for the Lakeshore Model 336 temperature controller
using new channelization implementation.
  • Loading branch information
spauka committed Apr 10, 2017
1 parent 442c0d2 commit d7f9433
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions qcodes/instrument_drivers/Lakeshore/Model_336.py
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.

0 comments on commit d7f9433

Please sign in to comment.