add archive (files probably no longer used)

here we can find old files
This commit is contained in:
l_samenv
2022-08-22 15:28:09 +02:00
parent 6c83e592de
commit 4d9961fe5c
85 changed files with 3635 additions and 0 deletions

11
tcl/archive/ACM.config Normal file
View File

@ -0,0 +1,11 @@
deviceDesc = ACM 45
#--ACM Levelmeter---
makenv cap acm
GraphAdd cap pF R dark_green

View File

@ -0,0 +1,4 @@
deviceDesc = Andeen Hagerling 2700
makenv cap -driver ah2700 -port ldmcc13-ts:3006

View File

@ -0,0 +1,5 @@
deviceDesc = lock-in 7265_7270
makenv la lockin
appendVars la.x/mV/X la.y/mV/Y la/Hz/freq la.amp/uV/Amp

View File

@ -0,0 +1,5 @@
deviceDesc = anders special device
defineTemperature tc
makenv tc -driver anders

View File

@ -0,0 +1,6 @@
addonDesc = asm120h leak detector with fluke 45
makenv voltage fluke45
hsetprop /voltage expr {$x -9}
GraphAdd voltage.calc log-mbar-l-s leak_rate dark_green

6
tcl/archive/asm142.addon Normal file
View File

@ -0,0 +1,6 @@
addonDesc = asm142 leak detector with moxa nport 5130a
makenv ld asm142 -port asm142.psi.ch:3001
GraphAdd ld log-mbar-l-s leak_rate dark_green
#GraphAdd ld log-mbar-l-s leak_rate dark_green

5
tcl/archive/asm340.addon Normal file
View File

@ -0,0 +1,5 @@
addonDesc = asm340 leak detector
makenv ld asm340
GraphAdd ld mbar.l/s leak_rate dark_green

8
tcl/archive/avs2.addon Normal file
View File

@ -0,0 +1,8 @@
addonDesc = AVS 2 bridges
makenv r1 avs -port Prologix-00-21-69-01-1b-34:1234
makenv r2 avs -port Prologix-00-21-69-01-19-57:1234
GraphAdd r1/Ohm/R1/auto
GraphAdd r2/Ohm/R2/auto

7
tcl/archive/bunker.addon Normal file
View File

@ -0,0 +1,7 @@
addonDesc = bunker room T monitor
makenv tt -driver [lsdriver] {
lsc_sensor source A -sensor pt-1000
lsc_sensor mid B -sensor pt-1000
lsc_sensor instr C -sensor pt-1000
}

14
tcl/archive/bunker.config Normal file
View File

@ -0,0 +1,14 @@
deviceDesc = bunker room T monitor
makenv tt -driver [lsdriver] {
lsc_sensor SEL_1 A -sensor pt-1000 -sensorname Selene_2
lsc_sensor SEL_2 B -sensor pt-1000 -sensorname Selene_1
lsc_sensor MK10_1 C -sensor type-k -sensorname MK10_1
lsc_sensor MK10_3 D -sensor type-k -sensorname MK10_3
}
#GraphAdd tt.SEL_1 K Selene_1
#GraphAdd tt.SEL_2 K Selene_2
#GraphAdd tt.MK10_1 K MK10_1
#GraphAdd tt.MK10_3 K MK10_3

View File

@ -0,0 +1,11 @@
stickDesc = 50 mm calibration stick (ORI1/ORI2/ILL1), old version with calib370 driver
makenv r -driver calib370
GraphAdd res.s1 Ohm R1
GraphAdd res.s2 Ohm R2
GraphAdd res.s2 Ohm R3
GraphAdd res.s3 Ohm R4
GraphAdd res.s4 Ohm R5
GraphAdd res.s5 Ohm R6

View File

@ -0,0 +1,77 @@
stickDesc = dilution insert (added gonio T on channel 2)
makenv ts -driver dil12 -reg370 /treg -mon370 /tmon
stick_sensors undefined undefined
# lakeshore 370 ctrl
makenv treg -driver 370_lsc -port dil3-ts:3001 {
# curves for sample:
# u02045 normal dil2 holder
# m59 old dil2 weak link
# ruoxben1k weak link with test ring heater
# ruox5k weak link with test ring heater
# standard ch6 cx262 (new sensor from Sep2014)
# heater/thermo ch8 rx262 (new field insensitive sensor Sep2014)
lsc_sensor sample -channel 6 -sensor cx262 -active 0 -excitation 20uV \
-color blue
lsc_sensor mix -channel 5 -sensor ruoxm0 -active 1 -excitation 20uV \
-color cyan
lsc_sensor samplehtr -channel 8 -sensor rx262 -active 0 -excitation 20uV \
-color black
# weaklink heater
lsc_loop set -channel 5 -maxheater 31mA -resist 316 -linearpower 0.2e-3
GraphAdd treg.set.reg K T_set dark_green
GraphAdd treg.set.power W Htr_Power dark_green
}
# fix a bug (in the 370?): set the HRTRNG to 7 (31mA) when needed
hsetprop /treg/set fix_range 7
# lakeshore 370 monitor
makenv tmon -driver 370_lsc -port dil3-ts:3003 {
lsc_sensor sorb -channel 12 -sensor c270 -excitation 2mV -color dark_violet
lsc_sensor onek -channel 11 -sensor ruoxm0 -excitation 2mV -color yellow
lsc_sensor stillt -channel 10 -sensor ruoxm0 -excitation 200uV -color orange
lsc_sensor goniot -channel 2 -sensor gonio -excitation 20uV -color red
lsc_sensor sample 3 clone
lsc_sensor samplehtr 1 clone
lsc_sensor mix 4 clone
}
proc graphvti {} {
GraphItem shown tt.ts 0
GraphItem label tt.set.reg VTI_reg
GraphItem label tt.set.power VTI_power
}
dolater 0 graphvti
tt ts/curve undefined
hsetprop /tt group "VTI temperature"
makeDil -port dil3-ts:3005
makenv sorb -driver piloop -invar "/tmon/sorb" -outvar "dil psorb" \
-prop 200 -int 15
makenv n2trap -driver n2_ccu -port dil3-ts:3007 "trap level" trap
# control on mix by default (todo: check for unknown first/check default mechanism)
ts control 6
treg set/deriv 0
# Sept 2015: we have too much mixture in the dump:
ts auto/dumptarget 150
defineTemperature ts
dil extVersion 0
# take last selected values when doing samenv reload
catch {default ts control}
catch {default ts heaterselect}
# _treg updatescript /treg/sample "lsc::updatesensor370 /ts"
# makenv td -driver loop -invar "/tmon/sample" -outvar "treg set" -prop 1 -int 100 -outmax 1

View File

@ -0,0 +1,76 @@
stickDesc = dilution insert (added channels 2 blue, 9 yellow, 16 red)
stick_sensors undefined undefined
makenv ts -driver dil12 -reg370 /treg -mon370 /tmon -hasturbo 1
# lakeshore 370 ctrl
makenv treg -driver 370_lsc -port dil4-ts:3001 {
# curves for sample:
# u02045 normal dil2 holder
# m59 weak link 2
# ruoxben1k weak link with test ring heater
# ruox5k weak link with test ring heater
# standard ch6 cx078 (new sensor from Sep2014)
# heater/thermo ch8 rx078 (new field insensitive sensor Sep2014)
lsc_sensor sample -channel 6 -sensor cx078 -active 0 -excitation 20uV \
-color blue
lsc_sensor mix -channel 5 -sensor ruoxm0 -active 1 -excitation 20uV \
-color cyan
lsc_sensor samplehtr -channel 8 -sensor rx078 -active 0 -excitation 20uV \
-color black
# weaklink heater
lsc_loop set -channel 5 -maxheater 31mA -resist 316 -linearpower 0.2e-3
GraphAdd treg.set.reg K T_set dark_green
GraphAdd treg.set.power W Htr_Power dark_green
}
# fix a bug (in the 370?): set the HRTRNG to 7 (31mA) when needed
hsetprop /treg/set fix_range 7
# lakeshore 370 monitor
makenv tmon -driver 370_lsc -port dil4-ts:3003 {
lsc_sensor sorb -channel 12 -sensor c270 -excitation 2mV -color dark_violet
lsc_sensor onek -channel 11 -sensor ruoxm0 -excitation 2mV -color yellow
lsc_sensor stillt -channel 10 -sensor ruoxm0 -excitation 200uV -color orange
lsc_sensor rblue -channel 2 -sensor raw -excitation 20uV
lsc_sensor ryellow -channel 9 -sensor raw -excitation 20uV
lsc_sensor rred -channel 16 -sensor raw -excitation 20uV
lsc_sensor sample 3 clone
lsc_sensor samplehtr 1 clone
lsc_sensor mix 4 clone
}
proc graphvti {} {
GraphItem shown tt.ts 0
GraphItem label tt.set.reg VTI_reg
GraphItem label tt.set.power VTI_power
}
dolater 0 graphvti
tt ts/curve undefined
hsetprop /tt group "VTI temperature"
makeDil -port dil4-ts:3005
makenv sorb -driver piloop -invar "/tmon/sorb" -outvar "dil psorb" \
-prop 200 -int 15
#makenv n2trap -driver n2_ccu -port dil4-ts:3007 "trap level" trap
# control on mix by default
ts control 6
treg set/deriv 0
defineTemperature ts
dil extVersion 1
# take last selected values when doing samenv reload
catch {default ts control}
catch {default ts heaterselect}
#makenv -objname condflow -driver bronkfreg -port dil4-ts:3008 200. condflow
#GraphAdd condflow mln-min condflow magenta

44
tcl/archive/dilRDR2.stick Normal file
View File

@ -0,0 +1,44 @@
stickDesc = dilution insert RDR2
# lakeshore 370 ctrl 1
makenv tmon -driver 370_lsc -port ldmse3-ts:3002 {
# curves for sample:
# ruoxben1k weak link with test ring heater
lsc_sensor mcbot -channel 14 -sensor raw -active 1 -excitation 63uV -color blue
lsc_sensor hxup -channel 9 -sensor raw -active 1 -excitation 63uV -color cyan
lsc_sensor still -channel 13 -sensor raw -active 1 -excitation 200uV -color red
# MC heater
lsc_loop set -channel 14 -maxheater 3.16mA -resist 120
GraphAdd tmon.set.reg K T_set dark_green
GraphAdd tmon.set.power W Htr_Power dark_green
}
# lakeshore 370 ctrl 2
makenv tsample -driver 370_lsc -port ldmse3-ts:3003 {
#curves for sample temperature:
lsc_sensor sample -channel 1 -sensor ruox408 -active 1 -excitation 63uV -color yellow
}
GraphAdd tmon.analog2 pers Htr_Still red
makenv tbath -driver avs45 -port ldmse-ts:3004
GraphAdd tbath Ohm R_bath
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv P6 -driver ana8 -controller ana -port ldmse3-ts:3008 0 $div100
makenv P7 -driver ana8 -controller ana -port ldmse3-ts:3008 1 $div100
makenv P8 -driver ana8 -controller ana -port ldmse3-ts:3008 2 $div100
makenv P10 -driver ana8 -controller ana -port ldmse3-ts:3008 3 $div100
makenv P2 -driver ana8 -controller ana -port ldmse3-ts:3008 4 $div 0 tpr010
makenv P4 -driver ana8 -controller ana -port ldmse3-ts:3008 5 $div 0 tpr010
GraphAdd P6 mbar
GraphAdd P7 mbar
GraphAdd P8 mbar
GraphAdd P10 mbar
GraphAdd P2 mbar
GraphAdd P4 mbar

View File

@ -0,0 +1,58 @@
stickDesc = dilution insert RDR2
# lakeshore 370 ctrl 1
makenv tmon -driver 370_lsc -port ldmse3-ts:3002 {
# curves for sample:
# ruoxben1k weak link with test ring heater
lsc_sensor mcbot -channel 14 -sensor raw -active 0 -excitation 63uV -color blue
lsc_sensor hxup -channel 9 -sensor raw -active 0 -excitation 63uV -color cyan
lsc_sensor still -channel 13 -sensor raw -active 1 -excitation 200uV -color red
# MC heater
lsc_loop set -channel 13 -maxheater 3.16mA -resist 120
GraphAdd tmon.set.reg K T_set dark_green
GraphAdd tmon.set.power W Htr_Power dark_green
}
# lakeshore 370 ctrl 2
makenv tsample -driver 370_lsc -port ldmse3-ts:3003 {
#curves for sample temperature:
lsc_sensor sample -channel 1 -sensor ruox408 -active 1 -excitation 63uV -color yellow
lsc_loop set -channel 1 -maxheater 3.16mA -resist 120
GraphAdd tsample.set.reg K T_set green
GraphAdd tsample.set.power W Htr_Power green
}
GraphAdd tmon.analog2 pers Htr_Still red
makenv tbath -driver avs45 -port ldmse3-ts:3004
GraphAdd tbath Ohm R_bath
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv P6 -driver ana8 -controller ana -port ldmse3-ts:3008 0 $div100
makenv P7 -driver ana8 -controller ana -port ldmse3-ts:3008 1 $div100
makenv P8 -driver ana8 -controller ana -port ldmse3-ts:3008 2 $div100
makenv P10 -driver ana8 -controller ana -port ldmse3-ts:3008 3 $div100
makenv P2 -driver ana8 -controller ana -port ldmse3-ts:3008 4 $div 0 tpr010
makenv P4 -driver ana8 -controller ana -port ldmse3-ts:3008 5 $div 0 tpr010
GraphAdd P6 mbar
GraphAdd P7 mbar
GraphAdd P8 mbar
GraphAdd P10 mbar
GraphAdd P2 mbar
GraphAdd P4 mbar
#define current source
makenv curr -driver k2601b -port ldmse3-ts:3005
makenv volt -driver nanov -port ldmse3-ts:3006
GraphAdd curr.Imeas A VL_current
GraphAdd curr.Pmeas W VL_dissipation
GraphAdd curr.Vmeas V VL_Vkeith
GraphAdd volt.u1 V VL_Volt

View File

@ -0,0 +1,58 @@
stickDesc = dilution insert RDR2
# lakeshore 370 ctrl 1
makenv tmon -driver 370_lsc -port ldmse3-ts:3002 {
# curves for sample:
# ruoxben1k weak link with test ring heater
lsc_sensor mcbot -channel 14 -sensor matsh100 -active 0 -excitation 63uV -color blue
# lsc_sensor hxup -channel 9 -sensor raw -active 0 -excitation 63uV -color cyan
lsc_sensor still -channel 13 -sensor speer220 -active 1 -excitation 200uV -color red
# MC heater
lsc_loop set -channel 13 -maxheater 3.16mA -resist 120
GraphAdd tmon.set.reg K T_set dark_green
GraphAdd tmon.set.power W Htr_Power dark_green
}
# lakeshore 370 ctrl 2
makenv tsample -driver 370_lsc -port ldmse3-ts:3003 {
#curves for sample temperature:
lsc_sensor sample -channel 1 -sensor ruox408 -active 1 -excitation 63uV -color yellow
lsc_loop set -channel 1 -maxheater 3.16mA -resist 120
GraphAdd tsample.set.reg K T_set green
GraphAdd tsample.set.power W Htr_Power green
}
GraphAdd tmon.analog2 pers Htr_Still red
makenv tbath -driver avs45 -port ldmse3-ts:3004
GraphAdd tbath Ohm R_bath
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv P6 -driver ana8 -controller ana -port ldmse3-ts:3008 0 $div100
makenv P7 -driver ana8 -controller ana -port ldmse3-ts:3008 1 $div100
makenv P8 -driver ana8 -controller ana -port ldmse3-ts:3008 2 $div100
makenv P10 -driver ana8 -controller ana -port ldmse3-ts:3008 3 $div100
makenv P2 -driver ana8 -controller ana -port ldmse3-ts:3008 4 $div 0 tpr010
makenv P4 -driver ana8 -controller ana -port ldmse3-ts:3008 5 $div 0 tpr010
GraphAdd P6 mbar
GraphAdd P7 mbar
GraphAdd P8 mbar
GraphAdd P10 mbar
GraphAdd P2 mbar
GraphAdd P4 mbar
#define current source
makenv curr -driver k2601b -port ldmse3-ts:3005
makenv volt -driver nanov -port ldmse3-ts:3006
GraphAdd curr.Imeas A VL_current
GraphAdd curr.Pmeas W VL_dissipation
GraphAdd curr.Vmeas V VL_Vkeith
GraphAdd volt.u1 V VL_Volt

51
tcl/archive/dilRDR5.stick Normal file
View File

@ -0,0 +1,51 @@
stickDesc = dilution insert RDR5
# lakeshore 370 ctrl 1
makenv tmon -driver 370_lsc -port ldmse3-ts:3002 {
# curves for sample:
# ruoxben1k weak link with test ring heater
# lsc_sensor mcbot -channel 14 -sensor RCW575 -active 1 -excitation 63uV -color blue
lsc_sensor mctop -channel 12 -sensor RCW575 -active 1 -excitation 63uV -color cyan
lsc_sensor still -channel 13 -sensor RCW575 -active 1 -excitation 200uV -color red
# lsc_sensor t2k -channel 5 -sensor RCW575 -active 1 -excitation 200uV -color green
# MC heater
lsc_loop set -channel 12 -maxheater 10mA -resist 120
GraphAdd tmon.set.reg K T_set dark_green
GraphAdd tmon.set.power W Htr_Power dark_green
}
# lakeshore 370 ctrl 2
makenv tsample -driver 370_lsc -port ldmse3-ts:3003 {
#curves for sample temperature:
lsc_sensor sample -channel 1 -sensor rx102aa -active 1 -excitation 63uV -color yellow
lsc_loop set -channel 1 -maxheater 3.16mA -resist 120
GraphAdd tsample.set.reg K T_set dark_green
GraphAdd tsample.set.power W Htr_Power dark_green
}
GraphAdd tmon.analog2 pers Htr_Still red
makenv tbath -driver avs45 -port ldmse3-ts:3004
GraphAdd tbath Ohm R_bath
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv P6 -driver ana8 -controller ana -port ldmse3-ts:3008 0 $div100
makenv P7 -driver ana8 -controller ana -port ldmse3-ts:3008 1 $div100
makenv P8 -driver ana8 -controller ana -port ldmse3-ts:3008 2 $div100
makenv P10 -driver ana8 -controller ana -port ldmse3-ts:3008 3 $div100
makenv P2 -driver ana8 -controller ana -port ldmse3-ts:3008 4 $div 0 tpr010
makenv P4 -driver ana8 -controller ana -port ldmse3-ts:3008 5 $div 0 tpr010
GraphAdd P6 mbar
GraphAdd P7 mbar
GraphAdd P8 mbar
GraphAdd P10 mbar
GraphAdd P2 mbar
GraphAdd P4 mbar

53
tcl/archive/dilRDRN.stick Normal file
View File

@ -0,0 +1,53 @@
stickDesc = dilution insert RDRN
# lakeshore 370 ctrl 1
makenv tmon -driver 370_lsc -port ldmse3-ts:3002 {
# curves for sample:
# ruoxben1k weak link with test ring heater
lsc_sensor mctop -channel 1 -sensor RCW575 -active 1 -excitation 200uV
lsc_sensor mcbot -channel 2 -sensor RCW575 -active 1 -excitation 200uV
lsc_sensor ch3 -channel 3 -sensor RCW575 -active 1 -excitation 200uV
lsc_sensor still -channel 4 -sensor RCW575 -active 1 -excitation 200uV
lsc_sensor t2k -channel 5 -sensor RCW575 -active 1 -excitation 200uV
# MC heater
lsc_loop set -channel 1 -maxheater 10mA -resist 800
lsc_analog -maxuser 3.8 -maxvolt 3.8
GraphAdd tmon.set.reg K T_set dark_green
GraphAdd tmon.set.power W Htr_Power dark_green
}
# lakeshore 370 ctrl 2
makenv tsample -driver 370_lsc -port ldmse3-ts:3003 {
#curves for sample temperature:
lsc_sensor sample -channel 1 -sensor rx102aa -active 1 -excitation 63uV -color yellow
lsc_loop set -channel 1 -maxheater 3.16mA -resist 120
GraphAdd tsample.set.reg K T_set dark_green
GraphAdd tsample.set.power W Htr_Power dark_green
}
GraphAdd tmon.analog2 pers Htr_Still red
makenv tbath -driver avs45 -port ldmse3-ts:3004
GraphAdd tbath Ohm R_bath
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv P6 -driver ana8 -controller ana -port ldmse3-ts:3008 0 $div100
makenv P7 -driver ana8 -controller ana -port ldmse3-ts:3008 1 $div100
makenv P8 -driver ana8 -controller ana -port ldmse3-ts:3008 2 $div100
makenv P10 -driver ana8 -controller ana -port ldmse3-ts:3008 3 $div100
makenv P2 -driver ana8 -controller ana -port ldmse3-ts:3008 4 $div 0 tpr010
makenv P4 -driver ana8 -controller ana -port ldmse3-ts:3008 5 $div 0 tpr010
GraphAdd P6 mbar
GraphAdd P7 mbar
GraphAdd P8 mbar
GraphAdd P10 mbar
GraphAdd P2 mbar
GraphAdd P4 mbar

View File

@ -0,0 +1,7 @@
deviceDesc = dil heater test
makenv dh -driver dilhtr -port ets-62a713.psi.ch:3009
GraphAdd dh mW power_set green
GraphAdd dh.power mW power_rd red
GraphAdd dh.resistance Ohm R red

View File

@ -0,0 +1,57 @@
stickDesc = dilution insert 1989 RDR18
# lakeshore 370 ctrl 1
makenv tmon -driver 370_lsc -port ldmse3-ts:3002 {
# curves for sample:
# ruoxben1k weak link with test ring heater
lsc_sensor mcbot -channel 1 -sensor RCW575 -active 1 -excitation 63uV -color blue
lsc_sensor mctop -channel 2 -sensor RCW575 -active 1 -excitation 63uV -color cyan
lsc_sensor still -channel 4 -sensor RCW575 -active 1 -excitation 200uV -color red
lsc_sensor t2k -channel 5 -sensor RCW575 -active 1 -excitation 200uV -color green
# MC heater
lsc_loop set -channel 1 -maxheater 3.16mA -resist 120
GraphAdd tmon.set.reg K T_set dark_green
GraphAdd tmon.set.power W Htr_Power dark_green
}
# lakeshore 370 ctrl 2
makenv tsample -driver 370_lsc -port ldmse3-ts:3003 {
#curves for sample temperature:
lsc_sensor sample -channel 1 -sensor ruox408 -active 1 -excitation 63uV -color yellow
# sample holder heater
lsc_loop set -channel 1 -maxheater 3.16mA -resist 120
GraphAdd tsample.set.reg K T_set_sample dark_green
GraphAdd tsample.set.power W Htr_Power_sample dark_green
}
GraphAdd tmon.analog2 % Htr_Still red
makenv tbath -driver avs45 -port ldmse3-ts:3004
GraphAdd tbath Ohm R_bath
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv P6 -driver ana8 -controller ana -port ldmse3-ts:3008 0 $div100
makenv P7 -driver ana8 -controller ana -port ldmse3-ts:3008 1 $div100
makenv P8 -driver ana8 -controller ana -port ldmse3-ts:3008 2 $div100
makenv P10 -driver ana8 -controller ana -port ldmse3-ts:3008 3 $div100
makenv P2 -driver ana8 -controller ana -port ldmse3-ts:3008 4 $div 0 tpr010
makenv P4 -driver ana8 -controller ana -port ldmse3-ts:3008 5 $div 0 tpr010
GraphAdd P6 mbar
GraphAdd P7 mbar
GraphAdd P8 mbar
GraphAdd P10 mbar
GraphAdd P2 mbar
GraphAdd P4 mbar
#define current source
makenv curr -driver k2601b -port ldmse3-ts:3005
makenv volt -driver nanov -port ldmse3-ts:3006
GraphAdd curr.Imeas A VL_current
GraphAdd curr.Pmeas W VL_dissipation
GraphAdd curr.Vmeas V VL_Vkeith
GraphAdd volt.u1 V VL_Volt

View File

@ -0,0 +1,45 @@
stickDesc = dilution insert 1986 RDR18
# lakeshore 370 ctrl 1
makenv tmon -driver 370_lsc -port ldmse3-ts:3002 {
# curves for sample:
# ruoxben1k weak link with test ring heater
lsc_sensor mcbot -channel 1 -sensor RCW575 -active 1 -excitation 63uV -color blue
lsc_sensor mctop -channel 2 -sensor RCW575 -active 1 -excitation 63uV -color cyan
lsc_sensor still -channel 4 -sensor RCW575 -active 1 -excitation 200uV -color red
lsc_sensor t2k -channel 5 -sensor RCW575 -active 1 -excitation 200uV -color green
# MC heater
lsc_loop set -channel 1 -maxheater 3.16mA -resist 120
GraphAdd tmon.set.reg K T_set dark_green
GraphAdd tmon.set.power W Htr_Power dark_green
}
# lakeshore 370 ctrl 2
makenv tsample -driver 370_lsc -port ldmse3-ts:3003 {
#curves for sample temperature:
lsc_sensor sample -channel 1 -sensor rx102aa -active 1 -excitation 63uV -color yellow
}
GraphAdd tmon.analog2 pers Htr_Still red
makenv tbath -driver avs45 -port ldmlab1-ts:3004
GraphAdd tbath Ohm R_bath
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv P6 -driver ana8 -controller ana -port ldmlab1-ts:3008 0 $div100
makenv P7 -driver ana8 -controller ana -port ldmlab1-ts:3008 1 $div100
makenv P8 -driver ana8 -controller ana -port ldmlab1-ts:3008 2 $div100
makenv P10 -driver ana8 -controller ana -port ldmlab1-ts:3008 3 $div100
makenv P2 -driver ana8 -controller ana -port ldmlab1-ts:3008 4 $div 0 tpr010
makenv P4 -driver ana8 -controller ana -port ldmlab1-ts:3008 5 $div 0 tpr010
GraphAdd P6 mbar
GraphAdd P7 mbar
GraphAdd P8 mbar
GraphAdd P10 mbar
GraphAdd P2 mbar
GraphAdd P4 mbar

View File

@ -0,0 +1,60 @@
namespace eval DAQ {} {
}
proc stdConfig::DAQ {} {
controller std "\n" 20
prop startcmd "*IDN?"
obj DAQ -none
kids settings {
node resist upd
node stddev upd
node file upd
node measure out
default 0
prop write DAQ::measure
prop enum 1
node freq out
default 5000.0
prop write DAQ::setval
node ampl out
default 0.1
prop write DAQ::setval
}
}
proc DAQ::measure {} {
sct send "AQUIRE"
return DAQ::update
}
proc DAQ::update {} {
set output [sct result]
set items [split $output ","]
hupdate [sct parent]/resist [lindex $items 0]
hupdate [sct parent]/stddev [lindex $items 1]
hupdate [sct parent]/file [lindex $items 2]
hupdate [sct] 0
return idle
}
proc DAQ::setval {} {
sct send "PULSE [format "%0.2f" [sctval [sct parent]/freq]] [format "%0.3f" [sctval [sct parent]/ampl]]"
# clientput "PULSE [format "%0.2f" [sctval [sct parent]/freq]] [format "%0.3f" [sctval [sct parent]/ampl]]"
return DAQ::readval
}
proc DAQ::readval {} {
set dat [sct result]
scan $dat "F=%fHz; A= %fVpp" f a
hupdate [sct parent]/freq $f
hupdate [sct parent]/ampl $a
return idle
}

View File

@ -0,0 +1,122 @@
# read 8 ADC channels with taskit RS232 ADC
namespace eval ana8 {
}
if {![namespace exists lsc]} {
source drivers/lsc.tcl
}
proc stdConfig::ana8 {channel {scale 1} {offset 0} {curve ""}} {
controller std "\r" 2
prop node_$channel 0
prop time_$channel 0
poll 1 read ana8::poll
pollperiod 5
obj ANA8 rd
prop read "ana8::read $channel"
variable name
variable path
kids "$name analog input" {
node scale par $scale
node offset par $offset
node raw upd
node curve out -text
prop width 32
prop model 0
prop check ana8::curve
prop write stdSct::completeUpdate
kids "calibration" {
hfactory $path/points plain mugger floatvarar 1
}
}
if {$curve ne "" && $curve ne "raw"} {
hset /$name/curve $curve
} else {
hupdate /$name/curve ""
}
return "ANA8"
}
proc ana8::start {} {
# set adc rate to 11
sct send ":10000D000102000B.."
return ana8::start2
}
proc ana8::start2 {} {
# set all i/o to output / push-pull / low
sct send ":10000000030600FF00FF0000.."
return ana8::getidn
}
proc ana8::getidn {} {
sct send ":0300030001.."
return stdSct::completeStart
}
proc ana8::read {channel} {
sct node_$channel [sct]
sct time_$channel [DoubleTime]
return idle
}
proc ana8::poll {} {
set now [DoubleTime]
set channels [list ]
foreach channel {0 1 2 3 4 5 6 7} {
if {$now < [silent 0 sct time_$channel] + 30} {
lappend channels $channel
}
}
if {[llength $channels] == 0} {
return idle
}
set first [lindex $channels 0]
set nchan [expr [lindex $channels end] - $first + 1]
if {$nchan > 0} {
sct channels $channels
sct nchan $nchan
sct send ":04000${first}000${nchan}.."
return ana8::update
}
return idle
}
proc ana8::update {} {
set first [lindex [sct channels] 0]
set nb [format %.2X [expr [sct nchan] * 2]]
set res [scan [sct result] ":04${nb}%4x%4x%4x%4x%4x%4x%4x%4x" a0 a1 a2 a3 a4 a5 a6 a7]
if {$res < [sct nchan]} {
error "bad response to '[sct send]': '[sct result]'"
}
foreach ch [sct channels] {
set i [expr $ch - $first]
set scale [hval [sct node_$ch]/scale]
set offset [hval [sct node_$ch]/offset]
# 26214 = (2^32-1) steps / 2.5 V
set raw [expr [set a$i] / 26214. * $scale + $offset]
set node [sct node_$ch]
updateval $node/raw $raw
if {[hval $node/curve] eq ""} {
updateval $node $raw
} else {
set t [interpolate [hvali $node/curve/points] 0 $raw logy extrapolate]
updateval $node $t
}
}
return idle
}
proc ana8::curve {} {
if {[sct requested] ne "" && [sct requested] ne "raw"} {
lsc::read_curve
}
}

View File

@ -0,0 +1,10 @@
namespace eval anders {
}
proc stdConfig::anders {} {
controller std "\n++read eoi\n"
obj TCOUPLE rd
prop readcmd "SETP?1"
prop readfmt "%g"
}

View File

@ -0,0 +1,27 @@
# ASM 120 h, analog output read by fluke 45
namespace eval asm120h {} {
}
proc stdConfig::asm120h {} {
controller std "\n" 5 ">"
prop startcmd "*IDN?"
obj Fluke45 rd
prop read asm120h::read
prop readcmd "MEAS?"
prop readfmt "%g"
}
proc asm120h::read {} {
sct send "MEAS?"
return asm120h::update
}
proc asm120h::update {} {
set res 0
scan [sct result] %f res
sct update [expr $res - 9]
return idle
}

View File

@ -0,0 +1,130 @@
namespace eval asm142 {} {
}
proc stdConfig::asm142 {} {
controller bin
pollperiod 0.01
obj ASM142 rd
prop read asm142::read
kids "leak detector" {
node p upd
node state upd
prop enum standby,cycle,test
node vent upd
prop enum 1
node manualvalve par 0
prop enum 1
}
}
proc asm142::read {} {
# we wait for at least one byte. the bin driver adds additional bytes
# arriving immediately, but as we are sending nothing, nothing is purged
# (modification of SICS 22.10.2014)
sct send " / hex"
return asm142::update
}
proc asm142::update {} {
# Format of data sent from ASM142 to its remote control:
# ff <adr> <data>
# for <adr>==04 <data> is 2 bytes, for all other known <adr> 1 byte
# several (not always all) data chunks are sent one by one
# at the end, "ff 00 00" is sent, and the remote control respond is
# "00 00" (or i.e. "00 02" when CYCLE is pressed)
# if the remote control is not connected, only ff "00 00" is sent
# known data chunks:
# 01 <i>: mbar bargraph (<i> = 1 ... 20, meaning 1e-3 ... 2e+3, 3 per magnitude)
# 02 <i>: leak rate bargraph (<i> = 1 ... 40, meaning 1.7e-12 ... 1e-2)
# 04 nm cl: leak rate (n.mE-l, BCD format, where c seems to be the code for "-")
# 06 10tzaclr (LEDs bits: test, zero, autocal, cycle, left, right)
# 07 0000v0s0 (LEDs bits: vent, snif)
# 0d <i>: threshold for leak rate (blinking) (<i> = 128 + bar number)
set buf [silent "" sct buf]
set res [concat [silent "" sct oldres] [sct result]]
#clientput $res
foreach byte $res {
if {$byte eq "ff"} {
if {[llength $buf] > 0} {
set adr [lindex $buf 1]
set val [lrange $buf 2 end]
switch $adr {
04 {
set exp1 0
scan $val "%1s%1s %1s%1s" dig1 dig2 exp1 exp2
switch $exp1 {
3 {set exp1 "e-1"}
c {set exp1 "e-"}
}
if {$exp1 ne "0"} {
sct update "${dig1}.${dig2}${exp1}${exp2}"
}
}
01 {
set p 0
scan $val "%x" p
updateval [sct]/p [expr pow(10, ($p-1)/3.0) * 0.001]
}
06 {
set state 0
set led 0
scan $val "%x" led
if {$led & 32} {
set state 2
} elseif {$led & 4} {
set state 1
}
updateval [sct]/state $state
}
07 {
set vent 0
set led 0
scan $val "%x" led
if {$led & 8} {
set vent 1
}
updateval [sct]/vent $vent
}
# 02 - 0d {
# # ignore leak rate bar and level
# set press 0
# scan $val "%x" p
# updateval [sct]/p [expr pow(10, ($p-1)/3.0) * 0.001]
# }
# default {
# set old ""
# global pars
# catch {set old $pars($adr)}
# if {$old ne $val} {
# set pars($adr) $val
# clientput "${adr}:${val}"
# }
# }
}
set buf ""
}
set buf $byte
} else {
append buf " $byte"
if {$buf eq "ff 00 00" && [silent 0 sct noremote]} {
#clientput "send 00 00"
sct buf ""
sct send "00 00 /"
return asm142::readnext
}
}
}
sct buf $buf
return idle
}
proc asm142::readnext {} {
sct oldres [sct result]
return idle
}

View File

@ -0,0 +1,50 @@
# ASM340 RS232 interface.
# Setup: >EINSTELLUNGEN>Extras>Seriell Schnittstelle#1
# Typ: Seriell
# >Konfiguration
# Betriebsart: Tabelle
# Zeitintervall: 1 s
# Handshake: None
# Versor.pin9: 5 Volt (not relevant)
#
namespace eval asm340 {} {
}
proc stdConfig::asm340 {} {
controller std timeout=10
# pollperiod 1 1
obj ASM340 rd
prop read asm340::read
kids "ASM 340" {
node p upd
node text -text upd
}
}
proc asm340::read {} {
sct send "@@NOSEND@@"
return asm340::update
}
proc asm340::update {} {
if {[scan [sct result] "%s %s S=%s P=%s %s %s" x e s p t f] == 6} {
sct update $s
updateval [sct]/p $p
if {$e ne "on"} {
set tail "filament off"
} else {
set tail ""
}
updateval [sct]/text "$x $tail"
} else {
clientput "NO"
sct geterror "syntax error"
hsetprop [sct]/p geterror "syntax error"
updateval [sct]/text [sct result]
clientput "NO [sct result]"
}
return idle
}

View File

@ -0,0 +1,13 @@
namespace eval avs45 {} {
}
proc stdConfig::avs45 {} {
controller std sendterminator=\r
# attention: baud rate 4800
obj AVS45 rd
prop readcmd "D"
prop readfmt "%g"
}

View File

@ -0,0 +1,22 @@
namespace eval bin {} {
}
proc stdConfig::bin {} {
controller bin chksum-crc 5
obj BIN upd
prop read bin::poll
}
proc bin::read {} {
sct send " / dump"
sct print poll
return bin::update
}
proc bin::update {} {
sct print [sct result]
return idle
}

View File

@ -0,0 +1,82 @@
# calibration with a 370 using 6 channels
# datafile format: <time> <log10(R)> <channel>
namespace eval calib370 {} {
}
proc stdConfig::calib370 {} {
variable ctrl
controller std "\n" 5
prop startcmd "*IDN?"
obj calib370 rd
default 0
prop read calib370::read
prop period 30
prop period0 0
kids "Sensor Channels" {
node chan1 upd
prop newline 1
node active1 par 1
prop enum 1
node chan2 upd
node active2 par 1
prop enum 1
node chan3 upd
node active3 par 1
prop enum 1
node chan4 upd
node active4 par 1
prop enum 1
node chan5 upd
node active5 par 1
prop enum 1
node chan6 upd
node active6 par 1
prop enum 1
}
}
proc calib370::read {} {
if {[sct period] ne [sct period0]} {
[sct controller] poll [sct] [sct period] read read
sct period0 [sct period]
}
if {[hvali [sct]] > 0} {
sct send "RDGR?[hvali [sct]]"
sct utime send_time
if {[silent 0 sct base_time] == 0} {
sct base_time [expr [clock seconds] / 3600 * 3600]
}
return calib370::update
}
sct update 1
sct send "SCAN 1,0;SCAN?"
return stdSct::complete
}
proc calib370::update {} {
set chan [hvali [sct]]
set value [expr log10([sct result])]
hdelprop [sct]/chan$chan geterror
hupdate [sct]/chan$chan $value
set file [silent 0 sct outputfile]
if {$file ne "0"} {
set fd [open $file a]
set now [expr [sct utime] * 0.5 + [sct send_time] * 0.5 - [sct base_time]]
puts $fd [format "%.3f\t%.6f\t%d" $now $value $chan]
close $fd
}
for {set i 0} {$i < 6} {incr i} {
incr chan
if {$chan > 6} {
set chan 1
}
if {[hvali [sct]/active$chan]} {
break
}
}
sct update $chan
sct send "SCAN $chan,0;SCAN?"
return stdSct::complete
}

View File

@ -0,0 +1,45 @@
namespace eval cryocon_sniffer {} {
}
proc stdConfig::cryocon_sniffer {} {
controller std "\n" 5
pollperiod 0.001 0.001
obj CryoconSniffer rd
prop read cryocon_sniffer::read
prop rdcmd "INPUT A:SENPR?"
prop path ""
kids "cryocon" {
# node tb upd
# prop rdcmd "INPUT B:SENPR?"
node l1 upd
prop rdcmd "LOOP 1:OUTPWR?"
node l2 upd
prop rdcmd "LOOP 2:OUTPWR?"
}
}
proc cryocon_sniffer::read {} {
sct send "@@NOSEND@@"
return cryocon_sniffer::update
}
proc cryocon_sniffer::update {} {
if {[sct result] eq [sct rdcmd]} {
sct path [sct]
return idle
}
foreach var [hlist [sct]] {
if {[sct result] eq [silent "" hgetpropval [sct]/$var rdcmd]} {
sct path [sct]/$var
return idle
}
}
if {[sct path] ne ""} {
updateval [sct path] [sct result]
sct path ""
}
return idle
}

View File

@ -0,0 +1,48 @@
namespace eval cryotel {} {
}
proc stdConfig::cryotel {} {
# controler uses std with send terminator "\r" 5sec comm.interval receive terminator "\n" and multi line replies will be separated by ","
controller std "\r" 5 "\n" ","
# the {2} in addition to the command defines the number of expected return values
prop startcmd "SERIAL{2}"
# driver for Sunpower stirling cooler CryoTel
# serial interface is set to:
# Char Size/Stop Bits: 8/1 Input Speed: 4800
# Flow Ctrl: None Output Speed: 4800
# Parity: None Modem Control: None
obj cryo rd
prop label Temperature
prop readcmd "TC{2}"
prop readfmt "TC ,%f"
#cryotel::readT
kids cryo {
node setT wr
prop label Setpoint
prop writecmd "SET TTARGET=%.2f"
prop readcmd "SET TTARGET{2}"
prop readfmt "SET TTARGET ,%f"
node power rd
prop label Power
prop readcmd "P{2}"
prop readfmt "P ,%f"
node cool wr
prop label Cool
prop enum on,off
prop writecmd "SET SSTOP=%i"
prop readcmd "SET SSTOP{2}"
prop readfmt "SET SSTOP ,%i"
}
}

View File

@ -0,0 +1,84 @@
# based on untested flowbusprot, not used M.Z. Feb 2017
namespace eval flowbus {} {
}
proc stdConfig::flowbus {label scale {adr 128} {readonly 0}} {
controller flowbus "\r\n"
# driver for Bronkhorst Flow or Pressure regulator (i.e.P-602CV-21KA-AAD)
# serial interface is set to:
# Char Size/Stop Bits: 8/1 Input Speed: 38400
# Flow Ctrl: None Output Speed: 38400
# Parity: None Modem Control: None
# syntax (chaining not mentioned):
# read command: :06Ad04CopyPrTp
# write command: :LnAd01PrTpData
# where:
# Ln: number of bytes (hex digits pairs) following
# Ad: node address (starting from 3)
# Copy: values just to be copied by the reply (first and third digit < 8)
# recommended practice: Use PrTp for Copy
# Pr: Process number (<80)
# Tp: Type + parameter number. Type: 00 byte, 20 int, 40 long/float, 60 string
# for strings either 00 (for nul terminated) or the max. number of chars
# has to be appended to the type
# Data: length depending on type.
# the interface returns readings on a scale where 32000 is 100%
set adr [format %02x $adr]
clientput "BRONK $label $scale $adr"
obj bflow rd
prop label $label
prop readcmd "r$adr 1 i0"
prop readfmt "%d"
prop update flowbus::conv $scale
prop @adr $adr
kids "$label" {
node setpoint wr
prop label Setpoint
prop write flowbus::setp $scale
prop readcmd "r$adr 1 i1"
prop readfmt "%d"
prop update flowbus::conv $scale
}
}
proc flowbus::conv {scale} {
if {[scan [sct result] [sct readfmt] flow ] != 1} {
error "bad result format: '[sct result]'"
}
sct update [format %.6g [expr $flow * $scale / 32000.]]
return idle
}
proc flowbus::setp {scale} {
set setval [expr int( [sct target] * 32000.0 / $scale) ]
if {$setval > 32000 } {
if {$setval < 32320} {
set setval 32000
} else {
error "[sct]: setpoint [sct target] must be <= $scale"
}
} elseif {$setval < 0 } {
error "[sct]: setpoint [sct target] must be >= 0"
}
sct send "w [sct @adr] 1 i1=$setval"
return "flowbus::acknowledge"
}
proc flowbus::acknowledge {} {
if {[string compare [sct result] "0" ] != 0} {
error "bad result format: '[sct result]' [sct result]"
}
return read
}

View File

@ -0,0 +1,56 @@
namespace eval ihelium3_cryocon {} {
}
proc stdConfig::ihelium3_cryocon {} {
controller std "\n" 5
pollperiod 0.001 0.001
obj CryoconSniffer rd
prop read ihelium3_cryocon::read
prop path ""
kids "cryocon" {
# node tb upd
# prop rdcmd "INPUT B:SENPR?"
node ra upd
prop rdcmd "INPUT A:SENPR?"
prop sensno 054
node l1 upd
prop rdcmd "LOOP 1:OUTPWR?"
node l2 upd
prop rdcmd "LOOP 2:OUTPWR?"
node bref par 0
}
}
proc ihelium3_cryocon::read {} {
sct send "@@NOSEND@@"
return ihelium3_cryocon::update
}
proc ihelium3_cryocon::update {} {
foreach var [hlist [sct]] {
if {[sct result] eq [silent "" hgetpropval [sct]/$var rdcmd]} {
sct path [sct]/$var
return idle
}
}
if {[sct path] ne ""} {
updateval [sct path] [sct result]
set sensno [silent "" hgetpropval [sct path] sensno]
sct path ""
if {$sensno ne ""} {
if {![silent 0 sct $sensno]} {
ihelium3_calib $sensno
sct $sensno 1
}
set tk [ihelium3_res2temp $sensno [hvali [sct]/bref] [sct result]]
sct update $tk
}
}
return idle
}

View File

@ -0,0 +1,25 @@
# itc503 simple nv control
namespace eval itc503p {} {
}
proc stdConfig::itc503p {} {
controller std "\r" 5
prop startcmd "V"
obj nv rd
prop readcmd "R7"
prop readfmt "R%g"
kids nvoi {
node set wr
prop read stdSct::read
prop readcmd "R7"
prop readfmt "R%g"
prop write itc503p::write
}
}
proc itc503p::write {} {
sct send [format G%3.0f [sct target]]
return read
}

View File

@ -0,0 +1,61 @@
# keithley 2701 Digital multimeter
namespace eval kdvm {} {
}
proc stdConfig::kdvm {} {
controller std "\n" 5
prop startcmd "*IDN?"
obj Keithley2701 rd -none
prop read kdvm::read
kids channels {
node u1 upd
node u2 upd
node chan out
default 0
prop write kdvm::setchan
prop enum auto,chan1,chan2
}
}
proc kdvm::read {} {
sct send "READ?"
return kdvm::update
}
proc kdvm::update {} {
set mode [hvali [sct]/chan]
if {$mode == 0} {
set chan [silent 1 sct channel]
} else {
set chan $mode
}
hupdate [sct]/u$chan [sct result]
hdelprop [sct]/u$chan geterror
if {$mode != 0} {
return idle
}
set chan [expr 3-$chan]
sct send "ROUT:CLOS (@10${chan}); *IDN?"
sct channel $chan
return stdSct::complete
}
proc kdvm::setchan {} {
set mode [sct target]
if {$mode == 0} {
sct update $mode
return idle
}
set chan $mode
sct send "ROUT:CLOS (@10${chan}); *IDN?"
sct channel $chan
return kdvm::updatechan
}
proc kdvm::updatechan {} {
sct update [sct result]
return idle
}

View File

@ -0,0 +1,14 @@
namespace eval kei195 {} {
}
proc stdConfig::kei195 {} {
controller std "sendterminator=\n"
# prop startcmd "++addr 16"
obj kei195 rd
prop readcmd "++read eoi"
prop readfmt "NDCV %g"
# kids "avs settings" { }
}

View File

@ -0,0 +1,36 @@
namespace eval lowdpflow {} {
}
proc stdConfig::lowdpflow {} {
controller std "\r\n"
# driver for mass flow meter bronkhorst low-dp-flow
# serial interface is set to:
# Char Size/Stop Bits: 8/1 Input Speed: 38400
# Flow Ctrl: None Output Speed: 38400
# Parity: None Modem Control: None
obj low-dp-flow rd
# 0C=length
# 80=address
# 04=read
# 00 not chained, custom process 0
# 40 not chained, float, custom parameter 0
# 21 process 33
# 40 float, parameter 0
prop readcmd ":06800400402140"
prop readfmt ":0880020040%8s"
prop update lowdpflow::update
}
proc lowdpflow::update {} {
if {[scan [sct result] [sct readfmt] flow] != 1} {
error "bad result format: '[sct result]' $flow"
}
set flow [cnvrt xieee2float $flow]
sct update $flow
return idle
}

View File

@ -0,0 +1,86 @@
#LS370 simple driver
namespace eval ls370bf {} {
}
proc stdConfig::ls370bf {} {
variable ctrl
controller std "\n" 5
prop startcmd "*IDN?"
obj ls370bf rd
default 0
prop read ls370bf::read
prop period 15
prop period0 0
kids "Sensor Channels" {
node set wr
prop writecmd "SETP %g;*OPC?"
prop readcmd "SETP?"
prop readfmt "%g"
node htr rd
prop readcmd "HTR?"
prop readfmt "%g"
node still wr
prop writecmd "STILL %g;*OPC?"
prop readcmd "STILL?"
prop readfmt "%g"
foreach chan {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16} {
node active$chan par 1
prop enum 1
if {$chan == 1} {
prop newline 1
}
}
foreach chan {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16} {
node chan$chan upd
if {$chan == 1} {
prop newline 1
}
node res$chan upd
}
}
}
proc ls370bf::read {} {
if {[sct period] ne [sct period0]} {
[sct controller] poll [sct] [sct period] read read
sct period0 [sct period]
}
if {[hvali [sct]] > 0} {
sct send "RDGK?[hvali [sct]]"
return ls370bf::readR
}
sct update 1
sct send "SCAN 1,0;SCAN?"
return stdSct::complete
}
proc ls370bf::readR {} {
set chan [hvali [sct]]
hdelprop [sct]/chan$chan geterror
hupdate [sct]/chan$chan [sct result]
sct send "RDGR?$chan"
return ls370bf::update
}
proc ls370bf::update {} {
set chan [hvali [sct]]
hdelprop [sct]/res$chan geterror
hupdate [sct]/res$chan [sct result]
for {set i 0} {$i < 16} {incr i} {
incr chan
if {$chan > 16} {
set chan 1
}
if {[hvali [sct]/active$chan]} {
break
}
}
sct update $chan
sct send "SCAN $chan,0;SCAN?"
return stdSct::complete
}

View File

@ -0,0 +1,53 @@
namespace eval moxa {
}
proc stdConfig::moxa {} {
variable ctrl
variable node
if {[controller tmo 10 2]} {
controllerDesc "MOXA http connection"
}
obj moxa out
default 0
prop check moxa::check
prop write moxa::getline
prop connections ""
$ctrl queue $node write moxa::getline
}
proc moxa::getline {} {
sct send "GET /Mn_line.htm HTTP/1.1\r\n"
return moxa::updateline
}
proc moxa::updateline {} {
set r [sct result]
set l 0
set pattern {<TR><TD>(.*?)</TD><TD>TCP Server Mode</TD><TD>(.*?)</TD>.*?</TR>}
array set iplist {}
while {[regexp -start $l -indices ($pattern) $r idx]} {
set l [lindex $idx 1]
set line [string range $r [lindex $idx 0] $l]
regexp $pattern $line all port ip
if {$ip ne "Listen"} {
lappend iplist($ip) [expr 3000+$port]
}
}
sct connections [array get iplist]
sct update 0
clientput "connections: [sct connections]"
# seaclient hostport ${ip}:${po}
# seaclient cmd "disconnect_from [sct sicsdev]"
return idle
}
proc moxa::check {} {
sct connections ""
sct update [sct target]
[sct controllerName] reconnect
}

View File

@ -0,0 +1,17 @@
namespace eval nvdummy {} {
}
proc stdConfig::nvdummy {} {
controller syncedprot
obj NvDummy par 0
kids "nv dummy" {
node set par 0
node flow par 5
node autoflow par 0
kids "autoflow" {
node flowtarget par 5
}
}
}

View File

@ -0,0 +1,191 @@
namespace eval nvstep {
}
proc stdConfig::nvstep {} {
variable name
controller syncedprot
pollperiod 1 1
obj NvStep wr
prop write nvstep::setmode
prop read nvstep::read
prop enum fixed=0,controlled=1,automatic=2,close=3,open=4
prop write nvstep::write
prop lastpulse 0
prop filter 0
prop closetest 0
default 0
kids "needle value" {
node motpos upd
node flow upd
node set out
default 2.5
prop check nvstep::checkset
prop write stdSct::complete
prop label "flow set"
node flowmax par 20
prop label "flow maximum"
node ctrl -none
kids "control parameters" {
node prop par 50
node int par 15
node delay par 5
node dif upd
node lim upd
node tol upd
}
node autoflow -none
kids "autoflow control parameters" {
flow::make flow::tmts {result tt set/reg}
}
}
}
proc nvstep::checkset {} {
sct update [sct target]
set s [hvali [sct parent]]
if {[hvali /cc/fa] == 0 || ($s != 1 && $s != 2)} {
hset [sct parent] 1
}
}
proc nvstep::write {} {
switch {[sct target]} {
3 {
nvmot [hvali /nvmot/posclosed]
sct closetest 1
}
4 {
nvmot [hvali /nvmot/posopen]
}
}
sct update [sct target]
return idle
}
proc nvstep::transf {flow} {
if {$flow > 1} {
set flow [expr 2 - 1.0 / $flow]
}
return $flow
}
proc nvstep::poll {} {
hupdate [sct]/motpos [hvali /nvmot/pos]
set now [DoubleTime]
set delta [expr $now - [silent 0 sct lastpoll]]
sct lastpoll $now
if {$delta > 1} {
set delta 1
}
set umsg "automatic needle valve not activated - set temperature undefined"
switch [hvali [sct]] {
1 - 2 {
if {[hvali [sct]] == 1} {
set soll [hvali [sct]/set]
hupdate [sct]/autoflow/flowtarget $soll
} else {
flow::task [sct]/autoflow [hvali [sct]/set] [hvali [sct]/flowmax]
set soll [hvali [sct]/autoflow/flowset]
if {[hgetpropval [sct]/autoflow/getTset t_set_undefined]} {
if {[hvali [sct]/status] ne $umsg} {
clientput "ERROR: $umsg"
}
hupdate [sct]/status $umsg
}
}
set ist [hvali [sct]/flow]
set soll2 [expr $soll + [hvali [sct]/ctrl/tol]]
set soll [nvstep::transf $soll]
set tol [expr [nvstep::transf $soll2] - $soll]
set ist [nvstep::transf $ist]
set dif [expr $soll - $ist]
set lim [hvali [sct]/ctrl/lim]
set int [hvali [sct]/ctrl/int]
set lim [expr $lim * exp(-$delta/$int)]
if {abs($dif) > $tol + $lim} {
set lim [expr abs($dif) * exp($delta*[hvali [sct]/ctrl/delay]/double($int)) - $tol]
set step [expr $dif * [hvali [sct]/ctrl/prop]]
run nvmot [expr [hvali /nvmot] + $step]
}
hupdate [sct]/ctrl/dif [expr log(abs($dif)/$tol + 1e-3)]
hupdate [sct]/ctrl/tol [expr log($lim/$tol + 1.0)]
hupdate [sct]/ctrl/lim $lim
sct lastmode [hvali [sct]]
}
0 - 3 - 4 { # fixed, close, open
if {[hvali [sct]] == 3 && [sct closetest]} {
if {[hgetpropval /nvmot status] ne "run"} {
if {[hvali /nvmot] < [hvali /nvmot/posopen] + [hvali /nvmot/precision]} {
hupdate [sct]/status "needle valve not fully closed"
}
sct closetest 0
}
}
switch -- [hvali /cc/fm] {
2 - 4 { # closing or closed
sct update 3
}
1 - 3 { # opening or opened
sct update 4
}
default {
# sct update 0
}
}
logsetup [sct]/set clear
logsetup [sct]/autoflow/flowtarget clear
return idle
}
}
if {[hvali [sct]/status] eq $umsg && \
([sctval [sct]] != 2 || [hgetpropval [sct]/autoflow/getTset t_set_undefined] == 0)} {
hsetprop [sct]/autoflow/getTset t_set_undefined 0
hupdate [sct]/status ""
}
return idle
}
proc nvstep::read {} {
hsetprop /cc/fa nvpath [sct]
_cc updatescript /cc/fa nvstep::updatemode
hsetprop /cc/f nvpath [sct]
hsetprop /cc/f nvctrl [sct controller]
_cc updatescript /cc/f nvstep::updateflow
return unpoll
}
proc nvstep::updateflow {value} {
set filter [lrange "[silent $value sct filter] $value" end-9 10]
sct filter $filter
# filter out values which are within the 3 highest or 3 lowest values
# out of 10 last values (i.e. within 5 seconds)
set m 3
set filter [lsort -real $filter]
if {[llength $filter] < 10} {
set flow $value
} else {
set min [lindex $filter $m]
set max [lindex $filter end-$m]
set flow [silent 0 hvali [sct nvpath]/flow]
if {$max < $flow} {
set flow $max
} elseif {$min > $flow} {
set flow $min
}
}
if {$flow < -50} {
set flow -62.5
}
# clientput "flow $value $flow"
updateval_e [sct nvpath]/flow $flow -62.5 no_sensor
[sct nvctrl] queue [sct nvpath] read nvstep::poll
}

View File

@ -0,0 +1,129 @@
namespace eval taskit {} {
}
proc stdConfig::taskit {} {
controller std "\r" 5
obj TaskitADC rd
prop readcmd ":0400000008.."
prop update taskit::update
kids "Taskit Settings" {
node dig out -text
default 00
prop write taskit::write
node mode out -text
default ff
prop write taskit::write
node pulse out -int
prop write taskit::pulse
node res wr -int
prop write taskit::writeRes
prop read taskit::readRes
node a0 upd
node a1 upd
node a2 upd
node a3 upd
node a4 upd
node a5 upd
node a6 upd
node a7 upd
node p upd
}
return "new taskit"
}
proc taskit::writeRes {} {
sct send [format ":10000D00010200%2.2x.." [sct target]]
return taskit::readRes
}
proc taskit::readRes {} {
sct send ":03000D0001.."
return taskit::updateRes
}
proc taskit::updateRes {} {
set res 0
scan [sct result] ":0302%4x" res
sct update $res
return idle
}
proc taskit::update {} {
if {[scan [sct result] ":0410%4x%4x%4x%4x%4x%4x%4x%4x" \
a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7)] == 8} {
set vmax 2.5
foreach i {0 1 2 3 4 5 6 7} {
set a($i) [expr 2.5 * $a($i) / 65535.]
hupdate [sct]/a$i $a($i)
}
hupdate [sct]/p [expr 250 * ($a(2) - 0.4) / 1.6]
set x [expr ($a(6) - $vmax * 0.5)]
set y [expr ($a(7) - $vmax * 0.5)]
set r [expr abs($x) + abs($y)]
set old [silent 0 sct old]
if {$r < $vmax * 0.4 || $r > $vmax * 0.6} {
error "illegal value $r = |$x| + |$y|"
} elseif {$y > 0} {
if {$x > 0} {
set ang [expr $y/$r * 90]
} else {
set ang [expr - $x/$r * 90 + 90]
}
} else {
if {$x < 0} {
set ang [expr - $y/$r * 90 + 180]
} else {
set ang [expr $x/$r * 90 + 270]
}
}
set ang [expr $ang + 360 * round(($old - $ang) / 360.0)]
sct update $ang
sct old $ang
} else {
error "bad result: [sct result]"
}
return idle
}
proc taskit::write {} {
set value 0
set mode ff
sct update [sct target]
scan [hvali [sct objectPath]/dig] %x value
scan [hvali [sct objectPath]/mode] %x mode
sct send [format ":10000000030600FF%4.4X%4.4X.." $mode $value]
return taskit::completeOut
}
proc taskit::completeOut {} {
sct update [sct target]
return idle
}
proc taskit::pulse {} {
scan [hvali [sct objectPath]/dig] %x value
scan [hvali [sct objectPath]/mode] %x mode
set p [expr 1 << [sct target]]
set value [expr $value & (255 - $p)]
sct send [format ":10000000030600FF%4.4X%4.4X.." $mode $value]
sct update [sct target]
return taskit::pulsEnd
}
proc taskit::pulsEnd {} {
scan [hvali [sct objectPath]/dig] %x value
scan [hvali [sct objectPath]/mode] %x mode
set p [expr 1 << [sct target]]
set value [expr $value | $p]
sct send [format ":10000000030600FF%4.4X%4.4X.." $mode $value]
return taskit::completeOut
}

View File

@ -0,0 +1,21 @@
namespace eval testsync {
}
proc stdConfig::testsync {} {
controller syncedprot
obj test wr
prop write testsync::write
prop read testsync::read
}
proc testsync::write {} {
_lev debug 0
sctsync {lev mode [sct target]}
return stdSct::completeUpdate
}
proc testsync::read {} {
_lev debug -1
sct update [silent 0 hvali [sct]]
return idle
}

View File

@ -0,0 +1,31 @@
namespace eval ttdummy {} {
}
proc stdConfig::ttdummy {} {
controller syncedprot
obj NvDummy wr 1.5
prop read ttdummy::update
prop write ttdummy::update
prop check ttdummy::update
prop target 1.5
kids "tt dummy" {
node set par 0
node tm par 1.5
node ts par 1.5
kids "settings" {
node curve -text par "undefined"
}
}
}
proc ttdummy::update {} {
sct update [sct target]
hset [sct]/tm [sct target]
hset [sct]/ts [sct target]
return idle
}

View File

@ -0,0 +1,10 @@
deviceDesc = Dummy Variox
device stick_menu dil2
GraphAdd tt K T_VTI
GraphAdd nv.flow mbar nv_flow
makenv nv nvdummy
makenv tt ttdummy

10
tcl/archive/esr.config Normal file
View File

@ -0,0 +1,10 @@
deviceDesc = ESR
defineTemperature tt
makenv tt -driver [lsdriver] {
lsc_sensor tm A -sensor x22297 -sensorname main
lsc_loop set -loop 1 -channel A -maxheater 25W -resist 25Ohm
}
tt set/limit 315

12
tcl/archive/esr2.config Normal file
View File

@ -0,0 +1,12 @@
deviceDesc = ESR
defineTemperature tt
makenv tt -driver [lsdriver] {
lsc_sensor tm C -sensor dt-470 -sensorname main
lsc_loop set -loop 1 -channel C -maxheater 5W -resist 25Ohm
}
tt set/limit 315
makeCCU4 heox he

View File

@ -0,0 +1,11 @@
addonDesc = hastings over fluke 45 multimeter
makenv hastings -driver fluke45 {X * 10 + 0.4}
GraphAdd hastings ln/min h_flow dark_green
#change nv control variable to omron flow
dolater 5 exe omronctrl.tcl
GraphAdd nv.flowp ln/min nv_flow_p

5
tcl/archive/hefill.addon Normal file
View File

@ -0,0 +1,5 @@
addonDesc = add automatic He fill with ILM
makenv hefill -driver ccu4ext he lev
hsetprop /hefill slow_cmd "lev mode 0"
hsetprop /hefill fast_cmd "lev mode 1"

17
tcl/archive/heox.config Normal file
View File

@ -0,0 +1,17 @@
deviceDesc = HEOX cryostat for He3
defineTemperature tt
device stick_menu "heox_kappa"
makenv tt -driver [lsdriver] {
lsc_sensor ts B -sensor x34504 -sensorname He3_potold
lsc_sensor tm A -sensor x89063 -sensorname He3-pot
lsc_sensor tsorb D -sensor cab505 -sensorname Sorb
lsc_sensor t1k C -sensor cs405 -sensorname 1K-Pot
lsc_loop set -loop 1 -channel D -maxheater 5W -resist 40Ohm
lsc_loop set2 -loop 2 -channel A -maxheater 1W -resist 100Ohm
}
tt set/limit 40
makeCCU4 heox he nv

View File

@ -0,0 +1,21 @@
stickDesc = heox thermal cond setup
# lakeshore 370 ctrl
makenv tkappa -driver 370_lsc -port ldmcc12-ts:3008 {
# normal dil2 holder: u02045
# weak link 2: m59
# weak link with ring heater: ruoxben1k
lsc_sensor t1 -channel 1 -sensor ruox5a -active 1 -excitation 63uV -color blue
lsc_sensor t2 -channel 2 -sensor ruox5b -active 1 -excitation 63uV -color skyblue
lsc_sensor ref -channel 3 -sensor x58542 -active 1 -excitation 200uV -color red
# lsc_sensor heater -channel 5 -sensor ruox5k -active 1 -excitation 20uV -color cyan
# lsc_sensor hepot -channel 6 -sensor raw -active 1 -excitation 200uV -color yellow
lsc_loop set -channel 2 -maxheater 0.31mA -resist 5000
}
makenv kheat -driver nanov -port ldmcc12-ts:3003
#debug tkappa

View File

@ -0,0 +1,15 @@
stickDesc = high voltage stick Andeen Hagerling 2700
stick_sensors x50923 x63854
#ts_2 (second sensor):
# x63854 normal sensor
# x70261 marisas sample
GraphAdd tt.ts_2 K T_samp2 orange
makenv cap -driver ah2700
GraphAdd cap.cap pF Cap blue
GraphAdd cap.loss tand Loss blue
GraphAdd cap.freq Hz Freq blue

View File

@ -0,0 +1,13 @@
deviceDesc = ihelium3 capacity and cryocon sniffer
makenv tc -driver ihelium3_cryocon -port ldmse5-ts:3012
#makenv tc -driver cryocon_sniffer -port ldmse5-ts:3012
GraphAdd tc K T auto
GraphAdd tc.ra Ohm R auto
makenv cap -driver ah2700
GraphAdd cap.cap pF Cap blue
GraphAdd cap.loss tand Loss blue
GraphAdd cap.freq Hz Freq blue

View File

@ -0,0 +1,25 @@
deviceDesc = orange cryostat with 50 mm sample space
defineTemperature tt
device stick_menu ill1
makenv tt -driver [lsdriver] {
lsc_sensor tm A -sensor x71738 -sensorname VTI
lsc_sensor tx B -sensor x71738
lsc_sensor ts C -sensorname sample
lsc_sensor ts_2 D -sensor code -sensorname sample2
lsc_loop set -loop 1 -channel A -maxheater 50W -resist 50Ohm -color green
# if {[lsdriver] eq "336_lsc"} {
# lsc_loop setsamp -loop 2 -channel B -maxheater 62.5W -resist 40Ohm
# }
}
tt set/limit 310
tt maxwait 7200
makeCCU4 ill1 nv n2 he
hupdate /nv/set 1.5
nv ctrl/deriv_o 10
nv ctrl/deriv_c 10
nv ctrl/prop_o 0.2
nv ctrl/prop_c 0.1
source std_orange.table

View File

@ -0,0 +1,25 @@
deviceDesc = orange cryostat with 50 mm sample space
defineTemperature tt
device stick_menu ill1
makenv tt -driver [lsdriver] {
lsc_sensor tm A -sensor x71738 -sensorname VTI
# lsc_sensor tx B -sensorname extern
lsc_sensor ts C -sensorname sample
lsc_sensor ts_2 D -sensor code -sensorname sample2
lsc_loop set -loop 1 -channel A -maxheater 50W -resist 50Ohm -color green
if {[lsdriver] eq "336_lsc"} {
lsc_loop setsamp -loop 2 -channel C -maxheater 62.5W -resist 40Ohm
}
}
tt set/limit 310
tt maxwait 7200
makeCCU4 ill1 nv n2 he
hupdate /nv/set 1.5
nv ctrl/deriv_o 10
nv ctrl/deriv_c 10
nv ctrl/prop_o 0.2
nv ctrl/prop_c 0.1
source std_orange.table

4
tcl/archive/ill4p.config Normal file
View File

@ -0,0 +1,4 @@
deviceDesc = orange cryostat with 70 mm sample space (FOCUS) prep
source ill4.config
stick ill4

View File

@ -0,0 +1,16 @@
deviceDesc = orange cryostat with 100 mm sample space
defineTemperature tt
device stick_menu "ill5 ill5p sch"
stick ill5
makenv tt -driver [lsdriver] {
lsc_sensor tm B -sensor x34525 -sensorname VTI
lsc_sensor ts C -sensorname sample
lsc_sensor ts_2 D -sensor code -sensorname sample2
lsc_loop set -loop 1 -channel B -maxheater 50W -resist 50Ohm -color green
}
tt set/limit 310
makeCCU4 ill5 nvstep n2 he
source maxi_orange.table

View File

@ -0,0 +1,7 @@
addonDesc = ITC503 manual nedlevalve control
makenv nvoi -driver itc503p
makenv softnv -driver piloop -invar "/nv/flow" -outvar "nvoi set" \
-prop 10 -int 10
GraphAdd nvoi % nvpos dark_green

View File

@ -0,0 +1,35 @@
deviceDesc = CCR with JT-stage
defineTemperature tt
makenv t -driver 340_lsc -port jtccr-ts:3008 {
lsc_sensor main A x63710
lsc_sensor samp B x67737
lsc_loop set -loop 1 -channel A -maxheater 5W -resist 500Ohm
}
makenv p1 dtm -port jtccr-ts:3001 1.
GraphAdd p1 mbar p1 red
makenv p2 dtm -port jtccr-ts:3002 1.
GraphAdd p2 bar p2 green
makenv p3 dtm -port jtccr-ts:3003 1.
GraphAdd p3 bar p3 blue
makenv p4 dtm -port jtccr-ts:3004 1.
GraphAdd p4 bar p4 yellow
makenv -objname pressreg -driver bronkpreg -port jtccr-ts:3005 0.000562468
GraphAdd pressreg bar preg magenta
makenv -objname v -driver svumot -port jtccr-ts:3006 {
v1 1 v2 2 v3 3 v4 4 v5 5 v6 6 v7 7 v8 mot
}
#makenv epc epc8210 -port jtccr-ts:3007 {jt-compressor 1 jt-pump 2 ccr-compressor 3}
#makenv jtccr jtccr
#debug t
#t set 280

View File

@ -0,0 +1,4 @@
deviceDesc = Keithley DVM2701
makenv volt -driver kdvm -port 129.129.155.31:1394

View File

@ -0,0 +1,5 @@
deviceDesc = keithley 195
makenv Volt kei195 -port Prologix-00-21-69-01-1b-34:1234
GraphAdd Volt|V|V|auto

View File

@ -0,0 +1,11 @@
addonDesc = keithley6517B (pls config port in addon)
kthMake dil2-ts:3006
appendVars kth/pA/Kth/1 kth.volt/V/Volt/2
kth file /home/l_samenv/kth
kth time0 2
kth time 10

View File

@ -0,0 +1,3 @@
proc lambdapumpLayout args {
Label "reserved for lamdapump on PREP5"
}

15
tcl/archive/ls340.config Normal file
View File

@ -0,0 +1,15 @@
deviceDesc = lakeshore 340
defineTemperature tt
makenv tt -driver [lsdriver] {
lsc_sensor tm A -sensor X89135 -sensorname main
lsc_loop set -loop 1 -channel A -maxheater 50W -resist 40Ohm
}
tt set/limit 315
tt set/prop 15
tt set/integ 10
catch {
enableTable 0
}

23
tcl/archive/mango.config Normal file
View File

@ -0,0 +1,23 @@
deviceDesc = 5T System (1975)
device stick_menu "dilmango dilRDR5 dilRDR2 dilRDRN"
GraphOrder K W
# levelmeter
makeCCU4 mango nv he
cc hts 40
cc htf 10
cc hfu 200
cc hem 550
# 250 l vessel:
cc hem0 720
makenv mf -driver smc -port Prologix-00-21-69-01-19-57:1234
mf gen/profile 5:1
mf gen/profile_training 5:1
GraphAdd mf T mf
GraphAdd mf.smc.leads_set T mf_set
GraphAdd mf.smc.leads_meas T mf_cur

View File

@ -0,0 +1,5 @@
deviceDesc = LN2filler with CCU09.3
makenv n2 n2_ccu ccu
appendVars n2.upper/K2/N2_Upper n2.lower/K2/N2_Lower

View File

@ -0,0 +1,16 @@
stickDesc = ORI1 stick with tranport wiring
stick_sensors x17627 x70197
makenv pulse -driver DAQ -port ldmprep34-ts:3004
#makenv volt -driver nanov -port ma7-ts:3004
#makenv curr -driver ksm2400 -port ma7-ts:3006
#makenv fn -driver fungen -port A-33210A-12119.psi.ch:5025
#makenv la -driver lockin -port 10105266.psi.ch:50000
# with ssh tunnel:
#makenv fn -driver fungen -port localhost:3015
#makenv la -driver lockin -port localhost:3016

View File

@ -0,0 +1,17 @@
deviceDesc = orange cryostat with 50 mm sample space
defineTemperature tt
makenv tt -driver [lsdriver] {
lsc_sensor tm B -sensor x68258 -sensorname VTI
lsc_sensor tm_2 A -sensor pt-100 -sensorname VTI2 -is hidden
lsc_sensor ts C -sensorname sample
lsc_sensor code D -sensor code
lsc_loop set -loop 1 -channel B -maxheater 50W -resist 50Ohm
lsc_loop set2 -loop 2 -channel C -maxheater 50W -resist 80Ohm
}
tt set/limit 310
makeCCU4 ori1 nv n2 he
hupdate /nv/set 1.6
stick ppms

View File

@ -0,0 +1,16 @@
deviceDesc = orange cryostat with 100 mm sample space
defineTemperature tt
makenv tt -driver [lsdriver] {
lsc_sensor tm B -sensor x75608 -sensorname VTI
lsc_sensor ts C -sensorname sample
lsc_sensor code D -sensor code
lsc_loop set -loop 1 -channel B -maxheater 50W -resist 50Ohm
lsc_loop set2 -loop 2 -channel C -maxheater 50W -resist 80Ohm
}
tt set/limit 310
makeCCU4 ori2 nv n2 he
hupdate /nv/set 1.6
stick ppms

View File

@ -0,0 +1,4 @@
stickDesc = standard ORI4 stick (old)
stick_sensors x58600 x163061

View File

@ -0,0 +1,47 @@
######################################
proc DataFile {fname dt criterium} {
set fd [open $fname a]
puts $fd "# Time Temp Curr Volt"
puts $fd "# sec K pA V "
set t0 [clock clicks -milliseconds]
set time [expr ([clock clicks -milliseconds] - $t0) * 0.001]
set temp [result tt ts]
set curr [result kth]
set volt [result kth volt]
set nr 0
hsetprop tt updateperiod $dt
while {[expr $criterium]} {
set time [expr ([clock clicks -milliseconds] - $t0) * 0.001]
set temp [result tt ts]
set curr [result kth]
set volt [result kth volt]
set nr [expr $nr + 1]
puts $fd "$time $temp $curr $volt"
if {$nr > 10 } {
close $fd
set nr 0
set fd [open $fname a]
}
wait $dt
}
clientput "...done!"
close $fd
hsetprop tt updateperiod 5
}
####################################
##example
#set fname "testfile.dat"
#set dt 1
#set criterium {$time < 8.0}
#DataFile $fname $dt $criterium
###################################

View File

@ -0,0 +1,189 @@
namespace eval calib {
variable buf
}
proc calib::next_temp {T} {
variable buf
clientput "next_temp $T"
tt tolerance [expr $T * 0.01]
tt settle [expr $T + 60]
run tt $T
hsetprop /res @crit 0
set buf(1) [list]
set buf(2) [list]
set buf(3) [list]
set buf(4) [list]
set buf(5) [list]
set buf(6) [list]
hsetprop /res @chanidx 0
foreach channel [hgetpropval /res @channels] {
hsetprop /res/s$channel/raw dif 1
hsetprop /res/s$channel/raw endtime 0
}
}
proc calib::update_chan {value} {
variable buf
if {[sct @crit] == 0} {
if {[listexe] ne "Machine Idle"} {
if {[hval /res/autoscan] == 0} {
res autoscan 1
}
# stabilizing
return
}
if {[result tt set] < 1.3 && [result tt set] > 311} {
hepump valve 1
hepump running 0
calib::stop
return
}
sct @crit 1
res autoscan 0
return
}
set i [sct @chanidx]
set c [lindex [sct @channels] $i]
if {$c != [sct @channel]} {
if {$c != [hval /res]} {
res s$c/active 1
}
return
}
set time [format %.3f [expr [DoubleTime] - [sct @basetime]]]
lappend buf($c) $value
if {[llength $buf($c)] >= [sct count]} {
set mean [expr [::tcl::mathop::+ {*}$buf($c)] / double([llength $buf($c)])]
set sum2 0
foreach r $buf($c) {
set sum2 [expr $sum2 + pow($r - $mean, 2)]
}
sct sigma [expr sqrt($sum2) / double([llength $buf($c)])]
set buf($c) [list]
set lastmean [sct lastmean]
sct lastmean $mean
set endtime [silent 0 sct endtime]
if {$endtime > 0} {
set interval [expr abs($time - $endtime) / 60.0]
sct dif [expr (($mean - $lastmean) / double($mean)) / $interval]
} else {
sct dif 1
}
sct endtime $time
clientput [format "time %.0f dif %.6f c %d interval %.2f R %.7g sigma %.7g" $time [sct dif] $c $interval $mean [sct sigma]]
if {$c == [sct @calchan]} {
set lastchan [lindex [sct @channels] [expr $i - 1]]
hsetprop res/s$lastchan/raw refvalue [expr 0.5 * ($lastmean + $mean)]
set maxdif 0
foreach channel [sct @channels] {
set dif [hgetpropval /res/s$channel/raw dif]
if {abs($dif) > abs($maxdif)} {
set maxdif $dif
}
}
clientput "maxdif$i $maxdif"
set save [sct @crit]
if {$save == 1} {
if {abs($maxdif) <= [sct @crit1]} {
sct @nextsave $i
sct @crit 2
} else {
set save 0
}
} else {
if {$i == [sct @nextsave]} {
sct @crit [expr $save + 1]
} else {
set save 0
}
}
if {$save > 0} {
catch {
foreach channel [sct @channels] {
if {$channel != [sct @calchan]} {
set v [hgetpropval res/s$channel/raw lastmean]
set rv [hgetpropval res/s$channel/raw refvalue]
set sigma [hgetpropval res/s$channel/raw sigma]
set endtime [hgetpropval res/s$channel/raw endtime]
set fil [open [format [sct @basename] $save $channel] a]
puts $fil [format "%.2f %.9g %.9g %.9g" $endtime $rv $v $sigma]
close $fil
}
}
} msg
clientput SAVE/$save/$msg
if {$save >= 3} {
# finish T
# next_temp [format %.3g [expr [result tt set] * 0.8912]]
next_temp [format %.3g [expr [result tt set] * 1.778]]
}
}
}
incr i
if {$i >= [llength [sct @channels]]} {
set i 0
}
sct @chanidx $i
res s[lindex [sct @channels] $i]/active 1
}
}
proc calib::set_chan {channel} {
_res updatescript /res/s$channel/raw calib::update_chan
hsetprop /res/s$channel/raw count 10
hsetprop /res/s$channel/raw lastmean 0
hsetprop /res/s$channel/raw dif 1
}
proc calib::set_calchan {channel} {
_res updatescript /res/s$channel/raw calib::update_chan
hsetprop /res/s$channel/raw count 5
hsetprop /res/s$channel/raw lastmean 0
hsetprop /res/s$channel/raw dif 1
}
proc calib::start {T args} {
set calchan [lindex $args 0]
hsetprop /res @basetime [expr int([DoubleTime]/10) * 10]
hsetprop /res @calchan $calchan
hsetprop /res @chanidx 0
hsetprop /res @crit 0
# rel change / minute
hsetprop /res @crit1 0.0005
hsetprop /res @nextsave 0
set_calchan $calchan
set chanlist [list]
foreach channel $args {
if {$channel != $calchan} {
set_chan $channel
lappend chanlist $channel
lappend chanlist $calchan
}
}
hsetprop /res @channels $chanlist
res autoscan 0
hsetprop /res @basename "calib[clock format [clock seconds] -format "%Y-%m-%d"]_c%s_chan%s.dat"
res s$calchan/active 1
next_temp $T
nv autoflow/getTemp calib::tmts
}
proc calib::stop {} {
foreach channel {1 2 3 4 5 6} {
_res killupdatescript /res/s$channel/raw calib::update_chan
}
}
proc calib::tmts {} {
set tm [silent 1 result tt tm]
set ts [silent $tm hval /res/s[hgetpropval /res @calchan]]
if {$ts < $tm} {
return $ts
} else {
return $tm
}
}

View File

@ -0,0 +1,82 @@
proc ihelium3_chebychev {coef z} {
# coef: Zu Zl a0 a1 a2 ...
set a2_n [lassign $coef zu zl a0 a1]
set x [expr (($z - $zl) - ($zu - $z)) / double($zu - $zl)]
set tn_2 1
set tn_1 $x
set y [expr $a0 * 0.5 + $a1 * $x]
lappend conv $y
foreach an $a2_n {
set tn [expr 2 * $x * $tn_1 - $tn_2]
set y [expr $y + $an * $tn]
lappend conv $y
set tn_2 $tn_1
set tn_1 $tn
}
# clientput "zl=$zl zu=$zu z=$z x=$x $conv"
return $y
}
proc ihelium3_calib {sensorno} {
upvar #0 ihelium3_$sensorno cal
set fil [open calcurves/#CMP${sensorno}Coefftable.dat]
foreach B {0 0.2 0.4 0.6 0.8 1 2 3 4 5 6 7} {
set cal($B) [gets $fil]
}
close $fil
set fil [open calcurves/#CMP${sensorno}HT_Coeff.dat]
set c [list]
while {[gets $fil line] >= 0} {
if {[string index $line 0] ne "#"} {
lappend c [string trim $line]
}
}
close $fil
set cal(HT) $c
}
proc ihelium3_res2temp {sensorno B R} {
upvar #0 ihelium3_$sensorno cal
set r [expr log10($R)]
# clientput r=$r
if {$r < [lindex $cal(0) 1]} {
set t [ihelium3_chebychev $cal(HT) $r]
} else {
set B [expr abs($B)]
if {$B >= 7} {
set B0 6
set B1 7
set w 1
} else {
if {$B >= 1} {
set B0 [expr int($B)]
set B1 [expr $B0 + 1]
} else {
set B0 [format %g [expr int($B * 5) * 0.2]]
set B1 [format %g [expr $B0 + 0.2]]
}
set w [expr (sqrt($B) - sqrt($B0)) / (sqrt($B1) - sqrt($B0))]
}
set t0 [ihelium3_chebychev $cal($B0) $r]
set t1 [ihelium3_chebychev $cal($B1) $r]
set t [expr (1 - $w) * $t0 + $w * $t1]
}
return [expr pow(10, $t)]
}
proc ihelium3_tab {sensorno r} {
foreach B {0 0.2 0.4 0.6 0.8 1 2 3 4 5 6 7} {
set T [list $B]
foreach R $r {
set tt [ihelium3_res2temp $sensorno $B $R]
if {$tt < 0.4} {
break
}
lappend T $tt
}
clientput $T
}
}

View File

@ -0,0 +1,7 @@
set instr [result instrument]
if {[file exists istartup/${instr}.tcl]} {
exe istartup/${instr}.tcl
}
if {[file exists istartup/${instr}_delayed.tcl]} {
dolater 5 exe istartup/${instr}_delayed.tcl
}

View File

@ -0,0 +1,56 @@
#
# Usage:
#
# mpms wait [<timeout> [<interval>]]
#
# wait for mpms script and return file content
# timeout is a week by default, interval 1 second
#
# set text [mpms wait]
#
# alternative usage (polling):
#
# while {[mpms wait 1] ne ""} {
# DO SOMETHING
# }
# set text [mpms wait]
#
# mpms continue
#
# continue mpms script (deleting the file)
#
proc mpms {command {timeout 600000} {interval 1}} {
global env
set path $env(HOME)/MPMS/ReqToExt.txt
switch -- $command {
wait {
set start [DoubleTime]
while 1 {
if {[file exists $path]} {
set fil [open $path r]
set contents [read -nonewline $fil]
close $fil
return $contents
}
if {[DoubleTime] >= $start + $timeout} {
return ""
}
wait $interval
}
}
continue {
if {[file exists $path]} {
file delete $path
return 1
}
return 0
}
default {
error "what is $command ?"
}
}
}
publishLazy mpms

View File

@ -0,0 +1,199 @@
#
# Automatic N2 refill
#
# watching state (2):
# if lower sensor falls below startvalue for more than startdelay seconds,
# start fill, go to fillstart state (3)
# fillstart state (3):
# wait fillmini seconds, then go to filling state
# filling state (4):
# if upper sensor goes beyond fillvalue for more than filldelay seconds,
# stip fill, go to quiet state (1)
# quiet state (1):
# wait stopmini seconds, then go to watching state (2)
proc makeN2fill {} {
makeobject n2fillPar array logged
n2fillPar makeitem state 0
n2fillPar makeitem lower "tt tm"
n2fillPar makeitem upper "tt ts"
n2fillPar makeitem startvalue 100
n2fillPar makeitem stopvalue 100
n2fillPar makeitem lasttime 0
n2fillPar makeitem lastcron 0
n2fillPar makeitem startdelay 10
n2fillPar makeitem stopdelay 5
n2fillPar makeitem fillmini 10
n2fillPar makeitem stopmini 60
n2fillPar makeitem instance 0
n2fillPar makeitem errcnt 0
obj_list makeitem n2fillPar "LN2 refill parameters"
Layout n2fill
}
proc n2fillLayout args {
Group n2fill "LN2 refill"
}
proc n2fillGroup args {
showStatus n2fill
RadioGroup n2fill
Label "LN2 refill"
NoNewline
CheckBox active "n2fill on"
if {[result n2fill on]} {
NoNewline
CheckBox fill "n2fill fill"
}
NoNewline
Label "state: [result n2fill]"
Newline
Tip "upper sensor parameter name"
Input "upper sensor" "n2fillPar upper"
Tip "lower sensor parameter name"
Input "lower sensor" "n2fillPar lower"
Newline
Tip "switch-off value on upper sensor"
Input "stop value" "n2fillPar stopvalue"
Tip "switch-on value on lower sensor"
Input "start value" "n2fillPar startvalue"
Newline
Input "start delay" "n2fillPar startdelay"
Input "stop delay" "n2fillPar stopdelay"
Newline
Tip "minimum switch-on time"
Input "minimum fill time" "n2fillPar fillmini"
Tip "minimum switch-off time"
Input "minimum stop time" "n2fillPar stopmini"
Newline
}
proc n2state {state} {
n2fillPar lasttime [clock seconds]
if {$state > 2} {
clientput "valve ON"
tt send relay 2:2,1
} else {
clientput "valve OFF"
tt send relay 2:2,0
}
n2fillPar state $state
}
proc n2fill {{action none} {value none}} {
set now [clock seconds]
set lasttime [result n2fillPar lasttime]
set uval [result eval [result n2fillPar upper]]
set lval [result eval [result n2fillPar lower]]
set state [result n2fillPar state]
set errcnt [result n2fillPar errcnt]
switch -- $action {
none {
switch -- $state {
0 { return "n2fill = off (0)" }
1 { return "n2fill = quiet (1)" }
2 { return "n2fill = watching (2)" }
3 { return "n2fill = fillstart (3)" }
4 { return "n2fill = filling (4)" }
}
}
cron {
n2fillPar lastcron $now
if {$value != [result n2fillPar instance]} {
n2state 0
error "n2fill instance $value stopped"
}
if {$uval < 420 && $uval > 65 && $lval < 420 && $lval > 65} {
n2fillPar errcnt 0
} else {
incr errcnt
if {$errcnt >= 5} {
n2state 0
error "illegal upper ($uval) or lower ($lval) temperature"
}
n2fillPar errcnt $errcnt
return
}
switch -- $state {
3 {
if {$now > $lasttime + [result n2fillPar fillmini]} {
n2state 4
}
}
4 {
if {$uval < [result n2fillPar stopvalue]} {
if {$now > $lasttime + [result n2fillpar stopdelay]} {
n2state 1
}
} else {
n2fillpar lasttime $now
}
}
1 {
if {$now > $lasttime + [result n2fillPar stopmini]} {
n2state 2
}
}
2 {
if {$lval > [result n2fillPar startvalue] && $lval < 250} {
if {$now > $lasttime + [result n2fillpar startdelay]} {
n2state 3
}
} else {
n2fillpar lasttime $now
}
}
default {
error "n2fill stopped with state $state"
}
}
}
on {
switch -- $value {
1 {
set instance [result n2fillPar instance]
incr instance
n2fillPar instance $instance
sicscron 1 n2fill cron $instance
n2state 2
return "n2fill.on = 1"
}
0 {
n2state 0
return "n2fill.on = 0"
}
none {
if {$now > [result n2fillPar lastcron] + 10} {
return "n2fill.on = 0"
}
if {$state > 0} {
return "n2fill.on = 1"
} else {
return "n2fill.on = 0"
}
}
}
}
fill {
switch -- $value {
1 {
n2state 4
return "n2fill.fill = 1"
}
0 {
n2state 2
return "n2fill.fill = 1"
}
none {
if {$state > 2} {
return "n2fill.fill = 1"
} else {
return "n2fill.fill = 0"
}
}
}
}
}
}
publishLazy n2fill spy

View File

@ -0,0 +1,33 @@
namespace eval nvstep {
}
proc nvstep::trans {value {val2 none}} {
if {$value eq "inv"} {
if {$val2 > 1.9} {
return [expr $val2 * 100 - 180]
}
if {$val2 > 1.0} {
return [expr 1.0 / (2 - $val2)]
}
return $val2
}
if {$val2 eq "none"} {
if {$value > 10} {
return [expr ($value + 180) * 0.01]
}
if {$value > 1} {
return [expr 2 - 1.0 / $value]
}
return $value
}
error "illegal arguments: nvstep::trans $value $val2"
}
proc nvstep::out {motpath {value none}} {
if {$value eq "none"} {
return [hvali $motpath]
}
if {[hgetpropval $motpath status] ne "run"} {
hset $motpath $value
}
}

View File

@ -0,0 +1,434 @@
namespace eval SECoP {} {
}
proc SECoP::check_range {{low None} {high None}} {
[sct controller] timeout 0.001
if {$low ne "None" && [sct target] < $low} {
error "value [sct target] must be >= $low"
}
if {$high ne "None" && [sct target] > $high} {
error "value [sct target] must be <= $high"
}
}
proc SECoP::check_bool {} {
[sct controller] timeout 0.001
switch -- [string tolower [sct target]] {
off - false - no - 0 - on - true - yes - 1 {
return
}
}
error "illegal value for boolean: [sct target]"
}
proc SECoP::check_length {{low None} {high None}} {
if {$low ne "None" && [string length [sct target]] < $low} {
error "value [sct target] must not be shorter than $low"
}
if {$high ne "None" && [string length [sct target]] > $high} {
error "value [sct target] must not be longer than $high"
}
}
proc SECoP::make_par {secopar desc {kind ""}} {
set path [topath $secopar [silent "" dict get $desc group]]
array set props $desc
set validator_args [lassign [silent "" set props(datatype)] secoptype0]
if {$secoptype0 eq "tuple" && [string match *:status $secopar]} {
lassign $validator_args elements
make_par0 text ${path}_text $secopar $desc
hsetprop ${path}_text width 24
set validator_args [lassign [lindex $elements 0] secoptype]
set status_node 1
} else {
set secoptype $secoptype0
set status_node 0
}
switch -- $secoptype {
double {set type float}
int - enum {set type int}
string {
set type text
# can not use SICS drivable for string
set kind ""
}
bool {set type text}
none {set type none}
default {
clientput "unknown type for $secopar (use text): $secoptype ($props(datatype))"
set type text
}
}
make_par0 $type $path $secopar $desc $kind
hsetprop $path secoptype $secoptype0
if {$status_node} {
hsetprop $path nonewline 1
}
switch -- $secoptype {
enum {
set enumprop [list]
set wid 8
foreach {name value} [lindex $validator_args 0] {
lappend enumprop "$name=$value"
set wid [expr max($wid,[string length $name])]
}
hsetprop $path enum [join $enumprop ,]
if {$wid > 8} {
hsetprop $path width $wid
}
}
bool {
hsetprop $path enum 1
hsetprop $path validator SECoP::check_bool
}
double - int {
hsetprop $path validator [concat SECoP::check_range $validator_args]
}
string {
hsetprop $path width 16
hsetprop $path validator [concat SECoP::check_range $validator_args]
}
}
return $path
}
proc SECoP::make_par0 {type path secopar desc {kind std}} {
array set props $desc
# clientput "$path $desc"
set readonly [silent 0 set props(readonly)]
if {$readonly} {
set priv internal
} else {
set priv user
}
if {[silent "" hinfo $path] ne ""} {
error "$path exists already!"
}
lassign [split $path /] nul obj par
if {$par eq ""} {
if {$kind eq "driv"} {
dynsctdriveobj $obj float user SECoP [sct controller]
hfactory $path link $obj
hsetprop $obj checklimits SECoP::checklimits
hsetprop $obj halt SECoP::halt
# allow start without run:
hsetprop $obj check SECoP::checklimits
hsetprop $obj write SECoP::complete_run
set readonly 0
hsetprop $obj sicscommand "run $obj"
} else {
# clientput "OBJ $obj $type"
dynsicsobj $obj SECoP $priv $type
hfactory $path link $obj
}
hsetprop $path group $obj
hsetprop $path objectPath $path
hsetprop /sics/[sct controller] p_$secopar:value $path
} else {
if {$par eq "status"} {
set path /$obj/s_status
}
# clientput "PAR $path $type"
hfactory $path plain $priv $type
if {[info exists props(visibility)]} {
if {$props(visibility) >= 3} {
hsetprop $path visible false
}
}
}
hsetprop $path secopar $secopar
hsetprop /sics/[sct controller] p_$secopar $path
if {!$readonly} {
[sct controller] write $path
} else {
[sct controller] connect $path
}
logsetup $path 1
if {[info exists props(value)]} {
clientput "VALUE in descr $path"
if {[catch {hupdate /$path $props(value)} msg]} {
clientput $msg
}
unset props(value)
}
set fmtunit ""
if {[info exists props(unit)]} {
set fmtunit [format { [%s]} $props(unit)]
if {$par eq "" || $par eq "target"} {
if {[sct shownUnits] eq "ALL" || [lsearch [sct shownUnits] $props(unit)] >= 0} {
GraphAdd $path $props(unit) [join [lrange [split $path /] 1 end] .]
}
}
}
if {[info exists props(description)]} {
hsetprop $path help "$props(description)$fmtunit"
unset props(description)
}
foreach {prop item} [array get props] {
hsetprop $path s_$prop $item
}
}
proc SECoP::make_cmd {secopar desc {first 0}} {
array set props $desc
set path [topath $secopar [silent "" dict get $desc group]]
set cmd [join [lassign [split $path /] _ obj] /]
lassign [lindex [silent "" set props(datatype)] 1] secoptype validator
if {$secoptype eq "None"} {
$obj makescriptfunc $cmd "SECoP::check_cmd [sct secoppath] $secopar" user
hsetprop $path newline $first
hsetprop $path secopar $secopar
hsetprop $path sicscommand "$obj $cmd"
if {[info exists props(visibility)]} {
if {$props(visibility) >= 3} {
hsetprop $path visible false
}
}
} else {
if {[llength $secoptype] == 1} {
set secoptype [lindex $secoptype 0]
}
dict set desc datatype $secoptype
make_par $secopar $desc
lassign $secoptype maintype
if {$maintype eq "double" || $maintype eq "int" || $maintype eq "bool"} {
hsetprop $path check "SECoP::check_cmd_num [sct secoppath] $secopar"
} else {
hsetprop $path check "SECoP::check_cmd_text [sct secoppath] $secopar"
}
}
}
proc SECoP::check_cmd {secoppath secopar} {
hset $secoppath "do $secopar"
}
proc SECoP::check_cmd_num {secoppath secopar} {
hset $secoppath [format {do %s %.15g} $secopar [sct target]]
sct update [sct target]
}
proc SECoP::check_cmd_text {secoppath secopar} {
hset $secoppath [format {do %s "%s"} $secopar [sct target]]
sct update [sct target]
}
proc SECoP::make_module {obj desc} {
clientput "MAKE_MODULE $obj"
if {[obj_list exists $obj]} {
clientput "$obj exists already"
return
}
obj_list makeitem $obj /$obj
array unset modprop
set parlist [list]
set pardict [dict create]
foreach {key item} $desc {
switch $key {
accessibles {
foreach acsitm $item {
lassign $acsitm parname pardesc
dict set pardict $parname $pardesc
}
}
default {
set modprop($key) $item
}
}
}
if {[dict exists $pardict value]} {
set value [dict get $pardict value]
dict unset pardict value
} else {
set value [dict create datatype none]
}
set classes [silent "" set modprop(interface_class)]
if {[string match "* Drivable *" " $classes "]} {
set path [make_par $obj $value driv]
} else {
set path [make_par $obj $value]
}
if {[info exists modprop(visibility)] && $modprop(visibility) >= 3} {
hdelprop $path group
}
foreach {prop val} [array get modprop] {
hsetprop $obj sm_$prop $val
}
device_layout makeitem /$obj [silent 0 set modprop(layoutpos)]
set groups [dict create]
foreach {parname pardesc} $pardict {
if {[dict exists $pardesc group]} {
dict set groups [dict get $pardesc group] 1
}
}
foreach g [dict keys $groups] {
clientput "GROUP $g"
hfactory $obj/$g plain user none
hsetprop $obj/$g group "group $g"
}
set shortcmds [list]
foreach {parname pardesc} $pardict {
set datatype [dict get $pardesc datatype]
if {[lindex $datatype 0] eq "command"} {
if {[lindex $datatype 1] ne "None"} {
# only commands with arguments
make_cmd $obj:$parname $pardesc 1
} else {
lappend shortcmds $parname $pardesc
}
} else {
make_par $obj:$parname $pardesc
}
}
# then commands without arguments, on one line
set first 1
foreach {parname pardesc} $shortcmds {
make_cmd $obj:$parname $pardesc $first
set first 0
}
}
proc SECoP::make_node {desc} {
array unset nodeprop
set modlist [list]
foreach {key item} $desc {
switch $key {
modules {
set modlist $item
}
default {
set nodeprop($key) $item
}
}
}
foreach moditem $modlist {
lassign $moditem modname moddesc
make_module $modname $moddesc
}
foreach {prop val} [array get nodeprop] {
sct sn_$prop $val
}
sort_layout
}
proc SECoP::topath {secopar {pargroup ""}} {
lassign [split [string tolower $secopar] :] module parameter
if {$parameter eq "value" || $parameter eq ""} {
return "/$module"
}
if {$parameter eq "status"} {
set parameter s_status
}
if {[string match {_*} $parameter]} {
set parameter [string range $parameter 1 end]
}
if {$pargroup ne ""} {
return "/$module/$pargroup/$parameter"
}
return "/$module/$parameter"
}
proc SECoP::msg_describing {secnode specifier val} {
do_as_manager {
make_node $val
}
$secnode activate
}
proc SECoP::msg_changed {secnode par val} {
variable sentto_$secnode
if {[string match *:target $par]} {
hsetprop /$obj writestatus done
}
hsetprop $path changed 0
if {[lrange [set sentto_$secnode] 0 1] eq [list change $par]} {
set message_to_client "change $par $val"
}
msg_update $secnode $par $val change
}
proc SECoP::msg_update {secnode par val {action update}} {
if {$action eq "update"} {
if {[DoubleTime] < [silent 0 hgetpropval $path changed] + 10} {
# ignore updates of variables during change
# clientput "ignore [sct result]"
return
}
if {[lrange $sent_message 0 1] eq [list read $par]} {
set message_to_client "$action $par $val"
}
}
lassign $val value qual
if {[silent 0 hgetpropval $path secoptype] eq "tuple" &&
[string match *:status $par]} {
if {[llength $value] > 2} {
set text_value [lrange $value 1 end]
} else {
set text_value [lindex $value 1]
}
set objpath [sct parent $path]
set visible_old [silent true hgetpropval $objpath visible]
if {$text_value ne "disabled"} {
set visible_new true
set shown 1
} else {
set visible_new false
set shown 0
}
if {$visible_new ne $visible_old} {
hsetprop $objpath visible $visible_new
GraphItem shown $objpath $shown
}
lassign $value value
if {[catch {updateval ${path}_text $text_value}]} {
clientput "cannot update ${path}_text to $text_value"
clientput "MSG($action $par $val)"
}
if {[string match *:status $par]} {
if {[silent 0 hgetpropval /$obj writestatus] eq "start"} {
set status run
} elseif {[string match 3* $value]} {
set status run
} elseif {[string match 4* $value]} {
set status posfault
} else {
set status idle
}
hsetprop /$obj status $status
}
}
if {[catch {updateval $path $value} msg]} {
if {$value eq "None"} {
hsetprop $path geterror None
} else {
clientput "cannot update $path to $value"
clientput $msg
}
} elseif {[string match *:target $par]} {
# clientput [sct result]/[silent "" hgetpropval /$obj status]
if {[silent "" hgetpropval /$obj status] eq "idle"} {
hsetprop /$obj target $value
}
}
catch {
hsetprop $path timestamp [dict get $qual t]
}
}
proc SECoP::msg_pong {secnode args} {
clientlog "pong $secnode $args"
}
proc SECoP::msg_done {secnode args} {
clientlog "done $secnode $args"
}
proc SECoP::msg_active {secnode args} {
clientlog "active $secnode $args"
}
proc SECoP::msg_error {secnode args} {
clientlog "error $secnode $args"
}

View File

@ -0,0 +1,195 @@
proc get_next_filename {} {
set file [store file]
set filepattern [file join [result exe batchpath] $file]
set nameformat [string map "* [store numfmt]" $filepattern]
if {$nameformat eq $filepattern} {
# no * in filepattern
if {![file exists $filepattern]} {
# simple filename
store path [file normalize $filepattern]
return $filepattern
}
# insert * before . or at end
set split [split $file .]
if {[llength $split] == 1} {
lappend split ""
}
set file [join [linsert $split end-1 *] .]
store file $file
set filepattern [file join [result exe batchpath] $file]
set nameformat [string map "* [store numfmt]" $filepattern]
set num 0
store num 0
} else {
set num [store num]
}
set path [format $nameformat $num]
if {$num == 0 || [file exists $path]} {
# determine next num
set n $num
foreach p [glob -nocomplain $filepattern] {
scan $p $nameformat n
if {$n > $num} {
set num $n
}
}
incr num
store num $num
set path [format $nameformat $num]
}
store path [file normalize $path]
return $path
}
proc store {{command ""} args} {
if {[sicsdescriptor store_array] ne "array"} {
makeobject store_array array
store_array makeitem numfmt %04d
store_array makeitem file data.txt
store_array makeitem path
store_array makeitem vars
store_array makeitem num 0
}
switch -- $command {
open {
store_array vars $args
set f [open [get_next_filename] w]
set i 1
foreach var $args {
puts $f [format "# col %d: %s (%s)" $i $var [GraphItem label $var]]
incr i
}
close $f
return "open [store path]"
}
put {
set row [list]
foreach var [split [store vars]] {
lappend row [get_var_value $var]
}
set f [open [store path] a]
puts $f [join $row "\t"]
close $f
}
"" - list {
set result [join {
"store open <var1> <var2> ... # open file for storing named variables"
"store put # write a row with values of variables"
} "\n"]
foreach key [store_array items] {
append result "\nstore $key [result store_array $key]"
}
return $result
}
default {
set l [llength $args]
if {$l > 1} {
error "Usage: store $command \[<$command>\]"
}
if {![store_array exists $command]} {
error "what is 'store $command'?"
}
if {$l == 1} {
if {$command eq "file" || $command eq "numfmt" } {
store_array num 0
}
store_array $command $args
}
return "[result store_array $command]"
}
}
}
namespace eval varscan {} {
variable waittime 10
variable cmd ""
variable reltol 0
variable digits 6
proc reltol {rel args} {
variable reltol
variable tolcmd
set reltol [expr abs($rel)]
set tolcmd $args
}
proc do {args} {
variable waittime
variable cmd
variable last
variable reltol
variable tolcmd
variable digits
foreach value $args {
if {$reltol != 0} {
eval "$tolcmd [format %.${digits}g [expr $reltol * $value]]"
}
set starttime [DoubleTime]
clientput "$cmd $value"
eval "$cmd $value"
wait [expr max(0, $starttime + $waittime - [DoubleTime])]
store put
set last $value
}
}
proc linear {encode value} {
return $value
}
proc log {encode value} {
variable digits
if {$encode} {
return [expr log10($value)]
}
return [format %.${digits}g [expr 10 ** $value]]
}
proc dosteps {step endarg {func linear}} {
variable last
variable precision
variable reltol
variable digits
set end [$func 1 $endarg]
set val [$func 1 $last]
if {$end < $val} {
set step [expr -abs($step)]
} else {
set step [expr abs($step)]
}
set precision [expr max(abs($step) * 0.1, $reltol)]
set prec 0.1
for {set digits 2} {$prec > $precision} {incr digits} {
set prec [expr $prec * 0.1]
}
while 1 {
set val [expr $val + $step]
if {($end - $val) / $step < 0.5} {
break
}
do [$func 0 $val]
}
do $endarg
set digits 6
}
proc waittime {wait} {
variable waittime
set waittime $wait
}
proc command {args} {
variable cmd
set cmd $args
}
}
proc varscan {code} {
namespace eval varscan $code
}
publishLazy store
publishLazy varscan

View File

@ -0,0 +1,10 @@
deviceDesc = "test ana8 (8 analog channels using taskit RS232 ADC)"
set div [expr (3.6 / 1.1 + 1)]
set div100 [expr (3.6 / 1.1 + 1) * 100]
makenv a4 -driver ana8 -controller ana -port ldmlab1-ts:3005 4 $div 0 tpr010
makenv a0 -driver ana8 -controller ana -port ldmlab1-ts:3005 0 $div100
GraphAdd a4 V
#GraphAdd a1 V
#GraphAdd a2 V

View File

@ -0,0 +1,3 @@
deviceDesc = "AVS45 test"
makenv t -driver avs45 -port ldmlab1-ts:3015

View File

@ -0,0 +1 @@
makenv b -driver bin

View File

@ -0,0 +1,10 @@
deviceDesc = flowmeter test
makeCCU4 ori1 nv sensirion
hupdate /nv/set 1.6
makenv hastings -driver fluke45 {X * 10 + 0.4}
GraphAdd hastings ln/min h_flow dark_green
GraphAdd cc.f mbar p

View File

@ -0,0 +1,3 @@
deviceDesc = taskit test
makenv t -driver taskit