Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LS372 Agent: Add ability in config file to set channel resistance range #500

Merged
merged 8 commits into from
Aug 9, 2023
20 changes: 17 additions & 3 deletions docs/agents/lakeshore372.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Lakeshore 372 configuration file::
excitation_mode: 'voltage'
excitation_value: 2.0e-6
autorange: 'on'
resistance_range: 2e3
dwell: 15 # seconds
pause: 10 # seconds
calibration_curve_num: 23
Expand All @@ -68,9 +69,10 @@ Lakeshore 372 configuration file::
excitation_mode: 'voltage'
excitation_value: 2.0e-6
autorange: 'off'
resistance_range: 2.0e+3
dwell: 10 # seconds
pause: 3 # seconds
calibruation_curve_num: 28
calibration_curve_num: 28
temperature_coeff: 'negative'
LSA2761:
device_settings:
Expand All @@ -81,6 +83,7 @@ Lakeshore 372 configuration file::
excitation_mode: 'voltage'
excitation_value: 2.0e-6
autorange: 'on'
resistance_range: 2.0e+3
dwell: 15 # seconds
pause: 10 # seconds
calibration_curve_num: 33
Expand All @@ -90,15 +93,17 @@ Lakeshore 372 configuration file::
excitation_mode: 'voltage'
excitation_value: 2.0e-6
autorange: 'off'
resistance_range: 2.0e+3
dwell: 10 # seconds
pause: 3 # seconds
calibruation_curve_num: 36
calibration_curve_num: 36
temperature_coeff: 'negative'
3:
enable: 'on'
excitation_mode: 'voltage'
excitation_value: 2.0e-6
autorange: 'on'
resistance_range: 2.0e+3
dwell: 15 # seconds
pause: 10 # seconds
calibration_curve_num: 34
Expand All @@ -108,11 +113,20 @@ Lakeshore 372 configuration file::
excitation_mode: 'voltage'
excitation_value: 2.0e-6
autorange: 'off'
resistance_range: 2.0e+3
dwell: 10 # seconds
pause: 3 # seconds
calibruation_curve_num: 35
calibration_curve_num: 35
temperature_coeff: 'negative'

.. note::
For setting a 372 channel to a specific resistance range, be sure to check
that autorange is set to 'off'. Else, the autorange setting will persist
over your desired resistance range.

.. note::
Make sure values like excitation and resistance are in float form as shown
in the example. Ex: always 2.0e+3, never 2e3

Docker Compose
``````````````
Expand Down
4 changes: 4 additions & 0 deletions socs/agents/lakeshore372/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,10 @@ def input_configfile(self, session, params=None):
elif ls_chann_settings[i]['autorange'] == 'off':
ls.channels[i].disable_autorange()
self.log.info("autorange off")
# set to desired resistance range after disabling autorange
resistance_range = ls_chann_settings[i]['resistance_range']
ls.channels[i].set_resistance_range(resistance_range)
self.log.info("resistance range for CH.{channel} set to {get_res}, the closest valid range to {res}".format(channel=i, get_res=ls.channels[i].get_resistance_range(), res=resistance_range))

excitation_mode = ls_chann_settings[i]['excitation_mode']
ls.channels[i].set_excitation_mode(excitation_mode)
Expand Down