Skip to content

Commit

Permalink
LS372 Agent: Add ability in config file to set channel resistance ran…
Browse files Browse the repository at this point in the history
…ge (#500)

* add resistance range ability to config file task

* change resistance range of channel iff autorange off

* move log statement up to elif condition

* add the closest valid range set in the log statement

* add resistance_range to config file example

* fix for not adding resistance range line for all channels in config file ex

* fix calibration_curve_num type in docs

* add note about float and fix example accordingly
  • Loading branch information
sanahabhimani authored and d-hoshino2626 committed Apr 12, 2024
1 parent b4ba17d commit cad61d7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
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

0 comments on commit cad61d7

Please sign in to comment.