From c8b29b26d1156adc97cc480d3396271c06851bce Mon Sep 17 00:00:00 2001 From: l_samenv Date: Mon, 22 Aug 2022 14:51:05 +0200 Subject: [PATCH] dil prep --- tcl/dilprep.config | 41 +++++++++++++++++++++++++++++++++++++++++ tcl/startup/dilprep.tcl | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 tcl/dilprep.config create mode 100644 tcl/startup/dilprep.tcl diff --git a/tcl/dilprep.config b/tcl/dilprep.config new file mode 100644 index 0000000..f0b16b3 --- /dev/null +++ b/tcl/dilprep.config @@ -0,0 +1,41 @@ +deviceDesc = dilution preparation resistance reading + +Layout dilprep + +makenv dilprep -driver dilprep + +# lakeshore 370 monitor +makenv tmon -driver 370_lsc -port linse-6837-ts:3001 { + lsc_sensor samplehtr -channel 1 -sensor raw -excitation 200mV -range 6kOhm -color black + lsc_sensor sample -channel 3 -sensor raw -excitation 200mV -range 2kOhm -color blue + lsc_sensor mix -channel 4 -sensor raw -excitation 200mV -range 6kOhm -color cyan + lsc_sensor stillt -channel 10 -sensor raw -excitation 200mV -range 6kOhm -color orange + lsc_sensor onek -channel 11 -sensor raw -excitation 200mV -range 6kOhm -color yellow + lsc_sensor sorb -channel 12 -sensor raw -excitation 200mV -range 632Ohm -color dark_violet +} + +# more than one softcal on the same raw value does not work properly +#makenv dil2 -driver softcal /tmon/sample/raw cx198 +#makenv dil3 -driver softcal /tmon/sample/raw cx262 +#makenv dil4 -driver softcal /tmon/sample/raw cx078 +makenv ts -driver softcal /tmon/sample/raw cx078 +#makenv sorb -driver softcal /tmon/sorb/raw c270 + +#GraphAdd dil2 K dil2 brown +#GraphAdd dil3 K dil3 green +#GraphAdd dil4 K dil4 green +GraphAdd ts K T_sample red +#GraphAdd sorb K sorb dark_violet +GraphAdd tmon.sorb.raw Ohm sorb dark_violet +GraphAdd tmon.onek.raw Ohm onek yellow +GraphAdd tmon.stillt.raw Ohm stillt orange +GraphAdd tmon.samplehtr.raw Ohm samplehtr black +GraphAdd tmon.sample.raw Ohm sample blue +GraphAdd tmon.mix.raw Ohm mix cyan + +tmon autoscan 1 +tmon sample/autorange 0 + +makenv tslope -driver slope /ts 1 +GraphAdd tslope K/min slope + diff --git a/tcl/startup/dilprep.tcl b/tcl/startup/dilprep.tcl new file mode 100644 index 0000000..62c73b3 --- /dev/null +++ b/tcl/startup/dilprep.tcl @@ -0,0 +1,37 @@ +proc dilprepLayout args { + set bad [list] + foreach {chan min max} { + /tmon/sorb 260 3290 + /tmon/onek 2000 2400 + /tmon/stillt 2000 2400 + /tmon/mix 2000 2400 + /tmon/samplehtr 2600 2800 + /ts 270 320 + } { + set val [silent 0 hval $chan] + if {$val < $min || $val > $max } { + lappend bad [lindex [split $chan /] end] + } + } + if {[enum_txt /dilprep/dil] eq "undef"} { + Style hotwarning + Label "detecting stick, please wait" + } elseif {[enum_txt /dilprep] eq "warmup"} { + Style hotwarning + Label "warming up [enum_txt /dilprep/dil], please wait before opening" + } elseif {[result _tmon status] eq "no response"} { + Style hotwarning + Label "LakeShore switched off" + } elseif {[result _tmon status] ne ""} { + Style hotwarning + Label "LakeShore not properly connected" + } elseif {$val == 0} { + Style hotwarning + Label "stick disconnected" + } elseif {[llength $bad] > 0} { + Style hotwarning + Label "bad channels: $bad" + } else { + Label "All channels OK on [enum_txt /dilprep/dil]" + } +}