BUGFIX Set 50ns veto window parameter correctly on the Fermi chopper.

Also disable the idle setting in the 'run' command.
And check that the 'run' command actually succeeded.
This commit is contained in:
Ferdi Franceschini
2013-05-13 22:15:43 +10:00
parent b8d059c266
commit ea3c8b7821

View File

@@ -326,7 +326,7 @@ namespace eval ::chopper {
set phGain [lindex $row 1 3 $dir] set phGain [lindex $row 1 3 $dir]
hset $hpath/$node/control/set_motor_dir $dir hset $hpath/$node/control/set_motor_dir $dir
hset $hpath/$node/control/set_vetowin50 $vetowin hset $hpath/$node/control/set_vetowin50 [expr $vetowin/50.0]
hset $hpath/$node/control/set_prop_gain $propGain hset $hpath/$node/control/set_prop_gain $propGain
hset $hpath/$node/control/set_int_gain $intGain hset $hpath/$node/control/set_int_gain $intGain
hset $hpath/$node/control/set_phase_gain $phGain hset $hpath/$node/control/set_phase_gain $phGain
@@ -395,6 +395,9 @@ namespace eval ::chopper {
proc imot_SRun {hpath node addr name target} { proc imot_SRun {hpath node addr name target} {
global SCode global SCode
set catch_status [ catch { set catch_status [ catch {
if {[hval $hpath/$node/control/device_error] != ""} {
hset $hpath/$node/control/device_error ""
}
# imot_status clears the abort flag, but this only happens if imot_status # imot_status clears the abort flag, but this only happens if imot_status
# is being checked because of a "run" or "drive" when a stop is sent. # is being checked because of a "run" or "drive" when a stop is sent.
hsetprop $hpath/$node abort 0 hsetprop $hpath/$node abort 0
@@ -403,6 +406,10 @@ namespace eval ::chopper {
return $ret return $ret
} }
hset $hpath/$node/control/start 1 hset $hpath/$node/control/start 1
# Disable idle if set
if {[hval $hpath/$node/idle_toggle] == 1} {
hset $hpath/$node/control/idle_toggle 1
}
hsetprop $hpath/$node/control timecheck -1 hsetprop $hpath/$node/control timecheck -1
set readtime [hgetpropval $hpath read_time] set readtime [hgetpropval $hpath read_time]
hsetprop $hpath lastupdate $readtime hsetprop $hpath lastupdate $readtime
@@ -416,9 +423,18 @@ namespace eval ::chopper {
set catch_status [ catch { set catch_status [ catch {
if [hgetpropval $hpath/$node abort] { if [hgetpropval $hpath/$node abort] {
hsetprop $hpath/$node abort 0 hsetprop $hpath/$node abort 0
clientput "User requested stop. Aborting operation" "" clientput "ERROR: User requested stop. Aborting operation"
return $SCode(HWFault) return $SCode(HWFault)
} }
set devErr [hval $hpath/$node/control/device_error]
if {$devErr != ""} {
clientput "ERROR: Drive request failed. Aborting operation"
clientput $devErr
return $SCode(HWFault)
}
if [hpropexists $hpath geterror] {
clientput "WARNING: [hgetpropval $hpath geterror]"
}
set readtime [hgetpropval $hpath read_time] set readtime [hgetpropval $hpath read_time]
set lastupdate [hgetpropval $hpath lastupdate] set lastupdate [hgetpropval $hpath lastupdate]
if {$readtime <= $lastupdate} { if {$readtime <= $lastupdate} {
@@ -455,7 +471,7 @@ namespace eval ::chopper {
proc imot_Halt {hpath node addr name} { proc imot_Halt {hpath node addr name} {
global SCode global SCode
# Don't halt the choppers just because someone tried to interrupt a scan. # Don't halt the choppers just because someone sent INT1712 to interrupt a scan.
if { [GetInt] == "continue" } { if { [GetInt] == "continue" } {
hset $hpath/$node/control/stop 1 hset $hpath/$node/control/stop 1
hsetprop $hpath/$node abort 1 hsetprop $hpath/$node abort 1