-
Notifications
You must be signed in to change notification settings - Fork 18
ls372: servo_to_temperature crashes if the control input (Channel A) is used for the servo #983
Copy link
Copy link
Open
Labels
Description
When calling the servo_to_temperature() task, if the sample heater is set to use the Control Input (Channel A), then this cast to int() fails:
socs/socs/agents/lakeshore372/agent.py
Lines 677 to 680 in 0323abc
| # Check we're scanning same channel expected by heater for control. | |
| if self.module.get_active_channel().channel_num != int(self.module.sample_heater.input): | |
| session.add_message('Changing active channel to expected heater control input') | |
| self.module.set_active_channel(int(self.module.sample_heater.input)) |
Example error:
2026-02-19T19:53:44+0000 Current still output is +00.00
2026-02-19T19:53:44+0000 get_still_output:4 Current still output is +00.00
2026-02-19T19:53:44+0000 get_still_output:4 Status is now "done".
2026-02-19T19:54:19+0000 start called for servo_to_temperature
2026-02-19T19:54:19+0000 servo_to_temperature:5 Status is now "starting".
2026-02-19T19:54:19+0000 servo_to_temperature:5 Status is now "running".
2026-02-19T19:54:20+0000 servo_to_temperature:5 Changing control to Closed Loop mode for servo.
2026-02-19T19:54:20+0000 servo_to_temperature:5 CRASH: [Failure instance: Traceback: <class 'ValueError'>: invalid literal for int() with base 10: 'A'
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:269:inContext
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:285:<lambda>
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:117:callWithContext
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:82:callWithContext
/opt/venv/lib/python3.10/site-packages/ocs/ocs_agent.py:984:_running_wrapper
/opt/venv/lib/python3.10/site-packages/socs/agents/lakeshore372/agent.py:678:servo_to_temperature
]
2026-02-19T19:54:20+0000 servo_to_temperature:5 Status is now "done".
2026-02-19T19:56:08+0000 start called for servo_to_temperature
2026-02-19T19:56:08+0000 servo_to_temperature:6 Status is now "starting".
2026-02-19T19:56:08+0000 servo_to_temperature:6 Status is now "running".
2026-02-19T19:56:09+0000 servo_to_temperature:6 CRASH: [Failure instance: Traceback: <class 'ValueError'>: invalid literal for int() with base 10: 'A'
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:269:inContext
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:285:<lambda>
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:117:callWithContext
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:82:callWithContext
/opt/venv/lib/python3.10/site-packages/ocs/ocs_agent.py:984:_running_wrapper
/opt/venv/lib/python3.10/site-packages/socs/agents/lakeshore372/agent.py:678:servo_to_temperature
]
2026-02-19T19:56:09+0000 servo_to_temperature:6 Status is now "done".
2026-02-19T19:56:46+0000 start called for set_heater_output
2026-02-19T19:56:46+0000 set_heater_output:7 Status is now "starting".
2026-02-19T19:56:46+0000 set_heater_output:7 Status is now "running".
2026-02-19T19:56:46+0000 display: power output: 0.0
2026-02-19T19:56:46+0000 Set sample heater display to power, output to 0.0
2026-02-19T19:56:46+0000 set_heater_output:7 Set sample display to power, output to 0.0
In practice, we've never used this input, but it appears to be the default control input for a freshly configured 372, and we should allow this configuration, since some users might make use of it.
Reactions are currently unavailable