updated Taipan
r3041 | jgn | 2010-12-14 10:23:49 +1100 (Tue, 14 Dec 2010) | 1 line
This commit is contained in:
committed by
Douglas Clowes
parent
26df0a884a
commit
159cd57982
55
site_ansto/instrument/tas/config/environment/environment.tcl
Normal file
55
site_ansto/instrument/tas/config/environment/environment.tcl
Normal file
@@ -0,0 +1,55 @@
|
||||
proc select_environment_controller {envtemp} {
|
||||
if [ catch {
|
||||
puts "selecting $envtemp for environment control"
|
||||
switch $envtemp {
|
||||
"lh45" {
|
||||
add_lh45 tc1 ca5-taipan 4003 1
|
||||
proc ::histogram_memory::pre_count {} {
|
||||
hset /sample/tc1/sensor/start_temperature [hval /sample/tc1/sensor/value]
|
||||
hset /sample/tc1/sensor/end_temperature [hval /sample/tc1/sensor/value]
|
||||
}
|
||||
proc ::histogram_memory::post_count {} {
|
||||
hset /sample/tc1/sensor/end_temperature [hval /sample/tc1/sensor/value]
|
||||
}
|
||||
}
|
||||
"rhqc" {
|
||||
puts "Configuring RHQC"
|
||||
# 9600 8 1 None None Enable
|
||||
add_sct_ls340 tc1 ca5-[instname] 4001 "\r" 0.5 5.0
|
||||
# TODO Set controlsensor
|
||||
# if { [SplitReply [environment_simulation]] == "false"} {
|
||||
# tc1 controlsensor sensorB
|
||||
# }
|
||||
# puts "Added tc1 with [tc1 controlsensor]"
|
||||
# 9600 8 1 None None Enable
|
||||
add_sct_ls340 tc2 ca5-[instname] 4002 "\r" 0.5 5.0
|
||||
# TODO Set controlsensor
|
||||
# if { [SplitReply [environment_simulation]] == "false"} {
|
||||
# tc2 controlsensor sensorD
|
||||
# }
|
||||
# puts "Added tc2 with [tc2 controlsensor]"
|
||||
}
|
||||
"11TMagnet" {
|
||||
puts "Configuring 11TMagnet"
|
||||
add_sct_ls340 tc2 ca5-[instname] 4001 "\r" 0.5 5.0
|
||||
if { [SplitReply [environment_simulation]] == "false"} {
|
||||
::utility::macro::getset float temperature {} {
|
||||
return [sicsmsgfmt [hval /sample/tc2/sensor/sensorValueA]]
|
||||
}
|
||||
sicslist setatt temperature long_name temperature
|
||||
sicslist setatt temperature klass sample
|
||||
sicslist setatt temperature units K
|
||||
# TODO Set controlsensor
|
||||
# tc1 controlsensor sensorA
|
||||
# }
|
||||
add_ips120 ips120 ca5-taipan 4004 0.001
|
||||
|
||||
}
|
||||
default {
|
||||
clientput "Unknown environment controller $envtemp"
|
||||
}
|
||||
}
|
||||
} msg ] {
|
||||
puts "Failed to configure $envtemp: $msg"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
source $cfPath(environment)/temperature/lakeshore340_common.tcl
|
||||
|
||||
# @brief Adds a lakeshore 340 temperature controller object.
|
||||
#
|
||||
# This must be called when the instrument configuration is loaded and before\n
|
||||
# the buildHDB function is called. Currently there is no way to add and remove\n
|
||||
# environment controllers and their hdb paths at runtime.
|
||||
#
|
||||
# @param tcn temperature controller name, the hdb name will be tcn_cntrl
|
||||
# @param mport, the moxa RS232 port number, ie 1,2,3,4
|
||||
#
|
||||
# Optional parameters, see lakeshore340_common.tcl for defaults in tc_dfltPar
|
||||
# @param tolerance, temperature controller tolerance
|
||||
# @param settle, settling time in seconds
|
||||
# @param range, lakeshore range
|
||||
# @param upperlimit, upper temperature limit Kelvin
|
||||
# @param lowerlimit, lower temperature limit Kelvin
|
||||
proc ::environment::temperature::add_ls340 {tcn tc_dfltURL mport args} {
|
||||
variable tc_dfltPar
|
||||
variable moxaPortMap
|
||||
if [catch {
|
||||
if {$tcn == "" || $mport == ""} {
|
||||
error "ERROR: You must provide a temperature controller name and moxa port number"
|
||||
}
|
||||
|
||||
array set tc_param [array get tc_dfltPar]
|
||||
|
||||
if {$args != ""} {
|
||||
array set tc_param $args
|
||||
foreach {nm v} $args {
|
||||
set tc_param($nm) $v
|
||||
}
|
||||
}
|
||||
set sim_mode [SplitReply [environment_simulation]]
|
||||
if {$sim_mode == "true"} {
|
||||
::environment::temperature::mkls340sim $tcn
|
||||
} else {
|
||||
::environment::temperature::mkls340 $tcn $tc_dfltURL $moxaPortMap($mport)
|
||||
foreach nm [array names tc_param] {
|
||||
$tcn $nm $tc_param($nm)
|
||||
}
|
||||
}
|
||||
|
||||
sicslist setatt $tcn environment_name ${tcn}_cntrl
|
||||
sicslist setatt $tcn long_name control_sensor_reading
|
||||
::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} }
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user