From d8f5030a8d18da8014c3857d9e12842973c304fd Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 20:29:23 +1100 Subject: [PATCH] SICS-795 Bring GIT up to date with changes made on ics1-wombat. --- .../environment/temperature/west400.tcl | 8 +- .../hipd/config/commands/commands.tcl | 86 +++++++++++++++++-- .../instrument/hipd/config/hmm/hmm_rapid.tcl | 20 ++++- .../config/motors/euler_configuration.tcl | 14 +-- .../config/motors/motor_configuration.tcl | 7 +- .../hipd/config/motors/tilt_configuration.tcl | 3 +- .../instrument/hipd/util/sics_config.ini | 31 ++----- .../instrument/hipd/wombat_configuration.tcl | 1 + 8 files changed, 122 insertions(+), 48 deletions(-) diff --git a/site_ansto/instrument/config/environment/temperature/west400.tcl b/site_ansto/instrument/config/environment/temperature/west400.tcl index 586247a3..71945a84 100644 --- a/site_ansto/instrument/config/environment/temperature/west400.tcl +++ b/site_ansto/instrument/config/environment/temperature/west400.tcl @@ -20,10 +20,12 @@ MakeRS232Controller sertemp $IP 502 sertemp timeout 300 sertemp sendterminator 0x0 sertemp replyterminator 0x0 -EvFactory new tc1 west4100 sertemp $ID 2 +#ffr 2014-09-22: The modbus addr should be 1 for single port moxas (Not $ID which is a SICS ID) +# EvFactory new tc1 west4100 sertemp $ID 2 +EvFactory new $temp_sobj west4100 sertemp 1 2 -sicslist setatt tc1 units kelvin -sicslist setatt tc1 klass @none +sicslist setatt $temp_sobj units kelvin +sicslist setatt $temp_sobj klass @none } # @brief Adds a west400 temperature controller object. diff --git a/site_ansto/instrument/hipd/config/commands/commands.tcl b/site_ansto/instrument/hipd/config/commands/commands.tcl index 75bd42d8..45411a95 100644 --- a/site_ansto/instrument/hipd/config/commands/commands.tcl +++ b/site_ansto/instrument/hipd/config/commands/commands.tcl @@ -6,7 +6,7 @@ namespace eval motor { } namespace eval ajscmds { -namespace export SetRadColl SimpleRun SimpleScan RadCollRun RadCollTimed RadCollScan +namespace export SetRadColl SimpleRun SimpleScan RadCollRun RadCollTimed RadCollScan RadCollBiScan # SetRadColl command SetRadColl { @@ -34,13 +34,13 @@ catch { } msg clientput $msg } + # SimpleRun command SimpleRun { float=0:inf steptime int=1:inf numsteps } { -# RadCollOff histmem mode time histmem preset $steptime newfile HISTOGRAM_XY @@ -49,6 +49,7 @@ int=1:inf numsteps save $i } } + # SimpleScan command SimpleScan { text=drivable motor @@ -58,7 +59,6 @@ int=1:inf numsteps float=0:inf steptime } { -# RadCollOff histmem mode time histmem preset $steptime newfile HISTOGRAM_XY @@ -68,13 +68,13 @@ float=0:inf steptime save $i } } + # RadCollRun command RadCollRun { int=1:inf oscno int=1:inf reps } { -# RadCollOn $oscno histmem mode unlimited newfile HISTOGRAM_XY for {set i 0} {$i < $reps} {incr i} { @@ -83,8 +83,8 @@ int=1:inf reps hmm countblock save $i } -# RadCollOff } + # RadCollTimed command RadCollTimed { int=1:inf oscno @@ -99,14 +99,16 @@ float=0:inf time set i 0 set timsecs [expr $time*60] while {$bool == 0} { + oct oscillate_count $oscno + oct oscillate start histmem start block save $i incr i set tim2 [expr [clock seconds] - $tim1] if {$tim2 > $timsecs} {set bool 1} } - RadCollOff } + # RadCollScan command RadCollScan { text=drivable motor @@ -115,8 +117,6 @@ float step int=1:inf numsteps int=1:inf oscno } { - -# RadCollOn $oscno histmem mode unlimited newfile HISTOGRAM_XY for {set i 0} {$i < $numsteps} {incr i} { @@ -126,8 +126,12 @@ int=1:inf oscno hmm countblock save $i } -# RadCollOff } + + + + + } namespace import ::ajscmds::* publish SetRadColl user @@ -140,3 +144,67 @@ publish RadCollScan user proc ::commands::isc_initialize {} { ::commands::ic_initialize } + + +# RadCollScanRange +proc RadCollScanRange {motor start step fin oscno} { + if {$step==0} {break} + if {($start > $fin) && ($step > 0)} {break} + if {($start < $fin) && ($step < 0)} {break} + set i_bool 0 + histmem mode unlimited + set currentmot $start + set i 0 + newfile HISTOGRAM_XY + while {$i_bool==0} { + drive $motor $currentmot + oct oscillate_count $oscno + oct oscillate start + hmm countblock + save $i + set currentmot [expr {$currentmot + $step}] + if {($step > 0) && ($currentmot > $fin)} {set i_bool 1} + if {($step < 0) && ($currentmot < $fin)} {set i_bool 1} + incr i + } +} + +publish RadCollScanRange user + +#RadCollScanBi +proc RadCollScanBi {motor start step fin oscno motdir} { + set i_bool 0 + histmem mode unlimited + if {$motdir == 1} { + set currentmot $start + set i 0 + } else { + set currentmot $fin + set i [expr {int(($fin-$start)/$step)}] + } + newfile HISTOGRAM_XY + while {$i_bool==0} { +# drive $motor $currentmot + oct oscillate_count $oscno + oct oscillate start + hmm countblock + + if {($motdir > 0)} { + set currentmot [expr {$currentmot + $step}] + if {$currentmot > $fin} {set i_bool 1} + incr i + } else { + set currentmot [expr {$currentmot - $step}] + if {$currentmot < $start} {set i_bool 1} + incr i -1 + } + run $motor $currentmot + save $i + } +} + +publish RadCollScanBi user + + + + diff --git a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl index fd7c040f..d8b6931f 100644 --- a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl +++ b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl @@ -148,7 +148,7 @@ proc SetHistoOneShot {frq framenum } { bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 } fat_table -set NOS_PERIODS $framenum oat_table -set T {0 2200000} NTC 1 - oat_table -set Y {-0.5 15.5} NYC 16 + oat_table -set Y {-0.5 31.5} NYC 16 histmem freq $frq histmem loadconf @@ -160,4 +160,22 @@ proc SetHistoOneShot {frq framenum } { publish SetHistoOneShot user +proc SetHistoStd {} { + histmem stop + hmm astop + FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED + OAT_TABLE -set X { 991.5 987.5 } NXC 248 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1 + histmem loadconf +} +publish SetHistoStd user + +proc SetHistoDX {} { + histmem stop + hmm astop + FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 16 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED + OAT_TABLE -set X { 991.5 989.5 } NXC 496 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1 + histmem loadconf +} + +publish SetHistoDX user diff --git a/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl b/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl index cb4b340e..4d59dad1 100644 --- a/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl @@ -56,20 +56,20 @@ Motor ephi $motor_driver_type [params \ asyncqueue mc2\ axis C\ units degrees\ - hardlowerlim -185\ - hardupperlim 185\ + hardlowerlim -365\ + hardupperlim 365\ maxSpeed 5\ maxAccel 5\ - maxDecel 1\ + maxDecel 5\ stepsPerX -12500\ absEnc 1\ absEncHome $ephi_Home\ cntsPerX -4096] -setHomeandRange -motor ephi -home 0 -lowrange 180 -uprange 180 -ephi softlowerlim -180 -ephi softupperlim 180 +setHomeandRange -motor ephi -home 0 -lowrange -360 -uprange 360 +ephi softlowerlim -360 +ephi softupperlim 360 ephi home 0 -ephi speed 1 +ephi speed 3 ephi movecount $move_count ephi precision 0.01 ephi part sample diff --git a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl index e3953a9f..6dddff24 100644 --- a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl @@ -24,8 +24,9 @@ if {$sim_mode == "true"} { #set mx_Home 23263535 set mx_Home 8390583 #set mom_Home 9274794 -#set mom_Home 8391038 -set mom_Home 8147038 +##set mom_Home 8391038 +#set mom_Home 8147038 +set mom_Home 7736816 set mtth_Home 19927837 #set mphi_Home 7613516 #set mphi_Home 27847793 @@ -291,7 +292,7 @@ Motor mom $motor_driver_type [params \ absEnc 1\ absEncHome $mom_Home\ cntsPerX -2048] -setHomeandRange -motor mom -home 0 -lowrange 5 -uprange 165 +setHomeandRange -motor mom -home 59.5066 -lowrange 5 -uprange 165 #setHomeandRange -motor mom -home 60.08 -lowrange 5 -uprange 165 mom speed 1 mom movecount $move_count diff --git a/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl b/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl index f4d77b6e..6681b7a6 100644 --- a/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl @@ -1,7 +1,8 @@ # This must be loaded by motor_configuration.tcl set sphi_Home 7938520 -set schi_Home 7586052 +#set schi_Home 7586052 +set schi_Home 9932404 set sy_Home 7790194 set sx_Home 7556649 diff --git a/site_ansto/instrument/hipd/util/sics_config.ini b/site_ansto/instrument/hipd/util/sics_config.ini index ab40aac9..809696ff 100644 --- a/site_ansto/instrument/hipd/util/sics_config.ini +++ b/site_ansto/instrument/hipd/util/sics_config.ini @@ -103,9 +103,11 @@ implementation = normal_sample_stage name = sample_stage optype = motion_axis [12tmagnet_oxford] +asyncqueue = sct desc = "12 Tesla Oxford Magnet" -driver = "oxford_labview" +driver = "oxford12tlv" imptype = magnetic_field +interval = 5 ip = 10.157.205.3 port = 55001 @@ -291,40 +293,21 @@ desc = "Load the small omega configuration" imptype = motion_axis [vf1_west4100] -asyncqueue = sct +asyncprotocol = modbus_ap desc = "VF1 Blue furnace temperature controller" dev_id = 1 -driver = "west4100" -imptype = temperature -ip = 10.157.205.24 -port = 502 - -[vf1_west6100] -asyncprotocol = modbus_ap -desc = "VF1 Blue furnace 6100 temperature controller" -dev_id = 1 -driver = "west_6100" +driver = "west6100" imptype = temperature ip = 10.157.205.24 port = 502 timeout = 2000 [vf2_west4100] -asyncqueue = sct +asyncprotocol = modbus_ap 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" +driver = "west6100" imptype = temperature ip = 10.157.205.25 port = 502 timeout = 2000 - diff --git a/site_ansto/instrument/hipd/wombat_configuration.tcl b/site_ansto/instrument/hipd/wombat_configuration.tcl index e92da140..8657ccb0 100644 --- a/site_ansto/instrument/hipd/wombat_configuration.tcl +++ b/site_ansto/instrument/hipd/wombat_configuration.tcl @@ -52,6 +52,7 @@ fileeval $cfPath(environment)/temperature/sct_julabo_lh45_gen.tcl fileeval $cfPath(environment)/temperature/sct_qlink.tcl fileeval $cfPath(environment)/temperature/west400.tcl fileeval $cfPath(environment)/temperature/sct_west4100.tcl +fileeval $cfPath(environment)/temperature/sct_west_6100.tcl fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl fileeval $cfPath(environment)/he3/sct_he3.tcl