From 17d72343e710a956589089d512341d2553853fe2 Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Fri, 17 May 2013 07:34:29 +1000 Subject: [PATCH] Removed old error message --- .../temperature/sct_lakeshore_218.tcl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl index 72b30687..7565d2bb 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl @@ -41,6 +41,10 @@ namespace eval ::scobj::ls218 { # @return nextState The next function to call after this one (typically 'rdValue') proc ::scobj::ls218::getValue {idx cmd chID nextState} { if {[ catch { + if {[hpropexists [sct] geterror]} { + hdelprop [sct] geterror + } + if {$chID == 1} { set comm "$cmd $idx" } elseif {$chID == 0} { @@ -72,8 +76,18 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { if {[ catch { set replyData [string trimright [sct result] " \r\n"] - set fields [split $replyData ,] - set curValue $replyData + + if {[string first "ASCERR" $replyData] != -1} { + #broadcast "Error in LS218 Response: ASCERR:" + sct geterror $replyData + return -code error "Error in LS218 Response: $replyData" + } elseif {[string length $replyData] < 1} { + #broadcast "Error in LS218 Response: no message returned from device" + return -code error "Error in LS218: no message returned from device" + } else { + set fields [split $replyData ,] + set curValue $replyData + } switch -exact $varName { "alarm" { if {[lindex $fields 0] == 0} {