Commit 4daef5c7 authored by Anthony Mauro's avatar Anthony Mauro

An error for reading the temperature does not stop the code but return 'nan'

parent aadbd034
Pipeline #11644 failed with stages
in 30 minutes and 24 seconds
......@@ -260,12 +260,21 @@ class LakeshoreBase(Controller, LogMixin):
channel = tinput.config.get("channel")
read_unit = tinput.config.get("unit", "Kelvin")
if read_unit == "Kelvin":
return self._lakeshore.read_temperature(channel, "Kelvin")
try:
return self._lakeshore.read_temperature(channel, "Kelvin")
except ValueError:
return float("NAN")
elif read_unit == "Celsius":
return self._lakeshore.read_temperature(channel, "Celsius")
try:
return self._lakeshore.read_temperature(channel, "Celsius")
except ValueError:
return float("NAN")
elif read_unit == "Sensor_unit":
# sensor unit can be Ohm or Volt depending on sensor type
return self._lakeshore.read_temperature(channel, "Sensor_unit")
try:
# sensor unit can be Ohm or Volt depending on sensor type
return self._lakeshore.read_temperature(channel, "Sensor_unit")
except ValueError:
return float("NAN")
# the method state_input(self, tinput) is not implemented
# (is inherited from temp.py)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment