diff --git a/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl b/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl index f6d5de26..e1e4f623 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl @@ -114,6 +114,10 @@ debug_log "rdValue [sct] [sct result]" debug_log "update result data=$data, oldval=[sct oldval]" } # TODO handle end of drive command + if {abs([hval $tc_root/setpoint] - [hval $tc_root/sensor/value]) <= [hval $tc_root/tolerance]} { + sct driving 0 + sct print "drivestatus: idle" + } } } } @@ -732,7 +736,7 @@ debug_log "setPoint $cmd $par" set rslt [scan $data "DR%6x%4x%6x%2x%4x%2x" the_t the_c the_v the_e the_s the_r] debug_log "scan result rslt=$rslt, the_t=$the_t , the_c=$the_c , the_v=$the_v , the_e=$the_e , the_s=$the_s , the_r=$the_r" if {$rslt == 6} { - # TODO handle test start + # handle RVA indication of test start if {$the_r != 0} { set data 1 } else { @@ -812,11 +816,15 @@ debug_log "chkWrite new data for $tc_root [sct] result=$data" debug_log "drivestatus $tc_root driving=[sct driving]" if {[sct driving]} { # TODO handle end of drive command + if {abs([hval $tc_root/setpoint] - [hval $tc_root/sensor/value]) <= [hval $tc_root/tolerance]} { + sct driving 0 + sct print "drivestatus: idle" + return idle + } return busy - } else { - sct print "drivestatus: idle" - return idle - } + } + sct print "drivestatus: idle" + return idle } proc halt {tc_root} { @@ -930,7 +938,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ set deviceCommand {\ sensor value 1 0 0 float user {RST} {rdTemp} {0} {} {}\ - {} setpoint 0 1 0 float user {} {} {0} {setTemp.chkWrite} {}\ + {} setpoint 0 1 1 float user {} {} {0} {setTemp.chkWrite} {}\ {} speed 1 1 0 float user {RSR} {rdSpeed} {0} {setSpeed.chkWrite} {}\ {} power 1 0 0 float internal {RSC} {rdPower} {0} {} {}\ {} tower 1 0 0 float internal {RSD} {rdTower} {0} {} {}\