From a52835379de6241b16e8ed873d608bb7c61ebbfb Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 24 Apr 2014 10:45:45 +1000 Subject: [PATCH] Changes to sct files --- .../config/environment/hiden_xcs.sct | 28 +++++++++++-------- .../environment/temperature/mercury_scpi.sct | 1 + .../environment/temperature/pfeiffer_hg.sct | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/site_ansto/instrument/config/environment/hiden_xcs.sct b/site_ansto/instrument/config/environment/hiden_xcs.sct index 86bbab8d..46c82fe0 100644 --- a/site_ansto/instrument/config/environment/hiden_xcs.sct +++ b/site_ansto/instrument/config/environment/hiden_xcs.sct @@ -223,14 +223,16 @@ driver hiden_xcs = { code pid_function pid_humidity = { @ set sign 1 -@ foreach node [list analog/sp1 analog/sp2] { +@ foreach node [list ${tc_root}/analog/sp1 ${tc_root}/analog/sp2] { @ set sign [expr -${sign}] @ set signed_pid [expr ${sign} * ${pid}] -@ hsetprop ${tc_root}/${node} bias_humidity ${signed_pid} -@ if { [hpropexists ${tc_root}/${node} target] } { -@ hset ${tc_root}/${node} [hgetpropval ${tc_root}/${node} target] -@ } else { -@ hset ${tc_root}/${node} [hval ${tc_root}/${node}] +@ if { !([hpropexists ${node} bias_humidity] && [hgetpropval ${node} bias_humidity] == ${signed_pid}) } { +@ hsetprop ${node} bias_humidity ${signed_pid} +@ if { [hpropexists ${node} target] } { +@ hset ${node} [hgetpropval ${node} target] +@ } else { +@ hset ${node} [hval ${node}] +@ } @ } @ } } @@ -250,12 +252,14 @@ driver hiden_xcs = { } code pid_function pid_flow = { -@ foreach node [list analog/sp1 analog/sp2] { -@ hsetprop ${tc_root}/${node} bias_flow ${pid} -@ if { [hpropexists ${tc_root}/${node} target] } { -@ hset ${tc_root}/${node} [hgetpropval ${tc_root}/${node} target] -@ } else { -@ hset ${tc_root}/${node} [hval ${tc_root}/${node}] +@ foreach node [list ${tc_root}/analog/sp1 ${tc_root}/analog/sp2] { +@ if { !([hpropexists ${node} bias_flow] && [hgetpropval ${node} bias_flow] == ${pid}) } { +@ hsetprop ${node} bias_flow ${pid} +@ if { [hpropexists ${node} target] } { +@ hset ${node} [hgetpropval ${node} target] +@ } else { +@ hset ${node} [hval ${node}] +@ } @ } @ } } diff --git a/site_ansto/instrument/config/environment/temperature/mercury_scpi.sct b/site_ansto/instrument/config/environment/temperature/mercury_scpi.sct index 962d0add..7ce39717 100644 --- a/site_ansto/instrument/config/environment/temperature/mercury_scpi.sct +++ b/site_ansto/instrument/config/environment/temperature/mercury_scpi.sct @@ -84,5 +84,6 @@ driver mercury_scpi = { @ set par [expr ${par} + [hgetpropval [sct] pid_bias]] @ set cmd "${cmd_str}${par}" @ } +@ sct update [sct target] } } diff --git a/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct b/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct index 39bb4b70..a83bfc67 100644 --- a/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct +++ b/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct @@ -44,7 +44,7 @@ driver pfeiffer_hg = { code read_function ack_enq = { @ if {[string equal -nocase -length 1 ${data} "\x06"]} { -@ debug_log 1 "ack_enq received ACK, send ENQ" +@ debug_log ${tc_root} 1 "ack_enq received ACK, send ENQ" @ sct send "\x05" @ } @ return "readPR1"