diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl index fe06d19d..8724579f 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl @@ -1579,7 +1579,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p # @param tempobj short name for the temperature controller scriptcontext object (typ. tc1 or tc2) # @param tol temperature tolerance in Kelvin (typ. 1) # @return nothing (well, the sct object) - proc mk_sct_lakeshore_336 {sct_controller klasse tempobj tol1 tol2 verbose} { + proc mk_sct_lakeshore_336 {sct_controller klasse tempobj CID CTYPE tol1 tol2 verbose} { if {[ catch { MakeSICSObj $tempobj SCT_OBJECT sicslist setatt $tempobj klass $klasse @@ -1846,7 +1846,22 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p # Problem: Does not write non-numbers to the hdf file unless told differently - but how? # How can I make it write the NAME (or any character/string variable) to the hdf file? # ::scobj::hinitprops $tempobj/sensor sampleSensor + hsetprop $scobj_hpath/sensor/setpoint1 permlink data_set ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/sensor/setpoint1 @description ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/sensor/setpoint2 permlink data_set ${CTYPE}${CID}SP2 + hsetprop $scobj_hpath/sensor/setpoint2 @description ${CTYPE}${CID}SP2 + hsetprop $scobj_hpath/sensor/sensorValueA permlink data_set ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/sensor/sensorValueA @description ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/sensor/sensorValueB permlink data_set ${CTYPE}${CID}S2 + hsetprop $scobj_hpath/sensor/sensorValueB @description ${CTYPE}${CID}S2 + hsetprop $scobj_hpath/sensor/sensorValueC permlink data_set ${CTYPE}${CID}S3 + hsetprop $scobj_hpath/sensor/sensorValueC @description ${CTYPE}${CID}S3 + hsetprop $scobj_hpath/sensor/sensorValueD permlink data_set ${CTYPE}${CID}S4 + hsetprop $scobj_hpath/sensor/sensorValueD @description ${CTYPE}${CID}S4 + + hsetprop $scobj_hpath/sensor/setpoint1 type drivable + hsetprop $scobj_hpath/sensor/setpoint2 type drivable ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/sensor/setpoint1 $scobj_hpath/sensor/ctrlLp1_value $sct_controller ansto_makesctdrive ${tempobj}_driveable2 $scobj_hpath/sensor/setpoint2 $scobj_hpath/sensor/ctrlLp2_value $sct_controller @@ -1871,7 +1886,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p # @param port port number on the moxabox (typ. 4001, 4002, 4003, or 4004) # @param tol temperature tolerance in Kelvin (typ. 1) # @return nothing (well, the sct object) -proc add_sct_ls336 {name IP port terminator {_tol1 1.0} {_tol2 1.0} {_verbose 0} } { +proc add_sct_ls336 {name IP port terminator {_tol1 1.0} {_tol2 1.0} {CID 1} {CTYPE T} {_verbose 0} } { # ffr 2009-11-09, Don't create a temperature controller for the script validator, this causes the # lakeshore to lock up. # NOTE: I put this outside the catch block because "return" raises an exception @@ -1885,9 +1900,9 @@ proc add_sct_ls336 {name IP port terminator {_tol1 1.0} {_tol2 1.0} {_verbose 0} makesctcontroller sct_ls336_$name aqadapter ${port} } else { puts "\nadd_ls336: makesctcontroller sct_ls336_$name std ${IP}:$port $terminator for Lakeshore model 336" - makesctcontroller sct_ls336_$name std ${IP}:$port $terminator + makesctcontroller sct_ls336_$name std ${IP}:$port {*}$terminator } - mk_sct_lakeshore_336 sct_ls336_$name environment $name $_tol1 $_tol2 $_verbose + ::scobj::ls336::mk_sct_lakeshore_336 sct_ls336_$name environment $name $CID $CTYPE $_tol1 $_tol2 $_verbose makesctemon $name /sics/$name/emon/monMode_Lp1 /sics/$name/emon/isInTolerance_Lp1 /sics/$name/emon/errhandler # set m2 "_2" # makesctemon $name$m2 /sics/$name/emon/monMode_Lp2 /sics/$name/emon/isInTolerance_Lp2 /sics/$name/emon/errhandler @@ -1896,4 +1911,22 @@ proc add_sct_ls336 {name IP port terminator {_tol1 1.0} {_tol2 1.0} {_verbose 0} } } +if {[ catch { +if { [ info exists ::config_dict ] } { + if { [ dict get $::config_dict ls336 enabled ] } { + set IP [dict get $::config_dict ls336 ip] + set PORT [dict get $::config_dict ls336 port] + set name [dict get $::config_dict ls336 name] + set ctype [dict get $::config_dict ls336 type] + set cid [dict get $::config_dict ls336 id] + set term [dict get $::config_dict ls336 terminator] + set tol1 [dict get $::config_dict ls336 tol1] + set tol2 [dict get $::config_dict ls336 tol2] + + add_sct_ls336 $name $IP $PORT $term $tol1 $tol2 $cid $ctype + } + } +} message ]} { + puts "ERROR: $message" +} namespace import ::scobj::ls336::* diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl index 1138a3ec..c6fbadf1 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl @@ -2051,12 +2051,18 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p # How can I make it write the NAME (or any character/string variable) to the hdf file? # ::scobj::hinitprops $tempobj/sensor sampleSensor hsetprop $scobj_hpath/sensor/setpoint1 permlink data_set ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/sensor/setpoint1 @description ${CTYPE}${CID}SP1 hsetprop $scobj_hpath/sensor/setpoint2 permlink data_set ${CTYPE}${CID}SP2 + hsetprop $scobj_hpath/sensor/setpoint2 @description ${CTYPE}${CID}SP2 hsetprop $scobj_hpath/sensor/sensorValueA permlink data_set ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/sensor/sensorValueA @description ${CTYPE}${CID}S1 hsetprop $scobj_hpath/sensor/sensorValueB permlink data_set ${CTYPE}${CID}S2 + hsetprop $scobj_hpath/sensor/sensorValueB @description ${CTYPE}${CID}S2 hsetprop $scobj_hpath/sensor/sensorValueC permlink data_set ${CTYPE}${CID}S3 + hsetprop $scobj_hpath/sensor/sensorValueC @description ${CTYPE}${CID}S3 hsetprop $scobj_hpath/sensor/sensorValueD permlink data_set ${CTYPE}${CID}S4 + hsetprop $scobj_hpath/sensor/sensorValueD @description ${CTYPE}${CID}S4 hsetprop $scobj_hpath/sensor/setpoint1 type drivable hsetprop $scobj_hpath/sensor/setpoint2 type drivable @@ -2111,15 +2117,15 @@ proc add_sct_ls340 {name IP port terminator {_tol1 1.0} {_tol2 1.0} {CID 1} {CTY if {[ catch { if { [ info exists ::config_dict ] } { - if { [ dict get $::config_dict ls340_1 enabled ] } { - set IP [dict get $::config_dict ls340_1 ip] - set PORT [dict get $::config_dict ls340_1 port] - set name [dict get $::config_dict ls340_1 name] - set ctype [dict get $::config_dict ls340_1 type] - set cid [dict get $::config_dict ls340_1 id] - set term [dict get $::config_dict ls340_1 terminator] - set tol1 [dict get $::config_dict ls340_1 tol1] - set tol2 [dict get $::config_dict ls340_1 tol2] + if { [ dict get $::config_dict ls340 enabled ] } { + set IP [dict get $::config_dict ls340 ip] + set PORT [dict get $::config_dict ls340 port] + set name [dict get $::config_dict ls340 name] + set ctype [dict get $::config_dict ls340 type] + set cid [dict get $::config_dict ls340 id] + set term [dict get $::config_dict ls340 terminator] + set tol1 [dict get $::config_dict ls340 tol1] + set tol2 [dict get $::config_dict ls340 tol2] add_sct_ls340 $name $IP $PORT $term $tol1 $tol2 $cid $ctype } diff --git a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl index faaded90..2e86f952 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl @@ -703,8 +703,8 @@ namespace eval ::scobj::[set vendor]_[set device] { return OK } - proc mk_sct_driver {sct_controller the_klass the_name tol} { - debug_log 1 "mk_sct_driver $sct_controller $the_klass $the_name $tol" + proc mk_sct_driver {sct_controller the_klass the_name tol CID CTYPE} { + debug_log 1 "mk_sct_driver $sct_controller $the_klass $the_name $tol $CID $CTYPE" set catch_status [ catch { MakeSICSObj $the_name SCT_OBJECT @@ -845,7 +845,31 @@ if {0} { debug_log 5 "error in [ns]::mk_sct_driver($point) $catch_message_2" return -code error "in [ns]::mk_sct_driver($point) $catch_message_2" } + hsetprop $scobj_hpath/Loop1/setpoint permlink data_set ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/Loop1/setpoint @description ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/Loop1/setpoint permlink data_set ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/Loop1/setpoint @description ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/Loop2/setpoint permlink data_set ${CTYPE}${CID}SP2 + hsetprop $scobj_hpath/Loop2/setpoint @description ${CTYPE}${CID}SP2 + hsetprop $scobj_hpath/Loop3/setpoint permlink data_set ${CTYPE}${CID}SP3 + hsetprop $scobj_hpath/Loop3/setpoint @description ${CTYPE}${CID}SP3 + hsetprop $scobj_hpath/Loop4/setpoint permlink data_set ${CTYPE}${CID}SP4 + hsetprop $scobj_hpath/Loop4/setpoint @description ${CTYPE}${CID}SP4 + + hsetprop $scobj_hpath/Loop1/sensor permlink data_set ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/Loop1/sensor @description ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/Loop2/sensor permlink data_set ${CTYPE}${CID}S2 + hsetprop $scobj_hpath/Loop2/sensor @description ${CTYPE}${CID}S2 + hsetprop $scobj_hpath/Loop3/sensor permlink data_set ${CTYPE}${CID}S3 + hsetprop $scobj_hpath/Loop3/sensor @description ${CTYPE}${CID}S3 + hsetprop $scobj_hpath/Loop4/sensor permlink data_set ${CTYPE}${CID}S4 + hsetprop $scobj_hpath/Loop4/sensor @description ${CTYPE}${CID}S4 + if {[SplitReply [environment_simulation]]=="false"} { + hsetprop $scobj_hpath/Loop1/setpoint type drivable + hsetprop $scobj_hpath/Loop2/setpoint type drivable + hsetprop $scobj_hpath/Loop3/setpoint type drivable + hsetprop $scobj_hpath/Loop4/setpoint type drivable ansto_makesctdrive ${the_name}_loop1 $scobj_hpath/Loop1/setpoint $scobj_hpath/Loop1/sensor $sct_controller ansto_makesctdrive ${the_name}_loop2 $scobj_hpath/Loop2/setpoint $scobj_hpath/Loop2/sensor $sct_controller ansto_makesctdrive ${the_name}_loop3 $scobj_hpath/Loop3/setpoint $scobj_hpath/Loop3/sensor $sct_controller @@ -858,9 +882,9 @@ if {0} { } } - proc add_[set vendor]_[set device] {the_name IP port {_tol 5.0}} { + proc add_[set vendor]_[set device] {the_name IP port CID CTYPE terminator {_tol 5.0}} { set [ns]::log_file "/tmp/[set [ns]::ven_dev]_[set the_name].log" - set fd [set [open [ns]::log_file "w"]] + set fd [open [set [ns]::log_file] "w"] close $fd debug_log 1 "add_[set [ns]::vendor]_[set [ns]::device] ${the_name} ${IP} ${port} ${_tol}" puts "Namespace: [namespace current]" @@ -872,10 +896,10 @@ if {0} { puts "[namespace current]::log_file [set [namespace current]::log_file]" if {[SplitReply [environment_simulation]]=="false"} { debug_log 1 "makesctcontroller sct_${the_name} std ${IP}:${port}" - makesctcontroller sct_${the_name} std ${IP}:${port} "\r\n" + makesctcontroller sct_${the_name} std ${IP}:${port} {*}$terminator } - debug_log 1 "mk_sct_driver sct_${the_name} environment ${the_name} ${_tol}" - mk_sct_driver sct_${the_name} environment ${the_name} ${_tol} + debug_log 1 "::scobj::oxford_mercury::mk_sct_driver sct_${the_name} environment ${the_name} ${_tol} $CID $CTYPE" + ::scobj::oxford_mercury::mk_sct_driver sct_${the_name} environment ${the_name} ${_tol} $CID $CTYPE } @@ -890,8 +914,11 @@ if { [ info exists ::config_dict ] && [ dict get $::config_dict mercury_scipi en puts "ADD MERCURY SCIPI MODE" set IP [dict get $::config_dict mercury_scipi ip] set PORT [dict get $::config_dict mercury_scipi port] - set NAME [dict get $::config_dict mercury_scipi name] - set TOL [dict get $::config_dict mercury_scipi tol] - add_oxford_mercury $NAME $IP $PORT 2.0 "\r" + set name [dict get $::config_dict mercury_scipi name] + set ctype [dict get $::config_dict mercury_scipi type] + set cid [dict get $::config_dict mercury_scipi id] + set tol [dict get $::config_dict mercury_scipi tol] + set term [dict get $::config_dict mercury_scipi terminator] + add_oxford_mercury $name $IP $PORT $ctype $cid {*}$term $tol } diff --git a/site_ansto/instrument/tas/util/sics_config.ini b/site_ansto/instrument/tas/util/sics_config.ini index a40cc442..c354f979 100644 --- a/site_ansto/instrument/tas/util/sics_config.ini +++ b/site_ansto/instrument/tas/util/sics_config.ini @@ -13,7 +13,20 @@ cascade = 12tmagnet,s1_sample_insert,mercury_scipi enabled = False group = 0setup -[ls340_1] +[ls336] +desc = "tc2: Lakeshore 336 temperature controller" +enabled = False +group = environment:temperature +ip = 10.157.xxx.xxx +name = tc2 +type = T +id = 2 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340] desc = "tc1: Lakeshore 340 temperature controller" enabled = False group = environment:temperature @@ -27,13 +40,13 @@ tol1 = 1.0 tol2 = 1.0 [ls370_2] -desc = "tc2: Lakeshore 370 temperature controller" +desc = "tc3: Lakeshore 370 temperature controller" enabled = False group = environment:temperature ip = 137.157.203.137 -name = tc2 +name = tc3 type = T -id = 2 +id = 3 port = 4003 terminator = \r\n tol = 2.0 @@ -62,6 +75,7 @@ id = 9 offifon = mercury_itc500 port = 7020 tol = 2.0 +terminator = \r [s1_sample_insert] desc = "s1 will be defined as the sample insert rotation. Sample stage will be renamed to s1ss and sgu and sgl will be simulated" @@ -72,7 +86,7 @@ group = motors desc = "tc1: Blue furnace temperature controller" enabled = False group = environment:temperature -ip = 137.157.203.141 +ip = 10.157.205.19 name = tc1 type = T id = 1