Pullback from Taipan 2015-02-19

This commit is contained in:
Douglas Clowes
2015-02-19 10:34:12 +11:00
parent 042119898d
commit fbdd46e258
8 changed files with 2684 additions and 1205 deletions

View File

@ -7,7 +7,6 @@ namespace eval counter {
proc ::counter::transferscript {} { proc ::counter::transferscript {} {
variable isc_numchannels variable isc_numchannels
bm status
set val [SplitReply [bm1 gettime]] set val [SplitReply [bm1 gettime]]
for {set i 1} {$i <= $isc_numchannels} {incr i} { for {set i 1} {$i <= $isc_numchannels} {incr i} {
append val " [SplitReply [bm$i getcounts] ]" append val " [SplitReply [bm$i getcounts] ]"
@ -36,8 +35,8 @@ proc ::counter::ic_initialize {} {
# This must be sourced before the hmm_configuration.tcl until we separate the scan setup from the hmm setup # This must be sourced before the hmm_configuration.tcl until we separate the scan setup from the hmm setup
for {set i 0; set n 1} {$i < $isc_numchannels} {incr i; incr n} { for {set i 0; set n 1} {$i < $isc_numchannels} {incr i; incr n} {
MakeCounter bm$n anstomonitor [ params host $isc_monitor_address port [lindex $isc_portlist $i] ] MakeCounter bm$n anstomonitor [ params host $isc_monitor_address port [lindex $isc_portlist $i] ]
bm$n send scan=1 bm$n send set scan=1
bm$n send sample=10 bm$n send set sample=10
append bm_list "bm$n " append bm_list "bm$n "
} }
} }

View File

@ -50,7 +50,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
proc debug_log {debug_level arg_string} { proc debug_log {debug_level arg_string} {
# write a timestamped string message to a log file for debugging # write a timestamped string message to a log file for debugging
set debug_threshold 0 set debug_threshold 5
if {$debug_level >= $debug_threshold} { if {$debug_level >= $debug_threshold} {
set fd [open "[set [namespace current]::log_file]" "a"] set fd [open "[set [namespace current]::log_file]" "a"]
set line "[clock format [clock seconds] -format "%T"] $arg_string" set line "[clock format [clock seconds] -format "%T"] $arg_string"

View File

@ -27,6 +27,33 @@ proc ::scobj::west_6100::sics_log {debug_level debug_string} {
} catch_message ] } catch_message ]
} }
# checklimits function for driveable interface
proc ::scobj::west_6100::checklimits {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "checklimits tc_root=${tc_root} sct=[sct] target=[sct target]"
set setpoint [sct target]
if { [hpropexists [sct] lowerlimit] } {
set lolimit [sct lowerlimit]
} else {
# lowerlimit not set, use target
set lolimit [sct target]
}
if { [hpropexists [sct] upperlimit] } {
set hilimit [sct upperlimit]
} else {
# upperlimit not set, use target
set hilimit [sct target]
}
# checklimits hook code goes here
if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {
sct driving 0
error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"
}
return OK
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# check function for hset change # check function for hset change
proc ::scobj::west_6100::checkrange {tc_root} { proc ::scobj::west_6100::checkrange {tc_root} {
set catch_status [ catch { set catch_status [ catch {
@ -53,6 +80,40 @@ proc ::scobj::west_6100::checkrange {tc_root} {
handle_exception ${catch_status} ${catch_message} handle_exception ${catch_status} ${catch_message}
} }
# checkstatus function for driveable interface
proc ::scobj::west_6100::checkstatus {tc_root} {
set catch_status [ catch {
# checkstatus hook code goes here
if {[sct driving]} {
set sp "[sct target]"
set pv "[hval ${tc_root}/[sct driveable]]"
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
if { [hpropexists [sct] settle_time] } {
if { [hpropexists [sct] settle_time_start] } {
if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} {
sct driving 0
return "idle"
}
return "busy"
} else {
sct utime settle_time_start
return "busy"
}
}
sct driving 0
return "idle"
}
if { [hpropexists [sct] settle_time_start] } {
hdelprop [sct] settle_time_start
}
return "busy"
} else {
return "idle"
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to request the read of a parameter on a device # function to request the read of a parameter on a device
proc ::scobj::west_6100::getDecimal {tc_root nextState cmd_str} { proc ::scobj::west_6100::getDecimal {tc_root nextState cmd_str} {
set catch_status [ catch { set catch_status [ catch {
@ -101,6 +162,18 @@ proc ::scobj::west_6100::getInteger {tc_root nextState cmd_str} {
handle_exception ${catch_status} ${catch_message} handle_exception ${catch_status} ${catch_message}
} }
# halt function for driveable interface
proc ::scobj::west_6100::halt {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "halt tc_root=${tc_root} sct=[sct] driving=[sct driving]"
### TODO hset [sct] [hval [sct]]
# halt hook code goes here
sct driving 0
return "idle"
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to check the write parameter on a device # function to check the write parameter on a device
proc ::scobj::west_6100::noResponse {tc_root} { proc ::scobj::west_6100::noResponse {tc_root} {
set catch_status [ catch { set catch_status [ catch {
@ -262,8 +335,8 @@ proc ::scobj::west_6100::wrInteger {tc_root nextState cmd_str} {
handle_exception ${catch_status} ${catch_message} handle_exception ${catch_status} ${catch_message}
} }
proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port dev_id } { proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id {datype T} } {
::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}" ::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
set ns "[namespace current]" set ns "[namespace current]"
set catch_status [ catch { set catch_status [ catch {
@ -358,6 +431,8 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath}/sensor data true hsetprop ${scobj_hpath}/sensor data true
hsetprop ${scobj_hpath}/sensor mutable true hsetprop ${scobj_hpath}/sensor mutable true
hsetprop ${scobj_hpath}/sensor nxsave true hsetprop ${scobj_hpath}/sensor nxsave true
hsetprop ${scobj_hpath}/sensor permlink data_set "${datype}[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/sensor @description "${datype}[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/sensor oldval 0.0 hsetprop ${scobj_hpath}/sensor oldval 0.0
hsetprop ${scobj_hpath}/sensor klass "parameter" hsetprop ${scobj_hpath}/sensor klass "parameter"
hsetprop ${scobj_hpath}/sensor sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/sensor sdsinfo "::nexus::scobj::sdsinfo"
@ -370,14 +445,25 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath}/setpoint write ${ns}::wrDecimal ${scobj_hpath} noResponse {2} hsetprop ${scobj_hpath}/setpoint write ${ns}::wrDecimal ${scobj_hpath} noResponse {2}
hsetprop ${scobj_hpath}/setpoint noResponse ${ns}::noResponse ${scobj_hpath} hsetprop ${scobj_hpath}/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint check ${ns}::checkrange ${scobj_hpath} hsetprop ${scobj_hpath}/setpoint check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint driving 0
hsetprop ${scobj_hpath}/setpoint checklimits ${ns}::checklimits ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint halt ${ns}::halt ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint driveable sensor
hsetprop ${scobj_hpath}/setpoint control true hsetprop ${scobj_hpath}/setpoint control true
hsetprop ${scobj_hpath}/setpoint data true hsetprop ${scobj_hpath}/setpoint data true
hsetprop ${scobj_hpath}/setpoint mutable true hsetprop ${scobj_hpath}/setpoint mutable true
hsetprop ${scobj_hpath}/setpoint nxsave true hsetprop ${scobj_hpath}/setpoint nxsave true
hsetprop ${scobj_hpath}/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/setpoint upperlimit 1600
hsetprop ${scobj_hpath}/setpoint tolerance 1
hsetprop ${scobj_hpath}/setpoint permlink data_set "${datype}[format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/setpoint @description "${datype}[format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/setpoint oldval 0.0 hsetprop ${scobj_hpath}/setpoint oldval 0.0
hsetprop ${scobj_hpath}/setpoint klass "parameter" hsetprop ${scobj_hpath}/setpoint klass "parameter"
hsetprop ${scobj_hpath}/setpoint sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/setpoint type "part" hsetprop ${scobj_hpath}/setpoint settle_time "30"
hsetprop ${scobj_hpath}/setpoint type "drivable"
hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint" hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint"
hfactory ${scobj_hpath}/w_sp plain user float hfactory ${scobj_hpath}/w_sp plain user float
@ -471,14 +557,17 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath} klass ${device_class} hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5 hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase "${simulation_flag}" "false"]} {
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor ${sct_controller}
}
# mkDriver hook code goes here # mkDriver hook code goes here
} catch_message ] } catch_message ]
handle_exception ${catch_status} ${catch_message} handle_exception ${catch_status} ${catch_message}
} }
proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_address tcp_port dev_id} { proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_address tcp_port id {datype T} } {
set catch_status [ catch { set catch_status [ catch {
::scobj::west_6100::sics_log 9 "::scobj::west_6100::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}" ::scobj::west_6100::sics_log 9 "::scobj::west_6100::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
if {[string equal -nocase "${simulation_flag}" "false"]} { if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} { if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" ::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
@ -490,8 +579,8 @@ proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_addres
} else { } else {
::scobj::west_6100::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for west_6100" ::scobj::west_6100::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for west_6100"
} }
::scobj::west_6100::sics_log 1 "::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}" ::scobj::west_6100::sics_log 1 "::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id} ::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} $datype
} catch_message ] } catch_message ]
handle_exception ${catch_status} ${catch_message} handle_exception ${catch_status} ${catch_message}
} }
@ -504,9 +593,9 @@ namespace eval ::scobj::west_6100 {
namespace export add_driver namespace export add_driver
} }
proc add_west_6100 {name ip_address tcp_port dev_id} { proc add_west_6100 {name ip_address tcp_port id {datype T} } {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${dev_id}" ::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id} ${datype}"
} }
clientput "file evaluation of sct_west_6100.tcl" clientput "file evaluation of sct_west_6100.tcl"
@ -572,7 +661,7 @@ proc ::scobj::west_6100::read_config {} {
} }
set arg_list [list] set arg_list [list]
set missing_list [list] set missing_list [list]
foreach arg {dev_id} { foreach arg {id datype} {
if {[dict exists $u $arg]} { if {[dict exists $u $arg]} {
lappend arg_list "[dict get $u $arg]" lappend arg_list "[dict get $u $arg]"
} elseif {[dict exists $v $arg]} { } elseif {[dict exists $v $arg]} {

View File

@ -254,25 +254,20 @@ proc waitaction {obj action args} {
publish waitaction user publish waitaction user
proc server_set_sobj_attributes {} { proc server_set_sobj_attributes {} {
if [ catch { if [ catch { motor_set_sobj_attributes } msg ] { puts $msg }
motor_set_sobj_attributes if [ catch { ::utility::set_motor_attributes } msg ] { puts $msg }
::utility::set_motor_attributes
#XXX::utility::set_histomem_attributes #XXX::utility::set_histomem_attributes
::utility::set_sobj_attributes if [ catch { ::utility::set_sobj_attributes } msg ] { puts $msg }
::utility::set_envcontrol_attributes if [ catch { ::utility::set_envcontrol_attributes } msg ] { puts $msg }
::plc::set_sobj_attributes if [ catch { ::plc::set_sobj_attributes } msg ] { puts $msg }
::counter::set_sobj_attributes if [ catch { ::counter::set_sobj_attributes } msg ] { puts $msg }
::nexus::set_sobj_attributes if [ catch { ::nexus::set_sobj_attributes } msg ] { puts $msg }
::histogram_memory::set_sobj_attributes if [ catch { ::histogram_memory::set_sobj_attributes } msg ] { puts $msg }
::utility::set_chopper_attributes if [ catch { ::utility::set_chopper_attributes } msg ] { puts $msg }
::utility::set_sct_object_attributes if [ catch { ::utility::set_sct_object_attributes } msg ] { puts $msg }
## TODO move the following to the new ansto gumxml.tcl ## TODO move the following to the new ansto gumxml.tcl
sicslist setatt getgumtreexml privilege internal if [ catch { sicslist setatt getgumtreexml privilege internal } msg ] { puts $msg }
clientput "serverport $::serverport" clientput "serverport $::serverport"
} message ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
}
} }
proc server_init {} { proc server_init {} {
@ -313,6 +308,7 @@ proc server_init {} {
fileeval ../extraconfig.tcl fileeval ../extraconfig.tcl
} }
server_set_sobj_attributes server_set_sobj_attributes
if [ catch { hsetprop /sics/magnet1/magneticFieldTesla permlink data_set B1S1 } msg ] { puts $msg }
buildHDB instrument_dictionary buildHDB instrument_dictionary
} message ] } message ]

View File

@ -4,9 +4,6 @@
# FastShutter is currently set on Quokka only # FastShutter is currently set on Quokka only
#::utility::mkVar FastShutter text manager FastShutter false instrument true false #::utility::mkVar FastShutter text manager FastShutter false instrument true false
# SET TO 1 TO USE THE TILT STAGE ie sample phi and chi
set use_tiltstage 0
set animal taipan set animal taipan
set sim_mode [SplitReply [motor_simulation]] set sim_mode [SplitReply [motor_simulation]]
@ -93,6 +90,75 @@ set move_count 100
############################ ############################
# #
# CHOOSE HERE for sample stage configuration
##########################################
# Set axis_config as follows to use different axis configurations
# 0: normal stage configuration
# 1: Oxford magnet sample stick
set axis_config 0
if { [ info exists ::config_dict ] } {
if { [ dict exists $::config_dict sample_stage implementation ] } {
set implementation [ dict get $::config_dict sample_stage implementation ]
if {$implementation == "normal_sample_stage"} {
set axis_config 0
} elseif {$implementation == "12tmagnet_sample_insert"} {
set axis_config 1
} elseif {$implementation == "eulerian_cradle"} {
set axis_config 2
} else {
set axis_config 0
}
}
if { [ dict exists $::config_dict m2s2 implementation ] } {
set implementation [ dict get $::config_dict m2s2 implementation ]
if {$implementation == "normal_m2s2"} {
set m2_speed 0.4
set m2_accel 0.04
set m2_decel 0.04
set s2_speed 0.8
set s2_accel 0.2
set s2_decel 0.2
} elseif {$implementation == "extended_m2s2"} {
set m2_speed 0.1
set m2_accel 0.025
set m2_decel 0.025
set s2_speed 0.4
set s2_accel 0.1
set s2_decel 0.1
} else {
set m2_speed 0.4
set m2_accel 0.04
set m2_decel 0.04
set s2_speed 0.8
set s2_accel 0.2
set s2_decel 0.2
}
}
}
switch $axis_config {
0 {
set use_s1_stage "true"
set tilt_motor_driver_type $motor_driver_type
fileeval $cfPath(motors)/tilt_configuration.tcl
}
1 {
set magmot s1
set magmot_aq "mc2"
set magmot_axis "A"
set use_s1_stage "false"
set tilt_motor_driver_type asim
fileeval $cfPath(motors)/tilt_configuration.tcl
fileeval $cfPath(motors)/magnet_configuration.tcl
}
2 {
set use_s1_stage "true"
fileeval $cfPath(motors)/euler_configuration.tcl
}
}
# Dummy translation motor, useful for testing scans # Dummy translation motor, useful for testing scans
Motor dummy_motor asim [params \ Motor dummy_motor asim [params \
@ -138,36 +204,6 @@ dummy_s1 softupperlim 180
dummy_s1 precision 0.02 dummy_s1 precision 0.02
dummy_s1 home 0 dummy_s1 home 0
if { [ info exists ::config_dict ] && [ dict get $::config_dict s1_sample_insert enabled ] } {
set samp_stage_name "s1ss"
set tilt_motor_driver_type asim
Motor s1 $motor_driver_type [params \
asyncqueue mc2\
host mc2-taipan\
port pmc2-taipan\
axis A\
units degrees\
hardlowerlim -1440\
hardupperlim 1440\
maxSpeed 1\
maxAccel 1\
maxDecel 1\
stepsPerX [expr 67.0 * 25000 / 360]\
absEnc 1\
absEncHome 31275743\
cntsPerX [expr 67.0 * 8192 / 360]]
s1 part sample
s1 long_name s1
s1 softlowerlim -180
s1 softupperlim 180
s1 home 0
} else {
set samp_stage_name "s1"
set tilt_motor_driver_type $motor_driver_type
}
#if $use_tiltstage {
# mc1: Monochromator crystal selection rotation/Tilt # mc1: Monochromator crystal selection rotation/Tilt
Motor mtilt $motor_driver_type [params \ Motor mtilt $motor_driver_type [params \
asyncqueue mc1\ asyncqueue mc1\
@ -182,16 +218,14 @@ Motor mtilt $motor_driver_type [params \
maxDecel 1\ maxDecel 1\
stepsPerX 25000\ stepsPerX 25000\
absEnc 1\ absEnc 1\
absEncHome 79650\ absEncHome 27115\
cntsPerX 4096] cntsPerX 4096]
mtilt part crystal mtilt part crystal
mtilt long_name mtilt mtilt long_name mtilt
mtilt softlowerlim -5 mtilt softlowerlim -5
mtilt softupperlim 5 mtilt softupperlim 5
mtilt home 0 mtilt home 0
#}
set atest mtilt
# mc1: Monochromator Linear (Translate) # mc1: Monochromator Linear (Translate)
Motor mtrans $motor_driver_type [params \ Motor mtrans $motor_driver_type [params \
@ -207,7 +241,7 @@ Motor mtrans $motor_driver_type [params \
maxDecel 1\ maxDecel 1\
stepsPerX 25000\ stepsPerX 25000\
absEnc 1\ absEnc 1\
absEncHome 469388\ absEncHome 859242\
cntsPerX 4096] cntsPerX 4096]
mtrans part crystal mtrans part crystal
mtrans long_name mtrans mtrans long_name mtrans
@ -249,9 +283,9 @@ m2 motOffDelay 0
m2 backlash_offset -0.5 m2 backlash_offset -0.5
m2 creep_offset 0.1 m2 creep_offset 0.1
m2 creep_precision 0.0 m2 creep_precision 0.0
m2 speed 0.4 m2 speed $m2_speed
m2 accel 0.04 m2 accel $m2_accel
m2 decel 0.04 m2 decel $m2_decel
# mc1: Detector Rotate # mc1: Detector Rotate
Motor a2 $motor_driver_type [params \ Motor a2 $motor_driver_type [params \
@ -291,100 +325,9 @@ a2 decel 0.2
############################ ############################
# #
# mc2: Sample Tilt 1
Motor sgu $tilt_motor_driver_type [params \
asyncqueue mc2\
host mc2-taipan\
port pmc2-taipan\
axis A\
units degrees\
hardlowerlim -13\
hardupperlim 16.5\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
stepsPerX 25000\
absEnc 1\
absEncHome 7745478\
cntsPerX 8192]
sgu part sample
sgu long_name sgu
sgu softlowerlim -13
sgu softupperlim 16.5
sgu home 0
sgu backlash_offset -0.2
# mc2: Sample Tilt 2
Motor sgl $tilt_motor_driver_type [params \
asyncqueue mc2\
host mc2-taipan\
port pmc2-taipan\
axis B\
units degrees\
hardlowerlim -16.5\
hardupperlim 17.5\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
stepsPerX 25000\
absEnc 1\
absEncHome 7499135\
cntsPerX 8192]
sgl part sample
sgl long_name sgl
sgl softlowerlim -16.5
sgl softupperlim 17.5
sgl home 0
sgl backlash_offset -0.2
# mc2: Sample Up Tanslation
Motor stu $motor_driver_type [params \
asyncqueue mc2\
host mc2-taipan\
port pmc2-taipan\
axis C\
units mm\
hardlowerlim -15\
hardupperlim 15\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
stepsPerX -25000\
absEnc 1\
absEncHome 7392933\
cntsPerX -8192]
stu part sample
stu long_name stu
stu softlowerlim -15
stu softupperlim 15
stu home 0.0
stu backlash_offset -0.2
# mc2: Sample Lower Tanslation
Motor stl $motor_driver_type [params \
asyncqueue mc2\
host mc2-taipan\
port pmc2-taipan\
axis D\
units mm\
hardlowerlim -15\
hardupperlim 15\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
stepsPerX 25000\
absEnc 1\
absEncHome 7582773\
cntsPerX 8192]
stl part sample
stl long_name stl
stl softlowerlim -15
stl softupperlim 15
stl home 0.0
stl backlash_offset -0.2
# mc2: Sample Rotate # mc2: Sample Rotate
Motor $samp_stage_name $motor_driver_type [params \ if {$use_s1_stage == "true"} {
Motor s1 $motor_driver_type [params \
asyncqueue mc2\ asyncqueue mc2\
host mc2-taipan\ host mc2-taipan\
port pmc2-taipan\ port pmc2-taipan\
@ -399,12 +342,14 @@ Motor $samp_stage_name $motor_driver_type [params \
absEnc 1\ absEnc 1\
absEncHome 10695068\ absEncHome 10695068\
cntsPerX 4096] cntsPerX 4096]
$samp_stage_name part sample s1 part sample
$samp_stage_name long_name $samp_stage_name s1 long_name s1
$samp_stage_name softlowerlim -170 s1 softlowerlim -170
$samp_stage_name softupperlim 120 s1 softupperlim 120
$samp_stage_name home 35.997 s1 home 35.997
$samp_stage_name backlash_offset -0.2 s1 backlash_offset -0.2
}
# mc2: Analyser Detector Rotate -- Sample Scattering Angle # mc2: Analyser Detector Rotate -- Sample Scattering Angle
# absEncHome 20728908\ at -50 # absEncHome 20728908\ at -50
@ -437,9 +382,9 @@ s2 backlash_offset 0.5
s2 blockage_thresh 1 s2 blockage_thresh 1
s2 creep_offset 0.015 s2 creep_offset 0.015
s2 creep_precision 0.005 s2 creep_precision 0.005
s2 speed 0.8 s2 speed $s2_speed
s2 accel 0.2 s2 accel $s2_accel
s2 decel 0.2 s2 decel $s2_decel
# mc2: Analyser Horizontal Focus # mc2: Analyser Horizontal Focus
Motor ahfocus $motor_driver_type [params \ Motor ahfocus $motor_driver_type [params \
@ -517,9 +462,10 @@ mvfocus long_name mvfocus
mvfocus softlowerlim 0 mvfocus softlowerlim 0
mvfocus softupperlim 300 mvfocus softupperlim 300
mvfocus home 0.0 mvfocus home 0.0
mvfocus Blockage_Thresh 2 mvfocus Blockage_Thresh 4
mvfocus Blockage_Check_Interval 2 mvfocus Blockage_Check_Interval 2
mvfocus creep_offset 0.2 mvfocus creep_offset 0.2
mvfocus backlash_offset -4
# mc3: Monochromator Horizontal Focus # mc3: Monochromator Horizontal Focus
Motor mhfocus $motor_driver_type [params \ Motor mhfocus $motor_driver_type [params \
asyncqueue mc3\ asyncqueue mc3\
@ -528,25 +474,26 @@ Motor mhfocus $motor_driver_type [params \
axis B\ axis B\
units degrees\ units degrees\
precision 0.2\ precision 0.2\
hardlowerlim -80\ hardlowerlim -10\
hardupperlim 240\ hardupperlim 280\
maxSpeed 3.6\ maxSpeed 3.6\
maxAccel 1.728\ maxAccel 1.728\
maxDecel 1.728\ maxDecel 1.728\
stepsPerX [expr 25000.0 * 50.0 / 360.0]\ stepsPerX [expr 25000.0 * 50.0 / 360.0]\
absEnc 1\ absEnc 1\
bias_bits 12\ bias_bits 12\
bias_bias 1540\ bias_bias 1300\
absEncHome 2788\ absEncHome 243\
cntsPerX [expr -4096.0 / 360.0]] cntsPerX [expr 4096.0 / 360.0]]
mhfocus part crystal mhfocus part crystal
mhfocus long_name mhfocus mhfocus long_name mhfocus
mhfocus softlowerlim -75 mhfocus softlowerlim -10
mhfocus softupperlim 235 mhfocus softupperlim 280
mhfocus home 0 mhfocus home 0
mhfocus Blockage_Thresh 2 mhfocus Blockage_Thresh 4
mhfocus Blockage_Check_Interval 2 mhfocus Blockage_Check_Interval 2
mhfocus creep_offset 0.2 mhfocus creep_offset 0.2
mhfocus backlash_offset -4
# mc3: Monochromator Rotate # mc3: Monochromator Rotate
Motor m1 $motor_driver_type [params \ Motor m1 $motor_driver_type [params \
@ -563,13 +510,13 @@ Motor m1 $motor_driver_type [params \
maxDecel 0.25\ maxDecel 0.25\
stepsPerX 100000\ stepsPerX 100000\
absEnc 1\ absEnc 1\
absEncHome 16323070\ absEncHome 16189898\
cntsPerX -2048] cntsPerX -2048]
m1 part crystal m1 part crystal
m1 long_name m1 m1 long_name m1
m1 softlowerlim 5 m1 softlowerlim 5
m1 softupperlim 40 m1 softupperlim 40
m1 home 20.45933 m1 home 0
m1 backlash_offset -1.0 m1 backlash_offset -1.0
# mc4: Analyzer Tilt 1 -- Two-theta Angle # mc4: Analyzer Tilt 1 -- Two-theta Angle

View File

@ -35,21 +35,27 @@ namespace eval anticollider { proc ::anticollider::init {} {} }
#fileeval $cfPath(anticollider)/anticollider.tcl #fileeval $cfPath(anticollider)/anticollider.tcl
#fileeval $cfPath(tasmad)/taspub_sics/tasp.tcl #fileeval $cfPath(tasmad)/taspub_sics/tasp.tcl
#fileeval $cfPath(tasmad)/taspub_sics/tasscript.tcl #fileeval $cfPath(tasmad)/taspub_sics/tasscript.tcl
fileeval $cfPath(environment)/sct_agilent_33220A.tcl
fileeval $cfPath(environment)/sct_protek_common.tcl
fileeval $cfPath(environment)/sct_protekmm.tcl
fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl
fileeval $cfPath(environment)/temperature/sct_eurotherm_3200.tcl
fileeval $cfPath(environment)/temperature/sct_julabo_lh45.tcl fileeval $cfPath(environment)/temperature/sct_julabo_lh45.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl
fileeval $cfPath(environment)/temperature/sct_ls336.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
fileeval $cfPath(environment)/temperature/sct_ls340.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_m370.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
fileeval $cfPath(environment)/temperature/sct_mercury_base.tcl
fileeval $cfPath(environment)/temperature/sct_mercury_temp.tcl
fileeval $cfPath(environment)/temperature/sct_mercury_pres.tcl
fileeval $cfPath(environment)/temperature/sct_mercury_level.tcl
fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl
fileeval $cfPath(environment)/temperature/west400.tcl fileeval $cfPath(environment)/temperature/west400.tcl
fileeval $cfPath(environment)/temperature/sct_west_6100.tcl
fileeval $cfPath(environment)/he3/sct_he3.tcl fileeval $cfPath(environment)/he3/sct_he3.tcl
fileeval $cfPath(environment)/magneticField/oxford_labview.tcl fileeval $cfPath(environment)/magneticField/oxford_labview.tcl
fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl
fileeval $cfPath(beamline)/sct_he3_polanal.tcl
fileeval config/load_setup.tcl fileeval config/load_setup.tcl
fileeval log.tcl fileeval log.tcl
publish logbook spy publish logbook spy
@ -58,12 +64,44 @@ source gumxml.tcl
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false ::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
::anticollider::protect_detector "true" ::anticollider::protect_detector "true"
if { [ dict exists $::config_dict sample_stage implementation ] } {
set sample_stage [ dict get $::config_dict sample_stage implementation ]
} else {
set sample_stage "normal_sample_stage"
}
switch $sample_stage {
"eulerian_cradle" {
# s1-> eom, sgu -> ephi, sgl -> echi
set OMEGA s1
set PHI ephi
set CHI echi
}
"normal_sample_stage" - default {
set OMEGA s1
set PHI sgu
set CHI sgl
}
}
# init for the tasUB # init for the tasUB
#make mcv mch acv ach into mvfocus mhfocus avfocus ahfocus when it works #make mcv mch acv ach into mvfocus mhfocus avfocus ahfocus when it works
puts "doing tasub" puts "doing tasub"
MakeTasUB tasub m1 m2 mcv mch s1 s2 sgu sgl a1 a2 acv ach MakeTasUB tasub m1 m2 mvfocus mhfocus $OMEGA s2 $PHI $CHI a1 a2 avfocus ahfocus
tasub mono dd 3.35416 tasub mono dd 3.35416
tasub ana dd 3.35416 tasub ana dd 3.35416
# NOTE Autofocussing parameters (vbn, hbn) persist in status.tcl
# To override this behaviour you can set them in extraconfig.tcl
tasub mono vb1 102.2
tasub mono vb2 1.78
tasub mono hb1 18.28
tasub mono hb2 60.1
tasub mono hb3 0.951
tasub ana vb1 115
tasub ana vb2 2.13
tasub ana hb1 45.68
tasub ana hb2 105.7
tasub ana hb3 0.945
tasub focusfn energy
tasub autofocus 0
tasub updatetargets tasub updatetargets
puts "done tasub" puts "done tasub"
@ -74,6 +112,16 @@ server_init
########################################### ###########################################
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly. # WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
puts "Making hkl command"
MakeMono mono PG m1 m2
mono dd 3.35416
MakeWaveLength lambda mono
MakeEnergy energy mono
#MakeSingleX singlex
#MakeHKL s2 $OMEGA $PHI $CHI
#MakeHKLMot hkl
#MakeUBcalc ubcalc hkl
# Provide tasmot notifications to GumTree when real motors move # Provide tasmot notifications to GumTree when real motors move
proc m2tasupdate {} { proc m2tasupdate {} {
tasub update tasub update
@ -109,7 +157,7 @@ proc a2tasupdate {} {
publish a2tasupdate user publish a2tasupdate user
scriptcallback connect m2 MOTEND m2tasupdate scriptcallback connect m2 MOTEND m2tasupdate
scriptcallback connect s1 MOTEND s1s2tasupdate scriptcallback connect $OMEGA MOTEND s1s2tasupdate
scriptcallback connect s2 MOTEND s1s2tasupdate scriptcallback connect s2 MOTEND s1s2tasupdate
scriptcallback connect a2 MOTEND a2tasupdate scriptcallback connect a2 MOTEND a2tasupdate

View File

@ -1,156 +1,304 @@
[12tmagnet]
desc = "12 Tesla Oxford Magnet"
driver = "12tmagnet"
enabled = False
group = environment:magnet
id = 11
ip = 10.157.205.3
name = magnetic
port = 55001
type = B
[12tmagnet_setup] [12tmagnet_setup]
cascade = 12tmagnet,s1_sample_insert,mercury_scpi cascade = B1:12tmagnet_oxford,sample_stage:12tmagnet_sample_insert,T1:mercury_scpi_01
enabled = False enabled = False
group = 0setup [CF1]
cascade = T1:CF1_ls340,sample_stage:normal_sample_stage
[ls336_1] enabled = False
desc = "tc1: Lakeshore 336 temperature controller" [Default]
driver = "ls336" cascade = sample_stage:normal_sample_stage
enabled = True
[B1]
datype = B
enabled = False enabled = False
group = environment:temperature
id = 1 id = 1
ip = 10.157.205.28 implementation = none
name = tc1 name = magnet1
port = 7777 optype = magnetic_field
terminator = \r\n [Function_Generator]
tol1 = 1.0 datype = V
tol2 = 1.0
type = T
[ls336_12]
desc = "tc6: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False enabled = False
group = environment:temperature id = 1
id = 6 implementation = none
ip = 10.157.205.31 name = pulser
name = tc6 optype = function_generator
port = 7777 [I1]
terminator = \r\n datype = I
tol1 = 1.0 enabled = False
tol2 = 1.0 id = 1
type = T implementation = none
name = curr1
[ls336_2] optype = multimeter
desc = "tc2: Lakeshore 336 temperature controller" [I2]
driver = "ls336" datype = I
enabled = False enabled = False
group = environment:temperature
id = 2 id = 2
ip = 10.157.205.29 implementation = none
name = curr2
optype = multimeter
[T1]
datype = T
enabled = False
id = 1
implementation = none
name = tc1
optype = temperature
[T2]
datype = T
enabled = False
id = 2
implementation = none
name = tc2 name = tc2
port = 7777 optype = temperature
terminator = \r\n [T3]
tol1 = 1.0 datype = T
tol2 = 1.0
type = T
[ls336_4]
desc = "tc3: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False enabled = False
group = environment:temperature
id = 3 id = 3
ip = 10.157.205.30 implementation = none
name = tc3 name = tc3
port = 7777 optype = temperature
terminator = \r\n [T4]
tol1 = 1.0 datype = T
tol2 = 1.0
type = T
[ls336_5]
desc = "tc4: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False enabled = False
group = environment:temperature
id = 4 id = 4
ip = 137.157.201.21 implementation = none
name = tc4 name = tc4
port = 7777 optype = temperature
terminator = \r\n [V1]
tol1 = 1.0 datype = V
tol2 = 1.0
type = T
[ls336_6]
desc = "tc5: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False enabled = False
group = environment:temperature id = 1
id = 5 implementation = none
ip = 137.157.201.21 name = volts1
name = tc5 optype = multimeter
port = 7777 [V2]
terminator = \r\n datype = V
tol1 = 1.0 enabled = False
tol2 = 1.0 id = 2
type = T implementation = none
name = volts2
optype = multimeter
[sample_stage]
enabled = Always
implementation = normal_sample_stage
name = sample_stage
optype = motion_axis
[12tmagnet_oxford]
asyncqueue = sct
desc = "12 Tesla Oxford Magnet"
driver = "oxford12tlv"
imptype = magnetic_field
interval = 5
ip = 10.157.205.3
port = 55001
[ls340_1] [12tmagnet_sample_insert]
desc = "tc13: Lakeshore 340 temperature controller" desc = "s1 will be redefined as the magnet sample insert rotation."
imptype = motion_axis
[CF1_ls340]
desc = "cf1: Bottom loading cryofurnace"
driver = "ls340" driver = "ls340"
enabled = False imptype = temperature
group = environment:temperature ip = 10.157.205.43
id = 13
ip = 137.157.203.137
name = tc13
port = 4001 port = 4001
terminator = \r\n terminator = \r\n
tol1 = 1.0 tol1 = 1.0
tol2 = 1.0 tol2 = 1.0
type = T
[ls370] [agilent_33220A]
desc = "tc8: Lakeshore 370 temperature controller" asyncqueue = sct
driver = "ls370" desc = "Function Generator"
enabled = False driver = agilent_33220A
group = environment:temperature imptype = function_generator
id = 8 ip = 10.157.205.16
ip = 137.157.203.137 name = pulser
name = tc8 port = 5025
port = 4003
[ls336_01]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.28
port = 7777
terminator = \r\n terminator = \r\n
tol = 2.0 tol1 = 1.0
type = T tol2 = 1.0
[mercury_scpi] [ls336_02]
desc = "tc9: Oxford Mercury temperature controller in Mercury mode" asyncqueue = sct
driver = "mercury_scpi" desc = "Lakeshore 336 temperature controller"
enabled = False driver = "ls336"
group = environment:temperature imptype = temperature
id = 9 ip = 10.157.205.29
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_04]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.30
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_05]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 137.157.201.21
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_06]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.30
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_11]
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.27
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_12]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.31
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_01]
asyncqueue = sct
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_02]
asyncqueue = sct
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4002
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_11]
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[mercury_scpi_01]
desc = "Oxford Mercury temperature controller with three temperature loops."
driver = "mercury_base"
imptype = temperature
ip = 10.157.205.5 ip = 10.157.205.5
name = tc9 permlink = LT
offifon = mercury_itc500
port = 7020 port = 7020
terminator = \r terminator = \r\n
tol = 2.0 tol = 1.0
type = T valve_tol = 2
[s1_sample_insert] [mercury_scpi_02]
desc = "s1 will be defined as the sample insert rotation. Sample stage will be renamed to s1ss and sgu and sgl will be simulated" desc = "Oxford Mercury temperature controller with four temperature loops and needle valve control"
enabled = False driver = "mercury_scpi"
group = motors imptype = temperature
ip = 10.157.205.47
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
[west4100] [normal_sample_stage]
desc = "tc10: Blue furnace temperature controller" desc = "This is the default sample stage configuration"
imptype = motion_axis
[protek_01]
asyncqueue = sct
desc = "Protek Multimeter"
driver = "protekmm"
imptype = multimeter
ip = 10.157.205.36
port = 4001
[protek_02]
asyncqueue = sct
desc = "Protek Multimeter"
driver = "protekmm"
imptype = multimeter
ip = 10.157.205.37
port = 4001
[vf1_west4100]
asyncqueue = sct
desc = "VF1 Blue furnace temperature controller"
dev_id = 1
driver = "west4100" driver = "west4100"
enabled = False imptype = temperature
group = environment:temperature ip = 10.157.205.24
id = 10 port = 502
ip = 10.157.205.19
name = tc10 [vf1_west6100]
type = T asyncprotocol = modbus_ap
desc = "VF1 Blue furnace 6100 temperature controller"
dev_id = 1
driver = "west_6100"
imptype = temperature
ip = 10.157.205.24
port = 502
timeout = 2000
[vf2_west4100]
asyncqueue = sct
desc = "VF2 Blue furnace temperature controller"
dev_id = 1
driver = "west4100"
imptype = temperature
ip = 10.157.205.25
port = 502
[vf2_west6100]
asyncprotocol = modbus_ap
desc = "VF2 Blue furnace 6100 temperature controller"
dev_id = 1
driver = "west_6100"
imptype = temperature
ip = 10.157.205.25
port = 502
timeout = 2000