diff --git a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl index a693a605..df8ee782 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl @@ -225,18 +225,17 @@ proc ::scobj::oxford_mercury::rdValue {tc_root} { } # rdValue hook code starts set value [lindex [split "${data}" ":"] end] - if {[string equal -nocase [string index ${value} end] K]} { - set value [string range ${value} 0 end-1] - } - if {[string equal -nocase ${value} NaN]} { + if {[string equal -nocase -length 3 ${value} NaN]} { set value 0 } - if {[string equal -nocase ${value} inf] || [string equal -nocase ${value} -inf]} { + if {[string equal -nocase -length 3 ${value} inf] || [string equal -nocase -length 4 ${value} -inf]} { set value 0 } - if {![string is double ${value}]} { + if {![string is digit [string index ${value} 0]]} { set value 0 } + debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} sct=[sct] result=[sct result]" + debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} data=${data} value=${value}" scan ${value} "%g" data # rdValue hook code ends if { [hpropexists [sct] geterror] } { @@ -507,7 +506,7 @@ proc ::scobj::oxford_mercury::mkDriver { sct_controller name device_class simula if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]} { hfactory ${scobj_hpath}/Pres5/valve plain user float - hsetprop ${scobj_hpath}/Pres5/valve read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN} + hsetprop ${scobj_hpath}/Pres5/valve read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:PERC} hsetprop ${scobj_hpath}/Pres5/valve rdValue ${ns}::rdValue ${scobj_hpath} hsetprop ${scobj_hpath}/Pres5/valve control true hsetprop ${scobj_hpath}/Pres5/valve data true @@ -624,7 +623,7 @@ proc ::scobj::oxford_mercury::mkDriver { sct_controller name device_class simula if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]} { hfactory ${scobj_hpath}/Pres8/valve plain user float - hsetprop ${scobj_hpath}/Pres8/valve read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN} + hsetprop ${scobj_hpath}/Pres8/valve read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:PERC} hsetprop ${scobj_hpath}/Pres8/valve rdValue ${ns}::rdValue ${scobj_hpath} hsetprop ${scobj_hpath}/Pres8/valve control true hsetprop ${scobj_hpath}/Pres8/valve data true @@ -1384,7 +1383,7 @@ proc ::scobj::oxford_mercury::mkDriver { sct_controller name device_class simula } hfactory ${scobj_hpath}/Valve/sensor plain user float - hsetprop ${scobj_hpath}/Valve/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN} + hsetprop ${scobj_hpath}/Valve/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:PERC} hsetprop ${scobj_hpath}/Valve/sensor rdValue ${ns}::rdValue ${scobj_hpath} hsetprop ${scobj_hpath}/Valve/sensor control true hsetprop ${scobj_hpath}/Valve/sensor data true