From 78cfe7f5a9ee1e4f435cbfd021b823627fb99121 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 22 Aug 2014 12:00:33 +1000 Subject: [PATCH] SICS-770 Fixed SICS reports 'bad status code' when scanning the schp motor --- .../instrument/pelican/config/chopper/fermimot.tcl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/site_ansto/instrument/pelican/config/chopper/fermimot.tcl b/site_ansto/instrument/pelican/config/chopper/fermimot.tcl index be3d6648..ba5aae80 100644 --- a/site_ansto/instrument/pelican/config/chopper/fermimot.tcl +++ b/site_ansto/instrument/pelican/config/chopper/fermimot.tcl @@ -423,13 +423,16 @@ namespace eval ::chopper { set catch_status [ catch { if [hgetpropval $hpath/$node abort] { hsetprop $hpath/$node abort 0 - clientput "ERROR: User requested stop. Aborting operation" + set errStr "ERROR: User requested stop. Aborting operation" + clientput $errStr + hsetprop $hpath/$node errmsg $errStr return $SCode(HWFault) } set devErr [hval $hpath/$node/control/device_error] if {$devErr != ""} { - clientput "ERROR: Drive request failed. Aborting operation" - clientput $devErr + set errStr "ERROR: Drive request failed. Aborting operation: device_error = $devErr" + clientput $errStr + hsetprop $hpath/$node errmsg $errStr return $SCode(HWFault) } if [hpropexists $hpath geterror] { @@ -458,6 +461,8 @@ namespace eval ::chopper { return $SCode(HWBusy) } elseif {[expr $readtime - $timecheck] > $timeout} { return $SCode(HWIdle) + } else { + return $SCode(HWBusy) } } else { if {$timecheck != -1} { @@ -498,6 +503,9 @@ namespace eval ::chopper { proc imot_PhRun {hpath node addr name target} { global SCode + if {[hval $hpath/$node/control/device_error] != ""} { + hset $hpath/$node/control/device_error "" + } hset $hpath/$node/control/set_ref_delay $target hsetprop $hpath/$node/control timecheck -1 set readtime [hgetpropval $hpath read_time]