From d7acb7c16c93fe40b7c2e69cf996b7313d53813c Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 5 May 2014 12:20:53 +1000 Subject: [PATCH] Load drivers which have been enabled in the SICS config ini files. Lakeshore 336 drivers with known IP addresses have been added to the ini files with unique IDs. All entries in the ini files now have unique IDs The wombat ini now has radio buttons to select sample stage motor configurations. --- .../magneticField/sct_bruker_BEC1.tcl | 28 ++- .../config/environment/sct_keithley_2700.tcl | 30 +++- .../temperature/sct_eurotherm_2000.tcl | 29 ++- .../temperature/sct_julabo_lh45.tcl | 29 ++- .../temperature/sct_lakeshore_336.tcl | 40 ++--- .../temperature/sct_lakeshore_340.tcl | 40 ++--- .../environment/temperature/sct_watlow_pm.tcl | 32 +++- .../environment/temperature/sct_watlow_rm.tcl | 32 +++- .../temperature/sct_watlow_st4.tcl | 32 +++- .../instrument/hipd/util/sics_config.ini | 138 +++++++++----- .../instrument/hrpd/util/sics_config.ini | 170 ++++++++++++++++++ .../instrument/rsd/util/sics_config.ini | 123 +++++++++++++ .../instrument/tas/util/sics_config.ini | 135 ++++++++++---- 13 files changed, 699 insertions(+), 159 deletions(-) create mode 100644 site_ansto/instrument/hrpd/util/sics_config.ini create mode 100644 site_ansto/instrument/rsd/util/sics_config.ini diff --git a/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl b/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl index 80c413d8..a82de6a4 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl @@ -1143,7 +1143,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p # @param tempobj short name for the magnet power supply scriptcontext object (typ. ma1 or ma2) # @param tol magentic field strength tolerance in Tesla (typ. 1) # @return nothing (well, the sct object) -proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol} { +proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol CID CTYPE} { set catch_status [ catch { set ns ::scobj::bruker_BEC1 set ::scobj::bruker_BEC1::bruker_BEC1_sct_obj_name $tempobj @@ -1323,6 +1323,8 @@ proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol} { #::scobj::hinitprops $tempobj/sensor nominal_outp_current hsetprop $scobj_hpath/pwrctrl/statusByte control false hsetprop $scobj_hpath/sensor/desired_current type drivable + hsetprop $scobj_hpath/sensor/desired_current permlink data_set ${CTYPE}${CID}SP1 + hsetprop $scobj_hpath/sensor/measured_field permlink data_set ${CTYPE}${CID}S1 ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/sensor/desired_current $scobj_hpath/sensor/nominal_outp_current $sct_controller @@ -1346,7 +1348,7 @@ namespace export mk_sct_bruker_BEC1 # @param port port number on the moxabox (typ. 4001, 4002, 4003, or 4004) # @param tol magnetic field strength tolerance in Tesla (default 0.1T) # @return nothing (well, the sct object) -proc add_bruker_BEC1 {name IP port {_tol 0.1} } { +proc add_bruker_BEC1 {name IP port {_tol 0.1} {CID 1} {CTYPE B} } { # Don't create a magnet controller for the script validator, this may cause the # the BEC1 to lock up. # NOTE: This is placed outside the catch block because "return" raises an exception @@ -1358,10 +1360,30 @@ proc add_bruker_BEC1 {name IP port {_tol 0.1} } { # Command terminator for Bruker unit is always carriage return without linefeed '\r' makesctcontroller sct_bruker_BEC1_$name astvelsel ${IP}:$port "\r" # proc mk_sct_bruker_BEC1 (sct_controller klasse tempobj tol) - mk_sct_bruker_BEC1 sct_bruker_BEC1_$name environment $name $_tol + mk_sct_bruker_BEC1 sct_bruker_BEC1_$name environment $name $_tol $CID $CTYPE makesctemon $name /sics/$name/emon/mon_mode /sics/$name/emon/is_in_tolerance /sics/$name/emon/errhandler } message ] handle_exception $catch_status $message "In subroutine add_bruker_BEC1()." } +if {[ catch { + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "bruker_bec1") } { + if { [ dict get $::secinfo enabled ] } { + set name [dict get $::secinfo name] + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set tol [dict get $::secinfo tol] + set cid [dict get $::secinfo id] + set ctype [dict get $::secinfo type] + add_bruker_BEC1 $name $IP $PORT $tol $cid $ctype + } + } + } + } +} message ]} { + puts "ERROR: $message" +} + namespace import ::scobj::bruker_BEC1::* diff --git a/site_ansto/instrument/config/environment/sct_keithley_2700.tcl b/site_ansto/instrument/config/environment/sct_keithley_2700.tcl index 69031a82..c96a16c0 100644 --- a/site_ansto/instrument/config/environment/sct_keithley_2700.tcl +++ b/site_ansto/instrument/config/environment/sct_keithley_2700.tcl @@ -569,7 +569,7 @@ debug_log "Registering node $nodeName for write callback" return OK } - proc mk_sct_keithley_2700 {sct_controller klass tempobj tol} { + proc mk_sct_keithley_2700 {sct_controller klass tempobj tol CID CTYPE} { set catch_status [ catch { # set ns ::scobj::k2700 set ns "[namespace current]" @@ -621,6 +621,7 @@ debug_log "Registering node $nodeName for write callback" hset $scobj_hpath/device_lasterror "" hsetprop $scobj_hpath/setpoint tolerance $tol + hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1 if {[SplitReply [environment_simulation]]=="false"} { $sct_controller poll $scobj_hpath/device_state 1 halt read @@ -642,6 +643,7 @@ debug_log "Registering node $nodeName for write callback" hsetprop $scobj_hpath/$snsr/value nxalias mm1_${snsr}_value hsetprop $scobj_hpath/$snsr/value mutable true hsetprop $scobj_hpath/$snsr/value sdsinfo ::nexus::scobj::sdsinfo + hsetprop $scobj_hpath/$snsr/value permlink data_set ${CTYPE}${CID}S1 } hsetprop $scobj_hpath privilege spy ::scobj::hinitprops $tempobj setpoint @@ -662,14 +664,14 @@ debug_log "Registering node $nodeName for write callback" # @param name, the name of the multimeter (eg mm1) # @param IP, the IP address of the device, this can be a hostname, (eg ca1-kowari) # @param port, the IP protocol port number of the device -proc add_k2700 {name IP port terminator {_tol 1.0}} { +proc add_k2700 {name IP port terminator {_tol 1.0} {CID 1} {CTYPE V} } { set fd [open "/tmp/k2700.log" a] if {[SplitReply [environment_simulation]]=="false"} { puts $fd "makesctcontroller sct_k2700 std ${IP}:$port" makesctcontroller sct_k2700 std ${IP}:$port $terminator } puts $fd "mk_sct_keithley_2700 sct_k2700 environment $name $_tol" - mk_sct_keithley_2700 sct_k2700 environment $name $_tol + mk_sct_keithley_2700 sct_k2700 environment $name $_tol $CID $CTYPE close $fd } @@ -678,4 +680,26 @@ set fd [open "/tmp/k2700.log" w] puts $fd "file evaluation of sct_keithley_2700.tcl" close $fd +if {[ catch { + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "k2700") } { + if { [ dict get $::secinfo enabled ] } { + set name [dict get $::secinfo name] + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set term [dict get $::secinfo terminator] + set tol [dict get $::secinfo tol] + set cid [dict get $::secinfo id] + set ctype [dict get $::secinfo type] + + add_k2700 $name $IP $PORT $term $tol $cid $ctype + } + } + } + } +} message ]} { + puts "ERROR: $message" +} + namespace import ::scobj::k2700::* diff --git a/site_ansto/instrument/config/environment/temperature/sct_eurotherm_2000.tcl b/site_ansto/instrument/config/environment/temperature/sct_eurotherm_2000.tcl index 285855d4..ff6a5a49 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_eurotherm_2000.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_eurotherm_2000.tcl @@ -163,7 +163,7 @@ debug_log "halt $tc_root" return idle } - proc mk_sct_eurotherm_et2000 {sct_controller klass tempobj dev_id tol} { + proc mk_sct_eurotherm_et2000 {sct_controller klass tempobj dev_id tol CID CTYPE} { if {[ catch { set ns ::scobj::et2000 @@ -185,6 +185,7 @@ debug_log "halt $tc_root" hsetprop $scobj_hpath/setpoint checklimits ${ns}::check $scobj_hpath hsetprop $scobj_hpath/setpoint checkstatus ${ns}::drivestatus $scobj_hpath hsetprop $scobj_hpath/setpoint halt ${ns}::halt $scobj_hpath + hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1 hfactory $scobj_hpath/overtemp_warnlimit plain user float hsetprop $scobj_hpath/overtemp_warnlimit read ${ns}::getValue $scobj_hpath rdValue "14" @@ -206,6 +207,7 @@ debug_log "halt $tc_root" hsetprop $scobj_hpath/sensor/value rdValue ${ns}::rdValue hsetprop $scobj_hpath/sensor/value oldval UNKNOWN hsetprop $scobj_hpath/sensor/value units "C" + hsetprop $scobj_hpath/sensor/value permlink data_set ${CTYPE}${CID}S1 hfactory $scobj_hpath/setpoint_slew_rate plain user float hsetprop $scobj_hpath/setpoint_slew_rate read ${ns}::getValue $scobj_hpath rdValue "35" @@ -346,14 +348,14 @@ debug_log "halt $tc_root" # @param IP, the IP address of the device, this can be a hostname, (eg ca5-kowari) # @param port, the IP protocol port number of the device (502 for modbus) # @param _tol (optional), this is the initial tolerance setting -proc add_et2000 {name IP port dev_id {_tol 5.0}} { +proc add_et2000 {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { set fd [open "/tmp/et2000.log" a] if {[SplitReply [environment_simulation]]=="false"} { puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" makesctcontroller sct_${name} modbus ${IP}:$port } puts $fd "mk_sct_eurotherm_et2000 sct_${name} environment $name $dev_id $_tol" - mk_sct_eurotherm_et2000 sct_${name} environment $name $dev_id $_tol + mk_sct_eurotherm_et2000 sct_${name} environment $name $dev_id $_tol $CID $CTYPE puts $fd "makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler" makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler close $fd @@ -364,6 +366,27 @@ set fd [open "/tmp/et2000.log" w] puts $fd "file evaluation of sct_eurotherm_2000.tcl" close $fd +if {[ catch { + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "et2000") } { + if { [ dict get $::secinfo enabled ] } { + set name [dict get $::secinfo name] + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set devid [dict get $::secinfo devid] + set tol [dict get $::secinfo tol] + set cid [dict get $::secinfo id] + set ctype [dict get $::secinfo type] + add_et2000 $name $IP $PORT $devid $tol $cid $ctype + } + } + } + } +} message ]} { + puts "ERROR: $message" +} + namespace import ::scobj::et2000::* #add_et2000 et2000 137.157.201.213 502 1 5 diff --git a/site_ansto/instrument/config/environment/temperature/sct_julabo_lh45.tcl b/site_ansto/instrument/config/environment/temperature/sct_julabo_lh45.tcl index 2b88a707..bdd74746 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_julabo_lh45.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_julabo_lh45.tcl @@ -238,7 +238,7 @@ namespace eval ::scobj::lh45 { return idle } - proc mk_sct_julabo_lh45 {sct_controller klass tempobj tol} { + proc mk_sct_julabo_lh45 {sct_controller klass tempobj tol CID CTYPE} { if {[ catch { set ns ::scobj::lh45 @@ -258,6 +258,7 @@ namespace eval ::scobj::lh45 { hsetprop $scobj_hpath/setpoint writestatus UNKNOWN hsetprop $scobj_hpath/setpoint type drivable hsetprop $scobj_hpath/setpoint setpoint_pending 0 + hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1 # Drive adapter interface hsetprop $scobj_hpath/setpoint checklimits ${ns}::check $scobj_hpath hsetprop $scobj_hpath/setpoint checkstatus ${ns}::drivestatus $scobj_hpath @@ -285,6 +286,7 @@ namespace eval ::scobj::lh45 { hsetprop $scobj_hpath/sensor/value rdValue ${ns}::rdValue "double" hsetprop $scobj_hpath/sensor/value oldval UNKNOWN hsetprop $scobj_hpath/sensor/value units "C" + hsetprop $scobj_hpath/sensor/value permlink data_set ${CTYPE}${CID}S1 hfactory $scobj_hpath/sensor/bathtemp plain internal float hsetprop $scobj_hpath/sensor/bathtemp read ${ns}::getValue rdValue "in_pv_00" @@ -412,11 +414,11 @@ namespace eval ::scobj::lh45 { # @param port, the IP protocol port number of the device # @param sensor (optional), select the 'bath' sensor or an external sensor 'ext' # @param _tol (optional), this is the initial tolerance setting -proc add_lh45 {name IP port {sensor "bath"} {_tol 5.0}} { +proc add_lh45 { name IP port {sensor "bath"} {_tol 5.0} {CID 1} {CTYPE T} } { if {[SplitReply [environment_simulation]]=="false"} { makesctcontroller sct_lh45 std ${IP}:$port "\r" } - mk_sct_julabo_lh45 sct_lh45 environment $name $_tol + mk_sct_julabo_lh45 sct_lh45 environment $name $_tol $CID $CTYPE set scobj_hpath /sics/$name switch $sensor { "bath" { @@ -432,4 +434,25 @@ proc add_lh45 {name IP port {sensor "bath"} {_tol 5.0}} { makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler } +if {[ catch { + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "lh45") } { + if { [ dict get $::secinfo enabled ] } { + set name [dict get $::secinfo name] + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set sensor [dict get $::secinfo sensor] + set tol [dict get $::secinfo tol] + set cid [dict get $::secinfo id] + set ctype [dict get $::secinfo type] + add_lh45 $name $IP $PORT $sensor $tol $cid $ctype + } + } + } + } +} message ]} { + puts "ERROR: $message" +} + namespace import ::scobj::lh45::* 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 968d16cf..92a99042 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl @@ -1912,31 +1912,23 @@ proc add_sct_ls336 {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 ls336_1 enabled ] } { - set IP [dict get $::config_dict ls336_1 ip] - set PORT [dict get $::config_dict ls336_1 port] - set name [dict get $::config_dict ls336_1 name] - set ctype [dict get $::config_dict ls336_1 type] - set cid [dict get $::config_dict ls336_1 id] - set term [dict get $::config_dict ls336_1 terminator] - set tol1 [dict get $::config_dict ls336_1 tol1] - set tol2 [dict get $::config_dict ls336_1 tol2] + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "ls336") } { + if { [ dict get $::secinfo enabled ] } { + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set name [dict get $::secinfo name] + set ctype [dict get $::secinfo type] + set cid [dict get $::secinfo id] + set term [dict get $::secinfo terminator] + set tol1 [dict get $::secinfo tol1] + set tol2 [dict get $::secinfo tol2] - add_sct_ls336 $name $IP $PORT $term $tol1 $tol2 $cid $ctype - } - if { [ dict get $::config_dict ls336_2 enabled ] } { - set IP [dict get $::config_dict ls336_2 ip] - set PORT [dict get $::config_dict ls336_2 port] - set name [dict get $::config_dict ls336_2 name] - set ctype [dict get $::config_dict ls336_2 type] - set cid [dict get $::config_dict ls336_2 id] - set term [dict get $::config_dict ls336_2 terminator] - set tol1 [dict get $::config_dict ls336_2 tol1] - set tol2 [dict get $::config_dict ls336_2 tol2] - - add_sct_ls336 $name $IP $PORT $term $tol1 $tol2 $cid $ctype - } + add_sct_ls336 $name $IP $PORT $term $tol1 $tol2 $cid $ctype + } + } + } } } message ]} { puts "ERROR: $message" 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 38fc2e21..7bbc0fe4 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl @@ -2116,31 +2116,23 @@ 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 { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "ls340") } { + if { [ dict get $::secinfo enabled ] } { + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set name [dict get $::secinfo name] + set ctype [dict get $::secinfo type] + set cid [dict get $::secinfo id] + set term [dict get $::secinfo terminator] + set tol1 [dict get $::secinfo tol1] + set tol2 [dict get $::secinfo tol2] - add_sct_ls340 $name $IP $PORT $term $tol1 $tol2 $cid $ctype - } - if { [ dict get $::config_dict ls340_2 enabled ] } { - set IP [dict get $::config_dict ls340_2 ip] - set PORT [dict get $::config_dict ls340_2 port] - set name [dict get $::config_dict ls340_2 name] - set ctype [dict get $::config_dict ls340_2 type] - set cid [dict get $::config_dict ls340_2 id] - set term [dict get $::config_dict ls340_2 terminator] - set tol1 [dict get $::config_dict ls340_2 tol1] - set tol2 [dict get $::config_dict ls340_2 tol2] - - add_sct_ls340 $name $IP $PORT $term $tol1 $tol2 $cid $ctype - } + add_sct_ls340 $name $IP $PORT $term $tol1 $tol2 $cid $ctype + } + } + } } } message ]} { puts "ERROR: $message" diff --git a/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl b/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl index bf0d2677..78f8c878 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl @@ -399,7 +399,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ return OK } - proc mk_sct_watlow_pm {sct_controller klass tempobj dev_id tol} { + proc mk_sct_watlow_pm {sct_controller klass tempobj dev_id tol CID CTYPE} { set catch_status [ catch { set ns "[namespace current]" @@ -428,6 +428,8 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ hsetprop $scobj_hpath/sensor/value lowerlimit 0 hsetprop $scobj_hpath/sensor/value upperlimit 500 hsetprop $scobj_hpath/sensor/value units "C" + hsetprop $scobj_hpath/sensor/value permlink data_set ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1 hfactory $scobj_hpath/apply_tolerance plain user int hsetprop $scobj_hpath/apply_tolerance values 0,1 @@ -520,14 +522,14 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ # @param IP, the IP address of the device, this can be a hostname, (eg ca5-kowari) # @param port, the IP protocol port number of the device (502 for modbus) # @param _tol (optional), this is the initial tolerance setting -proc add_watlow_pm {name IP port dev_id {_tol 5.0}} { +proc add_watlow_pm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { set fd [open "/tmp/watlow_pm.log" a] if {[SplitReply [environment_simulation]]=="false"} { puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" makesctcontroller sct_${name} modbus ${IP}:$port } puts $fd "mk_sct_watlow_pm sct_${name} environment $name $dev_id $_tol" - mk_sct_watlow_pm sct_${name} environment $name $dev_id $_tol + mk_sct_watlow_pm sct_${name} environment $name $dev_id $_tol $CID $CTYPE puts $fd "makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler" makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler close $fd @@ -538,7 +540,25 @@ set fd [open "/tmp/watlow_pm.log" w] puts $fd "file evaluation of sct_watlow_pm.tcl" close $fd -namespace import ::scobj::watlow_pm::* +if {[ catch { + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "watlow_pm") } { + if { [ dict get $::secinfo enabled ] } { + set name [dict get $::secinfo name] + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set sensor [dict get $::secinfo sensor] + set tol [dict get $::secinfo tol] + set cid [dict get $::secinfo id] + set ctype [dict get $::secinfo type] + add_watlow_pm $name $IP $PORT $devid $tol $cid $ctype + } + } + } + } +} message ]} { + puts "ERROR: $message" +} -#add_watlow_pm watlow_pm 137.157.201.213 502 1 5 -#add_watlow_pm watlow_pm localhost 30502 1 5 +namespace import ::scobj::watlow_pm::* diff --git a/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl b/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl index 92067ff1..c555871b 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl @@ -407,7 +407,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ return OK } - proc mk_sct_watlow_rm {sct_controller klass tempobj dev_id tol} { + proc mk_sct_watlow_rm {sct_controller klass tempobj dev_id tol CID CTYPE} { set catch_status [ catch { set ns "[namespace current]" @@ -457,6 +457,8 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ hsetprop $scobj_hpath/sensor/value lowerlimit 0 hsetprop $scobj_hpath/sensor/value upperlimit 500 hsetprop $scobj_hpath/sensor/value units "C" + hsetprop $scobj_hpath/sensor/value permlink data_set ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1 hfactory $scobj_hpath/apply_tolerance plain user int hsetprop $scobj_hpath/apply_tolerance values 0,1 @@ -550,14 +552,14 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ # @param IP, the IP address of the device, this can be a hostname, (eg ca5-kowari) # @param port, the IP protocol port number of the device (502 for modbus) # @param _tol (optional), this is the initial tolerance setting -proc add_watlow_rm {name IP port dev_id {_tol 5.0}} { +proc add_watlow_rm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { set fd [open "/tmp/watlow_rm.log" a] if {[SplitReply [environment_simulation]]=="false"} { puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" makesctcontroller sct_${name} modbus ${IP}:$port } puts $fd "mk_sct_watlow_rm sct_${name} environment $name $dev_id $_tol" - mk_sct_watlow_rm sct_${name} environment $name $dev_id $_tol + mk_sct_watlow_rm sct_${name} environment $name $dev_id $_tol $CID $CTYPE puts $fd "makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler" makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler close $fd @@ -568,7 +570,25 @@ set fd [open "/tmp/watlow_rm.log" w] puts $fd "file evaluation of sct_watlow_rm.tcl" close $fd -namespace import ::scobj::watlow_rm::* +if {[ catch { + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "watlow_rm") } { + if { [ dict get $::secinfo enabled ] } { + set name [dict get $::secinfo name] + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set sensor [dict get $::secinfo sensor] + set tol [dict get $::secinfo tol] + set cid [dict get $::secinfo id] + set ctype [dict get $::secinfo type] + add_watlow_rm $name $IP $PORT $devid $tol $cid $ctype + } + } + } + } +} message ]} { + puts "ERROR: $message" +} -#add_watlow_rm watlow_rm 137.157.201.213 502 1 5 -#add_watlow_rm watlow_rm localhost 30502 1 5 +namespace import ::scobj::watlow_rm::* diff --git a/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl b/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl index 304baf78..4db147cf 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl @@ -593,7 +593,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ return OK } - proc mk_sct_watlow_st {sct_controller klass tempobj dev_id tol} { + proc mk_sct_watlow_st {sct_controller klass tempobj dev_id tol CID CTYPE} { set catch_status [ catch { set ns "[namespace current]" @@ -653,6 +653,8 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ hsetprop $scobj_hpath/sensor/value lowerlimit 0 hsetprop $scobj_hpath/sensor/value upperlimit 500 hsetprop $scobj_hpath/sensor/value units "C" + hsetprop $scobj_hpath/sensor/value permlink data_set ${CTYPE}${CID}S1 + hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1 hfactory $scobj_hpath/apply_tolerance plain user int hsetprop $scobj_hpath/apply_tolerance values 0,1 @@ -761,14 +763,14 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ # @param IP, the IP address of the device, this can be a hostname, (eg ca5-kowari) # @param port, the IP protocol port number of the device (502 for modbus) # @param _tol (optional), this is the initial tolerance setting -proc add_watlow_st {name IP port dev_id {_tol 5.0}} { +proc add_watlow_st {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { set fd [open "/tmp/watlow_st.log" a] if {[SplitReply [environment_simulation]]=="false"} { puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" makesctcontroller sct_${name} modbus ${IP}:$port } puts $fd "mk_sct_watlow_st sct_${name} environment $name $dev_id $_tol" - mk_sct_watlow_st sct_${name} environment $name $dev_id $_tol + mk_sct_watlow_st sct_${name} environment $name $dev_id $_tol $CID $CTYPE puts $fd "makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler" makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler close $fd @@ -779,7 +781,25 @@ set fd [open "/tmp/watlow_st.log" w] puts $fd "file evaluation of sct_watlow_st4.tcl" close $fd -namespace import ::scobj::watlow_st::* +if {[ catch { + if { [ info exists ::config_dict ] } { + dict for {secname secinfo} $::config_dict { + if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "watlow_st") } { + if { [ dict get $::secinfo enabled ] } { + set name [dict get $::secinfo name] + set IP [dict get $::secinfo ip] + set PORT [dict get $::secinfo port] + set sensor [dict get $::secinfo sensor] + set tol [dict get $::secinfo tol] + set cid [dict get $::secinfo id] + set ctype [dict get $::secinfo type] + add_watlow_st $name $IP $PORT $devid $tol $cid $ctype + } + } + } + } +} message ]} { + puts "ERROR: $message" +} -#add_watlow_st watlow_st 137.157.201.213 502 1 5 -#add_watlow_st watlow_st localhost 30502 1 5 +namespace import ::scobj::watlow_st::* diff --git a/site_ansto/instrument/hipd/util/sics_config.ini b/site_ansto/instrument/hipd/util/sics_config.ini index 90264a80..72871094 100644 --- a/site_ansto/instrument/hipd/util/sics_config.ini +++ b/site_ansto/instrument/hipd/util/sics_config.ini @@ -1,24 +1,15 @@ [12tmagnet_setup] -cascade = 12tmagnet,12tmagnet_sample_insert,mercury_scipi +cascade = 12tmagnet,12tmagnet_sample_insert,mercury_scpi enabled = False group = 0setup onifoff = normal_sample_stage -[12tmagnet] -desc = "12 Tesla Oxford Magnet" -enabled = False -group = environment:magnet -ip = 10.157.205.3 -name = magnetic -type = B -id = 1 -port = 55001 - [ls336_1] desc = "tc1: Lakeshore 336 temperature controller" +driver = "ls336" enabled = False group = environment:temperature -ip = 137.157.201.85 +ip = 10.157.205.28 name = tc1 type = T id = 1 @@ -29,9 +20,10 @@ tol2 = 1.0 [ls336_2] desc = "tc2: Lakeshore 336 temperature controller" +driver = "ls336" enabled = False group = environment:temperature -ip = 137.157.201.87 +ip = 10.157.205.29 name = tc2 type = T id = 2 @@ -40,58 +32,123 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls340_1] -desc = "tc3: Lakeshore 340 temperature controller" +[ls336_4] +desc = "tc3: Lakeshore 336 temperature controller" +driver = "ls336" enabled = False group = environment:temperature -ip = 137.157.201.86 +ip = 10.157.205.30 name = tc3 type = T id = 3 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_5] +desc = "tc4: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc4 +type = T +id = 4 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_6] +desc = "tc5: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc5 +type = T +id = 5 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_12] +desc = "tc6: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.31 +name = tc6 +type = T +id = 6 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_1] +desc = "tc7: Lakeshore 340 temperature controller" +enabled = False +group = environment:temperature +ip = 137.157.201.86 +name = tc7 +type = T +id = 7 port = 4001 terminator = \r\n tol1 = 1.0 tol2 = 1.0 [ls340_2] -desc = "tc4: Lakeshore 340 temperature controller" +desc = "tc8: Lakeshore 340 temperature controller" enabled = False group = environment:temperature ip = 137.157.201.86 -name = tc4 +name = tc8 type = T -id = 4 +id = 8 port = 4002 terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[mercury_itc500] -addr = @1 -desc = "tc1: Oxford Mercury temperature controller in legacy mode" +[mercury_scpi] +desc = "tc9: Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" enabled = False group = environment:temperature ip = 10.157.205.5 -name = tc1 +name = tc9 type = T -id = 1 -offifon = mercury_scipi -port = 7020 -tol = 2.0 - -[mercury_scipi] -desc = "tc1: Oxford Mercury temperature controller in Mercury mode" -enabled = False -group = environment:temperature -ip = 10.157.205.5 -name = tc1 -type = T -id = 1 +id = 9 offifon = mercury_itc500 port = 7020 tol = 2.0 terminator = \r +[west4100] +desc = "tc10: Blue furnace temperature controller" +driver = "west4100" +enabled = False +group = environment:temperature +ip = 10.157.205.19 +name = tc10 +type = T +id = 10 + +[12tmagnet] +desc = "12 Tesla Oxford Magnet" +driver = "12tmagnet" +enabled = False +group = environment:magnet +ip = 10.157.205.3 +name = magnetic +type = B +id = 11 +port = 55001 + [normal_sample_stage] desc = "This is the default sample stage configuration with xy translation and phi and chi tilt stages" enabled = True @@ -119,12 +176,3 @@ enabled = False group = motors offifon = normal_sample_stage,eularian_cradle,small_omega radio=samstage - -[west4100] -desc = "tc1: Blue furnace temperature controller" -enabled = False -group = environment:temperature -ip = 10.157.205.19 -name = tc1 -type = T -id = 1 diff --git a/site_ansto/instrument/hrpd/util/sics_config.ini b/site_ansto/instrument/hrpd/util/sics_config.ini new file mode 100644 index 00000000..fd88ffc0 --- /dev/null +++ b/site_ansto/instrument/hrpd/util/sics_config.ini @@ -0,0 +1,170 @@ +[12tmagnet_setup] +cascade = 12tmagnet,12tmagnet_sample_insert,mercury_scpi +enabled = False +group = 0setup + +[ls336_1] +desc = "tc1: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.28 +name = tc1 +type = T +id = 1 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_2] +desc = "tc2: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.29 +name = tc2 +type = T +id = 2 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_4] +desc = "tc4: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.30 +name = tc4 +type = T +id = 4 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_5] +desc = "tc5: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc5 +type = T +id = 5 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_6] +desc = "tc6: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc6 +type = T +id = 6 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_11] +desc = "tc11: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.27 +name = tc11 +type = T +id = 11 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_12] +desc = "tc12: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.31 +name = tc12 +type = T +id = 12 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_1] +desc = "tc13: Lakeshore 340 temperature controller" +driver = "ls340" +enabled = False +group = environment:temperature +ip = ca5-echidna +name = tc13 +type = T +id = 13 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_2] +desc = "tc14: Lakeshore 340 temperature controller" +driver = "ls340" +enabled = False +group = environment:temperature +ip = ca5-echidna +name = tc14 +type = T +id = 14 +port = 4002 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[mercury_scpi] +desc = "tc25: Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" +enabled = False +group = environment:temperature +ip = 10.157.205.5 +name = tc25 +type = T +id = 25 +offifon = mercury_itc500 +port = 7020 +tol = 2.0 +terminator = \r + +[west4100] +desc = "tc26: Blue furnace temperature controller" +driver = "west4100" +enabled = False +group = environment:temperature +ip = 10.157.205.19 +name = tc26 +type = T +id = 26 + +[12tmagnet] +desc = "12 Tesla Oxford Magnet" +driver = "12tmagnet" +enabled = False +group = environment:magnet +ip = 10.157.205.3 +name = magnetic +type = B +id = 27 +port = 55001 + +[12tmagnet_sample_insert] +desc = "REVIEW THIS -> som will be redefined as the sample insert rotation. Sample stage will be renamed to somss" +enabled = False +group = motors diff --git a/site_ansto/instrument/rsd/util/sics_config.ini b/site_ansto/instrument/rsd/util/sics_config.ini new file mode 100644 index 00000000..553bb486 --- /dev/null +++ b/site_ansto/instrument/rsd/util/sics_config.ini @@ -0,0 +1,123 @@ +[ls336_1] +desc = "tc1: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.28 +name = tc1 +type = T +id = 1 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_2] +desc = "tc2: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.29 +name = tc2 +type = T +id = 2 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_4] +desc = "tc4: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.30 +name = tc4 +type = T +id = 4 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_5] +desc = "tc5: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc5 +type = T +id = 5 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_6] +desc = "tc6: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc6 +type = T +id = 6 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_11] +desc = "tc11: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.27 +name = tc11 +type = T +id = 11 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_12] +desc = "tc12: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.31 +name = tc12 +type = T +id = 12 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[mercury_scpi] +desc = "tc25: Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" +enabled = False +group = environment:temperature +ip = 10.157.205.5 +name = tc25 +type = T +id = 25 +offifon = mercury_itc500 +port = 7020 +tol = 2.0 +terminator = \r + +[eurotherm_2000] +desc = "tc26: Eurotherm 2000 temperature controller" +driver = "et2000" +enabled = false +group = environment:temperature +name = et2000 +ip = 137.157.201.213 +port = 502 +id = 26 +tol = 5.0 +type = T diff --git a/site_ansto/instrument/tas/util/sics_config.ini b/site_ansto/instrument/tas/util/sics_config.ini index 13022ad0..352cd7a7 100644 --- a/site_ansto/instrument/tas/util/sics_config.ini +++ b/site_ansto/instrument/tas/util/sics_config.ini @@ -1,23 +1,28 @@ -[12tmagnet] -desc = "12 Tesla Oxford Magnet" -enabled = False -group = environment:magnet -ip = 10.157.205.3 -name = magnetic -type = B -id = 1 -port = 55001 - [12tmagnet_setup] -cascade = 12tmagnet,s1_sample_insert,mercury_scipi +cascade = 12tmagnet,s1_sample_insert,mercury_scpi enabled = False group = 0setup [ls336_1] -desc = "tc2: Lakeshore 336 temperature controller" +desc = "tc1: Lakeshore 336 temperature controller" +driver = "ls336" enabled = False group = environment:temperature -ip = 10.157.xxx.xxx +ip = 10.157.205.28 +name = tc1 +type = T +id = 1 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_2] +desc = "tc2: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.29 name = tc2 type = T id = 2 @@ -26,46 +31,92 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 +[ls336_4] +desc = "tc3: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.30 +name = tc3 +type = T +id = 3 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_5] +desc = "tc4: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc4 +type = T +id = 4 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_6] +desc = "tc5: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 137.157.201.21 +name = tc5 +type = T +id = 5 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_12] +desc = "tc6: Lakeshore 336 temperature controller" +driver = "ls336" +enabled = False +group = environment:temperature +ip = 10.157.205.31 +name = tc6 +type = T +id = 6 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + [ls340_1] -desc = "tc1: Lakeshore 340 temperature controller" +desc = "tc13: Lakeshore 340 temperature controller" +driver = "ls340" enabled = False group = environment:temperature ip = 137.157.203.137 -name = tc1 +name = tc13 type = T -id = 1 +id = 13 port = 4001 terminator = \r\n tol1 = 1.0 tol2 = 1.0 [ls370] -desc = "tc3: Lakeshore 370 temperature controller" +desc = "tc8: Lakeshore 370 temperature controller" +driver = "ls370" enabled = False group = environment:temperature ip = 137.157.203.137 -name = tc3 +name = tc8 type = T -id = 3 +id = 8 port = 4003 terminator = \r\n tol = 2.0 -[mercury_itc500] -addr = @1 -desc = "tc9: Oxford Mercury temperature controller in legacy mode" -enabled = False -group = environment:temperature -ip = 10.157.205.5 -name = tc9 -type = T -id = 9 -offifon = mercury_scipi -port = 7020 -tol = 2.0 - -[mercury_scipi] +[mercury_scpi] desc = "tc9: Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" enabled = False group = environment:temperature ip = 10.157.205.5 @@ -83,10 +134,22 @@ enabled = False group = motors [west4100] -desc = "tc1: Blue furnace temperature controller" +desc = "tc10: Blue furnace temperature controller" +driver = "west4100" enabled = False group = environment:temperature ip = 10.157.205.19 -name = tc1 +name = tc10 type = T -id = 1 +id = 10 + +[12tmagnet] +desc = "12 Tesla Oxford Magnet" +driver = "12tmagnet" +enabled = False +group = environment:magnet +ip = 10.157.205.3 +name = magnetic +type = B +id = 11 +port = 55001