diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl index 2b1f3665..12b94151 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl @@ -710,7 +710,8 @@ proc inTolerance {CtrlLoopIdx} { set cmpIdString [string compare -length 13 $data "LSCI,MODEL336"] } if {$cmpIdString == 0 } { - if [ hgetpropval $tc_root/sensor/setpoint$CtrlLoopIdx setpoint_pending ] { + set wrStatus [ hgetpropval $tc_root/sensor/setpoint$CtrlLoopIdx writestatus ] + if {$wrStatus == "start"} { continue } # set nodename $tc_root/control/config_Loop_$CtrlLoopIdx @@ -903,12 +904,11 @@ proc setPoint {tc_root nextState cmd whichCtrlLoop} { # Called by drive adapter # puts "setPoint(): driving set to 1" set nodename $tc_root/sensor/setpoint$whichCtrlLoop + hsetprop $nodename driving 1 } #puts "setPoint(wrStatus=$wrStatus): sct send $cmd$par" sct send "$cmd$par" - sct setpoint_pending 0 } message ]} { - hsetprop $nodename driving 0 return -code error "in setPoint: $message. Last write command: $::scobj::ls336::ls336_lastWriteCmd" } return $nextState @@ -1087,7 +1087,12 @@ proc checktol {tc_root currtime timecheck iLoop iSensor} { set sensorValue $tc_root/sensor/sensorValue$iSensor set temp [hval $sensorValue] set isetp $tc_root/sensor/setpoint$iLoop - set setpt [hval $isetp] + if [hpropexists $isetp "target"] { + set setpt [hgetpropval $isetp "target"] + } else { + hset $tc_root/emon/isInTolerance_Lp$iLoop "inTolerance" + return 1 + } set tol [hval $tc_root/control/tolerance1] if {$iLoop == 2 } { set tol [hval $tc_root/control/tolerance2] @@ -1179,10 +1184,8 @@ proc check {tc_root whichCtrlLoop} { } } } message ]} { - sct driving 0 return -code error "in check(): $message. Last write command: $::scobj::ls336::ls336_lastWriteCmd" } - sct setpoint_pending 1 return OK } @@ -1734,7 +1737,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p hsetprop $nodeName checklimits ${ns}::check $scobj_hpath $idx hsetprop $nodeName checkstatus ${ns}::drivestatus $scobj_hpath hsetprop $nodeName halt ${ns}::halt $scobj_hpath $idx - hsetprop $nodeName setpoint_pending 0 } } message ]} { return -code error "in createNode $message" diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl index 4db6084a..a5440afa 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl @@ -710,7 +710,8 @@ proc inTolerance {CtrlLoopIdx} { set cmpIdString [string compare -length 13 $data "LSCI,MODEL336"] } if {$cmpIdString == 0 } { - if [ hgetpropval $tc_root/sensor/setpoint$CtrlLoopIdx setpoint_pending ] { + set wrStatus [ hgetpropval $tc_root/sensor/setpoint$CtrlLoopIdx writestatus ] + if {$wrStatus == "start"} { continue } # set nodename $tc_root/control/config_Loop_$CtrlLoopIdx @@ -903,12 +904,11 @@ proc setPoint {tc_root nextState cmd whichCtrlLoop} { # Called by drive adapter # puts "setPoint(): driving set to 1" set nodename $tc_root/sensor/setpoint$whichCtrlLoop + hsetprop $nodename driving 1 } #puts "setPoint(wrStatus=$wrStatus): sct send $cmd$par" sct send "$cmd$par" - sct setpoint_pending 0 } message ]} { - hsetprop $nodename driving 0 return -code error "in setPoint: $message. Last write command: $::scobj::ls340::ls340_lastWriteCmd" } return $nextState @@ -1087,7 +1087,12 @@ proc checktol {tc_root currtime timecheck iLoop iSensor} { set sensorValue $tc_root/sensor/sensorValue$iSensor set temp [hval $sensorValue] set isetp $tc_root/sensor/setpoint$iLoop - set setpt [hval $isetp] + if [hpropexists $isetp "target"] { + set setpt [hgetpropval $isetp "target"] + } else { + hset $tc_root/emon/isInTolerance_Lp$iLoop "inTolerance" + return 1 + } set tol [hval $tc_root/control/tolerance1] if {$iLoop == 2 } { set tol [hval $tc_root/control/tolerance2] @@ -1179,10 +1184,8 @@ proc check {tc_root whichCtrlLoop} { } } } message ]} { - sct driving 0 return -code error "in check(): $message. Last write command: $::scobj::ls340::ls340_lastWriteCmd" } - sct setpoint_pending 1 return OK } @@ -1734,7 +1737,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p hsetprop $nodeName checklimits ${ns}::check $scobj_hpath $idx hsetprop $nodeName checkstatus ${ns}::drivestatus $scobj_hpath hsetprop $nodeName halt ${ns}::halt $scobj_hpath $idx - hsetprop $nodeName setpoint_pending 0 } } message ]} { return -code error "in createNode $message"