Qcodes example with Lakeshore 311

[1]:
from qcodes_contrib_drivers.drivers.Lakeshore.Model_331 import Model_331

Initialize instrument

We connect to the instrument using its GPIB address.

[2]:
lakeshore = Model_331(name="Lakeshore", address='GPIB0::12::INSTR')
Connected to: LSCI 331S (serial:331259, firmware:032301) in 0.13s

Read temperatures

We read the temperatures for both channels.

[3]:
print(lakeshore.A.temperature.label, ': ', lakeshore.A.temperature.get(), lakeshore.A.temperature.unit)
print(lakeshore.B.temperature.label, ': ', lakeshore.B.temperature.get(), lakeshore.B.temperature.unit)
temperature A :  294.63 K
temperature B :  284.32 K

Heater configuration

We read the heater output, heater range, heater input channel and heater setpoint.

[4]:
print(lakeshore.heater_output.label, ': ', lakeshore.heater_output.get(), lakeshore.heater_output.unit)
print(lakeshore.heater_range.label, ': ', lakeshore.heater_range.get(), lakeshore.heater_range.unit)
print(lakeshore.input.label, ': ', lakeshore.input.get(), lakeshore.input.unit)
print(lakeshore.setpoint.label, ': ', lakeshore.setpoint.get(), lakeshore.setpoint.unit)
heater output :  0.0 %
heater range :  off
input :  A
setpoint :  290.0 K

Now let’s turn on the heater and read the status again.

[5]:
lakeshore.setpoint.set(300)
lakeshore.heater_range.set('5W')
[6]:
print(lakeshore.heater_output.label, ': ', lakeshore.heater_output.get(), lakeshore.heater_output.unit)
print(lakeshore.heater_range.label, ': ', lakeshore.heater_range.get(), lakeshore.heater_range.unit)
print(lakeshore.input.label, ': ', lakeshore.input.get(), lakeshore.input.unit)
print(lakeshore.setpoint.label, ': ', lakeshore.setpoint.get(), lakeshore.setpoint.unit)
heater output :  100.0 %
heater range :  5W
input :  A
setpoint :  300.0 K

Now turn the heater off again.

[7]:
lakeshore.heater_range.set('off')

Close the instrument

[8]:
lakeshore.close()