diff --git a/site_ansto/instrument/config/environment/temperature/sct_oxford_itc.tcl b/site_ansto/instrument/config/environment/temperature/sct_oxford_itc.tcl index fc1b73b4..90fa8d60 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_itc.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_itc.tcl @@ -175,7 +175,7 @@ debug_log "rdState $tc_root state=$my_state, version=$my_model" hsetprop $tc_root/itc500_state my_status "[sct result]" set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]" debug_log "rdState my_status=$my_status" - set rslt [scan $my_status "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] + set rslt [scan "$my_status" "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d $the_s] H$the_h L$the_l" set auto 0 if {[hval $tc_root/heater_auto] > 0} { @@ -199,7 +199,7 @@ debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d set nextState read } elseif {$my_state == "STATE_C"} { set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]" - set rslt [scan $my_status "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] + set rslt [scan "$my_status" "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] set auto 0 if {[hval $tc_root/heater_auto] > 0} { set auto [expr {$auto + 1}] @@ -240,7 +240,7 @@ debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d if { $nextState == "" } { set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]" debug_log "rdState my_status=$my_status" - set rslt [scan $my_status "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] + set rslt [scan "$my_status" "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d $the_s] H$the_h L$the_l" set my_driving [SplitReply [hgetprop $tc_root/setpoint driving]] debug_log "rdState $tc_root: driving=$my_driving" @@ -283,6 +283,7 @@ debug_log "rdState driving $tc_root finished at $temp in ($lotemp, $hitemp)" } } catch_message ]} { debug_log "rdState error: $catch_message" + set nextState idle } debug_log "rdState returns: $nextState" return $nextState @@ -397,12 +398,12 @@ debug_log "halt $tc_root" hfactory $scobj_hpath/heater_auto plain user int hsetprop $scobj_hpath/heater_auto values 0,1 hsetprop $scobj_hpath/heater_auto oldval 0 - hset $scobj_hpath/heater_auto 0 + hset $scobj_hpath/heater_auto 1 hfactory $scobj_hpath/cooler_auto plain user int hsetprop $scobj_hpath/cooler_auto values 0,1 hsetprop $scobj_hpath/cooler_auto oldval 0 - hset $scobj_hpath/cooler_auto 0 + hset $scobj_hpath/cooler_auto 1 hfactory $scobj_hpath/apply_tolerance plain user int hsetprop $scobj_hpath/apply_tolerance values 0,1 @@ -526,8 +527,8 @@ debug_log "halt $tc_root" proc add_itc500 {name IP port {_tol 5.0} {addr "@1"} } { set fd [open "/tmp/itc500.log" a] if {[SplitReply [environment_simulation]]=="false"} { - puts $fd "makesctcontroller sct_itc500 oxford ${IP}:$port" - makesctcontroller sct_itc500 oxford ${IP}:$port + puts $fd "makesctcontroller sct_itc500 oxford ${IP}:$port \"\r\"" + makesctcontroller sct_itc500 oxford ${IP}:$port "\r" } puts $fd "mk_sct_oxford_itc500 sct_itc500 environment $name $_tol $addr" mk_sct_oxford_itc500 sct_itc500 environment $name $_tol $addr