From c6abb1fabdd9766145eb34453c00fd7a8d8fb932 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Tue, 30 Sep 2014 17:24:58 +1000 Subject: [PATCH 01/54] Slight change to the way we do PID in SCT files --- .../config/environment/hiden_xcs.sct | 42 ++++++++-- .../config/environment/sct_hiden_xcs.tcl | 76 ++++++++++++++++--- site_ansto/instrument/util/gen_sct.py | 4 +- 3 files changed, 103 insertions(+), 19 deletions(-) diff --git a/site_ansto/instrument/config/environment/hiden_xcs.sct b/site_ansto/instrument/config/environment/hiden_xcs.sct index 46c82fe0..7d70ae6d 100644 --- a/site_ansto/instrument/config/environment/hiden_xcs.sct +++ b/site_ansto/instrument/config/environment/hiden_xcs.sct @@ -20,6 +20,11 @@ driver hiden_xcs = { group_property 'nxsave' = 'true' property 'klass' = 'environment' property 'sdsinfo' = '::nexus::scobj::sdsinfo' + var auto = { + type = int; + allowed = '0,1'; + value = 0; + } var enabled = { permlink = 'G.X02' type = int; @@ -64,12 +69,15 @@ driver hiden_xcs = { property pid_error = 0 property pid_deriv = 0 property pid_integ = 0 - property pid_pvalue = 0.2 + property pid_pvalue = 0.1 property pid_ivalue = 0.1 property pid_dvalue = 0.0 - property pid_imax = 30 + property pid_imax = 50 } var setpoint = { + readable = 1; + read_command = '@' + fetch_function = getTarget permlink = 'G.SP01' driveable = flow/sensor write_function = write_flow @@ -96,19 +104,22 @@ driver hiden_xcs = { property pid_error = 0 property pid_deriv = 0 property pid_integ = 0 - property pid_pvalue = 0.2 - property pid_ivalue = 0.1 + property pid_pvalue = 1.0 + property pid_ivalue = 0.10 property pid_dvalue = 0.0 - property pid_imax = 30 + property pid_imax = 20 } var setpoint = { + readable = 1; + read_command = '@' + fetch_function = getTarget permlink = 'G.SP02' driveable = humidity/sensor write_function = write_humidity checkrange_function = chkrange_function value = 50 - lowerlimit = 10 - upperlimit = 90 + lowerlimit = 0 + upperlimit = 100 tolerance = 1 } } @@ -140,6 +151,14 @@ driver hiden_xcs = { # Code lines start with '@' which is stripped before being emitted into generated driver # The code is emitted at the appropriate place in the given function # + code getTarget = { +@ if { [hpropexists [sct] target] } { +@ sct result [sct target] +@ } else { +@ sct result [hval [sct]] +@ } +@ set cmd "@@NOSEND@@" + } code read_function read_digital = { @ if { [string equal -nocase -length 5 "${data}" "DOUT ="] } { @ set result [scan "${data}" "DOUT = %d OK" val] @@ -222,6 +241,10 @@ driver hiden_xcs = { } code pid_function pid_humidity = { +@ if { ![hval ${tc_root}/auto] } { +@ set pid 0.0 +@ sct pid_integ 0.0 +@ } @ set sign 1 @ foreach node [list ${tc_root}/analog/sp1 ${tc_root}/analog/sp2] { @ set sign [expr -${sign}] @@ -252,6 +275,10 @@ driver hiden_xcs = { } code pid_function pid_flow = { +@ if { ![hval ${tc_root}/auto] } { +@ set pid 0.0 +@ sct pid_integ 0.0 +@ } @ 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} @@ -266,6 +293,7 @@ driver hiden_xcs = { code write_function write_digital = { } + code write_function write_twelve = { @ if { [hpropexists [sct] base] } { @ set base [sct base] diff --git a/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl b/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl index 0801bad6..a56a10da 100644 --- a/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl +++ b/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl @@ -176,6 +176,35 @@ proc ::scobj::hiden_xcs::fetch_flow {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } +# function to request the read of a parameter on a device +proc ::scobj::hiden_xcs::getTarget {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "getTarget tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# getTarget hook code starts + if { [hpropexists [sct] target] } { + sct result [sct target] + } else { + sct result [hval [sct]] + } + set cmd "@@NOSEND@@" +# getTarget hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "getTarget sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # function to request the read of a parameter on a device proc ::scobj::hiden_xcs::getValue {tc_root nextState cmd_str} { set catch_status [ catch { @@ -254,16 +283,20 @@ proc ::scobj::hiden_xcs::pid_flow {tc_root sp pv} { set p_value [expr {[sct pid_pvalue] * [sct pid_error]}] set d_value [expr {[sct pid_dvalue] * (${pv} - [sct oldval])}] sct pid_deriv [sct pid_error] - sct pid_integ [expr {[sct pid_integ] + [sct pid_error]}] + sct pid_integ [expr {[sct pid_integ] + [sct pid_error] * [sct pid_ivalue]}] if { [sct pid_integ] > [sct pid_imax] } { sct pid_integ [sct pid_imax] } if { [sct pid_integ] < -[sct pid_imax] } { sct pid_integ -[sct pid_imax] } - set i_value [expr {[sct pid_ivalue] * [sct pid_integ]}] + set i_value [sct pid_integ] set pid [expr {${p_value} + ${i_value} + ${d_value}}] # pid_flow hook code starts + if { ![hval ${tc_root}/auto] } { + set pid 0.0 + sct pid_integ 0.0 + } 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} @@ -289,16 +322,20 @@ proc ::scobj::hiden_xcs::pid_humidity {tc_root sp pv} { set p_value [expr {[sct pid_pvalue] * [sct pid_error]}] set d_value [expr {[sct pid_dvalue] * (${pv} - [sct oldval])}] sct pid_deriv [sct pid_error] - sct pid_integ [expr {[sct pid_integ] + [sct pid_error]}] + sct pid_integ [expr {[sct pid_integ] + [sct pid_error] * [sct pid_ivalue]}] if { [sct pid_integ] > [sct pid_imax] } { sct pid_integ [sct pid_imax] } if { [sct pid_integ] < -[sct pid_imax] } { sct pid_integ -[sct pid_imax] } - set i_value [expr {[sct pid_ivalue] * [sct pid_integ]}] + set i_value [sct pid_integ] set pid [expr {${p_value} + ${i_value} + ${d_value}}] # pid_humidity hook code starts + if { ![hval ${tc_root}/auto] } { + set pid 0.0 + sct pid_integ 0.0 + } set sign 1 foreach node [list ${tc_root}/analog/sp1 ${tc_root}/analog/sp2] { set sign [expr -${sign}] @@ -757,6 +794,19 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_ set scobj_hpath /sics/${name} + hfactory ${scobj_hpath}/auto plain user int + hsetprop ${scobj_hpath}/auto control true + hsetprop ${scobj_hpath}/auto data true + hsetprop ${scobj_hpath}/auto mutable true + hsetprop ${scobj_hpath}/auto nxsave true + hsetprop ${scobj_hpath}/auto values 0,1 + hsetprop ${scobj_hpath}/auto oldval 0 + hset ${scobj_hpath}/auto 0 + hsetprop ${scobj_hpath}/auto klass "environment" + hsetprop ${scobj_hpath}/auto sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/auto type "part" + hsetprop ${scobj_hpath}/auto nxalias "${name}_auto" + hfactory ${scobj_hpath}/enabled plain user int hsetprop ${scobj_hpath}/enabled read ${ns}::getValue ${scobj_hpath} read_digital {?DOUT,2} hsetprop ${scobj_hpath}/enabled read_digital ${ns}::read_digital ${scobj_hpath} @@ -1021,15 +1071,17 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_ hsetprop ${scobj_hpath}/flow/sensor pid_deriv "0" hsetprop ${scobj_hpath}/flow/sensor pid_dvalue "0.0" hsetprop ${scobj_hpath}/flow/sensor pid_error "0" - hsetprop ${scobj_hpath}/flow/sensor pid_imax "30" + hsetprop ${scobj_hpath}/flow/sensor pid_imax "50" hsetprop ${scobj_hpath}/flow/sensor pid_integ "0" hsetprop ${scobj_hpath}/flow/sensor pid_ivalue "0.1" - hsetprop ${scobj_hpath}/flow/sensor pid_pvalue "0.2" + hsetprop ${scobj_hpath}/flow/sensor pid_pvalue "0.1" hsetprop ${scobj_hpath}/flow/sensor sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/flow/sensor type "part" hsetprop ${scobj_hpath}/flow/sensor nxalias "${name}_flow_sensor" hfactory ${scobj_hpath}/flow/setpoint plain user float + hsetprop ${scobj_hpath}/flow/setpoint read ${ns}::getTarget ${scobj_hpath} rdValue {@} + hsetprop ${scobj_hpath}/flow/setpoint rdValue ${ns}::rdValue ${scobj_hpath} hsetprop ${scobj_hpath}/flow/setpoint write ${ns}::write_flow ${scobj_hpath} noResponse {} hsetprop ${scobj_hpath}/flow/setpoint noResponse ${ns}::noResponse ${scobj_hpath} hsetprop ${scobj_hpath}/flow/setpoint check ${ns}::checkrange ${scobj_hpath} @@ -1056,6 +1108,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_ if {[string equal -nocase "${simulation_flag}" "false"]} { ${sct_controller} poll ${scobj_hpath}/flow/sensor 1 + ${sct_controller} poll ${scobj_hpath}/flow/setpoint 1 ${sct_controller} write ${scobj_hpath}/flow/setpoint } else { ::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs" @@ -1081,15 +1134,17 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_ hsetprop ${scobj_hpath}/humidity/sensor pid_deriv "0" hsetprop ${scobj_hpath}/humidity/sensor pid_dvalue "0.0" hsetprop ${scobj_hpath}/humidity/sensor pid_error "0" - hsetprop ${scobj_hpath}/humidity/sensor pid_imax "30" + hsetprop ${scobj_hpath}/humidity/sensor pid_imax "20" hsetprop ${scobj_hpath}/humidity/sensor pid_integ "0" hsetprop ${scobj_hpath}/humidity/sensor pid_ivalue "0.1" - hsetprop ${scobj_hpath}/humidity/sensor pid_pvalue "0.2" + hsetprop ${scobj_hpath}/humidity/sensor pid_pvalue "1.0" hsetprop ${scobj_hpath}/humidity/sensor sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/humidity/sensor type "part" hsetprop ${scobj_hpath}/humidity/sensor nxalias "${name}_humidity_sensor" hfactory ${scobj_hpath}/humidity/setpoint plain user float + hsetprop ${scobj_hpath}/humidity/setpoint read ${ns}::getTarget ${scobj_hpath} rdValue {@} + hsetprop ${scobj_hpath}/humidity/setpoint rdValue ${ns}::rdValue ${scobj_hpath} hsetprop ${scobj_hpath}/humidity/setpoint write ${ns}::write_humidity ${scobj_hpath} noResponse {} hsetprop ${scobj_hpath}/humidity/setpoint noResponse ${ns}::noResponse ${scobj_hpath} hsetprop ${scobj_hpath}/humidity/setpoint check ${ns}::chkrange_function ${scobj_hpath} @@ -1102,8 +1157,8 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_ hsetprop ${scobj_hpath}/humidity/setpoint data true hsetprop ${scobj_hpath}/humidity/setpoint mutable true hsetprop ${scobj_hpath}/humidity/setpoint nxsave true - hsetprop ${scobj_hpath}/humidity/setpoint lowerlimit 10 - hsetprop ${scobj_hpath}/humidity/setpoint upperlimit 90 + hsetprop ${scobj_hpath}/humidity/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/humidity/setpoint upperlimit 100 hsetprop ${scobj_hpath}/humidity/setpoint tolerance 1 hsetprop ${scobj_hpath}/humidity/setpoint permlink data_set "G[format "%02d" ${id}]SP02" hsetprop ${scobj_hpath}/humidity/setpoint @description "G[format "%02d" ${id}]SP02" @@ -1116,6 +1171,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_ if {[string equal -nocase "${simulation_flag}" "false"]} { ${sct_controller} poll ${scobj_hpath}/humidity/sensor 1 + ${sct_controller} poll ${scobj_hpath}/humidity/setpoint 1 ${sct_controller} write ${scobj_hpath}/humidity/setpoint } else { ::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs" diff --git a/site_ansto/instrument/util/gen_sct.py b/site_ansto/instrument/util/gen_sct.py index 3cddcfc8..a4130931 100755 --- a/site_ansto/instrument/util/gen_sct.py +++ b/site_ansto/instrument/util/gen_sct.py @@ -1217,14 +1217,14 @@ def put_pid_function(MyDriver, func): txt += [' set p_value [expr {[sct pid_pvalue] * [sct pid_error]}]'] txt += [' set d_value [expr {[sct pid_dvalue] * (${pv} - [sct oldval])}]'] txt += [' sct pid_deriv [sct pid_error]'] - txt += [' sct pid_integ [expr {[sct pid_integ] + [sct pid_error]}]'] + txt += [' sct pid_integ [expr {[sct pid_integ] + [sct pid_error] * [sct pid_ivalue]}]'] txt += [' if { [sct pid_integ] > [sct pid_imax] } {'] txt += [' sct pid_integ [sct pid_imax]'] txt += [' }'] txt += [' if { [sct pid_integ] < -[sct pid_imax] } {'] txt += [' sct pid_integ -[sct pid_imax]'] txt += [' }'] - txt += [' set i_value [expr {[sct pid_ivalue] * [sct pid_integ]}]'] + txt += [' set i_value [sct pid_integ]'] txt += [' set pid [expr {${p_value} + ${i_value} + ${d_value}}]'] if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0: txt += ['# %s hook code starts' % func] From 591c602da2d46d1a58406a9a0f7198453a6c692e Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 3 Oct 2014 10:17:46 +1000 Subject: [PATCH 02/54] Regen SCT drivers --- .../config/environment/sct_knauer_pump.tcl | 123 +++++++++++++++++- .../temperature/sct_lakeshore_m370.tcl | 111 +++++++++------- .../temperature/sct_pfeiffer_hg.tcl | 4 +- 3 files changed, 180 insertions(+), 58 deletions(-) diff --git a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl index d58d4bf4..c92eebee 100644 --- a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl +++ b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl @@ -92,7 +92,11 @@ proc ::scobj::knauer_pump::fetch_from_glp {tc_root nextState cmd_str} { set index ${cmd_str} set data [hgetpropval ${tc_root}/dummy/glp real_data] set dlist [split ${data} ","] - sct result [lindex ${dlist} ${index}] + if { [llength ${dlist}] > ${index} } { + sct result [lindex ${dlist} ${index}] + } else { + sct result "" + } set cmd "@@NOSEND@@" # fetch_from_glp hook code ends if { [hpropexists [sct] geterror] } { @@ -120,7 +124,11 @@ proc ::scobj::knauer_pump::fetch_from_status {tc_root nextState cmd_str} { set index ${cmd_str} set data [hgetpropval ${tc_root}/dummy/status real_data] set dlist [split ${data} ","] - sct result [lindex ${dlist} ${index}] + if { [llength ${dlist}] > ${index} } { + sct result [lindex ${dlist} ${index}] + } else { + sct result "" + } set cmd "@@NOSEND@@" # fetch_from_status hook code ends if { [hpropexists [sct] geterror] } { @@ -374,9 +382,12 @@ proc ::scobj::knauer_pump::read_glp {tc_root} { error "[sct geterror]" } # read_glp hook code starts - set dlist [split [lindex [split ${data} ":"] 1] ","] - sct real_data "[join [lrange ${dlist} 0 end] ,]" - set data "Hidden in real_data property" + if { [string equal -nocase -length 6 ${data} "ERROR:"] } { + } else { + set dlist [split [lindex [split ${data} ":"] 1] ","] + sct real_data "[join [lrange ${dlist} 0 end] ,]" + set data "Hidden in real_data property" + } # read_glp hook code ends if { [hpropexists [sct] geterror] } { debug_log ${tc_root} 9 "[sct] error: [sct geterror]" @@ -427,6 +438,77 @@ proc ::scobj::knauer_pump::read_status {tc_root} { handle_exception ${catch_status} ${catch_message} } +# function to parse the read of a parameter on a device +proc ::scobj::knauer_pump::remote_read {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "remote_read tc_root=${tc_root} sct=[sct] result=[sct result]" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set data [sct result] + set nextState "idle" + if {[string equal -nocase -length 7 ${data} "ASCERR:"]} { + # the protocol driver has reported an error + sct geterror "${data}" + error "[sct geterror]" + } +# remote_read hook code starts + if { [string equal -length 7 ${data} "REMOTE:"] } { + set data [lindex [split ${data} :] 1] + } else { + sct geterror "bad response" + error "[sct geterror]" + } +# remote_read hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::knauer_pump::remote_write {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "remote_write tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# remote_write hook code starts + if { ${par} == 0 } { + set cmd "LOCAL" + } else { + set cmd "REMOTE" + } +# remote_write hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "remote_write sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # function to write a parameter value on a device proc ::scobj::knauer_pump::setValue {tc_root nextState cmd_str} { set catch_status [ catch { @@ -549,6 +631,7 @@ proc ::scobj::knauer_pump::volume_checkpumping {tc_root nextState cmd_str} { set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" set nextState noResponse + sct driving 0 sct pumping 0 } } @@ -621,10 +704,10 @@ proc ::scobj::knauer_pump::volume_fetch {tc_root nextState cmd_str} { sct raw_volume ${pump_volume} if { [hpropexists [sct] base_volume] } { set pump_volume [expr {${pump_volume} - [sct base_volume]}] - } else { + } elseif { [hpropexists [sct] raw_volume] } { sct base_volume [sct raw_volume] } - sct result ${pump_volume} + sct result [format "%.2f" ${pump_volume}] set cmd "@@NOSEND@@" # volume_fetch hook code ends if { [hpropexists [sct] geterror] } { @@ -673,6 +756,13 @@ proc ::scobj::knauer_pump::volume_write {tc_root nextState cmd_str} { set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,3" sct pumping 1 + set data ${par} + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } # volume_write hook code ends if { [hpropexists [sct] geterror] } { debug_log ${tc_root} 9 "[sct] error: [sct geterror]" @@ -717,6 +807,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/dummy/glp mutable true hsetprop ${scobj_hpath}/dummy/glp nxsave false hsetprop ${scobj_hpath}/dummy/glp oldval UNKNOWN + hsetprop ${scobj_hpath}/dummy/glp real_data " " hsetprop ${scobj_hpath}/dummy/glp sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/dummy/glp type "part" hsetprop ${scobj_hpath}/dummy/glp nxalias "${name}_dummy_glp" @@ -1077,6 +1168,22 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/ratio_sp units "percent" hsetprop ${scobj_hpath}/pump/ratio_sp nxalias "${name}_pump_ratio_sp" + hfactory ${scobj_hpath}/pump/remote plain user int + hsetprop ${scobj_hpath}/pump/remote read ${ns}::getValue ${scobj_hpath} remote_read {REMOTE?} + hsetprop ${scobj_hpath}/pump/remote remote_read ${ns}::remote_read ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/remote write ${ns}::remote_write ${scobj_hpath} noResponse {} + hsetprop ${scobj_hpath}/pump/remote noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/remote check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/remote control true + hsetprop ${scobj_hpath}/pump/remote data true + hsetprop ${scobj_hpath}/pump/remote mutable true + hsetprop ${scobj_hpath}/pump/remote nxsave true + hsetprop ${scobj_hpath}/pump/remote oldval 0 + hsetprop ${scobj_hpath}/pump/remote klass "parameter" + hsetprop ${scobj_hpath}/pump/remote sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/remote type "part" + hsetprop ${scobj_hpath}/pump/remote nxalias "${name}_pump_remote" + hfactory ${scobj_hpath}/pump/state plain user text hsetprop ${scobj_hpath}/pump/state read ${ns}::state_fetch ${scobj_hpath} rdValue { } hsetprop ${scobj_hpath}/pump/state rdValue ${ns}::rdValue ${scobj_hpath} @@ -1145,12 +1252,14 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio if {[string equal -nocase "${simulation_flag}" "false"]} { ${sct_controller} poll ${scobj_hpath}/pump/flow_pv 1 ${sct_controller} poll ${scobj_hpath}/pump/ratio_pv 1 + ${sct_controller} poll ${scobj_hpath}/pump/remote 1 ${sct_controller} poll ${scobj_hpath}/pump/state 1 ${sct_controller} poll ${scobj_hpath}/pump/status 1 ${sct_controller} poll ${scobj_hpath}/pump/volume_pv 1 ${sct_controller} poll ${scobj_hpath}/pump/volume_sp 1 ${sct_controller} write ${scobj_hpath}/pump/flow_sp ${sct_controller} write ${scobj_hpath}/pump/ratio_sp + ${sct_controller} write ${scobj_hpath}/pump/remote ${sct_controller} write ${scobj_hpath}/pump/volume_sp } else { ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_m370.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_m370.tcl index c959e923..8e6e7de7 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_m370.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_m370.tcl @@ -27,18 +27,19 @@ proc ::scobj::lakeshore_m370::sics_log {debug_level debug_string} { } catch_message ] } -proc ::scobj::lakeshore_m370::mkDriver { sct_controller name id tol} { - ::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::mkDriver ${sct_controller} ${name} ${id} ${tol}" +proc ::scobj::lakeshore_m370::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id tol } { + ::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}" set ns "[namespace current]" set catch_status [ catch { MakeSICSObj ${name} SCT_OBJECT user none - sicslist setatt ${name} klass environment + sicslist setatt ${name} klass ${device_class} sicslist setatt ${name} long_name ${name} set scobj_hpath /sics/${name} - hsetprop ${scobj_hpath} klass environment + hsetprop ${scobj_hpath} klass ${device_class} + hsetprop ${scobj_hpath} data true hsetprop ${scobj_hpath} debug_threshold 5 # mkDriver hook code starts ::scobj::lakeshore_370::mk_sct_driver $sct_controller environment $name $tol @@ -51,31 +52,37 @@ proc ::scobj::lakeshore_m370::mkDriver { sct_controller name id tol} { handle_exception ${catch_status} ${catch_message} } +proc ::scobj::lakeshore_m370::add_driver {name device_class simulation_flag ip_address tcp_port id tol} { + set catch_status [ catch { + ::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} std ${ip_address}:${tcp_port} + } + } else { + ::scobj::lakeshore_m370::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for lakeshore_m370" + } + ::scobj::lakeshore_m370::sics_log 1 "::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}" + ::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + namespace eval ::scobj::lakeshore_m370 { namespace export debug_threshold namespace export debug_log namespace export sics_log namespace export mkDriver + namespace export add_driver } -proc add_lakeshore_m370 {name IP port id tol} { - set catch_status [ catch { - ::scobj::lakeshore_m370::sics_log 9 "add_lakeshore_m370 ${name} ${IP} ${port} ${tol}" - if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} { - if {[string equal -nocase "aqadapter" "${IP}"]} { - ::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} aqadapter ${port}" - makesctcontroller sct_${name} aqadapter ${port} - } else { - ::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} std ${IP}:${port}" - makesctcontroller sct_${name} std ${IP}:${port} - } - } else { - ::scobj::lakeshore_m370::sics_log 9 "[environment_simulation] => No sctcontroller for lakeshore_m370" - } - ::scobj::lakeshore_m370::sics_log 1 "::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${id} ${tol}" - ::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${id} ${tol} - } catch_message ] - handle_exception ${catch_status} ${catch_message} +proc add_lakeshore_m370 {name ip_address tcp_port id tol} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::lakeshore_m370::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${tol}" } clientput "file evaluation of sct_lakeshore_m370.tcl" @@ -84,42 +91,41 @@ clientput "file evaluation of sct_lakeshore_m370.tcl" proc ::scobj::lakeshore_m370::read_config {} { set catch_status [ catch { set ns "::scobj::lakeshore_m370" - dict for {k v} $::config_dict { - if { [dict exists $v "implementation"] } { - if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } { + dict for {k u} $::config_dict { + if { [dict exists $u "implementation"] } { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + set device_class "environment" + if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } { continue } - set enabled [string tolower [dict get $v "enabled"]] + set enabled [string tolower [dict get $u "enabled"]] if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } { continue } - set name [dict get $v name] - set implementation [dict get $v "implementation"] + if { [dict exists $u "simulation_group"] } { + set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]] + } + if { [dict exists $u "device_class"] } { + set device_class "[dict get $u "device_class"]" + } + set name [dict get $u name] + set implementation [dict get $u "implementation"] if { !([dict exists $::config_dict $implementation]) } { continue } - set arg_list [list] - foreach arg {id} { - if {[dict exists $v $arg]} { - lappend arg_list "[dict get $v $arg]" - } else { - ${ns}::sics_log 9 "Missing configuration value $arg" - error "Missing configuration value $arg" - } - } set v [dict get $::config_dict $implementation] if { !([dict exists $v "driver"]) } { continue } if { [string equal -nocase [dict get $v "driver"] "lakeshore_m370"] } { - if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } { + if { ![string equal -nocase "${simulation_flag}" "false"] } { set asyncqueue "null" - ${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue" + ${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue" } elseif { [dict exists $v "asyncqueue"] } { set asyncqueue [dict get $v "asyncqueue"] if { [string equal -nocase ${asyncqueue} "sct"] } { - set IP [dict get $v ip] - set PORT [dict get $v port] + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] } } else { if { [dict exists $v "asyncprotocol"] } { @@ -133,25 +139,32 @@ proc ::scobj::lakeshore_m370::read_config {} { } } set asyncqueue ${name}_queue - set IP [dict get $v ip] - set PORT [dict get $v port] - MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT} + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port} if { [dict exists $v "timeout"] } { ${asyncqueue} timeout "[dict get $v "timeout"]" } } - foreach arg {tol} { - if {[dict exists $v $arg]} { + set arg_list [list] + set missing_list [list] + foreach arg {id tol} { + if {[dict exists $u $arg]} { + lappend arg_list "[dict get $u $arg]" + } elseif {[dict exists $v $arg]} { lappend arg_list "[dict get $v $arg]" } else { ${ns}::sics_log 9 "Missing configuration value $arg" - error "Missing configuration value $arg" + lappend missing_list $arg } } + if { [llength $missing_list] > 0 } { + error "$name is missing configuration values $missing_list" + } if { [string equal -nocase ${asyncqueue} "sct"] } { - add_lakeshore_m370 ${name} ${IP} ${PORT} {*}$arg_list + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list } else { - add_lakeshore_m370 ${name} "aqadapter" ${asyncqueue} {*}$arg_list + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list } } } diff --git a/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl b/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl index a9e1ebc6..1176f967 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl @@ -201,14 +201,14 @@ proc ::scobj::pfeiffer_hg::pid_pressure {tc_root sp pv} { set p_value [expr {[sct pid_pvalue] * [sct pid_error]}] set d_value [expr {[sct pid_dvalue] * (${pv} - [sct oldval])}] sct pid_deriv [sct pid_error] - sct pid_integ [expr {[sct pid_integ] + [sct pid_error]}] + sct pid_integ [expr {[sct pid_integ] + [sct pid_error] * [sct pid_ivalue]}] if { [sct pid_integ] > [sct pid_imax] } { sct pid_integ [sct pid_imax] } if { [sct pid_integ] < -[sct pid_imax] } { sct pid_integ -[sct pid_imax] } - set i_value [expr {[sct pid_ivalue] * [sct pid_integ]}] + set i_value [sct pid_integ] set pid [expr {${p_value} + ${i_value} + ${d_value}}] # pid_pressure hook code starts if { [hpropexists [sct] pid_control] } { From a51ce71999af5c028fa71cbb02966360b03b5915 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Tue, 7 Oct 2014 15:03:28 +1100 Subject: [PATCH 03/54] Major revision of the Knauer pump driver --- .../config/environment/knauer_pump.sct | 112 +++++- .../config/environment/sct_knauer_pump.tcl | 328 ++++++++++++------ 2 files changed, 321 insertions(+), 119 deletions(-) diff --git a/site_ansto/instrument/config/environment/knauer_pump.sct b/site_ansto/instrument/config/environment/knauer_pump.sct index 7d78e18a..8c05b606 100644 --- a/site_ansto/instrument/config/environment/knauer_pump.sct +++ b/site_ansto/instrument/config/environment/knauer_pump.sct @@ -1,6 +1,6 @@ # # Template driver for the Knauer BlueShadow Pump 40P -# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent +# vim: ft=tcl ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent # driver knauer_pump = { debug_threshold = 0; @@ -19,6 +19,7 @@ driver knauer_pump = { type = int; readable = 1; read_command = 'REMOTE?'; read_function = remote_read; writeable = 1; write_function = remote_write; + allowed = '0,1'; } var state = { type = text; @@ -40,13 +41,28 @@ driver knauer_pump = { #checkrange_function = volume_reject; property 'units' = 'mL'; } + var pump_sp = { + type = float; + writeable = 1; + write_command = ' '; + write_function = pump_write; + driveable = pump/volume_pv; + checkstatus_function = pump_checkstatus; + halt_function = pump_halt; + lowerlimit = 0; upperlimit = 100; tolerance = 0.01; + readable = 1; + read_command = ' '; + fetch_function = pump_fetch; + property 'units' = 'mL'; + property this_state = 0; + } var volume_sp = { type = float; writeable = 1; write_command = ' '; write_function = volume_write; - driveable = pump/volume_pv - checkstatus_function = volume_checkstatus; + driveable = pump/volume_pv; + checkstatus_function = volume_checkstatus; halt_function = volume_halt; lowerlimit = 0; upperlimit = 100; tolerance = 0.01; readable = 1; @@ -61,6 +77,7 @@ driver knauer_pump = { } var ratio_sp = { type = text; + value = '25/25/25/25'; writeable = 1; write_command = ' '; write_function = ratios_write; checkrange_function = ratios_check; property 'units' = 'percent'; } @@ -71,6 +88,7 @@ driver knauer_pump = { } var flow_sp = { type = float; + value = 1.0; writeable = 1; write_command = ' '; write_function = flow_write; lowerlimit = 0; upperlimit = 10; property 'units' = 'mL/min'; @@ -78,7 +96,7 @@ driver knauer_pump = { } group stuff = { - readable = 60; + readable = 600; type = text; data = false; control = false; nxsave = false; var an_out = { read_command = 'AN_OUT?'; } @@ -106,15 +124,6 @@ driver knauer_pump = { var 'units' = { read_command = 'UNITS?'; } var valves = { read_command = 'VALVES?'; } } - group prog = { - readable = 30; - type = text; - var line_01 = { read_command = "TT_GET:1,1"; } - var line_02 = { read_command = "TT_GET:1,2"; } - var line_03 = { read_command = "TT_GET:1,3"; } - var line_04 = { read_command = "TT_GET:1,4"; } - var line_05 = { read_command = "TT_GET:1,5"; } - } group glp = { type = text; readable = 1; @@ -303,6 +312,7 @@ driver knauer_pump = { set cmd "REMOTE" } %%} + code volume_fetch = {%% set data [hgetpropval ${tc_root}/dummy/glp real_data] set dlist [split ${data} ","] @@ -322,6 +332,81 @@ driver knauer_pump = { sct result [format "%.2f" ${pump_volume}] set cmd "@@NOSEND@@" %%} + +########## + code pump_write = {%% + hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] + hset ${tc_root}/[sct driveable] 0.0 + set cmd "REMOTE" + sct this_state 1 + sct pumping 1 + set data ${par} + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + %%} + + code pump_fetch = {%% + if { [sct this_state] > 0 } { + set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow_sp])}] + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] + set time_1 [expr {${time_tgt} - 500}] + set time_2 [expr {${time_tgt} + 500}] + set nextState noResponse + if { [sct this_state] == 1 } { + set cmd "TT_LOAD:1" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 2 } { + set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 3 } { + set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 4 } { + set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 5 } { + set cmd "START:1,0" + sct this_state 0 + } else { + sct this_state 0 + set cmd "@@NOSEND@@" + set nextState idle + } + } else { + set cmd "@@NOSEND@@" + set nextState idle + if { [hpropexists [sct] pumping] && [sct pumping] } { + if { [hpropexists [sct] driving] && [sct driving] } { + pump_checkstatus "${tc_root}" + } + set new_value [hval ${tc_root}/pump/status] + set old_value [sct oldval] + if {${new_value} != ${old_value}} { + sct oldval ${new_value} + if {${old_value} == "PUMPING" && ${new_value} == "IDLE"} { + set cmd "STOP" + set nextState noResponse + sct result "" + sct driving 0 + sct pumping 0 + } + } + } + } + %%} + + code pump_halt = {%% + set flow_tgt 0 + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set cmd "STOP" + sct send ${cmd} + %%} + ########## code volume_write = {%% hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] hset ${tc_root}/[sct driveable] 0.0 @@ -352,6 +437,7 @@ driver knauer_pump = { set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" set nextState noResponse + sct result "" sct driving 0 sct pumping 0 } diff --git a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl index c92eebee..86627387 100644 --- a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl +++ b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl @@ -238,6 +238,169 @@ proc ::scobj::knauer_pump::noResponse {tc_root} { handle_exception ${catch_status} ${catch_message} } +# checkstatus function for driveable interface +proc ::scobj::knauer_pump::pump_checkstatus {tc_root} { + set catch_status [ catch { +# pump_checkstatus hook code goes here + if {[sct driving]} { + set sp "[sct target]" + set pv "[hval ${tc_root}/[sct driveable]]" + if { abs(${pv} - ${sp}) <= [sct tolerance] } { + if { [hpropexists [sct] settle_time] } { + if { [hpropexists [sct] settle_time_start] } { + if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} { + sct driving 0 + return "idle" + } + return "busy" + } else { + sct utime settle_time_start + return "busy" + } + } + sct driving 0 + return "idle" + } + if { [hpropexists [sct] settle_time_start] } { + hdelprop [sct] settle_time_start + } + return "busy" + } else { + return "idle" + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to request the read of a parameter on a device +proc ::scobj::knauer_pump::pump_fetch {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "pump_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# pump_fetch hook code starts + if { [sct this_state] > 0 } { + set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow_sp])}] + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] + set time_1 [expr {${time_tgt} - 500}] + set time_2 [expr {${time_tgt} + 500}] + set nextState noResponse + if { [sct this_state] == 1 } { + set cmd "TT_LOAD:1" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 2 } { + set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 3 } { + set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 4 } { + set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 5 } { + set cmd "START:1,0" + sct this_state 0 + } else { + sct this_state 0 + set cmd "@@NOSEND@@" + set nextState idle + } + } else { + set cmd "@@NOSEND@@" + set nextState idle + if { [hpropexists [sct] pumping] && [sct pumping] } { + if { [hpropexists [sct] driving] && [sct driving] } { + pump_checkstatus "${tc_root}" + } + set new_value [hval ${tc_root}/pump/status] + set old_value [sct oldval] + if {${new_value} != ${old_value}} { + sct oldval ${new_value} + if {${old_value} == "PUMPING" && ${new_value} == "IDLE"} { + set cmd "STOP" + set nextState noResponse + sct result "" + sct driving 0 + sct pumping 0 + } + } + } + } +# pump_fetch hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "pump_fetch sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# halt function for driveable interface +proc ::scobj::knauer_pump::pump_halt {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "pump_halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" + ### TODO hset [sct] [hval [sct]] +# pump_halt hook code starts + set flow_tgt 0 + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set cmd "STOP" + sct send ${cmd} +# pump_halt hook code ends + sct driving 0 + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::knauer_pump::pump_write {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "pump_write tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# pump_write hook code starts + hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] + hset ${tc_root}/[sct driveable] 0.0 + set cmd "REMOTE" + sct this_state 1 + sct pumping 1 + set data ${par} + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } +# pump_write hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "pump_write sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # check function for hset change proc ::scobj::knauer_pump::ratios_check {tc_root} { set catch_status [ catch { @@ -631,6 +794,7 @@ proc ::scobj::knauer_pump::volume_checkpumping {tc_root nextState cmd_str} { set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" set nextState noResponse + sct result "" sct driving 0 sct pumping 0 } @@ -1023,86 +1187,6 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } - hfactory ${scobj_hpath}/prog plain spy none - hsetprop ${scobj_hpath}/prog data "true" - hsetprop ${scobj_hpath}/prog klass "@none" - hsetprop ${scobj_hpath}/prog type "part" - - hfactory ${scobj_hpath}/prog/line_01 plain user text - hsetprop ${scobj_hpath}/prog/line_01 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,1} - hsetprop ${scobj_hpath}/prog/line_01 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/prog/line_01 control true - hsetprop ${scobj_hpath}/prog/line_01 data true - hsetprop ${scobj_hpath}/prog/line_01 mutable true - hsetprop ${scobj_hpath}/prog/line_01 nxsave true - hsetprop ${scobj_hpath}/prog/line_01 oldval UNKNOWN - hsetprop ${scobj_hpath}/prog/line_01 klass "parameter" - hsetprop ${scobj_hpath}/prog/line_01 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/prog/line_01 type "part" - hsetprop ${scobj_hpath}/prog/line_01 nxalias "${name}_prog_line_01" - - hfactory ${scobj_hpath}/prog/line_02 plain user text - hsetprop ${scobj_hpath}/prog/line_02 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,2} - hsetprop ${scobj_hpath}/prog/line_02 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/prog/line_02 control true - hsetprop ${scobj_hpath}/prog/line_02 data true - hsetprop ${scobj_hpath}/prog/line_02 mutable true - hsetprop ${scobj_hpath}/prog/line_02 nxsave true - hsetprop ${scobj_hpath}/prog/line_02 oldval UNKNOWN - hsetprop ${scobj_hpath}/prog/line_02 klass "parameter" - hsetprop ${scobj_hpath}/prog/line_02 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/prog/line_02 type "part" - hsetprop ${scobj_hpath}/prog/line_02 nxalias "${name}_prog_line_02" - - hfactory ${scobj_hpath}/prog/line_03 plain user text - hsetprop ${scobj_hpath}/prog/line_03 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,3} - hsetprop ${scobj_hpath}/prog/line_03 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/prog/line_03 control true - hsetprop ${scobj_hpath}/prog/line_03 data true - hsetprop ${scobj_hpath}/prog/line_03 mutable true - hsetprop ${scobj_hpath}/prog/line_03 nxsave true - hsetprop ${scobj_hpath}/prog/line_03 oldval UNKNOWN - hsetprop ${scobj_hpath}/prog/line_03 klass "parameter" - hsetprop ${scobj_hpath}/prog/line_03 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/prog/line_03 type "part" - hsetprop ${scobj_hpath}/prog/line_03 nxalias "${name}_prog_line_03" - - hfactory ${scobj_hpath}/prog/line_04 plain user text - hsetprop ${scobj_hpath}/prog/line_04 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,4} - hsetprop ${scobj_hpath}/prog/line_04 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/prog/line_04 control true - hsetprop ${scobj_hpath}/prog/line_04 data true - hsetprop ${scobj_hpath}/prog/line_04 mutable true - hsetprop ${scobj_hpath}/prog/line_04 nxsave true - hsetprop ${scobj_hpath}/prog/line_04 oldval UNKNOWN - hsetprop ${scobj_hpath}/prog/line_04 klass "parameter" - hsetprop ${scobj_hpath}/prog/line_04 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/prog/line_04 type "part" - hsetprop ${scobj_hpath}/prog/line_04 nxalias "${name}_prog_line_04" - - hfactory ${scobj_hpath}/prog/line_05 plain user text - hsetprop ${scobj_hpath}/prog/line_05 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,5} - hsetprop ${scobj_hpath}/prog/line_05 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/prog/line_05 control true - hsetprop ${scobj_hpath}/prog/line_05 data true - hsetprop ${scobj_hpath}/prog/line_05 mutable true - hsetprop ${scobj_hpath}/prog/line_05 nxsave true - hsetprop ${scobj_hpath}/prog/line_05 oldval UNKNOWN - hsetprop ${scobj_hpath}/prog/line_05 klass "parameter" - hsetprop ${scobj_hpath}/prog/line_05 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/prog/line_05 type "part" - hsetprop ${scobj_hpath}/prog/line_05 nxalias "${name}_prog_line_05" - - if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/prog/line_01 30 - ${sct_controller} poll ${scobj_hpath}/prog/line_02 30 - ${sct_controller} poll ${scobj_hpath}/prog/line_03 30 - ${sct_controller} poll ${scobj_hpath}/prog/line_04 30 - ${sct_controller} poll ${scobj_hpath}/prog/line_05 30 - } else { - ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" - } - hfactory ${scobj_hpath}/pump plain spy none hsetprop ${scobj_hpath}/pump data "true" hsetprop ${scobj_hpath}/pump klass "@none" @@ -1132,13 +1216,40 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/flow_sp nxsave true hsetprop ${scobj_hpath}/pump/flow_sp lowerlimit 0 hsetprop ${scobj_hpath}/pump/flow_sp upperlimit 10 - hsetprop ${scobj_hpath}/pump/flow_sp oldval 0.0 + hsetprop ${scobj_hpath}/pump/flow_sp oldval 1.0 + hset ${scobj_hpath}/pump/flow_sp 1.0 hsetprop ${scobj_hpath}/pump/flow_sp klass "parameter" hsetprop ${scobj_hpath}/pump/flow_sp sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/pump/flow_sp type "part" hsetprop ${scobj_hpath}/pump/flow_sp units "mL/min" hsetprop ${scobj_hpath}/pump/flow_sp nxalias "${name}_pump_flow_sp" + hfactory ${scobj_hpath}/pump/pump_sp plain user float + hsetprop ${scobj_hpath}/pump/pump_sp read ${ns}::pump_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/pump_sp rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/pump_sp write ${ns}::pump_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/pump_sp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/pump_sp check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/pump_sp driving 0 + hsetprop ${scobj_hpath}/pump/pump_sp checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/pump_sp checkstatus ${ns}::pump_checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/pump_sp halt ${ns}::pump_halt ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/pump_sp driveable pump/volume_pv + hsetprop ${scobj_hpath}/pump/pump_sp control true + hsetprop ${scobj_hpath}/pump/pump_sp data true + hsetprop ${scobj_hpath}/pump/pump_sp mutable true + hsetprop ${scobj_hpath}/pump/pump_sp nxsave true + hsetprop ${scobj_hpath}/pump/pump_sp lowerlimit 0 + hsetprop ${scobj_hpath}/pump/pump_sp upperlimit 100 + hsetprop ${scobj_hpath}/pump/pump_sp tolerance 0.01 + hsetprop ${scobj_hpath}/pump/pump_sp oldval 0.0 + hsetprop ${scobj_hpath}/pump/pump_sp klass "parameter" + hsetprop ${scobj_hpath}/pump/pump_sp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/pump_sp this_state "0" + hsetprop ${scobj_hpath}/pump/pump_sp type "drivable" + hsetprop ${scobj_hpath}/pump/pump_sp units "mL" + hsetprop ${scobj_hpath}/pump/pump_sp nxalias "${name}_pump_pump_sp" + hfactory ${scobj_hpath}/pump/ratio_pv plain user text hsetprop ${scobj_hpath}/pump/ratio_pv read ${ns}::ratios_fetch ${scobj_hpath} rdValue { } hsetprop ${scobj_hpath}/pump/ratio_pv rdValue ${ns}::rdValue ${scobj_hpath} @@ -1161,7 +1272,8 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/ratio_sp data true hsetprop ${scobj_hpath}/pump/ratio_sp mutable true hsetprop ${scobj_hpath}/pump/ratio_sp nxsave true - hsetprop ${scobj_hpath}/pump/ratio_sp oldval UNKNOWN + hsetprop ${scobj_hpath}/pump/ratio_sp oldval 25/25/25/25 + hset ${scobj_hpath}/pump/ratio_sp 25/25/25/25 hsetprop ${scobj_hpath}/pump/ratio_sp klass "parameter" hsetprop ${scobj_hpath}/pump/ratio_sp sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/pump/ratio_sp type "part" @@ -1178,6 +1290,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/remote data true hsetprop ${scobj_hpath}/pump/remote mutable true hsetprop ${scobj_hpath}/pump/remote nxsave true + hsetprop ${scobj_hpath}/pump/remote values 0,1 hsetprop ${scobj_hpath}/pump/remote oldval 0 hsetprop ${scobj_hpath}/pump/remote klass "parameter" hsetprop ${scobj_hpath}/pump/remote sdsinfo "::nexus::scobj::sdsinfo" @@ -1251,6 +1364,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio if {[string equal -nocase "${simulation_flag}" "false"]} { ${sct_controller} poll ${scobj_hpath}/pump/flow_pv 1 + ${sct_controller} poll ${scobj_hpath}/pump/pump_sp 1 ${sct_controller} poll ${scobj_hpath}/pump/ratio_pv 1 ${sct_controller} poll ${scobj_hpath}/pump/remote 1 ${sct_controller} poll ${scobj_hpath}/pump/state 1 @@ -1258,6 +1372,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio ${sct_controller} poll ${scobj_hpath}/pump/volume_pv 1 ${sct_controller} poll ${scobj_hpath}/pump/volume_sp 1 ${sct_controller} write ${scobj_hpath}/pump/flow_sp + ${sct_controller} write ${scobj_hpath}/pump/pump_sp ${sct_controller} write ${scobj_hpath}/pump/ratio_sp ${sct_controller} write ${scobj_hpath}/pump/remote ${sct_controller} write ${scobj_hpath}/pump/volume_sp @@ -1835,30 +1950,30 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/stuff/valves nxalias "${name}_stuff_valves" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/stuff/an_out 60 - ${sct_controller} poll ${scobj_hpath}/stuff/boardinfo 60 - ${sct_controller} poll ${scobj_hpath}/stuff/config 60 - ${sct_controller} poll ${scobj_hpath}/stuff/cprofinfo 60 - ${sct_controller} poll ${scobj_hpath}/stuff/dout 60 - ${sct_controller} poll ${scobj_hpath}/stuff/error 60 - ${sct_controller} poll ${scobj_hpath}/stuff/errors 60 - ${sct_controller} poll ${scobj_hpath}/stuff/flushpmp 60 - ${sct_controller} poll ${scobj_hpath}/stuff/head 60 - ${sct_controller} poll ${scobj_hpath}/stuff/head_par 60 - ${sct_controller} poll ${scobj_hpath}/stuff/identify 60 - ${sct_controller} poll ${scobj_hpath}/stuff/lpg 60 - ${sct_controller} poll ${scobj_hpath}/stuff/oem 60 - ${sct_controller} poll ${scobj_hpath}/stuff/opt 60 - ${sct_controller} poll ${scobj_hpath}/stuff/plim 60 - ${sct_controller} poll ${scobj_hpath}/stuff/pressure 60 - ${sct_controller} poll ${scobj_hpath}/stuff/prfastacq 60 - ${sct_controller} poll ${scobj_hpath}/stuff/purge 60 - ${sct_controller} poll ${scobj_hpath}/stuff/remote 60 - ${sct_controller} poll ${scobj_hpath}/stuff/rfid 60 - ${sct_controller} poll ${scobj_hpath}/stuff/service 60 - ${sct_controller} poll ${scobj_hpath}/stuff/sysinfo 60 - ${sct_controller} poll ${scobj_hpath}/stuff/units 60 - ${sct_controller} poll ${scobj_hpath}/stuff/valves 60 + ${sct_controller} poll ${scobj_hpath}/stuff/an_out 600 + ${sct_controller} poll ${scobj_hpath}/stuff/boardinfo 600 + ${sct_controller} poll ${scobj_hpath}/stuff/config 600 + ${sct_controller} poll ${scobj_hpath}/stuff/cprofinfo 600 + ${sct_controller} poll ${scobj_hpath}/stuff/dout 600 + ${sct_controller} poll ${scobj_hpath}/stuff/error 600 + ${sct_controller} poll ${scobj_hpath}/stuff/errors 600 + ${sct_controller} poll ${scobj_hpath}/stuff/flushpmp 600 + ${sct_controller} poll ${scobj_hpath}/stuff/head 600 + ${sct_controller} poll ${scobj_hpath}/stuff/head_par 600 + ${sct_controller} poll ${scobj_hpath}/stuff/identify 600 + ${sct_controller} poll ${scobj_hpath}/stuff/lpg 600 + ${sct_controller} poll ${scobj_hpath}/stuff/oem 600 + ${sct_controller} poll ${scobj_hpath}/stuff/opt 600 + ${sct_controller} poll ${scobj_hpath}/stuff/plim 600 + ${sct_controller} poll ${scobj_hpath}/stuff/pressure 600 + ${sct_controller} poll ${scobj_hpath}/stuff/prfastacq 600 + ${sct_controller} poll ${scobj_hpath}/stuff/purge 600 + ${sct_controller} poll ${scobj_hpath}/stuff/remote 600 + ${sct_controller} poll ${scobj_hpath}/stuff/rfid 600 + ${sct_controller} poll ${scobj_hpath}/stuff/service 600 + ${sct_controller} poll ${scobj_hpath}/stuff/sysinfo 600 + ${sct_controller} poll ${scobj_hpath}/stuff/units 600 + ${sct_controller} poll ${scobj_hpath}/stuff/valves 600 } else { ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } @@ -1866,6 +1981,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath} data true hsetprop ${scobj_hpath} debug_threshold 0 if {[string equal -nocase "${simulation_flag}" "false"]} { + ansto_makesctdrive ${name}_pump_pump_sp ${scobj_hpath}/pump/pump_sp ${scobj_hpath}/pump/volume_pv ${sct_controller} ansto_makesctdrive ${name}_pump_volume_sp ${scobj_hpath}/pump/volume_sp ${scobj_hpath}/pump/volume_pv ${sct_controller} } # mkDriver hook code goes here From 5ba5af5db80dcd2bcb2ea6be2fd19af3b824086f Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 3 Oct 2014 14:59:56 +1000 Subject: [PATCH 04/54] Reworking the Knauer --- .../config/environment/knauer_pump.sct | 196 +- .../config/environment/sct_knauer_pump.tcl | 1972 ++++++++--------- 2 files changed, 1036 insertions(+), 1132 deletions(-) diff --git a/site_ansto/instrument/config/environment/knauer_pump.sct b/site_ansto/instrument/config/environment/knauer_pump.sct index 8c05b606..fbe377bd 100644 --- a/site_ansto/instrument/config/environment/knauer_pump.sct +++ b/site_ansto/instrument/config/environment/knauer_pump.sct @@ -10,7 +10,7 @@ driver knauer_pump = { # group dummy = { type = text; readable = 1; data = false; control = false; nxsave = false; - var status = { read_command = 'STATUS?'; read_function = read_status; } + var status = { read_command = 'STATUS?'; read_function = read_status; property real_data = ' '; } var glp = { read_command = 'GLP?'; read_function = read_glp; property real_data = ' '; } } @@ -33,69 +33,61 @@ driver knauer_pump = { read_command = ' '; fetch_function = status_fetch; } - var volume_pv = { - type = float; - readable = 1; - read_command = ' '; - fetch_function = volume_fetch; + group volume = { + var pval = { + type = float; + readable = 1; + read_command = ' '; + fetch_function = volume_fetch; #checkrange_function = volume_reject; - property 'units' = 'mL'; + property 'units' = 'mL'; + } + var setp = { + type = float; + writeable = 1; + write_command = ' '; + write_function = pump_write; + driveable = pump/volume/pval; + checkstatus_function = pump_checkstatus; + halt_function = pump_halt; + lowerlimit = 0; upperlimit = 100; tolerance = 0.01; + readable = 1; + read_command = ' '; + fetch_function = pump_fetch; + property 'units' = 'mL'; + property this_state = 0; + } } - var pump_sp = { - type = float; - writeable = 1; - write_command = ' '; - write_function = pump_write; - driveable = pump/volume_pv; - checkstatus_function = pump_checkstatus; - halt_function = pump_halt; - lowerlimit = 0; upperlimit = 100; tolerance = 0.01; - readable = 1; - read_command = ' '; - fetch_function = pump_fetch; - property 'units' = 'mL'; - property this_state = 0; + group ratio = { + var pval = { + type = text; + readable = 1; read_command = ' '; fetch_function = ratio_fetch; + property 'units' = 'percent'; + } + var setp = { + type = text; + value = '25/25/25/25'; + writeable = 1; write_command = ' '; write_function = ratio_write; checkrange_function = ratio_check; + property 'units' = 'percent'; + } } - var volume_sp = { - type = float; - writeable = 1; - write_command = ' '; - write_function = volume_write; - driveable = pump/volume_pv; - checkstatus_function = volume_checkstatus; - halt_function = volume_halt; - lowerlimit = 0; upperlimit = 100; tolerance = 0.01; - readable = 1; - read_command = ' '; - fetch_function = volume_checkpumping; - property 'units' = 'mL'; - } - var ratio_pv = { - type = text; - readable = 1; read_command = ' '; fetch_function = ratios_fetch; - property 'units' = 'percent'; - } - var ratio_sp = { - type = text; - value = '25/25/25/25'; - writeable = 1; write_command = ' '; write_function = ratios_write; checkrange_function = ratios_check; - property 'units' = 'percent'; - } - var flow_pv = { - type = float; - readable = 1; read_command = ' '; fetch_function = flow_fetch; - property 'units' = 'mL/min'; - } - var flow_sp = { - type = float; - value = 1.0; - writeable = 1; write_command = ' '; write_function = flow_write; - lowerlimit = 0; upperlimit = 10; - property 'units' = 'mL/min'; + group flow = { + var pval = { + type = float; + readable = 1; read_command = ' '; fetch_function = flow_fetch; + property 'units' = 'mL/min'; + } + var setp = { + type = float; + value = 1.0; + writeable = 1; write_command = ' '; write_function = flow_write; + lowerlimit = 0; upperlimit = 10; + property 'units' = 'mL/min'; + } } } - group stuff = { + group grp_stuff = { readable = 600; type = text; data = false; control = false; nxsave = false; @@ -124,7 +116,7 @@ driver knauer_pump = { var 'units' = { read_command = 'UNITS?'; } var valves = { read_command = 'VALVES?'; } } - group glp = { + group grp_glp = { type = text; readable = 1; fetch_function = fetch_from_glp; @@ -142,7 +134,7 @@ driver knauer_pump = { var pump_pwrhi = { read_command = '12'; } var pump_pwrlo = { read_command = '13'; } } - group status = { + group grp_status = { type = text; readable = 1; fetch_function = fetch_from_status; @@ -167,6 +159,24 @@ driver knauer_pump = { var error_in = { read_command = '19'; } } + # + # Ensure the pump starts up in REMOTE mode + # + code mkDriver = {%% + hset ${scobj_hpath}/pump/remote 1 + %%} + # + # These functions handle the real_data returned by the pump for the GLP? command + # + code read_glp = {%% + if { [string equal -nocase -length 6 ${data} "ERROR:"] } { + } else { + set dlist [split [lindex [split ${data} ":"] 1] ","] + sct real_data "[join [lrange ${dlist} 0 end] ,]" + set data "Hidden in real_data property" + } + %%} + code fetch_from_glp = {%% set index ${cmd_str} set data [hgetpropval ${tc_root}/dummy/glp real_data] @@ -179,6 +189,15 @@ driver knauer_pump = { set cmd "@@NOSEND@@" %%} + # + # These functions handle the real_data returned by the pump for the STATUS? command + # + code read_status = {%% + set dlist [split [lindex [split ${data} ":"] 1] ","] + sct real_data "[join [lrange ${dlist} 0 end] ,]" + set data "Hidden in real_data property" + %%} + code fetch_from_status = {%% set index ${cmd_str} set data [hgetpropval ${tc_root}/dummy/status real_data] @@ -191,19 +210,9 @@ driver knauer_pump = { set cmd "@@NOSEND@@" %%} - code read_glp = {%% - if { [string equal -nocase -length 6 ${data} "ERROR:"] } { - } else { - set dlist [split [lindex [split ${data} ":"] 1] ","] - sct real_data "[join [lrange ${dlist} 0 end] ,]" - set data "Hidden in real_data property" - } - %%} - code read_status = {%% - set dlist [split [lindex [split ${data} ":"] 1] ","] - sct real_data "[join [lrange ${dlist} 0 end] ,]" - set data "Hidden in real_data property" - %%} + # + # Decode the status from the real_data to PUMPING if it is pumping else IDLE + # code status_fetch = {%% set index 1 set data [hgetpropval ${tc_root}/dummy/status real_data] @@ -216,11 +225,19 @@ driver knauer_pump = { sct result "IDLE" } %%} + + # + # Decode the state from the real_data to one of the documented strings + # code state_fetch = {%% set index 1 set data [hgetpropval ${tc_root}/dummy/status real_data] set dlist [split ${data} ","] - set state_code [lindex ${dlist} ${index}] + if { [llength ${dlist}] > ${index} } { + set state_code [lindex ${dlist} ${index}] + } else { + set state_code "0" + } set cmd "@@NOSEND@@" if { ${state_code} < 0 || ${state_code} > 9 } { sct geterror "Invalid device_state ${state_code}" @@ -239,16 +256,17 @@ driver knauer_pump = { sct result [lindex ${slist} ${state_code}] %%} - code halt = {%% - set rlist [hval ${tc_root}/pump/ratio_sp] - set ratio_tgt [join [split ${rlist} /] ,] - set cmd "RAMP:0,0,${ratio_tgt},0,0,0,0,0,0,0,0,2" - %%} - + # + # code flow_fetch = {%% + set index 4 set data [hgetpropval ${tc_root}/dummy/status real_data] set dlist [split ${data} ","] - set flow_pv [lindex ${dlist} 4] + if { [llength ${dlist}] > ${index} } { + set flow_pv [lindex ${dlist} 4] + } else { + set flow_pv 0.0 + } sct result [expr {0.001 * ${flow_pv}}] set cmd "@@NOSEND@@" %%} @@ -264,7 +282,9 @@ driver knauer_pump = { } %%} - code ratios_check = {%% + # + # + code ratio_check = {%% set rlist [split ${setpoint} /] if { [llength ${rlist}] != 4 } { sct geterror "${setpoint} has [llength ${rlist}] components, needs 4" @@ -277,14 +297,14 @@ driver knauer_pump = { } %%} - code ratios_fetch = {%% + code ratio_fetch = {%% set data [hgetpropval ${tc_root}/dummy/status real_data] set dlist [split ${data} ","] set ratio_vals "[lindex ${dlist} 5]/[lindex ${dlist} 6]/[lindex ${dlist} 7]/[lindex ${dlist} 8]" sct result ${ratio_vals} set cmd "@@NOSEND@@" %%} - code ratios_write = {%% + code ratio_write = {%% set data [sct target] set cmd "@@NOSEND@@" set nextState idle @@ -296,6 +316,8 @@ driver knauer_pump = { } %%} + # + # code remote_read = {%% if { [string equal -length 7 ${data} "REMOTE:"] } { set data [lindex [split ${data} :] 1] @@ -313,6 +335,8 @@ driver knauer_pump = { } %%} + # + # code volume_fetch = {%% set data [hgetpropval ${tc_root}/dummy/glp real_data] set dlist [split ${data} ","] @@ -351,8 +375,8 @@ driver knauer_pump = { code pump_fetch = {%% if { [sct this_state] > 0 } { - set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow_sp])}] - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow/setp])}] + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio/setp] /] ,] set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] set time_1 [expr {${time_tgt} - 500}] set time_2 [expr {${time_tgt} + 500}] diff --git a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl index 86627387..a9c259a9 100644 --- a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl +++ b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl @@ -153,9 +153,14 @@ proc ::scobj::knauer_pump::flow_fetch {tc_root nextState cmd_str} { } set cmd "${cmd_str}" # flow_fetch hook code starts + set index 4 set data [hgetpropval ${tc_root}/dummy/status real_data] set dlist [split ${data} ","] - set flow_pv [lindex ${dlist} 4] + if { [llength ${dlist}] > ${index} } { + set flow_pv [lindex ${dlist} 4] + } else { + set flow_pv 0.0 + } sct result [expr {0.001 * ${flow_pv}}] set cmd "@@NOSEND@@" # flow_fetch hook code ends @@ -282,8 +287,8 @@ proc ::scobj::knauer_pump::pump_fetch {tc_root nextState cmd_str} { set cmd "${cmd_str}" # pump_fetch hook code starts if { [sct this_state] > 0 } { - set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow_sp])}] - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow/setp])}] + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio/setp] /] ,] set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] set time_1 [expr {${time_tgt} - 500}] set time_2 [expr {${time_tgt} + 500}] @@ -402,9 +407,9 @@ proc ::scobj::knauer_pump::pump_write {tc_root nextState cmd_str} { } # check function for hset change -proc ::scobj::knauer_pump::ratios_check {tc_root} { +proc ::scobj::knauer_pump::ratio_check {tc_root} { set catch_status [ catch { - debug_log ${tc_root} 1 "ratios_check tc_root=${tc_root} sct=[sct] target=[sct target]" + debug_log ${tc_root} 1 "ratio_check tc_root=${tc_root} sct=[sct] target=[sct target]" set setpoint [sct target] if { [hpropexists [sct] lowerlimit] } { set lolimit [sct lowerlimit] @@ -418,7 +423,7 @@ proc ::scobj::knauer_pump::ratios_check {tc_root} { # upperlimit not set, use target set hilimit [sct target] } -# ratios_check hook code starts +# ratio_check hook code starts set rlist [split ${setpoint} /] if { [llength ${rlist}] != 4 } { sct geterror "${setpoint} has [llength ${rlist}] components, needs 4" @@ -429,7 +434,7 @@ proc ::scobj::knauer_pump::ratios_check {tc_root} { sct geterror "sum is ${sum}, must be 100" error [sct geterror] } -# ratios_check hook code ends +# ratio_check hook code ends if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" } @@ -439,25 +444,25 @@ proc ::scobj::knauer_pump::ratios_check {tc_root} { } # function to request the read of a parameter on a device -proc ::scobj::knauer_pump::ratios_fetch {tc_root nextState cmd_str} { +proc ::scobj::knauer_pump::ratio_fetch {tc_root nextState cmd_str} { set catch_status [ catch { - debug_log ${tc_root} 1 "ratios_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + debug_log ${tc_root} 1 "ratio_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" if { [hpropexists [sct] geterror] } { hdelprop [sct] geterror } set cmd "${cmd_str}" -# ratios_fetch hook code starts +# ratio_fetch hook code starts set data [hgetpropval ${tc_root}/dummy/status real_data] set dlist [split ${data} ","] set ratio_vals "[lindex ${dlist} 5]/[lindex ${dlist} 6]/[lindex ${dlist} 7]/[lindex ${dlist} 8]" sct result ${ratio_vals} set cmd "@@NOSEND@@" -# ratios_fetch hook code ends +# ratio_fetch hook code ends if { [hpropexists [sct] geterror] } { debug_log ${tc_root} 9 "[sct] error: [sct geterror]" error "[sct geterror]" } - debug_log ${tc_root} 1 "ratios_fetch sct send ${cmd}" + debug_log ${tc_root} 1 "ratio_fetch sct send ${cmd}" if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { sct send "${cmd}" } @@ -467,15 +472,15 @@ proc ::scobj::knauer_pump::ratios_fetch {tc_root nextState cmd_str} { } # function to write a parameter value on a device -proc ::scobj::knauer_pump::ratios_write {tc_root nextState cmd_str} { +proc ::scobj::knauer_pump::ratio_write {tc_root nextState cmd_str} { set catch_status [ catch { - debug_log ${tc_root} 1 "ratios_write tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + debug_log ${tc_root} 1 "ratio_write tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" if { [hpropexists [sct] geterror] } { hdelprop [sct] geterror } set par [sct target] set cmd "${cmd_str}${par}" -# ratios_write hook code starts +# ratio_write hook code starts set data [sct target] set cmd "@@NOSEND@@" set nextState idle @@ -485,7 +490,7 @@ proc ::scobj::knauer_pump::ratios_write {tc_root nextState cmd_str} { sct update ${data} sct utime readtime } -# ratios_write hook code ends +# ratio_write hook code ends if { [hpropexists [sct] geterror] } { debug_log ${tc_root} 9 "[sct] error: [sct geterror]" error "[sct geterror]" @@ -495,7 +500,7 @@ proc ::scobj::knauer_pump::ratios_write {tc_root nextState cmd_str} { sct driving 1 } } - debug_log ${tc_root} 1 "ratios_write sct send ${cmd}" + debug_log ${tc_root} 1 "ratio_write sct send ${cmd}" if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { sct send "${cmd}" } @@ -708,7 +713,11 @@ proc ::scobj::knauer_pump::state_fetch {tc_root nextState cmd_str} { set index 1 set data [hgetpropval ${tc_root}/dummy/status real_data] set dlist [split ${data} ","] - set state_code [lindex ${dlist} ${index}] + if { [llength ${dlist}] > ${index} } { + set state_code [lindex ${dlist} ${index}] + } else { + set state_code "0" + } set cmd "@@NOSEND@@" if { ${state_code} < 0 || ${state_code} > 9 } { sct geterror "Invalid device_state ${state_code}" @@ -772,81 +781,6 @@ proc ::scobj::knauer_pump::status_fetch {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } -# function to request the read of a parameter on a device -proc ::scobj::knauer_pump::volume_checkpumping {tc_root nextState cmd_str} { - set catch_status [ catch { - debug_log ${tc_root} 1 "volume_checkpumping tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" - if { [hpropexists [sct] geterror] } { - hdelprop [sct] geterror - } - set cmd "${cmd_str}" -# volume_checkpumping hook code starts - set cmd "@@NOSEND@@" - set nextState idle - if { [hpropexists [sct] pumping] && [sct pumping] } { - if { [hpropexists [sct] driving] && [sct driving] } { - volume_checkstatus "${tc_root}" - } - set sp "[sct target]" - set pv "[hval ${tc_root}/[sct driveable]]" - if { (${sp} - ${pv}) <= [sct tolerance] } { - set flow_tgt 0 - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" - set nextState noResponse - sct result "" - sct driving 0 - sct pumping 0 - } - } -# volume_checkpumping hook code ends - if { [hpropexists [sct] geterror] } { - debug_log ${tc_root} 9 "[sct] error: [sct geterror]" - error "[sct geterror]" - } - debug_log ${tc_root} 1 "volume_checkpumping sct send ${cmd}" - if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { - sct send "${cmd}" - } - return ${nextState} - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - -# checkstatus function for driveable interface -proc ::scobj::knauer_pump::volume_checkstatus {tc_root} { - set catch_status [ catch { -# volume_checkstatus hook code goes here - if {[sct driving]} { - set sp "[sct target]" - set pv "[hval ${tc_root}/[sct driveable]]" - if { abs(${pv} - ${sp}) <= [sct tolerance] } { - if { [hpropexists [sct] settle_time] } { - if { [hpropexists [sct] settle_time_start] } { - if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} { - sct driving 0 - return "idle" - } - return "busy" - } else { - sct utime settle_time_start - return "busy" - } - } - sct driving 0 - return "idle" - } - if { [hpropexists [sct] settle_time_start] } { - hdelprop [sct] settle_time_start - } - return "busy" - } else { - return "idle" - } - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - # function to request the read of a parameter on a device proc ::scobj::knauer_pump::volume_fetch {tc_root nextState cmd_str} { set catch_status [ catch { @@ -887,65 +821,6 @@ proc ::scobj::knauer_pump::volume_fetch {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } -# halt function for driveable interface -proc ::scobj::knauer_pump::volume_halt {tc_root} { - set catch_status [ catch { - debug_log ${tc_root} 1 "volume_halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" - ### TODO hset [sct] [hval [sct]] -# volume_halt hook code starts - set flow_tgt 0 - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" - sct send ${cmd} -# volume_halt hook code ends - sct driving 0 - return "idle" - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - -# function to write a parameter value on a device -proc ::scobj::knauer_pump::volume_write {tc_root nextState cmd_str} { - set catch_status [ catch { - debug_log ${tc_root} 1 "volume_write tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" - if { [hpropexists [sct] geterror] } { - hdelprop [sct] geterror - } - set par [sct target] - set cmd "${cmd_str}${par}" -# volume_write hook code starts - hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] - hset ${tc_root}/[sct driveable] 0.0 - set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow_sp])}] - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,3" - sct pumping 1 - set data ${par} - if { ${data} != [sct oldval] } { - debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" - sct oldval ${data} - sct update ${data} - sct utime readtime - } -# volume_write hook code ends - if { [hpropexists [sct] geterror] } { - debug_log ${tc_root} 9 "[sct] error: [sct geterror]" - error "[sct geterror]" - } - if { [hpropexists [sct] driving] } { - if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { - sct driving 1 - } - } - debug_log ${tc_root} 1 "volume_write sct send ${cmd}" - if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { - sct send "${cmd}" - } - return ${nextState} - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } { ::scobj::knauer_pump::sics_log 9 "::scobj::knauer_pump::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" set ns "[namespace current]" @@ -984,6 +859,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/dummy/status mutable true hsetprop ${scobj_hpath}/dummy/status nxsave false hsetprop ${scobj_hpath}/dummy/status oldval UNKNOWN + hsetprop ${scobj_hpath}/dummy/status real_data " " hsetprop ${scobj_hpath}/dummy/status sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/dummy/status type "part" hsetprop ${scobj_hpath}/dummy/status nxalias "${name}_dummy_status" @@ -995,194 +871,792 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } - hfactory ${scobj_hpath}/glp plain spy none - hsetprop ${scobj_hpath}/glp data "true" - hsetprop ${scobj_hpath}/glp klass "@none" - hsetprop ${scobj_hpath}/glp type "part" + hfactory ${scobj_hpath}/grp_glp plain spy none + hsetprop ${scobj_hpath}/grp_glp data "true" + hsetprop ${scobj_hpath}/grp_glp klass "@none" + hsetprop ${scobj_hpath}/grp_glp type "part" - hfactory ${scobj_hpath}/glp/board_time plain user text - hsetprop ${scobj_hpath}/glp/board_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {0} - hsetprop ${scobj_hpath}/glp/board_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/board_time control true - hsetprop ${scobj_hpath}/glp/board_time data true - hsetprop ${scobj_hpath}/glp/board_time mutable true - hsetprop ${scobj_hpath}/glp/board_time nxsave true - hsetprop ${scobj_hpath}/glp/board_time oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/board_time klass "parameter" - hsetprop ${scobj_hpath}/glp/board_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/board_time type "part" - hsetprop ${scobj_hpath}/glp/board_time nxalias "${name}_glp_board_time" + hfactory ${scobj_hpath}/grp_glp/board_time plain user text + hsetprop ${scobj_hpath}/grp_glp/board_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {0} + hsetprop ${scobj_hpath}/grp_glp/board_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/board_time control true + hsetprop ${scobj_hpath}/grp_glp/board_time data true + hsetprop ${scobj_hpath}/grp_glp/board_time mutable true + hsetprop ${scobj_hpath}/grp_glp/board_time nxsave true + hsetprop ${scobj_hpath}/grp_glp/board_time oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/board_time klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/board_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/board_time type "part" + hsetprop ${scobj_hpath}/grp_glp/board_time nxalias "${name}_grp_glp_board_time" - hfactory ${scobj_hpath}/glp/head_count plain user text - hsetprop ${scobj_hpath}/glp/head_count read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {3} - hsetprop ${scobj_hpath}/glp/head_count rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/head_count control true - hsetprop ${scobj_hpath}/glp/head_count data true - hsetprop ${scobj_hpath}/glp/head_count mutable true - hsetprop ${scobj_hpath}/glp/head_count nxsave true - hsetprop ${scobj_hpath}/glp/head_count oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/head_count klass "parameter" - hsetprop ${scobj_hpath}/glp/head_count sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/head_count type "part" - hsetprop ${scobj_hpath}/glp/head_count nxalias "${name}_glp_head_count" + hfactory ${scobj_hpath}/grp_glp/head_count plain user text + hsetprop ${scobj_hpath}/grp_glp/head_count read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {3} + hsetprop ${scobj_hpath}/grp_glp/head_count rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/head_count control true + hsetprop ${scobj_hpath}/grp_glp/head_count data true + hsetprop ${scobj_hpath}/grp_glp/head_count mutable true + hsetprop ${scobj_hpath}/grp_glp/head_count nxsave true + hsetprop ${scobj_hpath}/grp_glp/head_count oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/head_count klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/head_count sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/head_count type "part" + hsetprop ${scobj_hpath}/grp_glp/head_count nxalias "${name}_grp_glp_head_count" - hfactory ${scobj_hpath}/glp/head_pwrhi plain user text - hsetprop ${scobj_hpath}/glp/head_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {7} - hsetprop ${scobj_hpath}/glp/head_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/head_pwrhi control true - hsetprop ${scobj_hpath}/glp/head_pwrhi data true - hsetprop ${scobj_hpath}/glp/head_pwrhi mutable true - hsetprop ${scobj_hpath}/glp/head_pwrhi nxsave true - hsetprop ${scobj_hpath}/glp/head_pwrhi oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/head_pwrhi klass "parameter" - hsetprop ${scobj_hpath}/glp/head_pwrhi sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/head_pwrhi type "part" - hsetprop ${scobj_hpath}/glp/head_pwrhi nxalias "${name}_glp_head_pwrhi" + hfactory ${scobj_hpath}/grp_glp/head_pwrhi plain user text + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {7} + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi control true + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi data true + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi mutable true + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi nxsave true + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi type "part" + hsetprop ${scobj_hpath}/grp_glp/head_pwrhi nxalias "${name}_grp_glp_head_pwrhi" - hfactory ${scobj_hpath}/glp/head_pwrlo plain user text - hsetprop ${scobj_hpath}/glp/head_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {8} - hsetprop ${scobj_hpath}/glp/head_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/head_pwrlo control true - hsetprop ${scobj_hpath}/glp/head_pwrlo data true - hsetprop ${scobj_hpath}/glp/head_pwrlo mutable true - hsetprop ${scobj_hpath}/glp/head_pwrlo nxsave true - hsetprop ${scobj_hpath}/glp/head_pwrlo oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/head_pwrlo klass "parameter" - hsetprop ${scobj_hpath}/glp/head_pwrlo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/head_pwrlo type "part" - hsetprop ${scobj_hpath}/glp/head_pwrlo nxalias "${name}_glp_head_pwrlo" + hfactory ${scobj_hpath}/grp_glp/head_pwrlo plain user text + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {8} + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo control true + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo data true + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo mutable true + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo nxsave true + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo type "part" + hsetprop ${scobj_hpath}/grp_glp/head_pwrlo nxalias "${name}_grp_glp_head_pwrlo" - hfactory ${scobj_hpath}/glp/head_time plain user text - hsetprop ${scobj_hpath}/glp/head_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {4} - hsetprop ${scobj_hpath}/glp/head_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/head_time control true - hsetprop ${scobj_hpath}/glp/head_time data true - hsetprop ${scobj_hpath}/glp/head_time mutable true - hsetprop ${scobj_hpath}/glp/head_time nxsave true - hsetprop ${scobj_hpath}/glp/head_time oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/head_time klass "parameter" - hsetprop ${scobj_hpath}/glp/head_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/head_time type "part" - hsetprop ${scobj_hpath}/glp/head_time nxalias "${name}_glp_head_time" + hfactory ${scobj_hpath}/grp_glp/head_time plain user text + hsetprop ${scobj_hpath}/grp_glp/head_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {4} + hsetprop ${scobj_hpath}/grp_glp/head_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/head_time control true + hsetprop ${scobj_hpath}/grp_glp/head_time data true + hsetprop ${scobj_hpath}/grp_glp/head_time mutable true + hsetprop ${scobj_hpath}/grp_glp/head_time nxsave true + hsetprop ${scobj_hpath}/grp_glp/head_time oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/head_time klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/head_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/head_time type "part" + hsetprop ${scobj_hpath}/grp_glp/head_time nxalias "${name}_grp_glp_head_time" - hfactory ${scobj_hpath}/glp/head_volm plain user text - hsetprop ${scobj_hpath}/glp/head_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {5} - hsetprop ${scobj_hpath}/glp/head_volm rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/head_volm control true - hsetprop ${scobj_hpath}/glp/head_volm data true - hsetprop ${scobj_hpath}/glp/head_volm mutable true - hsetprop ${scobj_hpath}/glp/head_volm nxsave true - hsetprop ${scobj_hpath}/glp/head_volm oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/head_volm klass "parameter" - hsetprop ${scobj_hpath}/glp/head_volm sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/head_volm type "part" - hsetprop ${scobj_hpath}/glp/head_volm nxalias "${name}_glp_head_volm" + hfactory ${scobj_hpath}/grp_glp/head_volm plain user text + hsetprop ${scobj_hpath}/grp_glp/head_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {5} + hsetprop ${scobj_hpath}/grp_glp/head_volm rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/head_volm control true + hsetprop ${scobj_hpath}/grp_glp/head_volm data true + hsetprop ${scobj_hpath}/grp_glp/head_volm mutable true + hsetprop ${scobj_hpath}/grp_glp/head_volm nxsave true + hsetprop ${scobj_hpath}/grp_glp/head_volm oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/head_volm klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/head_volm sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/head_volm type "part" + hsetprop ${scobj_hpath}/grp_glp/head_volm nxalias "${name}_grp_glp_head_volm" - hfactory ${scobj_hpath}/glp/head_voln plain user text - hsetprop ${scobj_hpath}/glp/head_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {6} - hsetprop ${scobj_hpath}/glp/head_voln rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/head_voln control true - hsetprop ${scobj_hpath}/glp/head_voln data true - hsetprop ${scobj_hpath}/glp/head_voln mutable true - hsetprop ${scobj_hpath}/glp/head_voln nxsave true - hsetprop ${scobj_hpath}/glp/head_voln oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/head_voln klass "parameter" - hsetprop ${scobj_hpath}/glp/head_voln sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/head_voln type "part" - hsetprop ${scobj_hpath}/glp/head_voln nxalias "${name}_glp_head_voln" + hfactory ${scobj_hpath}/grp_glp/head_voln plain user text + hsetprop ${scobj_hpath}/grp_glp/head_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {6} + hsetprop ${scobj_hpath}/grp_glp/head_voln rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/head_voln control true + hsetprop ${scobj_hpath}/grp_glp/head_voln data true + hsetprop ${scobj_hpath}/grp_glp/head_voln mutable true + hsetprop ${scobj_hpath}/grp_glp/head_voln nxsave true + hsetprop ${scobj_hpath}/grp_glp/head_voln oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/head_voln klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/head_voln sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/head_voln type "part" + hsetprop ${scobj_hpath}/grp_glp/head_voln nxalias "${name}_grp_glp_head_voln" - hfactory ${scobj_hpath}/glp/motor_time plain user text - hsetprop ${scobj_hpath}/glp/motor_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {1} - hsetprop ${scobj_hpath}/glp/motor_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/motor_time control true - hsetprop ${scobj_hpath}/glp/motor_time data true - hsetprop ${scobj_hpath}/glp/motor_time mutable true - hsetprop ${scobj_hpath}/glp/motor_time nxsave true - hsetprop ${scobj_hpath}/glp/motor_time oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/motor_time klass "parameter" - hsetprop ${scobj_hpath}/glp/motor_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/motor_time type "part" - hsetprop ${scobj_hpath}/glp/motor_time nxalias "${name}_glp_motor_time" + hfactory ${scobj_hpath}/grp_glp/motor_time plain user text + hsetprop ${scobj_hpath}/grp_glp/motor_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {1} + hsetprop ${scobj_hpath}/grp_glp/motor_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/motor_time control true + hsetprop ${scobj_hpath}/grp_glp/motor_time data true + hsetprop ${scobj_hpath}/grp_glp/motor_time mutable true + hsetprop ${scobj_hpath}/grp_glp/motor_time nxsave true + hsetprop ${scobj_hpath}/grp_glp/motor_time oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/motor_time klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/motor_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/motor_time type "part" + hsetprop ${scobj_hpath}/grp_glp/motor_time nxalias "${name}_grp_glp_motor_time" - hfactory ${scobj_hpath}/glp/pump_pwrhi plain user text - hsetprop ${scobj_hpath}/glp/pump_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {12} - hsetprop ${scobj_hpath}/glp/pump_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/pump_pwrhi control true - hsetprop ${scobj_hpath}/glp/pump_pwrhi data true - hsetprop ${scobj_hpath}/glp/pump_pwrhi mutable true - hsetprop ${scobj_hpath}/glp/pump_pwrhi nxsave true - hsetprop ${scobj_hpath}/glp/pump_pwrhi oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/pump_pwrhi klass "parameter" - hsetprop ${scobj_hpath}/glp/pump_pwrhi sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/pump_pwrhi type "part" - hsetprop ${scobj_hpath}/glp/pump_pwrhi nxalias "${name}_glp_pump_pwrhi" + hfactory ${scobj_hpath}/grp_glp/pump_pwrhi plain user text + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {12} + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi control true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi data true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi mutable true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi nxsave true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi type "part" + hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi nxalias "${name}_grp_glp_pump_pwrhi" - hfactory ${scobj_hpath}/glp/pump_pwrlo plain user text - hsetprop ${scobj_hpath}/glp/pump_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {13} - hsetprop ${scobj_hpath}/glp/pump_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/pump_pwrlo control true - hsetprop ${scobj_hpath}/glp/pump_pwrlo data true - hsetprop ${scobj_hpath}/glp/pump_pwrlo mutable true - hsetprop ${scobj_hpath}/glp/pump_pwrlo nxsave true - hsetprop ${scobj_hpath}/glp/pump_pwrlo oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/pump_pwrlo klass "parameter" - hsetprop ${scobj_hpath}/glp/pump_pwrlo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/pump_pwrlo type "part" - hsetprop ${scobj_hpath}/glp/pump_pwrlo nxalias "${name}_glp_pump_pwrlo" + hfactory ${scobj_hpath}/grp_glp/pump_pwrlo plain user text + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {13} + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo control true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo data true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo mutable true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo nxsave true + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo type "part" + hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo nxalias "${name}_grp_glp_pump_pwrlo" - hfactory ${scobj_hpath}/glp/pump_revs plain user text - hsetprop ${scobj_hpath}/glp/pump_revs read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {9} - hsetprop ${scobj_hpath}/glp/pump_revs rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/pump_revs control true - hsetprop ${scobj_hpath}/glp/pump_revs data true - hsetprop ${scobj_hpath}/glp/pump_revs mutable true - hsetprop ${scobj_hpath}/glp/pump_revs nxsave true - hsetprop ${scobj_hpath}/glp/pump_revs oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/pump_revs klass "parameter" - hsetprop ${scobj_hpath}/glp/pump_revs sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/pump_revs type "part" - hsetprop ${scobj_hpath}/glp/pump_revs nxalias "${name}_glp_pump_revs" + hfactory ${scobj_hpath}/grp_glp/pump_revs plain user text + hsetprop ${scobj_hpath}/grp_glp/pump_revs read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {9} + hsetprop ${scobj_hpath}/grp_glp/pump_revs rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/pump_revs control true + hsetprop ${scobj_hpath}/grp_glp/pump_revs data true + hsetprop ${scobj_hpath}/grp_glp/pump_revs mutable true + hsetprop ${scobj_hpath}/grp_glp/pump_revs nxsave true + hsetprop ${scobj_hpath}/grp_glp/pump_revs oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/pump_revs klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/pump_revs sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/pump_revs type "part" + hsetprop ${scobj_hpath}/grp_glp/pump_revs nxalias "${name}_grp_glp_pump_revs" - hfactory ${scobj_hpath}/glp/pump_volm plain user text - hsetprop ${scobj_hpath}/glp/pump_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {10} - hsetprop ${scobj_hpath}/glp/pump_volm rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/pump_volm control true - hsetprop ${scobj_hpath}/glp/pump_volm data true - hsetprop ${scobj_hpath}/glp/pump_volm mutable true - hsetprop ${scobj_hpath}/glp/pump_volm nxsave true - hsetprop ${scobj_hpath}/glp/pump_volm oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/pump_volm klass "parameter" - hsetprop ${scobj_hpath}/glp/pump_volm sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/pump_volm type "part" - hsetprop ${scobj_hpath}/glp/pump_volm nxalias "${name}_glp_pump_volm" + hfactory ${scobj_hpath}/grp_glp/pump_volm plain user text + hsetprop ${scobj_hpath}/grp_glp/pump_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {10} + hsetprop ${scobj_hpath}/grp_glp/pump_volm rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/pump_volm control true + hsetprop ${scobj_hpath}/grp_glp/pump_volm data true + hsetprop ${scobj_hpath}/grp_glp/pump_volm mutable true + hsetprop ${scobj_hpath}/grp_glp/pump_volm nxsave true + hsetprop ${scobj_hpath}/grp_glp/pump_volm oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/pump_volm klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/pump_volm sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/pump_volm type "part" + hsetprop ${scobj_hpath}/grp_glp/pump_volm nxalias "${name}_grp_glp_pump_volm" - hfactory ${scobj_hpath}/glp/pump_voln plain user text - hsetprop ${scobj_hpath}/glp/pump_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {11} - hsetprop ${scobj_hpath}/glp/pump_voln rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/glp/pump_voln control true - hsetprop ${scobj_hpath}/glp/pump_voln data true - hsetprop ${scobj_hpath}/glp/pump_voln mutable true - hsetprop ${scobj_hpath}/glp/pump_voln nxsave true - hsetprop ${scobj_hpath}/glp/pump_voln oldval UNKNOWN - hsetprop ${scobj_hpath}/glp/pump_voln klass "parameter" - hsetprop ${scobj_hpath}/glp/pump_voln sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/glp/pump_voln type "part" - hsetprop ${scobj_hpath}/glp/pump_voln nxalias "${name}_glp_pump_voln" + hfactory ${scobj_hpath}/grp_glp/pump_voln plain user text + hsetprop ${scobj_hpath}/grp_glp/pump_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {11} + hsetprop ${scobj_hpath}/grp_glp/pump_voln rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_glp/pump_voln control true + hsetprop ${scobj_hpath}/grp_glp/pump_voln data true + hsetprop ${scobj_hpath}/grp_glp/pump_voln mutable true + hsetprop ${scobj_hpath}/grp_glp/pump_voln nxsave true + hsetprop ${scobj_hpath}/grp_glp/pump_voln oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_glp/pump_voln klass "parameter" + hsetprop ${scobj_hpath}/grp_glp/pump_voln sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_glp/pump_voln type "part" + hsetprop ${scobj_hpath}/grp_glp/pump_voln nxalias "${name}_grp_glp_pump_voln" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/glp/board_time 1 - ${sct_controller} poll ${scobj_hpath}/glp/head_count 1 - ${sct_controller} poll ${scobj_hpath}/glp/head_pwrhi 1 - ${sct_controller} poll ${scobj_hpath}/glp/head_pwrlo 1 - ${sct_controller} poll ${scobj_hpath}/glp/head_time 1 - ${sct_controller} poll ${scobj_hpath}/glp/head_volm 1 - ${sct_controller} poll ${scobj_hpath}/glp/head_voln 1 - ${sct_controller} poll ${scobj_hpath}/glp/motor_time 1 - ${sct_controller} poll ${scobj_hpath}/glp/pump_pwrhi 1 - ${sct_controller} poll ${scobj_hpath}/glp/pump_pwrlo 1 - ${sct_controller} poll ${scobj_hpath}/glp/pump_revs 1 - ${sct_controller} poll ${scobj_hpath}/glp/pump_volm 1 - ${sct_controller} poll ${scobj_hpath}/glp/pump_voln 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/board_time 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/head_count 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/head_pwrhi 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/head_pwrlo 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/head_time 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/head_volm 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/head_voln 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/motor_time 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_pwrhi 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_pwrlo 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_revs 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_volm 1 + ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_voln 1 + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + } + + hfactory ${scobj_hpath}/grp_status plain spy none + hsetprop ${scobj_hpath}/grp_status data "true" + hsetprop ${scobj_hpath}/grp_status klass "@none" + hsetprop ${scobj_hpath}/grp_status type "part" + + hfactory ${scobj_hpath}/grp_status/cur_error plain user text + hsetprop ${scobj_hpath}/grp_status/cur_error read ${ns}::fetch_from_status ${scobj_hpath} rdValue {2} + hsetprop ${scobj_hpath}/grp_status/cur_error rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/cur_error control true + hsetprop ${scobj_hpath}/grp_status/cur_error data true + hsetprop ${scobj_hpath}/grp_status/cur_error mutable true + hsetprop ${scobj_hpath}/grp_status/cur_error nxsave true + hsetprop ${scobj_hpath}/grp_status/cur_error oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/cur_error klass "parameter" + hsetprop ${scobj_hpath}/grp_status/cur_error sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/cur_error type "part" + hsetprop ${scobj_hpath}/grp_status/cur_error nxalias "${name}_grp_status_cur_error" + + hfactory ${scobj_hpath}/grp_status/cur_pres plain user text + hsetprop ${scobj_hpath}/grp_status/cur_pres read ${ns}::fetch_from_status ${scobj_hpath} rdValue {17} + hsetprop ${scobj_hpath}/grp_status/cur_pres rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/cur_pres control true + hsetprop ${scobj_hpath}/grp_status/cur_pres data true + hsetprop ${scobj_hpath}/grp_status/cur_pres mutable true + hsetprop ${scobj_hpath}/grp_status/cur_pres nxsave true + hsetprop ${scobj_hpath}/grp_status/cur_pres oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/cur_pres klass "parameter" + hsetprop ${scobj_hpath}/grp_status/cur_pres sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/cur_pres type "part" + hsetprop ${scobj_hpath}/grp_status/cur_pres nxalias "${name}_grp_status_cur_pres" + + hfactory ${scobj_hpath}/grp_status/cur_run_time plain user text + hsetprop ${scobj_hpath}/grp_status/cur_run_time read ${ns}::fetch_from_status ${scobj_hpath} rdValue {3} + hsetprop ${scobj_hpath}/grp_status/cur_run_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/cur_run_time control true + hsetprop ${scobj_hpath}/grp_status/cur_run_time data true + hsetprop ${scobj_hpath}/grp_status/cur_run_time mutable true + hsetprop ${scobj_hpath}/grp_status/cur_run_time nxsave true + hsetprop ${scobj_hpath}/grp_status/cur_run_time oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/cur_run_time klass "parameter" + hsetprop ${scobj_hpath}/grp_status/cur_run_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/cur_run_time type "part" + hsetprop ${scobj_hpath}/grp_status/cur_run_time nxalias "${name}_grp_status_cur_run_time" + + hfactory ${scobj_hpath}/grp_status/error_in plain user text + hsetprop ${scobj_hpath}/grp_status/error_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {19} + hsetprop ${scobj_hpath}/grp_status/error_in rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/error_in control true + hsetprop ${scobj_hpath}/grp_status/error_in data true + hsetprop ${scobj_hpath}/grp_status/error_in mutable true + hsetprop ${scobj_hpath}/grp_status/error_in nxsave true + hsetprop ${scobj_hpath}/grp_status/error_in oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/error_in klass "parameter" + hsetprop ${scobj_hpath}/grp_status/error_in sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/error_in type "part" + hsetprop ${scobj_hpath}/grp_status/error_in nxalias "${name}_grp_status_error_in" + + hfactory ${scobj_hpath}/grp_status/evt_0 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {9} + hsetprop ${scobj_hpath}/grp_status/evt_0 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_0 control true + hsetprop ${scobj_hpath}/grp_status/evt_0 data true + hsetprop ${scobj_hpath}/grp_status/evt_0 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_0 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_0 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_0 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_0 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_0 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_0 nxalias "${name}_grp_status_evt_0" + + hfactory ${scobj_hpath}/grp_status/evt_1 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {10} + hsetprop ${scobj_hpath}/grp_status/evt_1 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_1 control true + hsetprop ${scobj_hpath}/grp_status/evt_1 data true + hsetprop ${scobj_hpath}/grp_status/evt_1 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_1 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_1 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_1 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_1 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_1 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_1 nxalias "${name}_grp_status_evt_1" + + hfactory ${scobj_hpath}/grp_status/evt_2 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {11} + hsetprop ${scobj_hpath}/grp_status/evt_2 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_2 control true + hsetprop ${scobj_hpath}/grp_status/evt_2 data true + hsetprop ${scobj_hpath}/grp_status/evt_2 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_2 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_2 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_2 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_2 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_2 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_2 nxalias "${name}_grp_status_evt_2" + + hfactory ${scobj_hpath}/grp_status/evt_3 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {12} + hsetprop ${scobj_hpath}/grp_status/evt_3 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_3 control true + hsetprop ${scobj_hpath}/grp_status/evt_3 data true + hsetprop ${scobj_hpath}/grp_status/evt_3 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_3 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_3 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_3 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_3 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_3 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_3 nxalias "${name}_grp_status_evt_3" + + hfactory ${scobj_hpath}/grp_status/evt_4 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_4 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {13} + hsetprop ${scobj_hpath}/grp_status/evt_4 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_4 control true + hsetprop ${scobj_hpath}/grp_status/evt_4 data true + hsetprop ${scobj_hpath}/grp_status/evt_4 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_4 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_4 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_4 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_4 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_4 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_4 nxalias "${name}_grp_status_evt_4" + + hfactory ${scobj_hpath}/grp_status/evt_5 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_5 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {14} + hsetprop ${scobj_hpath}/grp_status/evt_5 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_5 control true + hsetprop ${scobj_hpath}/grp_status/evt_5 data true + hsetprop ${scobj_hpath}/grp_status/evt_5 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_5 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_5 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_5 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_5 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_5 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_5 nxalias "${name}_grp_status_evt_5" + + hfactory ${scobj_hpath}/grp_status/evt_6 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_6 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {15} + hsetprop ${scobj_hpath}/grp_status/evt_6 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_6 control true + hsetprop ${scobj_hpath}/grp_status/evt_6 data true + hsetprop ${scobj_hpath}/grp_status/evt_6 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_6 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_6 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_6 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_6 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_6 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_6 nxalias "${name}_grp_status_evt_6" + + hfactory ${scobj_hpath}/grp_status/evt_7 plain user text + hsetprop ${scobj_hpath}/grp_status/evt_7 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {16} + hsetprop ${scobj_hpath}/grp_status/evt_7 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/evt_7 control true + hsetprop ${scobj_hpath}/grp_status/evt_7 data true + hsetprop ${scobj_hpath}/grp_status/evt_7 mutable true + hsetprop ${scobj_hpath}/grp_status/evt_7 nxsave true + hsetprop ${scobj_hpath}/grp_status/evt_7 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/evt_7 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/evt_7 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/evt_7 type "part" + hsetprop ${scobj_hpath}/grp_status/evt_7 nxalias "${name}_grp_status_evt_7" + + hfactory ${scobj_hpath}/grp_status/flow_rate plain user text + hsetprop ${scobj_hpath}/grp_status/flow_rate read ${ns}::fetch_from_status ${scobj_hpath} rdValue {4} + hsetprop ${scobj_hpath}/grp_status/flow_rate rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/flow_rate control true + hsetprop ${scobj_hpath}/grp_status/flow_rate data true + hsetprop ${scobj_hpath}/grp_status/flow_rate mutable true + hsetprop ${scobj_hpath}/grp_status/flow_rate nxsave true + hsetprop ${scobj_hpath}/grp_status/flow_rate oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/flow_rate klass "parameter" + hsetprop ${scobj_hpath}/grp_status/flow_rate sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/flow_rate type "part" + hsetprop ${scobj_hpath}/grp_status/flow_rate nxalias "${name}_grp_status_flow_rate" + + hfactory ${scobj_hpath}/grp_status/lpg_0 plain user text + hsetprop ${scobj_hpath}/grp_status/lpg_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {5} + hsetprop ${scobj_hpath}/grp_status/lpg_0 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/lpg_0 control true + hsetprop ${scobj_hpath}/grp_status/lpg_0 data true + hsetprop ${scobj_hpath}/grp_status/lpg_0 mutable true + hsetprop ${scobj_hpath}/grp_status/lpg_0 nxsave true + hsetprop ${scobj_hpath}/grp_status/lpg_0 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/lpg_0 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/lpg_0 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/lpg_0 type "part" + hsetprop ${scobj_hpath}/grp_status/lpg_0 nxalias "${name}_grp_status_lpg_0" + + hfactory ${scobj_hpath}/grp_status/lpg_1 plain user text + hsetprop ${scobj_hpath}/grp_status/lpg_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {6} + hsetprop ${scobj_hpath}/grp_status/lpg_1 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/lpg_1 control true + hsetprop ${scobj_hpath}/grp_status/lpg_1 data true + hsetprop ${scobj_hpath}/grp_status/lpg_1 mutable true + hsetprop ${scobj_hpath}/grp_status/lpg_1 nxsave true + hsetprop ${scobj_hpath}/grp_status/lpg_1 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/lpg_1 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/lpg_1 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/lpg_1 type "part" + hsetprop ${scobj_hpath}/grp_status/lpg_1 nxalias "${name}_grp_status_lpg_1" + + hfactory ${scobj_hpath}/grp_status/lpg_2 plain user text + hsetprop ${scobj_hpath}/grp_status/lpg_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {7} + hsetprop ${scobj_hpath}/grp_status/lpg_2 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/lpg_2 control true + hsetprop ${scobj_hpath}/grp_status/lpg_2 data true + hsetprop ${scobj_hpath}/grp_status/lpg_2 mutable true + hsetprop ${scobj_hpath}/grp_status/lpg_2 nxsave true + hsetprop ${scobj_hpath}/grp_status/lpg_2 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/lpg_2 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/lpg_2 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/lpg_2 type "part" + hsetprop ${scobj_hpath}/grp_status/lpg_2 nxalias "${name}_grp_status_lpg_2" + + hfactory ${scobj_hpath}/grp_status/lpg_3 plain user text + hsetprop ${scobj_hpath}/grp_status/lpg_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {8} + hsetprop ${scobj_hpath}/grp_status/lpg_3 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/lpg_3 control true + hsetprop ${scobj_hpath}/grp_status/lpg_3 data true + hsetprop ${scobj_hpath}/grp_status/lpg_3 mutable true + hsetprop ${scobj_hpath}/grp_status/lpg_3 nxsave true + hsetprop ${scobj_hpath}/grp_status/lpg_3 oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/lpg_3 klass "parameter" + hsetprop ${scobj_hpath}/grp_status/lpg_3 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/lpg_3 type "part" + hsetprop ${scobj_hpath}/grp_status/lpg_3 nxalias "${name}_grp_status_lpg_3" + + hfactory ${scobj_hpath}/grp_status/start_in plain user text + hsetprop ${scobj_hpath}/grp_status/start_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {18} + hsetprop ${scobj_hpath}/grp_status/start_in rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/start_in control true + hsetprop ${scobj_hpath}/grp_status/start_in data true + hsetprop ${scobj_hpath}/grp_status/start_in mutable true + hsetprop ${scobj_hpath}/grp_status/start_in nxsave true + hsetprop ${scobj_hpath}/grp_status/start_in oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/start_in klass "parameter" + hsetprop ${scobj_hpath}/grp_status/start_in sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/start_in type "part" + hsetprop ${scobj_hpath}/grp_status/start_in nxalias "${name}_grp_status_start_in" + + hfactory ${scobj_hpath}/grp_status/state plain user text + hsetprop ${scobj_hpath}/grp_status/state read ${ns}::fetch_from_status ${scobj_hpath} rdValue {1} + hsetprop ${scobj_hpath}/grp_status/state rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_status/state control true + hsetprop ${scobj_hpath}/grp_status/state data true + hsetprop ${scobj_hpath}/grp_status/state mutable true + hsetprop ${scobj_hpath}/grp_status/state nxsave true + hsetprop ${scobj_hpath}/grp_status/state oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_status/state klass "parameter" + hsetprop ${scobj_hpath}/grp_status/state sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_status/state type "part" + hsetprop ${scobj_hpath}/grp_status/state nxalias "${name}_grp_status_state" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/grp_status/cur_error 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/cur_pres 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/cur_run_time 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/error_in 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_0 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_1 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_2 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_3 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_4 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_5 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_6 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/evt_7 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/flow_rate 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_0 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_1 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_2 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_3 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/start_in 1 + ${sct_controller} poll ${scobj_hpath}/grp_status/state 1 + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + } + + hfactory ${scobj_hpath}/grp_stuff plain spy none + hsetprop ${scobj_hpath}/grp_stuff data "false" + hsetprop ${scobj_hpath}/grp_stuff klass "@none" + hsetprop ${scobj_hpath}/grp_stuff type "part" + + hfactory ${scobj_hpath}/grp_stuff/an_out plain user text + hsetprop ${scobj_hpath}/grp_stuff/an_out read ${ns}::getValue ${scobj_hpath} rdValue {AN_OUT?} + hsetprop ${scobj_hpath}/grp_stuff/an_out rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/an_out control false + hsetprop ${scobj_hpath}/grp_stuff/an_out data false + hsetprop ${scobj_hpath}/grp_stuff/an_out mutable true + hsetprop ${scobj_hpath}/grp_stuff/an_out nxsave false + hsetprop ${scobj_hpath}/grp_stuff/an_out oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/an_out sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/an_out type "part" + hsetprop ${scobj_hpath}/grp_stuff/an_out nxalias "${name}_grp_stuff_an_out" + + hfactory ${scobj_hpath}/grp_stuff/boardinfo plain user text + hsetprop ${scobj_hpath}/grp_stuff/boardinfo read ${ns}::getValue ${scobj_hpath} rdValue {BOARDINFO?} + hsetprop ${scobj_hpath}/grp_stuff/boardinfo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/boardinfo control false + hsetprop ${scobj_hpath}/grp_stuff/boardinfo data false + hsetprop ${scobj_hpath}/grp_stuff/boardinfo mutable true + hsetprop ${scobj_hpath}/grp_stuff/boardinfo nxsave false + hsetprop ${scobj_hpath}/grp_stuff/boardinfo oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/boardinfo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/boardinfo type "part" + hsetprop ${scobj_hpath}/grp_stuff/boardinfo nxalias "${name}_grp_stuff_boardinfo" + + hfactory ${scobj_hpath}/grp_stuff/config plain user text + hsetprop ${scobj_hpath}/grp_stuff/config read ${ns}::getValue ${scobj_hpath} rdValue {CONFIG?} + hsetprop ${scobj_hpath}/grp_stuff/config rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/config control false + hsetprop ${scobj_hpath}/grp_stuff/config data false + hsetprop ${scobj_hpath}/grp_stuff/config mutable true + hsetprop ${scobj_hpath}/grp_stuff/config nxsave false + hsetprop ${scobj_hpath}/grp_stuff/config oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/config sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/config type "part" + hsetprop ${scobj_hpath}/grp_stuff/config nxalias "${name}_grp_stuff_config" + + hfactory ${scobj_hpath}/grp_stuff/cprofinfo plain user text + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo read ${ns}::getValue ${scobj_hpath} rdValue {CPROFINFO?} + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo control false + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo data false + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo mutable true + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo nxsave false + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo type "part" + hsetprop ${scobj_hpath}/grp_stuff/cprofinfo nxalias "${name}_grp_stuff_cprofinfo" + + hfactory ${scobj_hpath}/grp_stuff/dout plain user text + hsetprop ${scobj_hpath}/grp_stuff/dout read ${ns}::getValue ${scobj_hpath} rdValue {DOUT?} + hsetprop ${scobj_hpath}/grp_stuff/dout rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/dout control false + hsetprop ${scobj_hpath}/grp_stuff/dout data false + hsetprop ${scobj_hpath}/grp_stuff/dout mutable true + hsetprop ${scobj_hpath}/grp_stuff/dout nxsave false + hsetprop ${scobj_hpath}/grp_stuff/dout oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/dout sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/dout type "part" + hsetprop ${scobj_hpath}/grp_stuff/dout nxalias "${name}_grp_stuff_dout" + + hfactory ${scobj_hpath}/grp_stuff/error plain user text + hsetprop ${scobj_hpath}/grp_stuff/error read ${ns}::getValue ${scobj_hpath} rdValue {ERROR?} + hsetprop ${scobj_hpath}/grp_stuff/error rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/error control false + hsetprop ${scobj_hpath}/grp_stuff/error data false + hsetprop ${scobj_hpath}/grp_stuff/error mutable true + hsetprop ${scobj_hpath}/grp_stuff/error nxsave false + hsetprop ${scobj_hpath}/grp_stuff/error oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/error sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/error type "part" + hsetprop ${scobj_hpath}/grp_stuff/error nxalias "${name}_grp_stuff_error" + + hfactory ${scobj_hpath}/grp_stuff/errors plain user text + hsetprop ${scobj_hpath}/grp_stuff/errors read ${ns}::getValue ${scobj_hpath} rdValue {ERRORS?} + hsetprop ${scobj_hpath}/grp_stuff/errors rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/errors control false + hsetprop ${scobj_hpath}/grp_stuff/errors data false + hsetprop ${scobj_hpath}/grp_stuff/errors mutable true + hsetprop ${scobj_hpath}/grp_stuff/errors nxsave false + hsetprop ${scobj_hpath}/grp_stuff/errors oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/errors sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/errors type "part" + hsetprop ${scobj_hpath}/grp_stuff/errors nxalias "${name}_grp_stuff_errors" + + hfactory ${scobj_hpath}/grp_stuff/flushpmp plain user text + hsetprop ${scobj_hpath}/grp_stuff/flushpmp read ${ns}::getValue ${scobj_hpath} rdValue {FLUSHPMP?} + hsetprop ${scobj_hpath}/grp_stuff/flushpmp rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/flushpmp control false + hsetprop ${scobj_hpath}/grp_stuff/flushpmp data false + hsetprop ${scobj_hpath}/grp_stuff/flushpmp mutable true + hsetprop ${scobj_hpath}/grp_stuff/flushpmp nxsave false + hsetprop ${scobj_hpath}/grp_stuff/flushpmp oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/flushpmp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/flushpmp type "part" + hsetprop ${scobj_hpath}/grp_stuff/flushpmp nxalias "${name}_grp_stuff_flushpmp" + + hfactory ${scobj_hpath}/grp_stuff/head plain user text + hsetprop ${scobj_hpath}/grp_stuff/head read ${ns}::getValue ${scobj_hpath} rdValue {HEAD?} + hsetprop ${scobj_hpath}/grp_stuff/head rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/head control false + hsetprop ${scobj_hpath}/grp_stuff/head data false + hsetprop ${scobj_hpath}/grp_stuff/head mutable true + hsetprop ${scobj_hpath}/grp_stuff/head nxsave false + hsetprop ${scobj_hpath}/grp_stuff/head oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/head sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/head type "part" + hsetprop ${scobj_hpath}/grp_stuff/head nxalias "${name}_grp_stuff_head" + + hfactory ${scobj_hpath}/grp_stuff/head_par plain user text + hsetprop ${scobj_hpath}/grp_stuff/head_par read ${ns}::getValue ${scobj_hpath} rdValue {HEAD_PAR?} + hsetprop ${scobj_hpath}/grp_stuff/head_par rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/head_par control false + hsetprop ${scobj_hpath}/grp_stuff/head_par data false + hsetprop ${scobj_hpath}/grp_stuff/head_par mutable true + hsetprop ${scobj_hpath}/grp_stuff/head_par nxsave false + hsetprop ${scobj_hpath}/grp_stuff/head_par oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/head_par sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/head_par type "part" + hsetprop ${scobj_hpath}/grp_stuff/head_par nxalias "${name}_grp_stuff_head_par" + + hfactory ${scobj_hpath}/grp_stuff/identify plain user text + hsetprop ${scobj_hpath}/grp_stuff/identify read ${ns}::getValue ${scobj_hpath} rdValue {IDENTIFY?} + hsetprop ${scobj_hpath}/grp_stuff/identify rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/identify control false + hsetprop ${scobj_hpath}/grp_stuff/identify data false + hsetprop ${scobj_hpath}/grp_stuff/identify mutable true + hsetprop ${scobj_hpath}/grp_stuff/identify nxsave false + hsetprop ${scobj_hpath}/grp_stuff/identify oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/identify sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/identify type "part" + hsetprop ${scobj_hpath}/grp_stuff/identify nxalias "${name}_grp_stuff_identify" + + hfactory ${scobj_hpath}/grp_stuff/lpg plain user text + hsetprop ${scobj_hpath}/grp_stuff/lpg read ${ns}::getValue ${scobj_hpath} rdValue {LPG?} + hsetprop ${scobj_hpath}/grp_stuff/lpg rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/lpg control false + hsetprop ${scobj_hpath}/grp_stuff/lpg data false + hsetprop ${scobj_hpath}/grp_stuff/lpg mutable true + hsetprop ${scobj_hpath}/grp_stuff/lpg nxsave false + hsetprop ${scobj_hpath}/grp_stuff/lpg oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/lpg sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/lpg type "part" + hsetprop ${scobj_hpath}/grp_stuff/lpg nxalias "${name}_grp_stuff_lpg" + + hfactory ${scobj_hpath}/grp_stuff/oem plain user text + hsetprop ${scobj_hpath}/grp_stuff/oem read ${ns}::getValue ${scobj_hpath} rdValue {OEM?} + hsetprop ${scobj_hpath}/grp_stuff/oem rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/oem control false + hsetprop ${scobj_hpath}/grp_stuff/oem data false + hsetprop ${scobj_hpath}/grp_stuff/oem mutable true + hsetprop ${scobj_hpath}/grp_stuff/oem nxsave false + hsetprop ${scobj_hpath}/grp_stuff/oem oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/oem sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/oem type "part" + hsetprop ${scobj_hpath}/grp_stuff/oem nxalias "${name}_grp_stuff_oem" + + hfactory ${scobj_hpath}/grp_stuff/opt plain user text + hsetprop ${scobj_hpath}/grp_stuff/opt read ${ns}::getValue ${scobj_hpath} rdValue {OPT?} + hsetprop ${scobj_hpath}/grp_stuff/opt rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/opt control false + hsetprop ${scobj_hpath}/grp_stuff/opt data false + hsetprop ${scobj_hpath}/grp_stuff/opt mutable true + hsetprop ${scobj_hpath}/grp_stuff/opt nxsave false + hsetprop ${scobj_hpath}/grp_stuff/opt oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/opt sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/opt type "part" + hsetprop ${scobj_hpath}/grp_stuff/opt nxalias "${name}_grp_stuff_opt" + + hfactory ${scobj_hpath}/grp_stuff/plim plain user text + hsetprop ${scobj_hpath}/grp_stuff/plim read ${ns}::getValue ${scobj_hpath} rdValue {PLIM?} + hsetprop ${scobj_hpath}/grp_stuff/plim rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/plim control false + hsetprop ${scobj_hpath}/grp_stuff/plim data false + hsetprop ${scobj_hpath}/grp_stuff/plim mutable true + hsetprop ${scobj_hpath}/grp_stuff/plim nxsave false + hsetprop ${scobj_hpath}/grp_stuff/plim oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/plim sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/plim type "part" + hsetprop ${scobj_hpath}/grp_stuff/plim nxalias "${name}_grp_stuff_plim" + + hfactory ${scobj_hpath}/grp_stuff/pressure plain user text + hsetprop ${scobj_hpath}/grp_stuff/pressure read ${ns}::getValue ${scobj_hpath} rdValue {PRESSURE?} + hsetprop ${scobj_hpath}/grp_stuff/pressure rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/pressure control false + hsetprop ${scobj_hpath}/grp_stuff/pressure data false + hsetprop ${scobj_hpath}/grp_stuff/pressure mutable true + hsetprop ${scobj_hpath}/grp_stuff/pressure nxsave false + hsetprop ${scobj_hpath}/grp_stuff/pressure oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/pressure sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/pressure type "part" + hsetprop ${scobj_hpath}/grp_stuff/pressure nxalias "${name}_grp_stuff_pressure" + + hfactory ${scobj_hpath}/grp_stuff/prfastacq plain user text + hsetprop ${scobj_hpath}/grp_stuff/prfastacq read ${ns}::getValue ${scobj_hpath} rdValue {PRFASTACQ?} + hsetprop ${scobj_hpath}/grp_stuff/prfastacq rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/prfastacq control false + hsetprop ${scobj_hpath}/grp_stuff/prfastacq data false + hsetprop ${scobj_hpath}/grp_stuff/prfastacq mutable true + hsetprop ${scobj_hpath}/grp_stuff/prfastacq nxsave false + hsetprop ${scobj_hpath}/grp_stuff/prfastacq oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/prfastacq sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/prfastacq type "part" + hsetprop ${scobj_hpath}/grp_stuff/prfastacq nxalias "${name}_grp_stuff_prfastacq" + + hfactory ${scobj_hpath}/grp_stuff/purge plain user text + hsetprop ${scobj_hpath}/grp_stuff/purge read ${ns}::getValue ${scobj_hpath} rdValue {PURGE?} + hsetprop ${scobj_hpath}/grp_stuff/purge rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/purge control false + hsetprop ${scobj_hpath}/grp_stuff/purge data false + hsetprop ${scobj_hpath}/grp_stuff/purge mutable true + hsetprop ${scobj_hpath}/grp_stuff/purge nxsave false + hsetprop ${scobj_hpath}/grp_stuff/purge oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/purge sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/purge type "part" + hsetprop ${scobj_hpath}/grp_stuff/purge nxalias "${name}_grp_stuff_purge" + + hfactory ${scobj_hpath}/grp_stuff/remote plain user text + hsetprop ${scobj_hpath}/grp_stuff/remote read ${ns}::getValue ${scobj_hpath} rdValue {REMOTE?} + hsetprop ${scobj_hpath}/grp_stuff/remote rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/remote control false + hsetprop ${scobj_hpath}/grp_stuff/remote data false + hsetprop ${scobj_hpath}/grp_stuff/remote mutable true + hsetprop ${scobj_hpath}/grp_stuff/remote nxsave false + hsetprop ${scobj_hpath}/grp_stuff/remote oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/remote sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/remote type "part" + hsetprop ${scobj_hpath}/grp_stuff/remote nxalias "${name}_grp_stuff_remote" + + hfactory ${scobj_hpath}/grp_stuff/rfid plain user text + hsetprop ${scobj_hpath}/grp_stuff/rfid read ${ns}::getValue ${scobj_hpath} rdValue {RFID?} + hsetprop ${scobj_hpath}/grp_stuff/rfid rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/rfid control false + hsetprop ${scobj_hpath}/grp_stuff/rfid data false + hsetprop ${scobj_hpath}/grp_stuff/rfid mutable true + hsetprop ${scobj_hpath}/grp_stuff/rfid nxsave false + hsetprop ${scobj_hpath}/grp_stuff/rfid oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/rfid sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/rfid type "part" + hsetprop ${scobj_hpath}/grp_stuff/rfid nxalias "${name}_grp_stuff_rfid" + + hfactory ${scobj_hpath}/grp_stuff/service plain user text + hsetprop ${scobj_hpath}/grp_stuff/service read ${ns}::getValue ${scobj_hpath} rdValue {SERVICE?} + hsetprop ${scobj_hpath}/grp_stuff/service rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/service control false + hsetprop ${scobj_hpath}/grp_stuff/service data false + hsetprop ${scobj_hpath}/grp_stuff/service mutable true + hsetprop ${scobj_hpath}/grp_stuff/service nxsave false + hsetprop ${scobj_hpath}/grp_stuff/service oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/service sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/service type "part" + hsetprop ${scobj_hpath}/grp_stuff/service nxalias "${name}_grp_stuff_service" + + hfactory ${scobj_hpath}/grp_stuff/sysinfo plain user text + hsetprop ${scobj_hpath}/grp_stuff/sysinfo read ${ns}::getValue ${scobj_hpath} rdValue {SYSINFO?} + hsetprop ${scobj_hpath}/grp_stuff/sysinfo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/sysinfo control false + hsetprop ${scobj_hpath}/grp_stuff/sysinfo data false + hsetprop ${scobj_hpath}/grp_stuff/sysinfo mutable true + hsetprop ${scobj_hpath}/grp_stuff/sysinfo nxsave false + hsetprop ${scobj_hpath}/grp_stuff/sysinfo oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/sysinfo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/sysinfo type "part" + hsetprop ${scobj_hpath}/grp_stuff/sysinfo nxalias "${name}_grp_stuff_sysinfo" + + hfactory ${scobj_hpath}/grp_stuff/units plain user text + hsetprop ${scobj_hpath}/grp_stuff/units read ${ns}::getValue ${scobj_hpath} rdValue {UNITS?} + hsetprop ${scobj_hpath}/grp_stuff/units rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/units control false + hsetprop ${scobj_hpath}/grp_stuff/units data false + hsetprop ${scobj_hpath}/grp_stuff/units mutable true + hsetprop ${scobj_hpath}/grp_stuff/units nxsave false + hsetprop ${scobj_hpath}/grp_stuff/units oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/units sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/units type "part" + hsetprop ${scobj_hpath}/grp_stuff/units nxalias "${name}_grp_stuff_units" + + hfactory ${scobj_hpath}/grp_stuff/valves plain user text + hsetprop ${scobj_hpath}/grp_stuff/valves read ${ns}::getValue ${scobj_hpath} rdValue {VALVES?} + hsetprop ${scobj_hpath}/grp_stuff/valves rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/grp_stuff/valves control false + hsetprop ${scobj_hpath}/grp_stuff/valves data false + hsetprop ${scobj_hpath}/grp_stuff/valves mutable true + hsetprop ${scobj_hpath}/grp_stuff/valves nxsave false + hsetprop ${scobj_hpath}/grp_stuff/valves oldval UNKNOWN + hsetprop ${scobj_hpath}/grp_stuff/valves sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/grp_stuff/valves type "part" + hsetprop ${scobj_hpath}/grp_stuff/valves nxalias "${name}_grp_stuff_valves" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/grp_stuff/an_out 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/boardinfo 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/config 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/cprofinfo 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/dout 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/error 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/errors 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/flushpmp 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/head 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/head_par 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/identify 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/lpg 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/oem 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/opt 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/plim 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/pressure 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/prfastacq 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/purge 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/remote 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/rfid 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/service 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/sysinfo 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/units 600 + ${sct_controller} poll ${scobj_hpath}/grp_stuff/valves 600 } else { ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } @@ -1192,94 +1666,6 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump klass "@none" hsetprop ${scobj_hpath}/pump type "part" - hfactory ${scobj_hpath}/pump/flow_pv plain user float - hsetprop ${scobj_hpath}/pump/flow_pv read ${ns}::flow_fetch ${scobj_hpath} rdValue { } - hsetprop ${scobj_hpath}/pump/flow_pv rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/flow_pv control true - hsetprop ${scobj_hpath}/pump/flow_pv data true - hsetprop ${scobj_hpath}/pump/flow_pv mutable true - hsetprop ${scobj_hpath}/pump/flow_pv nxsave true - hsetprop ${scobj_hpath}/pump/flow_pv oldval 0.0 - hsetprop ${scobj_hpath}/pump/flow_pv klass "parameter" - hsetprop ${scobj_hpath}/pump/flow_pv sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/pump/flow_pv type "part" - hsetprop ${scobj_hpath}/pump/flow_pv units "mL/min" - hsetprop ${scobj_hpath}/pump/flow_pv nxalias "${name}_pump_flow_pv" - - hfactory ${scobj_hpath}/pump/flow_sp plain user float - hsetprop ${scobj_hpath}/pump/flow_sp write ${ns}::flow_write ${scobj_hpath} noResponse { } - hsetprop ${scobj_hpath}/pump/flow_sp noResponse ${ns}::noResponse ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/flow_sp check ${ns}::checkrange ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/flow_sp control true - hsetprop ${scobj_hpath}/pump/flow_sp data true - hsetprop ${scobj_hpath}/pump/flow_sp mutable true - hsetprop ${scobj_hpath}/pump/flow_sp nxsave true - hsetprop ${scobj_hpath}/pump/flow_sp lowerlimit 0 - hsetprop ${scobj_hpath}/pump/flow_sp upperlimit 10 - hsetprop ${scobj_hpath}/pump/flow_sp oldval 1.0 - hset ${scobj_hpath}/pump/flow_sp 1.0 - hsetprop ${scobj_hpath}/pump/flow_sp klass "parameter" - hsetprop ${scobj_hpath}/pump/flow_sp sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/pump/flow_sp type "part" - hsetprop ${scobj_hpath}/pump/flow_sp units "mL/min" - hsetprop ${scobj_hpath}/pump/flow_sp nxalias "${name}_pump_flow_sp" - - hfactory ${scobj_hpath}/pump/pump_sp plain user float - hsetprop ${scobj_hpath}/pump/pump_sp read ${ns}::pump_fetch ${scobj_hpath} rdValue { } - hsetprop ${scobj_hpath}/pump/pump_sp rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/pump_sp write ${ns}::pump_write ${scobj_hpath} noResponse { } - hsetprop ${scobj_hpath}/pump/pump_sp noResponse ${ns}::noResponse ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/pump_sp check ${ns}::checkrange ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/pump_sp driving 0 - hsetprop ${scobj_hpath}/pump/pump_sp checklimits ${ns}::checklimits ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/pump_sp checkstatus ${ns}::pump_checkstatus ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/pump_sp halt ${ns}::pump_halt ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/pump_sp driveable pump/volume_pv - hsetprop ${scobj_hpath}/pump/pump_sp control true - hsetprop ${scobj_hpath}/pump/pump_sp data true - hsetprop ${scobj_hpath}/pump/pump_sp mutable true - hsetprop ${scobj_hpath}/pump/pump_sp nxsave true - hsetprop ${scobj_hpath}/pump/pump_sp lowerlimit 0 - hsetprop ${scobj_hpath}/pump/pump_sp upperlimit 100 - hsetprop ${scobj_hpath}/pump/pump_sp tolerance 0.01 - hsetprop ${scobj_hpath}/pump/pump_sp oldval 0.0 - hsetprop ${scobj_hpath}/pump/pump_sp klass "parameter" - hsetprop ${scobj_hpath}/pump/pump_sp sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/pump/pump_sp this_state "0" - hsetprop ${scobj_hpath}/pump/pump_sp type "drivable" - hsetprop ${scobj_hpath}/pump/pump_sp units "mL" - hsetprop ${scobj_hpath}/pump/pump_sp nxalias "${name}_pump_pump_sp" - - hfactory ${scobj_hpath}/pump/ratio_pv plain user text - hsetprop ${scobj_hpath}/pump/ratio_pv read ${ns}::ratios_fetch ${scobj_hpath} rdValue { } - hsetprop ${scobj_hpath}/pump/ratio_pv rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/ratio_pv control true - hsetprop ${scobj_hpath}/pump/ratio_pv data true - hsetprop ${scobj_hpath}/pump/ratio_pv mutable true - hsetprop ${scobj_hpath}/pump/ratio_pv nxsave true - hsetprop ${scobj_hpath}/pump/ratio_pv oldval UNKNOWN - hsetprop ${scobj_hpath}/pump/ratio_pv klass "parameter" - hsetprop ${scobj_hpath}/pump/ratio_pv sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/pump/ratio_pv type "part" - hsetprop ${scobj_hpath}/pump/ratio_pv units "percent" - hsetprop ${scobj_hpath}/pump/ratio_pv nxalias "${name}_pump_ratio_pv" - - hfactory ${scobj_hpath}/pump/ratio_sp plain user text - hsetprop ${scobj_hpath}/pump/ratio_sp write ${ns}::ratios_write ${scobj_hpath} noResponse { } - hsetprop ${scobj_hpath}/pump/ratio_sp noResponse ${ns}::noResponse ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/ratio_sp check ${ns}::ratios_check ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/ratio_sp control true - hsetprop ${scobj_hpath}/pump/ratio_sp data true - hsetprop ${scobj_hpath}/pump/ratio_sp mutable true - hsetprop ${scobj_hpath}/pump/ratio_sp nxsave true - hsetprop ${scobj_hpath}/pump/ratio_sp oldval 25/25/25/25 - hset ${scobj_hpath}/pump/ratio_sp 25/25/25/25 - hsetprop ${scobj_hpath}/pump/ratio_sp klass "parameter" - hsetprop ${scobj_hpath}/pump/ratio_sp sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/pump/ratio_sp type "part" - hsetprop ${scobj_hpath}/pump/ratio_sp units "percent" - hsetprop ${scobj_hpath}/pump/ratio_sp nxalias "${name}_pump_ratio_sp" - hfactory ${scobj_hpath}/pump/remote plain user int hsetprop ${scobj_hpath}/pump/remote read ${ns}::getValue ${scobj_hpath} remote_read {REMOTE?} hsetprop ${scobj_hpath}/pump/remote remote_read ${ns}::remote_read ${scobj_hpath} @@ -1323,657 +1709,150 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/status type "part" hsetprop ${scobj_hpath}/pump/status nxalias "${name}_pump_status" - hfactory ${scobj_hpath}/pump/volume_pv plain user float - hsetprop ${scobj_hpath}/pump/volume_pv read ${ns}::volume_fetch ${scobj_hpath} rdValue { } - hsetprop ${scobj_hpath}/pump/volume_pv rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume_pv control true - hsetprop ${scobj_hpath}/pump/volume_pv data true - hsetprop ${scobj_hpath}/pump/volume_pv mutable true - hsetprop ${scobj_hpath}/pump/volume_pv nxsave true - hsetprop ${scobj_hpath}/pump/volume_pv oldval 0.0 - hsetprop ${scobj_hpath}/pump/volume_pv klass "parameter" - hsetprop ${scobj_hpath}/pump/volume_pv sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/pump/volume_pv type "part" - hsetprop ${scobj_hpath}/pump/volume_pv units "mL" - hsetprop ${scobj_hpath}/pump/volume_pv nxalias "${name}_pump_volume_pv" - - hfactory ${scobj_hpath}/pump/volume_sp plain user float - hsetprop ${scobj_hpath}/pump/volume_sp read ${ns}::volume_checkpumping ${scobj_hpath} rdValue { } - hsetprop ${scobj_hpath}/pump/volume_sp rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume_sp write ${ns}::volume_write ${scobj_hpath} noResponse { } - hsetprop ${scobj_hpath}/pump/volume_sp noResponse ${ns}::noResponse ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume_sp check ${ns}::checkrange ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume_sp driving 0 - hsetprop ${scobj_hpath}/pump/volume_sp checklimits ${ns}::checklimits ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume_sp checkstatus ${ns}::volume_checkstatus ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume_sp halt ${ns}::volume_halt ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume_sp driveable pump/volume_pv - hsetprop ${scobj_hpath}/pump/volume_sp control true - hsetprop ${scobj_hpath}/pump/volume_sp data true - hsetprop ${scobj_hpath}/pump/volume_sp mutable true - hsetprop ${scobj_hpath}/pump/volume_sp nxsave true - hsetprop ${scobj_hpath}/pump/volume_sp lowerlimit 0 - hsetprop ${scobj_hpath}/pump/volume_sp upperlimit 100 - hsetprop ${scobj_hpath}/pump/volume_sp tolerance 0.01 - hsetprop ${scobj_hpath}/pump/volume_sp oldval 0.0 - hsetprop ${scobj_hpath}/pump/volume_sp klass "parameter" - hsetprop ${scobj_hpath}/pump/volume_sp sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/pump/volume_sp type "drivable" - hsetprop ${scobj_hpath}/pump/volume_sp units "mL" - hsetprop ${scobj_hpath}/pump/volume_sp nxalias "${name}_pump_volume_sp" - if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/pump/flow_pv 1 - ${sct_controller} poll ${scobj_hpath}/pump/pump_sp 1 - ${sct_controller} poll ${scobj_hpath}/pump/ratio_pv 1 ${sct_controller} poll ${scobj_hpath}/pump/remote 1 ${sct_controller} poll ${scobj_hpath}/pump/state 1 ${sct_controller} poll ${scobj_hpath}/pump/status 1 - ${sct_controller} poll ${scobj_hpath}/pump/volume_pv 1 - ${sct_controller} poll ${scobj_hpath}/pump/volume_sp 1 - ${sct_controller} write ${scobj_hpath}/pump/flow_sp - ${sct_controller} write ${scobj_hpath}/pump/pump_sp - ${sct_controller} write ${scobj_hpath}/pump/ratio_sp ${sct_controller} write ${scobj_hpath}/pump/remote - ${sct_controller} write ${scobj_hpath}/pump/volume_sp } else { ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } - hfactory ${scobj_hpath}/status plain spy none - hsetprop ${scobj_hpath}/status data "true" - hsetprop ${scobj_hpath}/status klass "@none" - hsetprop ${scobj_hpath}/status type "part" + hfactory ${scobj_hpath}/pump/flow plain spy none + hsetprop ${scobj_hpath}/pump/flow data "true" + hsetprop ${scobj_hpath}/pump/flow klass "@none" + hsetprop ${scobj_hpath}/pump/flow type "part" - hfactory ${scobj_hpath}/status/cur_error plain user text - hsetprop ${scobj_hpath}/status/cur_error read ${ns}::fetch_from_status ${scobj_hpath} rdValue {2} - hsetprop ${scobj_hpath}/status/cur_error rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/cur_error control true - hsetprop ${scobj_hpath}/status/cur_error data true - hsetprop ${scobj_hpath}/status/cur_error mutable true - hsetprop ${scobj_hpath}/status/cur_error nxsave true - hsetprop ${scobj_hpath}/status/cur_error oldval UNKNOWN - hsetprop ${scobj_hpath}/status/cur_error klass "parameter" - hsetprop ${scobj_hpath}/status/cur_error sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/cur_error type "part" - hsetprop ${scobj_hpath}/status/cur_error nxalias "${name}_status_cur_error" + hfactory ${scobj_hpath}/pump/flow/pval plain user float + hsetprop ${scobj_hpath}/pump/flow/pval read ${ns}::flow_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/flow/pval rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/flow/pval control true + hsetprop ${scobj_hpath}/pump/flow/pval data true + hsetprop ${scobj_hpath}/pump/flow/pval mutable true + hsetprop ${scobj_hpath}/pump/flow/pval nxsave true + hsetprop ${scobj_hpath}/pump/flow/pval oldval 0.0 + hsetprop ${scobj_hpath}/pump/flow/pval klass "parameter" + hsetprop ${scobj_hpath}/pump/flow/pval sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/flow/pval type "part" + hsetprop ${scobj_hpath}/pump/flow/pval units "mL/min" + hsetprop ${scobj_hpath}/pump/flow/pval nxalias "${name}_pump_flow_pval" - hfactory ${scobj_hpath}/status/cur_pres plain user text - hsetprop ${scobj_hpath}/status/cur_pres read ${ns}::fetch_from_status ${scobj_hpath} rdValue {17} - hsetprop ${scobj_hpath}/status/cur_pres rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/cur_pres control true - hsetprop ${scobj_hpath}/status/cur_pres data true - hsetprop ${scobj_hpath}/status/cur_pres mutable true - hsetprop ${scobj_hpath}/status/cur_pres nxsave true - hsetprop ${scobj_hpath}/status/cur_pres oldval UNKNOWN - hsetprop ${scobj_hpath}/status/cur_pres klass "parameter" - hsetprop ${scobj_hpath}/status/cur_pres sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/cur_pres type "part" - hsetprop ${scobj_hpath}/status/cur_pres nxalias "${name}_status_cur_pres" - - hfactory ${scobj_hpath}/status/cur_run_time plain user text - hsetprop ${scobj_hpath}/status/cur_run_time read ${ns}::fetch_from_status ${scobj_hpath} rdValue {3} - hsetprop ${scobj_hpath}/status/cur_run_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/cur_run_time control true - hsetprop ${scobj_hpath}/status/cur_run_time data true - hsetprop ${scobj_hpath}/status/cur_run_time mutable true - hsetprop ${scobj_hpath}/status/cur_run_time nxsave true - hsetprop ${scobj_hpath}/status/cur_run_time oldval UNKNOWN - hsetprop ${scobj_hpath}/status/cur_run_time klass "parameter" - hsetprop ${scobj_hpath}/status/cur_run_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/cur_run_time type "part" - hsetprop ${scobj_hpath}/status/cur_run_time nxalias "${name}_status_cur_run_time" - - hfactory ${scobj_hpath}/status/error_in plain user text - hsetprop ${scobj_hpath}/status/error_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {19} - hsetprop ${scobj_hpath}/status/error_in rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/error_in control true - hsetprop ${scobj_hpath}/status/error_in data true - hsetprop ${scobj_hpath}/status/error_in mutable true - hsetprop ${scobj_hpath}/status/error_in nxsave true - hsetprop ${scobj_hpath}/status/error_in oldval UNKNOWN - hsetprop ${scobj_hpath}/status/error_in klass "parameter" - hsetprop ${scobj_hpath}/status/error_in sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/error_in type "part" - hsetprop ${scobj_hpath}/status/error_in nxalias "${name}_status_error_in" - - hfactory ${scobj_hpath}/status/evt_0 plain user text - hsetprop ${scobj_hpath}/status/evt_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {9} - hsetprop ${scobj_hpath}/status/evt_0 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_0 control true - hsetprop ${scobj_hpath}/status/evt_0 data true - hsetprop ${scobj_hpath}/status/evt_0 mutable true - hsetprop ${scobj_hpath}/status/evt_0 nxsave true - hsetprop ${scobj_hpath}/status/evt_0 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_0 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_0 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_0 type "part" - hsetprop ${scobj_hpath}/status/evt_0 nxalias "${name}_status_evt_0" - - hfactory ${scobj_hpath}/status/evt_1 plain user text - hsetprop ${scobj_hpath}/status/evt_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {10} - hsetprop ${scobj_hpath}/status/evt_1 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_1 control true - hsetprop ${scobj_hpath}/status/evt_1 data true - hsetprop ${scobj_hpath}/status/evt_1 mutable true - hsetprop ${scobj_hpath}/status/evt_1 nxsave true - hsetprop ${scobj_hpath}/status/evt_1 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_1 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_1 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_1 type "part" - hsetprop ${scobj_hpath}/status/evt_1 nxalias "${name}_status_evt_1" - - hfactory ${scobj_hpath}/status/evt_2 plain user text - hsetprop ${scobj_hpath}/status/evt_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {11} - hsetprop ${scobj_hpath}/status/evt_2 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_2 control true - hsetprop ${scobj_hpath}/status/evt_2 data true - hsetprop ${scobj_hpath}/status/evt_2 mutable true - hsetprop ${scobj_hpath}/status/evt_2 nxsave true - hsetprop ${scobj_hpath}/status/evt_2 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_2 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_2 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_2 type "part" - hsetprop ${scobj_hpath}/status/evt_2 nxalias "${name}_status_evt_2" - - hfactory ${scobj_hpath}/status/evt_3 plain user text - hsetprop ${scobj_hpath}/status/evt_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {12} - hsetprop ${scobj_hpath}/status/evt_3 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_3 control true - hsetprop ${scobj_hpath}/status/evt_3 data true - hsetprop ${scobj_hpath}/status/evt_3 mutable true - hsetprop ${scobj_hpath}/status/evt_3 nxsave true - hsetprop ${scobj_hpath}/status/evt_3 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_3 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_3 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_3 type "part" - hsetprop ${scobj_hpath}/status/evt_3 nxalias "${name}_status_evt_3" - - hfactory ${scobj_hpath}/status/evt_4 plain user text - hsetprop ${scobj_hpath}/status/evt_4 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {13} - hsetprop ${scobj_hpath}/status/evt_4 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_4 control true - hsetprop ${scobj_hpath}/status/evt_4 data true - hsetprop ${scobj_hpath}/status/evt_4 mutable true - hsetprop ${scobj_hpath}/status/evt_4 nxsave true - hsetprop ${scobj_hpath}/status/evt_4 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_4 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_4 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_4 type "part" - hsetprop ${scobj_hpath}/status/evt_4 nxalias "${name}_status_evt_4" - - hfactory ${scobj_hpath}/status/evt_5 plain user text - hsetprop ${scobj_hpath}/status/evt_5 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {14} - hsetprop ${scobj_hpath}/status/evt_5 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_5 control true - hsetprop ${scobj_hpath}/status/evt_5 data true - hsetprop ${scobj_hpath}/status/evt_5 mutable true - hsetprop ${scobj_hpath}/status/evt_5 nxsave true - hsetprop ${scobj_hpath}/status/evt_5 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_5 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_5 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_5 type "part" - hsetprop ${scobj_hpath}/status/evt_5 nxalias "${name}_status_evt_5" - - hfactory ${scobj_hpath}/status/evt_6 plain user text - hsetprop ${scobj_hpath}/status/evt_6 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {15} - hsetprop ${scobj_hpath}/status/evt_6 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_6 control true - hsetprop ${scobj_hpath}/status/evt_6 data true - hsetprop ${scobj_hpath}/status/evt_6 mutable true - hsetprop ${scobj_hpath}/status/evt_6 nxsave true - hsetprop ${scobj_hpath}/status/evt_6 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_6 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_6 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_6 type "part" - hsetprop ${scobj_hpath}/status/evt_6 nxalias "${name}_status_evt_6" - - hfactory ${scobj_hpath}/status/evt_7 plain user text - hsetprop ${scobj_hpath}/status/evt_7 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {16} - hsetprop ${scobj_hpath}/status/evt_7 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/evt_7 control true - hsetprop ${scobj_hpath}/status/evt_7 data true - hsetprop ${scobj_hpath}/status/evt_7 mutable true - hsetprop ${scobj_hpath}/status/evt_7 nxsave true - hsetprop ${scobj_hpath}/status/evt_7 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/evt_7 klass "parameter" - hsetprop ${scobj_hpath}/status/evt_7 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/evt_7 type "part" - hsetprop ${scobj_hpath}/status/evt_7 nxalias "${name}_status_evt_7" - - hfactory ${scobj_hpath}/status/flow_rate plain user text - hsetprop ${scobj_hpath}/status/flow_rate read ${ns}::fetch_from_status ${scobj_hpath} rdValue {4} - hsetprop ${scobj_hpath}/status/flow_rate rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/flow_rate control true - hsetprop ${scobj_hpath}/status/flow_rate data true - hsetprop ${scobj_hpath}/status/flow_rate mutable true - hsetprop ${scobj_hpath}/status/flow_rate nxsave true - hsetprop ${scobj_hpath}/status/flow_rate oldval UNKNOWN - hsetprop ${scobj_hpath}/status/flow_rate klass "parameter" - hsetprop ${scobj_hpath}/status/flow_rate sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/flow_rate type "part" - hsetprop ${scobj_hpath}/status/flow_rate nxalias "${name}_status_flow_rate" - - hfactory ${scobj_hpath}/status/lpg_0 plain user text - hsetprop ${scobj_hpath}/status/lpg_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {5} - hsetprop ${scobj_hpath}/status/lpg_0 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/lpg_0 control true - hsetprop ${scobj_hpath}/status/lpg_0 data true - hsetprop ${scobj_hpath}/status/lpg_0 mutable true - hsetprop ${scobj_hpath}/status/lpg_0 nxsave true - hsetprop ${scobj_hpath}/status/lpg_0 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/lpg_0 klass "parameter" - hsetprop ${scobj_hpath}/status/lpg_0 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/lpg_0 type "part" - hsetprop ${scobj_hpath}/status/lpg_0 nxalias "${name}_status_lpg_0" - - hfactory ${scobj_hpath}/status/lpg_1 plain user text - hsetprop ${scobj_hpath}/status/lpg_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {6} - hsetprop ${scobj_hpath}/status/lpg_1 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/lpg_1 control true - hsetprop ${scobj_hpath}/status/lpg_1 data true - hsetprop ${scobj_hpath}/status/lpg_1 mutable true - hsetprop ${scobj_hpath}/status/lpg_1 nxsave true - hsetprop ${scobj_hpath}/status/lpg_1 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/lpg_1 klass "parameter" - hsetprop ${scobj_hpath}/status/lpg_1 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/lpg_1 type "part" - hsetprop ${scobj_hpath}/status/lpg_1 nxalias "${name}_status_lpg_1" - - hfactory ${scobj_hpath}/status/lpg_2 plain user text - hsetprop ${scobj_hpath}/status/lpg_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {7} - hsetprop ${scobj_hpath}/status/lpg_2 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/lpg_2 control true - hsetprop ${scobj_hpath}/status/lpg_2 data true - hsetprop ${scobj_hpath}/status/lpg_2 mutable true - hsetprop ${scobj_hpath}/status/lpg_2 nxsave true - hsetprop ${scobj_hpath}/status/lpg_2 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/lpg_2 klass "parameter" - hsetprop ${scobj_hpath}/status/lpg_2 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/lpg_2 type "part" - hsetprop ${scobj_hpath}/status/lpg_2 nxalias "${name}_status_lpg_2" - - hfactory ${scobj_hpath}/status/lpg_3 plain user text - hsetprop ${scobj_hpath}/status/lpg_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {8} - hsetprop ${scobj_hpath}/status/lpg_3 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/lpg_3 control true - hsetprop ${scobj_hpath}/status/lpg_3 data true - hsetprop ${scobj_hpath}/status/lpg_3 mutable true - hsetprop ${scobj_hpath}/status/lpg_3 nxsave true - hsetprop ${scobj_hpath}/status/lpg_3 oldval UNKNOWN - hsetprop ${scobj_hpath}/status/lpg_3 klass "parameter" - hsetprop ${scobj_hpath}/status/lpg_3 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/lpg_3 type "part" - hsetprop ${scobj_hpath}/status/lpg_3 nxalias "${name}_status_lpg_3" - - hfactory ${scobj_hpath}/status/start_in plain user text - hsetprop ${scobj_hpath}/status/start_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {18} - hsetprop ${scobj_hpath}/status/start_in rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/start_in control true - hsetprop ${scobj_hpath}/status/start_in data true - hsetprop ${scobj_hpath}/status/start_in mutable true - hsetprop ${scobj_hpath}/status/start_in nxsave true - hsetprop ${scobj_hpath}/status/start_in oldval UNKNOWN - hsetprop ${scobj_hpath}/status/start_in klass "parameter" - hsetprop ${scobj_hpath}/status/start_in sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/start_in type "part" - hsetprop ${scobj_hpath}/status/start_in nxalias "${name}_status_start_in" - - hfactory ${scobj_hpath}/status/state plain user text - hsetprop ${scobj_hpath}/status/state read ${ns}::fetch_from_status ${scobj_hpath} rdValue {1} - hsetprop ${scobj_hpath}/status/state rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/status/state control true - hsetprop ${scobj_hpath}/status/state data true - hsetprop ${scobj_hpath}/status/state mutable true - hsetprop ${scobj_hpath}/status/state nxsave true - hsetprop ${scobj_hpath}/status/state oldval UNKNOWN - hsetprop ${scobj_hpath}/status/state klass "parameter" - hsetprop ${scobj_hpath}/status/state sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/status/state type "part" - hsetprop ${scobj_hpath}/status/state nxalias "${name}_status_state" + hfactory ${scobj_hpath}/pump/flow/setp plain user float + hsetprop ${scobj_hpath}/pump/flow/setp write ${ns}::flow_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/flow/setp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/flow/setp check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/flow/setp control true + hsetprop ${scobj_hpath}/pump/flow/setp data true + hsetprop ${scobj_hpath}/pump/flow/setp mutable true + hsetprop ${scobj_hpath}/pump/flow/setp nxsave true + hsetprop ${scobj_hpath}/pump/flow/setp lowerlimit 0 + hsetprop ${scobj_hpath}/pump/flow/setp upperlimit 10 + hsetprop ${scobj_hpath}/pump/flow/setp oldval 1.0 + hset ${scobj_hpath}/pump/flow/setp 1.0 + hsetprop ${scobj_hpath}/pump/flow/setp klass "parameter" + hsetprop ${scobj_hpath}/pump/flow/setp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/flow/setp type "part" + hsetprop ${scobj_hpath}/pump/flow/setp units "mL/min" + hsetprop ${scobj_hpath}/pump/flow/setp nxalias "${name}_pump_flow_setp" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/status/cur_error 1 - ${sct_controller} poll ${scobj_hpath}/status/cur_pres 1 - ${sct_controller} poll ${scobj_hpath}/status/cur_run_time 1 - ${sct_controller} poll ${scobj_hpath}/status/error_in 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_0 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_1 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_2 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_3 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_4 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_5 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_6 1 - ${sct_controller} poll ${scobj_hpath}/status/evt_7 1 - ${sct_controller} poll ${scobj_hpath}/status/flow_rate 1 - ${sct_controller} poll ${scobj_hpath}/status/lpg_0 1 - ${sct_controller} poll ${scobj_hpath}/status/lpg_1 1 - ${sct_controller} poll ${scobj_hpath}/status/lpg_2 1 - ${sct_controller} poll ${scobj_hpath}/status/lpg_3 1 - ${sct_controller} poll ${scobj_hpath}/status/start_in 1 - ${sct_controller} poll ${scobj_hpath}/status/state 1 + ${sct_controller} poll ${scobj_hpath}/pump/flow/pval 1 + ${sct_controller} write ${scobj_hpath}/pump/flow/setp } else { ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } - hfactory ${scobj_hpath}/stuff plain spy none - hsetprop ${scobj_hpath}/stuff data "false" - hsetprop ${scobj_hpath}/stuff klass "@none" - hsetprop ${scobj_hpath}/stuff type "part" + hfactory ${scobj_hpath}/pump/ratio plain spy none + hsetprop ${scobj_hpath}/pump/ratio data "true" + hsetprop ${scobj_hpath}/pump/ratio klass "@none" + hsetprop ${scobj_hpath}/pump/ratio type "part" - hfactory ${scobj_hpath}/stuff/an_out plain user text - hsetprop ${scobj_hpath}/stuff/an_out read ${ns}::getValue ${scobj_hpath} rdValue {AN_OUT?} - hsetprop ${scobj_hpath}/stuff/an_out rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/an_out control false - hsetprop ${scobj_hpath}/stuff/an_out data false - hsetprop ${scobj_hpath}/stuff/an_out mutable true - hsetprop ${scobj_hpath}/stuff/an_out nxsave false - hsetprop ${scobj_hpath}/stuff/an_out oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/an_out sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/an_out type "part" - hsetprop ${scobj_hpath}/stuff/an_out nxalias "${name}_stuff_an_out" + hfactory ${scobj_hpath}/pump/ratio/pval plain user text + hsetprop ${scobj_hpath}/pump/ratio/pval read ${ns}::ratio_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/ratio/pval rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/ratio/pval control true + hsetprop ${scobj_hpath}/pump/ratio/pval data true + hsetprop ${scobj_hpath}/pump/ratio/pval mutable true + hsetprop ${scobj_hpath}/pump/ratio/pval nxsave true + hsetprop ${scobj_hpath}/pump/ratio/pval oldval UNKNOWN + hsetprop ${scobj_hpath}/pump/ratio/pval klass "parameter" + hsetprop ${scobj_hpath}/pump/ratio/pval sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/ratio/pval type "part" + hsetprop ${scobj_hpath}/pump/ratio/pval units "percent" + hsetprop ${scobj_hpath}/pump/ratio/pval nxalias "${name}_pump_ratio_pval" - hfactory ${scobj_hpath}/stuff/boardinfo plain user text - hsetprop ${scobj_hpath}/stuff/boardinfo read ${ns}::getValue ${scobj_hpath} rdValue {BOARDINFO?} - hsetprop ${scobj_hpath}/stuff/boardinfo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/boardinfo control false - hsetprop ${scobj_hpath}/stuff/boardinfo data false - hsetprop ${scobj_hpath}/stuff/boardinfo mutable true - hsetprop ${scobj_hpath}/stuff/boardinfo nxsave false - hsetprop ${scobj_hpath}/stuff/boardinfo oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/boardinfo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/boardinfo type "part" - hsetprop ${scobj_hpath}/stuff/boardinfo nxalias "${name}_stuff_boardinfo" - - hfactory ${scobj_hpath}/stuff/config plain user text - hsetprop ${scobj_hpath}/stuff/config read ${ns}::getValue ${scobj_hpath} rdValue {CONFIG?} - hsetprop ${scobj_hpath}/stuff/config rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/config control false - hsetprop ${scobj_hpath}/stuff/config data false - hsetprop ${scobj_hpath}/stuff/config mutable true - hsetprop ${scobj_hpath}/stuff/config nxsave false - hsetprop ${scobj_hpath}/stuff/config oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/config sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/config type "part" - hsetprop ${scobj_hpath}/stuff/config nxalias "${name}_stuff_config" - - hfactory ${scobj_hpath}/stuff/cprofinfo plain user text - hsetprop ${scobj_hpath}/stuff/cprofinfo read ${ns}::getValue ${scobj_hpath} rdValue {CPROFINFO?} - hsetprop ${scobj_hpath}/stuff/cprofinfo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/cprofinfo control false - hsetprop ${scobj_hpath}/stuff/cprofinfo data false - hsetprop ${scobj_hpath}/stuff/cprofinfo mutable true - hsetprop ${scobj_hpath}/stuff/cprofinfo nxsave false - hsetprop ${scobj_hpath}/stuff/cprofinfo oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/cprofinfo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/cprofinfo type "part" - hsetprop ${scobj_hpath}/stuff/cprofinfo nxalias "${name}_stuff_cprofinfo" - - hfactory ${scobj_hpath}/stuff/dout plain user text - hsetprop ${scobj_hpath}/stuff/dout read ${ns}::getValue ${scobj_hpath} rdValue {DOUT?} - hsetprop ${scobj_hpath}/stuff/dout rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/dout control false - hsetprop ${scobj_hpath}/stuff/dout data false - hsetprop ${scobj_hpath}/stuff/dout mutable true - hsetprop ${scobj_hpath}/stuff/dout nxsave false - hsetprop ${scobj_hpath}/stuff/dout oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/dout sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/dout type "part" - hsetprop ${scobj_hpath}/stuff/dout nxalias "${name}_stuff_dout" - - hfactory ${scobj_hpath}/stuff/error plain user text - hsetprop ${scobj_hpath}/stuff/error read ${ns}::getValue ${scobj_hpath} rdValue {ERROR?} - hsetprop ${scobj_hpath}/stuff/error rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/error control false - hsetprop ${scobj_hpath}/stuff/error data false - hsetprop ${scobj_hpath}/stuff/error mutable true - hsetprop ${scobj_hpath}/stuff/error nxsave false - hsetprop ${scobj_hpath}/stuff/error oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/error sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/error type "part" - hsetprop ${scobj_hpath}/stuff/error nxalias "${name}_stuff_error" - - hfactory ${scobj_hpath}/stuff/errors plain user text - hsetprop ${scobj_hpath}/stuff/errors read ${ns}::getValue ${scobj_hpath} rdValue {ERRORS?} - hsetprop ${scobj_hpath}/stuff/errors rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/errors control false - hsetprop ${scobj_hpath}/stuff/errors data false - hsetprop ${scobj_hpath}/stuff/errors mutable true - hsetprop ${scobj_hpath}/stuff/errors nxsave false - hsetprop ${scobj_hpath}/stuff/errors oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/errors sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/errors type "part" - hsetprop ${scobj_hpath}/stuff/errors nxalias "${name}_stuff_errors" - - hfactory ${scobj_hpath}/stuff/flushpmp plain user text - hsetprop ${scobj_hpath}/stuff/flushpmp read ${ns}::getValue ${scobj_hpath} rdValue {FLUSHPMP?} - hsetprop ${scobj_hpath}/stuff/flushpmp rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/flushpmp control false - hsetprop ${scobj_hpath}/stuff/flushpmp data false - hsetprop ${scobj_hpath}/stuff/flushpmp mutable true - hsetprop ${scobj_hpath}/stuff/flushpmp nxsave false - hsetprop ${scobj_hpath}/stuff/flushpmp oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/flushpmp sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/flushpmp type "part" - hsetprop ${scobj_hpath}/stuff/flushpmp nxalias "${name}_stuff_flushpmp" - - hfactory ${scobj_hpath}/stuff/head plain user text - hsetprop ${scobj_hpath}/stuff/head read ${ns}::getValue ${scobj_hpath} rdValue {HEAD?} - hsetprop ${scobj_hpath}/stuff/head rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/head control false - hsetprop ${scobj_hpath}/stuff/head data false - hsetprop ${scobj_hpath}/stuff/head mutable true - hsetprop ${scobj_hpath}/stuff/head nxsave false - hsetprop ${scobj_hpath}/stuff/head oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/head sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/head type "part" - hsetprop ${scobj_hpath}/stuff/head nxalias "${name}_stuff_head" - - hfactory ${scobj_hpath}/stuff/head_par plain user text - hsetprop ${scobj_hpath}/stuff/head_par read ${ns}::getValue ${scobj_hpath} rdValue {HEAD_PAR?} - hsetprop ${scobj_hpath}/stuff/head_par rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/head_par control false - hsetprop ${scobj_hpath}/stuff/head_par data false - hsetprop ${scobj_hpath}/stuff/head_par mutable true - hsetprop ${scobj_hpath}/stuff/head_par nxsave false - hsetprop ${scobj_hpath}/stuff/head_par oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/head_par sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/head_par type "part" - hsetprop ${scobj_hpath}/stuff/head_par nxalias "${name}_stuff_head_par" - - hfactory ${scobj_hpath}/stuff/identify plain user text - hsetprop ${scobj_hpath}/stuff/identify read ${ns}::getValue ${scobj_hpath} rdValue {IDENTIFY?} - hsetprop ${scobj_hpath}/stuff/identify rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/identify control false - hsetprop ${scobj_hpath}/stuff/identify data false - hsetprop ${scobj_hpath}/stuff/identify mutable true - hsetprop ${scobj_hpath}/stuff/identify nxsave false - hsetprop ${scobj_hpath}/stuff/identify oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/identify sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/identify type "part" - hsetprop ${scobj_hpath}/stuff/identify nxalias "${name}_stuff_identify" - - hfactory ${scobj_hpath}/stuff/lpg plain user text - hsetprop ${scobj_hpath}/stuff/lpg read ${ns}::getValue ${scobj_hpath} rdValue {LPG?} - hsetprop ${scobj_hpath}/stuff/lpg rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/lpg control false - hsetprop ${scobj_hpath}/stuff/lpg data false - hsetprop ${scobj_hpath}/stuff/lpg mutable true - hsetprop ${scobj_hpath}/stuff/lpg nxsave false - hsetprop ${scobj_hpath}/stuff/lpg oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/lpg sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/lpg type "part" - hsetprop ${scobj_hpath}/stuff/lpg nxalias "${name}_stuff_lpg" - - hfactory ${scobj_hpath}/stuff/oem plain user text - hsetprop ${scobj_hpath}/stuff/oem read ${ns}::getValue ${scobj_hpath} rdValue {OEM?} - hsetprop ${scobj_hpath}/stuff/oem rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/oem control false - hsetprop ${scobj_hpath}/stuff/oem data false - hsetprop ${scobj_hpath}/stuff/oem mutable true - hsetprop ${scobj_hpath}/stuff/oem nxsave false - hsetprop ${scobj_hpath}/stuff/oem oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/oem sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/oem type "part" - hsetprop ${scobj_hpath}/stuff/oem nxalias "${name}_stuff_oem" - - hfactory ${scobj_hpath}/stuff/opt plain user text - hsetprop ${scobj_hpath}/stuff/opt read ${ns}::getValue ${scobj_hpath} rdValue {OPT?} - hsetprop ${scobj_hpath}/stuff/opt rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/opt control false - hsetprop ${scobj_hpath}/stuff/opt data false - hsetprop ${scobj_hpath}/stuff/opt mutable true - hsetprop ${scobj_hpath}/stuff/opt nxsave false - hsetprop ${scobj_hpath}/stuff/opt oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/opt sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/opt type "part" - hsetprop ${scobj_hpath}/stuff/opt nxalias "${name}_stuff_opt" - - hfactory ${scobj_hpath}/stuff/plim plain user text - hsetprop ${scobj_hpath}/stuff/plim read ${ns}::getValue ${scobj_hpath} rdValue {PLIM?} - hsetprop ${scobj_hpath}/stuff/plim rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/plim control false - hsetprop ${scobj_hpath}/stuff/plim data false - hsetprop ${scobj_hpath}/stuff/plim mutable true - hsetprop ${scobj_hpath}/stuff/plim nxsave false - hsetprop ${scobj_hpath}/stuff/plim oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/plim sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/plim type "part" - hsetprop ${scobj_hpath}/stuff/plim nxalias "${name}_stuff_plim" - - hfactory ${scobj_hpath}/stuff/pressure plain user text - hsetprop ${scobj_hpath}/stuff/pressure read ${ns}::getValue ${scobj_hpath} rdValue {PRESSURE?} - hsetprop ${scobj_hpath}/stuff/pressure rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/pressure control false - hsetprop ${scobj_hpath}/stuff/pressure data false - hsetprop ${scobj_hpath}/stuff/pressure mutable true - hsetprop ${scobj_hpath}/stuff/pressure nxsave false - hsetprop ${scobj_hpath}/stuff/pressure oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/pressure sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/pressure type "part" - hsetprop ${scobj_hpath}/stuff/pressure nxalias "${name}_stuff_pressure" - - hfactory ${scobj_hpath}/stuff/prfastacq plain user text - hsetprop ${scobj_hpath}/stuff/prfastacq read ${ns}::getValue ${scobj_hpath} rdValue {PRFASTACQ?} - hsetprop ${scobj_hpath}/stuff/prfastacq rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/prfastacq control false - hsetprop ${scobj_hpath}/stuff/prfastacq data false - hsetprop ${scobj_hpath}/stuff/prfastacq mutable true - hsetprop ${scobj_hpath}/stuff/prfastacq nxsave false - hsetprop ${scobj_hpath}/stuff/prfastacq oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/prfastacq sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/prfastacq type "part" - hsetprop ${scobj_hpath}/stuff/prfastacq nxalias "${name}_stuff_prfastacq" - - hfactory ${scobj_hpath}/stuff/purge plain user text - hsetprop ${scobj_hpath}/stuff/purge read ${ns}::getValue ${scobj_hpath} rdValue {PURGE?} - hsetprop ${scobj_hpath}/stuff/purge rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/purge control false - hsetprop ${scobj_hpath}/stuff/purge data false - hsetprop ${scobj_hpath}/stuff/purge mutable true - hsetprop ${scobj_hpath}/stuff/purge nxsave false - hsetprop ${scobj_hpath}/stuff/purge oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/purge sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/purge type "part" - hsetprop ${scobj_hpath}/stuff/purge nxalias "${name}_stuff_purge" - - hfactory ${scobj_hpath}/stuff/remote plain user text - hsetprop ${scobj_hpath}/stuff/remote read ${ns}::getValue ${scobj_hpath} rdValue {REMOTE?} - hsetprop ${scobj_hpath}/stuff/remote rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/remote control false - hsetprop ${scobj_hpath}/stuff/remote data false - hsetprop ${scobj_hpath}/stuff/remote mutable true - hsetprop ${scobj_hpath}/stuff/remote nxsave false - hsetprop ${scobj_hpath}/stuff/remote oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/remote sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/remote type "part" - hsetprop ${scobj_hpath}/stuff/remote nxalias "${name}_stuff_remote" - - hfactory ${scobj_hpath}/stuff/rfid plain user text - hsetprop ${scobj_hpath}/stuff/rfid read ${ns}::getValue ${scobj_hpath} rdValue {RFID?} - hsetprop ${scobj_hpath}/stuff/rfid rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/rfid control false - hsetprop ${scobj_hpath}/stuff/rfid data false - hsetprop ${scobj_hpath}/stuff/rfid mutable true - hsetprop ${scobj_hpath}/stuff/rfid nxsave false - hsetprop ${scobj_hpath}/stuff/rfid oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/rfid sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/rfid type "part" - hsetprop ${scobj_hpath}/stuff/rfid nxalias "${name}_stuff_rfid" - - hfactory ${scobj_hpath}/stuff/service plain user text - hsetprop ${scobj_hpath}/stuff/service read ${ns}::getValue ${scobj_hpath} rdValue {SERVICE?} - hsetprop ${scobj_hpath}/stuff/service rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/service control false - hsetprop ${scobj_hpath}/stuff/service data false - hsetprop ${scobj_hpath}/stuff/service mutable true - hsetprop ${scobj_hpath}/stuff/service nxsave false - hsetprop ${scobj_hpath}/stuff/service oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/service sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/service type "part" - hsetprop ${scobj_hpath}/stuff/service nxalias "${name}_stuff_service" - - hfactory ${scobj_hpath}/stuff/sysinfo plain user text - hsetprop ${scobj_hpath}/stuff/sysinfo read ${ns}::getValue ${scobj_hpath} rdValue {SYSINFO?} - hsetprop ${scobj_hpath}/stuff/sysinfo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/sysinfo control false - hsetprop ${scobj_hpath}/stuff/sysinfo data false - hsetprop ${scobj_hpath}/stuff/sysinfo mutable true - hsetprop ${scobj_hpath}/stuff/sysinfo nxsave false - hsetprop ${scobj_hpath}/stuff/sysinfo oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/sysinfo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/sysinfo type "part" - hsetprop ${scobj_hpath}/stuff/sysinfo nxalias "${name}_stuff_sysinfo" - - hfactory ${scobj_hpath}/stuff/units plain user text - hsetprop ${scobj_hpath}/stuff/units read ${ns}::getValue ${scobj_hpath} rdValue {UNITS?} - hsetprop ${scobj_hpath}/stuff/units rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/units control false - hsetprop ${scobj_hpath}/stuff/units data false - hsetprop ${scobj_hpath}/stuff/units mutable true - hsetprop ${scobj_hpath}/stuff/units nxsave false - hsetprop ${scobj_hpath}/stuff/units oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/units sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/units type "part" - hsetprop ${scobj_hpath}/stuff/units nxalias "${name}_stuff_units" - - hfactory ${scobj_hpath}/stuff/valves plain user text - hsetprop ${scobj_hpath}/stuff/valves read ${ns}::getValue ${scobj_hpath} rdValue {VALVES?} - hsetprop ${scobj_hpath}/stuff/valves rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/stuff/valves control false - hsetprop ${scobj_hpath}/stuff/valves data false - hsetprop ${scobj_hpath}/stuff/valves mutable true - hsetprop ${scobj_hpath}/stuff/valves nxsave false - hsetprop ${scobj_hpath}/stuff/valves oldval UNKNOWN - hsetprop ${scobj_hpath}/stuff/valves sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/stuff/valves type "part" - hsetprop ${scobj_hpath}/stuff/valves nxalias "${name}_stuff_valves" + hfactory ${scobj_hpath}/pump/ratio/setp plain user text + hsetprop ${scobj_hpath}/pump/ratio/setp write ${ns}::ratio_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/ratio/setp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/ratio/setp check ${ns}::ratio_check ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/ratio/setp control true + hsetprop ${scobj_hpath}/pump/ratio/setp data true + hsetprop ${scobj_hpath}/pump/ratio/setp mutable true + hsetprop ${scobj_hpath}/pump/ratio/setp nxsave true + hsetprop ${scobj_hpath}/pump/ratio/setp oldval 25/25/25/25 + hset ${scobj_hpath}/pump/ratio/setp 25/25/25/25 + hsetprop ${scobj_hpath}/pump/ratio/setp klass "parameter" + hsetprop ${scobj_hpath}/pump/ratio/setp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/ratio/setp type "part" + hsetprop ${scobj_hpath}/pump/ratio/setp units "percent" + hsetprop ${scobj_hpath}/pump/ratio/setp nxalias "${name}_pump_ratio_setp" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/stuff/an_out 600 - ${sct_controller} poll ${scobj_hpath}/stuff/boardinfo 600 - ${sct_controller} poll ${scobj_hpath}/stuff/config 600 - ${sct_controller} poll ${scobj_hpath}/stuff/cprofinfo 600 - ${sct_controller} poll ${scobj_hpath}/stuff/dout 600 - ${sct_controller} poll ${scobj_hpath}/stuff/error 600 - ${sct_controller} poll ${scobj_hpath}/stuff/errors 600 - ${sct_controller} poll ${scobj_hpath}/stuff/flushpmp 600 - ${sct_controller} poll ${scobj_hpath}/stuff/head 600 - ${sct_controller} poll ${scobj_hpath}/stuff/head_par 600 - ${sct_controller} poll ${scobj_hpath}/stuff/identify 600 - ${sct_controller} poll ${scobj_hpath}/stuff/lpg 600 - ${sct_controller} poll ${scobj_hpath}/stuff/oem 600 - ${sct_controller} poll ${scobj_hpath}/stuff/opt 600 - ${sct_controller} poll ${scobj_hpath}/stuff/plim 600 - ${sct_controller} poll ${scobj_hpath}/stuff/pressure 600 - ${sct_controller} poll ${scobj_hpath}/stuff/prfastacq 600 - ${sct_controller} poll ${scobj_hpath}/stuff/purge 600 - ${sct_controller} poll ${scobj_hpath}/stuff/remote 600 - ${sct_controller} poll ${scobj_hpath}/stuff/rfid 600 - ${sct_controller} poll ${scobj_hpath}/stuff/service 600 - ${sct_controller} poll ${scobj_hpath}/stuff/sysinfo 600 - ${sct_controller} poll ${scobj_hpath}/stuff/units 600 - ${sct_controller} poll ${scobj_hpath}/stuff/valves 600 + ${sct_controller} poll ${scobj_hpath}/pump/ratio/pval 1 + ${sct_controller} write ${scobj_hpath}/pump/ratio/setp + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + } + + hfactory ${scobj_hpath}/pump/volume plain spy none + hsetprop ${scobj_hpath}/pump/volume data "true" + hsetprop ${scobj_hpath}/pump/volume klass "@none" + hsetprop ${scobj_hpath}/pump/volume type "part" + + hfactory ${scobj_hpath}/pump/volume/pval plain user float + hsetprop ${scobj_hpath}/pump/volume/pval read ${ns}::volume_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/volume/pval rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/pval control true + hsetprop ${scobj_hpath}/pump/volume/pval data true + hsetprop ${scobj_hpath}/pump/volume/pval mutable true + hsetprop ${scobj_hpath}/pump/volume/pval nxsave true + hsetprop ${scobj_hpath}/pump/volume/pval oldval 0.0 + hsetprop ${scobj_hpath}/pump/volume/pval klass "parameter" + hsetprop ${scobj_hpath}/pump/volume/pval sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/volume/pval type "part" + hsetprop ${scobj_hpath}/pump/volume/pval units "mL" + hsetprop ${scobj_hpath}/pump/volume/pval nxalias "${name}_pump_volume_pval" + + hfactory ${scobj_hpath}/pump/volume/setp plain user float + hsetprop ${scobj_hpath}/pump/volume/setp read ${ns}::pump_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/volume/setp rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp write ${ns}::pump_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/volume/setp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp driving 0 + hsetprop ${scobj_hpath}/pump/volume/setp checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp checkstatus ${ns}::pump_checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp halt ${ns}::pump_halt ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp driveable pump/volume/pval + hsetprop ${scobj_hpath}/pump/volume/setp control true + hsetprop ${scobj_hpath}/pump/volume/setp data true + hsetprop ${scobj_hpath}/pump/volume/setp mutable true + hsetprop ${scobj_hpath}/pump/volume/setp nxsave true + hsetprop ${scobj_hpath}/pump/volume/setp lowerlimit 0 + hsetprop ${scobj_hpath}/pump/volume/setp upperlimit 100 + hsetprop ${scobj_hpath}/pump/volume/setp tolerance 0.01 + hsetprop ${scobj_hpath}/pump/volume/setp oldval 0.0 + hsetprop ${scobj_hpath}/pump/volume/setp klass "parameter" + hsetprop ${scobj_hpath}/pump/volume/setp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/volume/setp this_state "0" + hsetprop ${scobj_hpath}/pump/volume/setp type "drivable" + hsetprop ${scobj_hpath}/pump/volume/setp units "mL" + hsetprop ${scobj_hpath}/pump/volume/setp nxalias "${name}_pump_volume_setp" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/volume/pval 1 + ${sct_controller} poll ${scobj_hpath}/pump/volume/setp 1 + ${sct_controller} write ${scobj_hpath}/pump/volume/setp } else { ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } @@ -1981,10 +1860,11 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath} data true hsetprop ${scobj_hpath} debug_threshold 0 if {[string equal -nocase "${simulation_flag}" "false"]} { - ansto_makesctdrive ${name}_pump_pump_sp ${scobj_hpath}/pump/pump_sp ${scobj_hpath}/pump/volume_pv ${sct_controller} - ansto_makesctdrive ${name}_pump_volume_sp ${scobj_hpath}/pump/volume_sp ${scobj_hpath}/pump/volume_pv ${sct_controller} + ansto_makesctdrive ${name}_pump_volume_setp ${scobj_hpath}/pump/volume/setp ${scobj_hpath}/pump/volume/pval ${sct_controller} } -# mkDriver hook code goes here +# mkDriver hook code starts + hset ${scobj_hpath}/pump/remote 1 +# mkDriver hook code ends } catch_message ] handle_exception ${catch_status} ${catch_message} } From 91b7c0b6eb4c208c75a0fe97e065ca252e05f117 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 3 Oct 2014 17:43:05 +1000 Subject: [PATCH 05/54] Reasonably working Knauer pump driver --- .../config/environment/knauer_pump.sct | 179 +-- .../config/environment/sct_knauer_pump.tcl | 1195 +++-------------- 2 files changed, 192 insertions(+), 1182 deletions(-) diff --git a/site_ansto/instrument/config/environment/knauer_pump.sct b/site_ansto/instrument/config/environment/knauer_pump.sct index fbe377bd..63a616f5 100644 --- a/site_ansto/instrument/config/environment/knauer_pump.sct +++ b/site_ansto/instrument/config/environment/knauer_pump.sct @@ -39,21 +39,20 @@ driver knauer_pump = { readable = 1; read_command = ' '; fetch_function = volume_fetch; -#checkrange_function = volume_reject; property 'units' = 'mL'; } var setp = { type = float; writeable = 1; write_command = ' '; - write_function = pump_write; + write_function = volume_write; driveable = pump/volume/pval; - checkstatus_function = pump_checkstatus; - halt_function = pump_halt; + checkstatus_function = volume_checkstatus; + halt_function = volume_halt; lowerlimit = 0; upperlimit = 100; tolerance = 0.01; readable = 1; read_command = ' '; - fetch_function = pump_fetch; + fetch_function = volume_fsm; property 'units' = 'mL'; property this_state = 0; } @@ -81,84 +80,12 @@ driver knauer_pump = { type = float; value = 1.0; writeable = 1; write_command = ' '; write_function = flow_write; - lowerlimit = 0; upperlimit = 10; + lowerlimit = 0; upperlimit = 9.999; property 'units' = 'mL/min'; } } } - group grp_stuff = { - readable = 600; - type = text; - data = false; control = false; nxsave = false; - var an_out = { read_command = 'AN_OUT?'; } - var boardinfo = { read_command = 'BOARDINFO?'; } - var config = { read_command = 'CONFIG?'; } - var cprofinfo = { read_command = 'CPROFINFO?'; } - var dout = { read_command = 'DOUT?'; } - var error = { read_command = 'ERROR?'; } - var errors = { read_command = 'ERRORS?'; } - var flushpmp = { read_command = 'FLUSHPMP?'; } - var head = { read_command = 'HEAD?'; } - var head_par = { read_command = 'HEAD_PAR?'; } - var identify = { read_command = 'IDENTIFY?'; } - var lpg = { read_command = 'LPG?'; } - var oem = { read_command = 'OEM?'; } - var opt = { read_command = 'OPT?'; } - var plim = { read_command = 'PLIM?'; } - var pressure = { read_command = 'PRESSURE?'; } - var prfastacq = { read_command = 'PRFASTACQ?'; } - var purge = { read_command = 'PURGE?'; } - var remote = { read_command = 'REMOTE?'; } - var rfid = { read_command = 'RFID?'; } - var service = { read_command = 'SERVICE?'; } - var sysinfo = { read_command = 'SYSINFO?'; } - var 'units' = { read_command = 'UNITS?'; } - var valves = { read_command = 'VALVES?'; } - } - group grp_glp = { - type = text; - readable = 1; - fetch_function = fetch_from_glp; - var board_time = { read_command = '0'; } - var motor_time = { read_command = '1'; } - var head_count = { read_command = '3'; } - var head_time = { read_command = '4'; } - var head_volm = { read_command = '5'; } - var head_voln = { read_command = '6'; } - var head_pwrhi = { read_command = '7'; } - var head_pwrlo = { read_command = '8'; } - var pump_revs = { read_command = '9'; } - var pump_volm = { read_command = '10'; } - var pump_voln = { read_command = '11'; } - var pump_pwrhi = { read_command = '12'; } - var pump_pwrlo = { read_command = '13'; } - } - group grp_status = { - type = text; - readable = 1; - fetch_function = fetch_from_status; - var state = { read_command = '1'; } - var cur_error = { read_command = '2'; } - var cur_run_time = { read_command = '3'; } - var flow_rate = { read_command = '4'; } - var lpg_0 = { read_command = '5'; } - var lpg_1 = { read_command = '6'; } - var lpg_2 = { read_command = '7'; } - var lpg_3 = { read_command = '8'; } - var evt_0 = { read_command = '9'; } - var evt_1 = { read_command = '10'; } - var evt_2 = { read_command = '11'; } - var evt_3 = { read_command = '12'; } - var evt_4 = { read_command = '13'; } - var evt_5 = { read_command = '14'; } - var evt_6 = { read_command = '15'; } - var evt_7 = { read_command = '16'; } - var cur_pres = { read_command = '17'; } - var start_in = { read_command = '18'; } - var error_in = { read_command = '19'; } - } - # # Ensure the pump starts up in REMOTE mode # @@ -177,18 +104,6 @@ driver knauer_pump = { } %%} - code fetch_from_glp = {%% - set index ${cmd_str} - set data [hgetpropval ${tc_root}/dummy/glp real_data] - set dlist [split ${data} ","] - if { [llength ${dlist}] > ${index} } { - sct result [lindex ${dlist} ${index}] - } else { - sct result "" - } - set cmd "@@NOSEND@@" - %%} - # # These functions handle the real_data returned by the pump for the STATUS? command # @@ -198,18 +113,6 @@ driver knauer_pump = { set data "Hidden in real_data property" %%} - code fetch_from_status = {%% - set index ${cmd_str} - set data [hgetpropval ${tc_root}/dummy/status real_data] - set dlist [split ${data} ","] - if { [llength ${dlist}] > ${index} } { - sct result [lindex ${dlist} ${index}] - } else { - sct result "" - } - set cmd "@@NOSEND@@" - %%} - # # Decode the status from the real_data to PUMPING if it is pumping else IDLE # @@ -250,6 +153,7 @@ driver knauer_pump = { "SYS_ST_HOLD" \ "SYS_ST_PURGE" \ "SYS_ST_STANDBY" \ + "SYS_ST_SEVEN" \ "SYS_ST_FAILED" \ "SYS_ST_RUNATEND" \ ] @@ -357,8 +261,7 @@ driver knauer_pump = { set cmd "@@NOSEND@@" %%} -########## - code pump_write = {%% + code volume_write = {%% hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] hset ${tc_root}/[sct driveable] 0.0 set cmd "REMOTE" @@ -373,7 +276,7 @@ driver knauer_pump = { } %%} - code pump_fetch = {%% + code volume_fsm = {%% if { [sct this_state] > 0 } { set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow/setp])}] set ratio_tgt [join [split [hval ${tc_root}/pump/ratio/setp] /] ,] @@ -396,6 +299,12 @@ driver knauer_pump = { } elseif { [sct this_state] == 5 } { set cmd "START:1,0" sct this_state 0 + } elseif { [sct this_state] == 91 } { + set cmd "STOP:1,0" + sct this_state 92 + } elseif { [sct this_state] == 92 } { + set cmd "STOP:0,0" + sct this_state 0 } else { sct this_state 0 set cmd "@@NOSEND@@" @@ -405,15 +314,13 @@ driver knauer_pump = { set cmd "@@NOSEND@@" set nextState idle if { [hpropexists [sct] pumping] && [sct pumping] } { - if { [hpropexists [sct] driving] && [sct driving] } { - pump_checkstatus "${tc_root}" - } set new_value [hval ${tc_root}/pump/status] set old_value [sct oldval] if {${new_value} != ${old_value}} { sct oldval ${new_value} if {${old_value} == "PUMPING" && ${new_value} == "IDLE"} { - set cmd "STOP" + set cmd "STOP:0,0" + sct this_state 91 set nextState noResponse sct result "" sct driving 0 @@ -424,59 +331,11 @@ driver knauer_pump = { } %%} - code pump_halt = {%% - set flow_tgt 0 - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "STOP" - sct send ${cmd} - %%} - ########## - code volume_write = {%% - hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] - hset ${tc_root}/[sct driveable] 0.0 - set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow_sp])}] - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,3" - sct pumping 1 - set data ${par} - if { ${data} != [sct oldval] } { - debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" - sct oldval ${data} - sct update ${data} - sct utime readtime - } - %%} - - code volume_checkpumping = {%% - set cmd "@@NOSEND@@" - set nextState idle - if { [hpropexists [sct] pumping] && [sct pumping] } { - if { [hpropexists [sct] driving] && [sct driving] } { - volume_checkstatus "${tc_root}" - } - set sp "[sct target]" - set pv "[hval ${tc_root}/[sct driveable]]" - if { (${sp} - ${pv}) <= [sct tolerance] } { - set flow_tgt 0 - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" - set nextState noResponse - sct result "" - sct driving 0 - sct pumping 0 - } - } - %%} - code volume_halt = {%% - set flow_tgt 0 - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" + set cmd "STOP:0,0" + sct this_state 91 + debug_log ${tc_root} 1 "volume_halt sct send ${cmd}" sct send ${cmd} %%} - code volume_reject = {%% - sct geterror "cannot use hset on [sct]" - error "[sct geterror]" - %%} } diff --git a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl index a9c259a9..32f1d88c 100644 --- a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl +++ b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl @@ -80,70 +80,6 @@ proc ::scobj::knauer_pump::checkrange {tc_root} { handle_exception ${catch_status} ${catch_message} } -# function to request the read of a parameter on a device -proc ::scobj::knauer_pump::fetch_from_glp {tc_root nextState cmd_str} { - set catch_status [ catch { - debug_log ${tc_root} 1 "fetch_from_glp tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" - if { [hpropexists [sct] geterror] } { - hdelprop [sct] geterror - } - set cmd "${cmd_str}" -# fetch_from_glp hook code starts - set index ${cmd_str} - set data [hgetpropval ${tc_root}/dummy/glp real_data] - set dlist [split ${data} ","] - if { [llength ${dlist}] > ${index} } { - sct result [lindex ${dlist} ${index}] - } else { - sct result "" - } - set cmd "@@NOSEND@@" -# fetch_from_glp hook code ends - if { [hpropexists [sct] geterror] } { - debug_log ${tc_root} 9 "[sct] error: [sct geterror]" - error "[sct geterror]" - } - debug_log ${tc_root} 1 "fetch_from_glp sct send ${cmd}" - if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { - sct send "${cmd}" - } - return ${nextState} - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - -# function to request the read of a parameter on a device -proc ::scobj::knauer_pump::fetch_from_status {tc_root nextState cmd_str} { - set catch_status [ catch { - debug_log ${tc_root} 1 "fetch_from_status tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" - if { [hpropexists [sct] geterror] } { - hdelprop [sct] geterror - } - set cmd "${cmd_str}" -# fetch_from_status hook code starts - set index ${cmd_str} - set data [hgetpropval ${tc_root}/dummy/status real_data] - set dlist [split ${data} ","] - if { [llength ${dlist}] > ${index} } { - sct result [lindex ${dlist} ${index}] - } else { - sct result "" - } - set cmd "@@NOSEND@@" -# fetch_from_status hook code ends - if { [hpropexists [sct] geterror] } { - debug_log ${tc_root} 9 "[sct] error: [sct geterror]" - error "[sct geterror]" - } - debug_log ${tc_root} 1 "fetch_from_status sct send ${cmd}" - if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { - sct send "${cmd}" - } - return ${nextState} - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - # function to request the read of a parameter on a device proc ::scobj::knauer_pump::flow_fetch {tc_root nextState cmd_str} { set catch_status [ catch { @@ -243,169 +179,6 @@ proc ::scobj::knauer_pump::noResponse {tc_root} { handle_exception ${catch_status} ${catch_message} } -# checkstatus function for driveable interface -proc ::scobj::knauer_pump::pump_checkstatus {tc_root} { - set catch_status [ catch { -# pump_checkstatus hook code goes here - if {[sct driving]} { - set sp "[sct target]" - set pv "[hval ${tc_root}/[sct driveable]]" - if { abs(${pv} - ${sp}) <= [sct tolerance] } { - if { [hpropexists [sct] settle_time] } { - if { [hpropexists [sct] settle_time_start] } { - if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} { - sct driving 0 - return "idle" - } - return "busy" - } else { - sct utime settle_time_start - return "busy" - } - } - sct driving 0 - return "idle" - } - if { [hpropexists [sct] settle_time_start] } { - hdelprop [sct] settle_time_start - } - return "busy" - } else { - return "idle" - } - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - -# function to request the read of a parameter on a device -proc ::scobj::knauer_pump::pump_fetch {tc_root nextState cmd_str} { - set catch_status [ catch { - debug_log ${tc_root} 1 "pump_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" - if { [hpropexists [sct] geterror] } { - hdelprop [sct] geterror - } - set cmd "${cmd_str}" -# pump_fetch hook code starts - if { [sct this_state] > 0 } { - set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow/setp])}] - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio/setp] /] ,] - set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] - set time_1 [expr {${time_tgt} - 500}] - set time_2 [expr {${time_tgt} + 500}] - set nextState noResponse - if { [sct this_state] == 1 } { - set cmd "TT_LOAD:1" - sct this_state [expr {[sct this_state] + 1}] - } elseif { [sct this_state] == 2 } { - set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" - sct this_state [expr {[sct this_state] + 1}] - } elseif { [sct this_state] == 3 } { - set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" - sct this_state [expr {[sct this_state] + 1}] - } elseif { [sct this_state] == 4 } { - set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" - sct this_state [expr {[sct this_state] + 1}] - } elseif { [sct this_state] == 5 } { - set cmd "START:1,0" - sct this_state 0 - } else { - sct this_state 0 - set cmd "@@NOSEND@@" - set nextState idle - } - } else { - set cmd "@@NOSEND@@" - set nextState idle - if { [hpropexists [sct] pumping] && [sct pumping] } { - if { [hpropexists [sct] driving] && [sct driving] } { - pump_checkstatus "${tc_root}" - } - set new_value [hval ${tc_root}/pump/status] - set old_value [sct oldval] - if {${new_value} != ${old_value}} { - sct oldval ${new_value} - if {${old_value} == "PUMPING" && ${new_value} == "IDLE"} { - set cmd "STOP" - set nextState noResponse - sct result "" - sct driving 0 - sct pumping 0 - } - } - } - } -# pump_fetch hook code ends - if { [hpropexists [sct] geterror] } { - debug_log ${tc_root} 9 "[sct] error: [sct geterror]" - error "[sct geterror]" - } - debug_log ${tc_root} 1 "pump_fetch sct send ${cmd}" - if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { - sct send "${cmd}" - } - return ${nextState} - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - -# halt function for driveable interface -proc ::scobj::knauer_pump::pump_halt {tc_root} { - set catch_status [ catch { - debug_log ${tc_root} 1 "pump_halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" - ### TODO hset [sct] [hval [sct]] -# pump_halt hook code starts - set flow_tgt 0 - set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] - set cmd "STOP" - sct send ${cmd} -# pump_halt hook code ends - sct driving 0 - return "idle" - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - -# function to write a parameter value on a device -proc ::scobj::knauer_pump::pump_write {tc_root nextState cmd_str} { - set catch_status [ catch { - debug_log ${tc_root} 1 "pump_write tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" - if { [hpropexists [sct] geterror] } { - hdelprop [sct] geterror - } - set par [sct target] - set cmd "${cmd_str}${par}" -# pump_write hook code starts - hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] - hset ${tc_root}/[sct driveable] 0.0 - set cmd "REMOTE" - sct this_state 1 - sct pumping 1 - set data ${par} - if { ${data} != [sct oldval] } { - debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" - sct oldval ${data} - sct update ${data} - sct utime readtime - } -# pump_write hook code ends - if { [hpropexists [sct] geterror] } { - debug_log ${tc_root} 9 "[sct] error: [sct geterror]" - error "[sct geterror]" - } - if { [hpropexists [sct] driving] } { - if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { - sct driving 1 - } - } - debug_log ${tc_root} 1 "pump_write sct send ${cmd}" - if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { - sct send "${cmd}" - } - return ${nextState} - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - # check function for hset change proc ::scobj::knauer_pump::ratio_check {tc_root} { set catch_status [ catch { @@ -730,6 +503,7 @@ proc ::scobj::knauer_pump::state_fetch {tc_root nextState cmd_str} { "SYS_ST_HOLD" \ "SYS_ST_PURGE" \ "SYS_ST_STANDBY" \ + "SYS_ST_SEVEN" \ "SYS_ST_FAILED" \ "SYS_ST_RUNATEND" \ ] @@ -781,6 +555,40 @@ proc ::scobj::knauer_pump::status_fetch {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } +# checkstatus function for driveable interface +proc ::scobj::knauer_pump::volume_checkstatus {tc_root} { + set catch_status [ catch { +# volume_checkstatus hook code goes here + if {[sct driving]} { + set sp "[sct target]" + set pv "[hval ${tc_root}/[sct driveable]]" + if { abs(${pv} - ${sp}) <= [sct tolerance] } { + if { [hpropexists [sct] settle_time] } { + if { [hpropexists [sct] settle_time_start] } { + if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} { + sct driving 0 + return "idle" + } + return "busy" + } else { + sct utime settle_time_start + return "busy" + } + } + sct driving 0 + return "idle" + } + if { [hpropexists [sct] settle_time_start] } { + hdelprop [sct] settle_time_start + } + return "busy" + } else { + return "idle" + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # function to request the read of a parameter on a device proc ::scobj::knauer_pump::volume_fetch {tc_root nextState cmd_str} { set catch_status [ catch { @@ -821,6 +629,139 @@ proc ::scobj::knauer_pump::volume_fetch {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } +# function to request the read of a parameter on a device +proc ::scobj::knauer_pump::volume_fsm {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_fsm tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# volume_fsm hook code starts + if { [sct this_state] > 0 } { + set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow/setp])}] + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio/setp] /] ,] + set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] + set time_1 [expr {${time_tgt} - 500}] + set time_2 [expr {${time_tgt} + 500}] + set nextState noResponse + if { [sct this_state] == 1 } { + set cmd "TT_LOAD:1" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 2 } { + set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 3 } { + set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 4 } { + set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 5 } { + set cmd "START:1,0" + sct this_state 0 + } elseif { [sct this_state] == 91 } { + set cmd "STOP:1,0" + sct this_state 92 + } elseif { [sct this_state] == 92 } { + set cmd "STOP:0,0" + sct this_state 0 + } else { + sct this_state 0 + set cmd "@@NOSEND@@" + set nextState idle + } + } else { + set cmd "@@NOSEND@@" + set nextState idle + if { [hpropexists [sct] pumping] && [sct pumping] } { + set new_value [hval ${tc_root}/pump/status] + set old_value [sct oldval] + if {${new_value} != ${old_value}} { + sct oldval ${new_value} + if {${old_value} == "PUMPING" && ${new_value} == "IDLE"} { + set cmd "STOP:0,0" + sct this_state 91 + set nextState noResponse + sct result "" + sct driving 0 + sct pumping 0 + } + } + } + } +# volume_fsm hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "volume_fsm sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# halt function for driveable interface +proc ::scobj::knauer_pump::volume_halt {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" + ### TODO hset [sct] [hval [sct]] +# volume_halt hook code starts + set cmd "STOP:0,0" + sct this_state 91 + debug_log ${tc_root} 1 "volume_halt sct send ${cmd}" + sct send ${cmd} +# volume_halt hook code ends + sct driving 0 + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::knauer_pump::volume_write {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_write tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# volume_write hook code starts + hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] + hset ${tc_root}/[sct driveable] 0.0 + set cmd "REMOTE" + sct this_state 1 + sct pumping 1 + set data ${par} + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } +# volume_write hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "volume_write sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } { ::scobj::knauer_pump::sics_log 9 "::scobj::knauer_pump::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" set ns "[namespace current]" @@ -871,796 +812,6 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" } - hfactory ${scobj_hpath}/grp_glp plain spy none - hsetprop ${scobj_hpath}/grp_glp data "true" - hsetprop ${scobj_hpath}/grp_glp klass "@none" - hsetprop ${scobj_hpath}/grp_glp type "part" - - hfactory ${scobj_hpath}/grp_glp/board_time plain user text - hsetprop ${scobj_hpath}/grp_glp/board_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {0} - hsetprop ${scobj_hpath}/grp_glp/board_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/board_time control true - hsetprop ${scobj_hpath}/grp_glp/board_time data true - hsetprop ${scobj_hpath}/grp_glp/board_time mutable true - hsetprop ${scobj_hpath}/grp_glp/board_time nxsave true - hsetprop ${scobj_hpath}/grp_glp/board_time oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/board_time klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/board_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/board_time type "part" - hsetprop ${scobj_hpath}/grp_glp/board_time nxalias "${name}_grp_glp_board_time" - - hfactory ${scobj_hpath}/grp_glp/head_count plain user text - hsetprop ${scobj_hpath}/grp_glp/head_count read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {3} - hsetprop ${scobj_hpath}/grp_glp/head_count rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/head_count control true - hsetprop ${scobj_hpath}/grp_glp/head_count data true - hsetprop ${scobj_hpath}/grp_glp/head_count mutable true - hsetprop ${scobj_hpath}/grp_glp/head_count nxsave true - hsetprop ${scobj_hpath}/grp_glp/head_count oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/head_count klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/head_count sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/head_count type "part" - hsetprop ${scobj_hpath}/grp_glp/head_count nxalias "${name}_grp_glp_head_count" - - hfactory ${scobj_hpath}/grp_glp/head_pwrhi plain user text - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {7} - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi control true - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi data true - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi mutable true - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi nxsave true - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi type "part" - hsetprop ${scobj_hpath}/grp_glp/head_pwrhi nxalias "${name}_grp_glp_head_pwrhi" - - hfactory ${scobj_hpath}/grp_glp/head_pwrlo plain user text - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {8} - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo control true - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo data true - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo mutable true - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo nxsave true - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo type "part" - hsetprop ${scobj_hpath}/grp_glp/head_pwrlo nxalias "${name}_grp_glp_head_pwrlo" - - hfactory ${scobj_hpath}/grp_glp/head_time plain user text - hsetprop ${scobj_hpath}/grp_glp/head_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {4} - hsetprop ${scobj_hpath}/grp_glp/head_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/head_time control true - hsetprop ${scobj_hpath}/grp_glp/head_time data true - hsetprop ${scobj_hpath}/grp_glp/head_time mutable true - hsetprop ${scobj_hpath}/grp_glp/head_time nxsave true - hsetprop ${scobj_hpath}/grp_glp/head_time oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/head_time klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/head_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/head_time type "part" - hsetprop ${scobj_hpath}/grp_glp/head_time nxalias "${name}_grp_glp_head_time" - - hfactory ${scobj_hpath}/grp_glp/head_volm plain user text - hsetprop ${scobj_hpath}/grp_glp/head_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {5} - hsetprop ${scobj_hpath}/grp_glp/head_volm rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/head_volm control true - hsetprop ${scobj_hpath}/grp_glp/head_volm data true - hsetprop ${scobj_hpath}/grp_glp/head_volm mutable true - hsetprop ${scobj_hpath}/grp_glp/head_volm nxsave true - hsetprop ${scobj_hpath}/grp_glp/head_volm oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/head_volm klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/head_volm sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/head_volm type "part" - hsetprop ${scobj_hpath}/grp_glp/head_volm nxalias "${name}_grp_glp_head_volm" - - hfactory ${scobj_hpath}/grp_glp/head_voln plain user text - hsetprop ${scobj_hpath}/grp_glp/head_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {6} - hsetprop ${scobj_hpath}/grp_glp/head_voln rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/head_voln control true - hsetprop ${scobj_hpath}/grp_glp/head_voln data true - hsetprop ${scobj_hpath}/grp_glp/head_voln mutable true - hsetprop ${scobj_hpath}/grp_glp/head_voln nxsave true - hsetprop ${scobj_hpath}/grp_glp/head_voln oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/head_voln klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/head_voln sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/head_voln type "part" - hsetprop ${scobj_hpath}/grp_glp/head_voln nxalias "${name}_grp_glp_head_voln" - - hfactory ${scobj_hpath}/grp_glp/motor_time plain user text - hsetprop ${scobj_hpath}/grp_glp/motor_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {1} - hsetprop ${scobj_hpath}/grp_glp/motor_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/motor_time control true - hsetprop ${scobj_hpath}/grp_glp/motor_time data true - hsetprop ${scobj_hpath}/grp_glp/motor_time mutable true - hsetprop ${scobj_hpath}/grp_glp/motor_time nxsave true - hsetprop ${scobj_hpath}/grp_glp/motor_time oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/motor_time klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/motor_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/motor_time type "part" - hsetprop ${scobj_hpath}/grp_glp/motor_time nxalias "${name}_grp_glp_motor_time" - - hfactory ${scobj_hpath}/grp_glp/pump_pwrhi plain user text - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {12} - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi control true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi data true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi mutable true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi nxsave true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi type "part" - hsetprop ${scobj_hpath}/grp_glp/pump_pwrhi nxalias "${name}_grp_glp_pump_pwrhi" - - hfactory ${scobj_hpath}/grp_glp/pump_pwrlo plain user text - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {13} - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo control true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo data true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo mutable true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo nxsave true - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo type "part" - hsetprop ${scobj_hpath}/grp_glp/pump_pwrlo nxalias "${name}_grp_glp_pump_pwrlo" - - hfactory ${scobj_hpath}/grp_glp/pump_revs plain user text - hsetprop ${scobj_hpath}/grp_glp/pump_revs read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {9} - hsetprop ${scobj_hpath}/grp_glp/pump_revs rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/pump_revs control true - hsetprop ${scobj_hpath}/grp_glp/pump_revs data true - hsetprop ${scobj_hpath}/grp_glp/pump_revs mutable true - hsetprop ${scobj_hpath}/grp_glp/pump_revs nxsave true - hsetprop ${scobj_hpath}/grp_glp/pump_revs oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/pump_revs klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/pump_revs sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/pump_revs type "part" - hsetprop ${scobj_hpath}/grp_glp/pump_revs nxalias "${name}_grp_glp_pump_revs" - - hfactory ${scobj_hpath}/grp_glp/pump_volm plain user text - hsetprop ${scobj_hpath}/grp_glp/pump_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {10} - hsetprop ${scobj_hpath}/grp_glp/pump_volm rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/pump_volm control true - hsetprop ${scobj_hpath}/grp_glp/pump_volm data true - hsetprop ${scobj_hpath}/grp_glp/pump_volm mutable true - hsetprop ${scobj_hpath}/grp_glp/pump_volm nxsave true - hsetprop ${scobj_hpath}/grp_glp/pump_volm oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/pump_volm klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/pump_volm sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/pump_volm type "part" - hsetprop ${scobj_hpath}/grp_glp/pump_volm nxalias "${name}_grp_glp_pump_volm" - - hfactory ${scobj_hpath}/grp_glp/pump_voln plain user text - hsetprop ${scobj_hpath}/grp_glp/pump_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {11} - hsetprop ${scobj_hpath}/grp_glp/pump_voln rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_glp/pump_voln control true - hsetprop ${scobj_hpath}/grp_glp/pump_voln data true - hsetprop ${scobj_hpath}/grp_glp/pump_voln mutable true - hsetprop ${scobj_hpath}/grp_glp/pump_voln nxsave true - hsetprop ${scobj_hpath}/grp_glp/pump_voln oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_glp/pump_voln klass "parameter" - hsetprop ${scobj_hpath}/grp_glp/pump_voln sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_glp/pump_voln type "part" - hsetprop ${scobj_hpath}/grp_glp/pump_voln nxalias "${name}_grp_glp_pump_voln" - - if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/grp_glp/board_time 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/head_count 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/head_pwrhi 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/head_pwrlo 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/head_time 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/head_volm 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/head_voln 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/motor_time 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_pwrhi 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_pwrlo 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_revs 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_volm 1 - ${sct_controller} poll ${scobj_hpath}/grp_glp/pump_voln 1 - } else { - ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" - } - - hfactory ${scobj_hpath}/grp_status plain spy none - hsetprop ${scobj_hpath}/grp_status data "true" - hsetprop ${scobj_hpath}/grp_status klass "@none" - hsetprop ${scobj_hpath}/grp_status type "part" - - hfactory ${scobj_hpath}/grp_status/cur_error plain user text - hsetprop ${scobj_hpath}/grp_status/cur_error read ${ns}::fetch_from_status ${scobj_hpath} rdValue {2} - hsetprop ${scobj_hpath}/grp_status/cur_error rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/cur_error control true - hsetprop ${scobj_hpath}/grp_status/cur_error data true - hsetprop ${scobj_hpath}/grp_status/cur_error mutable true - hsetprop ${scobj_hpath}/grp_status/cur_error nxsave true - hsetprop ${scobj_hpath}/grp_status/cur_error oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/cur_error klass "parameter" - hsetprop ${scobj_hpath}/grp_status/cur_error sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/cur_error type "part" - hsetprop ${scobj_hpath}/grp_status/cur_error nxalias "${name}_grp_status_cur_error" - - hfactory ${scobj_hpath}/grp_status/cur_pres plain user text - hsetprop ${scobj_hpath}/grp_status/cur_pres read ${ns}::fetch_from_status ${scobj_hpath} rdValue {17} - hsetprop ${scobj_hpath}/grp_status/cur_pres rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/cur_pres control true - hsetprop ${scobj_hpath}/grp_status/cur_pres data true - hsetprop ${scobj_hpath}/grp_status/cur_pres mutable true - hsetprop ${scobj_hpath}/grp_status/cur_pres nxsave true - hsetprop ${scobj_hpath}/grp_status/cur_pres oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/cur_pres klass "parameter" - hsetprop ${scobj_hpath}/grp_status/cur_pres sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/cur_pres type "part" - hsetprop ${scobj_hpath}/grp_status/cur_pres nxalias "${name}_grp_status_cur_pres" - - hfactory ${scobj_hpath}/grp_status/cur_run_time plain user text - hsetprop ${scobj_hpath}/grp_status/cur_run_time read ${ns}::fetch_from_status ${scobj_hpath} rdValue {3} - hsetprop ${scobj_hpath}/grp_status/cur_run_time rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/cur_run_time control true - hsetprop ${scobj_hpath}/grp_status/cur_run_time data true - hsetprop ${scobj_hpath}/grp_status/cur_run_time mutable true - hsetprop ${scobj_hpath}/grp_status/cur_run_time nxsave true - hsetprop ${scobj_hpath}/grp_status/cur_run_time oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/cur_run_time klass "parameter" - hsetprop ${scobj_hpath}/grp_status/cur_run_time sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/cur_run_time type "part" - hsetprop ${scobj_hpath}/grp_status/cur_run_time nxalias "${name}_grp_status_cur_run_time" - - hfactory ${scobj_hpath}/grp_status/error_in plain user text - hsetprop ${scobj_hpath}/grp_status/error_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {19} - hsetprop ${scobj_hpath}/grp_status/error_in rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/error_in control true - hsetprop ${scobj_hpath}/grp_status/error_in data true - hsetprop ${scobj_hpath}/grp_status/error_in mutable true - hsetprop ${scobj_hpath}/grp_status/error_in nxsave true - hsetprop ${scobj_hpath}/grp_status/error_in oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/error_in klass "parameter" - hsetprop ${scobj_hpath}/grp_status/error_in sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/error_in type "part" - hsetprop ${scobj_hpath}/grp_status/error_in nxalias "${name}_grp_status_error_in" - - hfactory ${scobj_hpath}/grp_status/evt_0 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {9} - hsetprop ${scobj_hpath}/grp_status/evt_0 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_0 control true - hsetprop ${scobj_hpath}/grp_status/evt_0 data true - hsetprop ${scobj_hpath}/grp_status/evt_0 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_0 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_0 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_0 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_0 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_0 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_0 nxalias "${name}_grp_status_evt_0" - - hfactory ${scobj_hpath}/grp_status/evt_1 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {10} - hsetprop ${scobj_hpath}/grp_status/evt_1 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_1 control true - hsetprop ${scobj_hpath}/grp_status/evt_1 data true - hsetprop ${scobj_hpath}/grp_status/evt_1 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_1 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_1 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_1 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_1 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_1 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_1 nxalias "${name}_grp_status_evt_1" - - hfactory ${scobj_hpath}/grp_status/evt_2 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {11} - hsetprop ${scobj_hpath}/grp_status/evt_2 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_2 control true - hsetprop ${scobj_hpath}/grp_status/evt_2 data true - hsetprop ${scobj_hpath}/grp_status/evt_2 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_2 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_2 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_2 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_2 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_2 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_2 nxalias "${name}_grp_status_evt_2" - - hfactory ${scobj_hpath}/grp_status/evt_3 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {12} - hsetprop ${scobj_hpath}/grp_status/evt_3 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_3 control true - hsetprop ${scobj_hpath}/grp_status/evt_3 data true - hsetprop ${scobj_hpath}/grp_status/evt_3 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_3 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_3 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_3 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_3 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_3 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_3 nxalias "${name}_grp_status_evt_3" - - hfactory ${scobj_hpath}/grp_status/evt_4 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_4 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {13} - hsetprop ${scobj_hpath}/grp_status/evt_4 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_4 control true - hsetprop ${scobj_hpath}/grp_status/evt_4 data true - hsetprop ${scobj_hpath}/grp_status/evt_4 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_4 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_4 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_4 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_4 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_4 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_4 nxalias "${name}_grp_status_evt_4" - - hfactory ${scobj_hpath}/grp_status/evt_5 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_5 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {14} - hsetprop ${scobj_hpath}/grp_status/evt_5 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_5 control true - hsetprop ${scobj_hpath}/grp_status/evt_5 data true - hsetprop ${scobj_hpath}/grp_status/evt_5 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_5 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_5 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_5 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_5 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_5 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_5 nxalias "${name}_grp_status_evt_5" - - hfactory ${scobj_hpath}/grp_status/evt_6 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_6 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {15} - hsetprop ${scobj_hpath}/grp_status/evt_6 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_6 control true - hsetprop ${scobj_hpath}/grp_status/evt_6 data true - hsetprop ${scobj_hpath}/grp_status/evt_6 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_6 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_6 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_6 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_6 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_6 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_6 nxalias "${name}_grp_status_evt_6" - - hfactory ${scobj_hpath}/grp_status/evt_7 plain user text - hsetprop ${scobj_hpath}/grp_status/evt_7 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {16} - hsetprop ${scobj_hpath}/grp_status/evt_7 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/evt_7 control true - hsetprop ${scobj_hpath}/grp_status/evt_7 data true - hsetprop ${scobj_hpath}/grp_status/evt_7 mutable true - hsetprop ${scobj_hpath}/grp_status/evt_7 nxsave true - hsetprop ${scobj_hpath}/grp_status/evt_7 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/evt_7 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/evt_7 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/evt_7 type "part" - hsetprop ${scobj_hpath}/grp_status/evt_7 nxalias "${name}_grp_status_evt_7" - - hfactory ${scobj_hpath}/grp_status/flow_rate plain user text - hsetprop ${scobj_hpath}/grp_status/flow_rate read ${ns}::fetch_from_status ${scobj_hpath} rdValue {4} - hsetprop ${scobj_hpath}/grp_status/flow_rate rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/flow_rate control true - hsetprop ${scobj_hpath}/grp_status/flow_rate data true - hsetprop ${scobj_hpath}/grp_status/flow_rate mutable true - hsetprop ${scobj_hpath}/grp_status/flow_rate nxsave true - hsetprop ${scobj_hpath}/grp_status/flow_rate oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/flow_rate klass "parameter" - hsetprop ${scobj_hpath}/grp_status/flow_rate sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/flow_rate type "part" - hsetprop ${scobj_hpath}/grp_status/flow_rate nxalias "${name}_grp_status_flow_rate" - - hfactory ${scobj_hpath}/grp_status/lpg_0 plain user text - hsetprop ${scobj_hpath}/grp_status/lpg_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {5} - hsetprop ${scobj_hpath}/grp_status/lpg_0 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/lpg_0 control true - hsetprop ${scobj_hpath}/grp_status/lpg_0 data true - hsetprop ${scobj_hpath}/grp_status/lpg_0 mutable true - hsetprop ${scobj_hpath}/grp_status/lpg_0 nxsave true - hsetprop ${scobj_hpath}/grp_status/lpg_0 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/lpg_0 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/lpg_0 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/lpg_0 type "part" - hsetprop ${scobj_hpath}/grp_status/lpg_0 nxalias "${name}_grp_status_lpg_0" - - hfactory ${scobj_hpath}/grp_status/lpg_1 plain user text - hsetprop ${scobj_hpath}/grp_status/lpg_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {6} - hsetprop ${scobj_hpath}/grp_status/lpg_1 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/lpg_1 control true - hsetprop ${scobj_hpath}/grp_status/lpg_1 data true - hsetprop ${scobj_hpath}/grp_status/lpg_1 mutable true - hsetprop ${scobj_hpath}/grp_status/lpg_1 nxsave true - hsetprop ${scobj_hpath}/grp_status/lpg_1 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/lpg_1 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/lpg_1 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/lpg_1 type "part" - hsetprop ${scobj_hpath}/grp_status/lpg_1 nxalias "${name}_grp_status_lpg_1" - - hfactory ${scobj_hpath}/grp_status/lpg_2 plain user text - hsetprop ${scobj_hpath}/grp_status/lpg_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {7} - hsetprop ${scobj_hpath}/grp_status/lpg_2 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/lpg_2 control true - hsetprop ${scobj_hpath}/grp_status/lpg_2 data true - hsetprop ${scobj_hpath}/grp_status/lpg_2 mutable true - hsetprop ${scobj_hpath}/grp_status/lpg_2 nxsave true - hsetprop ${scobj_hpath}/grp_status/lpg_2 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/lpg_2 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/lpg_2 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/lpg_2 type "part" - hsetprop ${scobj_hpath}/grp_status/lpg_2 nxalias "${name}_grp_status_lpg_2" - - hfactory ${scobj_hpath}/grp_status/lpg_3 plain user text - hsetprop ${scobj_hpath}/grp_status/lpg_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {8} - hsetprop ${scobj_hpath}/grp_status/lpg_3 rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/lpg_3 control true - hsetprop ${scobj_hpath}/grp_status/lpg_3 data true - hsetprop ${scobj_hpath}/grp_status/lpg_3 mutable true - hsetprop ${scobj_hpath}/grp_status/lpg_3 nxsave true - hsetprop ${scobj_hpath}/grp_status/lpg_3 oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/lpg_3 klass "parameter" - hsetprop ${scobj_hpath}/grp_status/lpg_3 sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/lpg_3 type "part" - hsetprop ${scobj_hpath}/grp_status/lpg_3 nxalias "${name}_grp_status_lpg_3" - - hfactory ${scobj_hpath}/grp_status/start_in plain user text - hsetprop ${scobj_hpath}/grp_status/start_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {18} - hsetprop ${scobj_hpath}/grp_status/start_in rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/start_in control true - hsetprop ${scobj_hpath}/grp_status/start_in data true - hsetprop ${scobj_hpath}/grp_status/start_in mutable true - hsetprop ${scobj_hpath}/grp_status/start_in nxsave true - hsetprop ${scobj_hpath}/grp_status/start_in oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/start_in klass "parameter" - hsetprop ${scobj_hpath}/grp_status/start_in sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/start_in type "part" - hsetprop ${scobj_hpath}/grp_status/start_in nxalias "${name}_grp_status_start_in" - - hfactory ${scobj_hpath}/grp_status/state plain user text - hsetprop ${scobj_hpath}/grp_status/state read ${ns}::fetch_from_status ${scobj_hpath} rdValue {1} - hsetprop ${scobj_hpath}/grp_status/state rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_status/state control true - hsetprop ${scobj_hpath}/grp_status/state data true - hsetprop ${scobj_hpath}/grp_status/state mutable true - hsetprop ${scobj_hpath}/grp_status/state nxsave true - hsetprop ${scobj_hpath}/grp_status/state oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_status/state klass "parameter" - hsetprop ${scobj_hpath}/grp_status/state sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_status/state type "part" - hsetprop ${scobj_hpath}/grp_status/state nxalias "${name}_grp_status_state" - - if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/grp_status/cur_error 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/cur_pres 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/cur_run_time 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/error_in 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_0 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_1 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_2 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_3 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_4 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_5 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_6 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/evt_7 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/flow_rate 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_0 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_1 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_2 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/lpg_3 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/start_in 1 - ${sct_controller} poll ${scobj_hpath}/grp_status/state 1 - } else { - ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" - } - - hfactory ${scobj_hpath}/grp_stuff plain spy none - hsetprop ${scobj_hpath}/grp_stuff data "false" - hsetprop ${scobj_hpath}/grp_stuff klass "@none" - hsetprop ${scobj_hpath}/grp_stuff type "part" - - hfactory ${scobj_hpath}/grp_stuff/an_out plain user text - hsetprop ${scobj_hpath}/grp_stuff/an_out read ${ns}::getValue ${scobj_hpath} rdValue {AN_OUT?} - hsetprop ${scobj_hpath}/grp_stuff/an_out rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/an_out control false - hsetprop ${scobj_hpath}/grp_stuff/an_out data false - hsetprop ${scobj_hpath}/grp_stuff/an_out mutable true - hsetprop ${scobj_hpath}/grp_stuff/an_out nxsave false - hsetprop ${scobj_hpath}/grp_stuff/an_out oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/an_out sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/an_out type "part" - hsetprop ${scobj_hpath}/grp_stuff/an_out nxalias "${name}_grp_stuff_an_out" - - hfactory ${scobj_hpath}/grp_stuff/boardinfo plain user text - hsetprop ${scobj_hpath}/grp_stuff/boardinfo read ${ns}::getValue ${scobj_hpath} rdValue {BOARDINFO?} - hsetprop ${scobj_hpath}/grp_stuff/boardinfo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/boardinfo control false - hsetprop ${scobj_hpath}/grp_stuff/boardinfo data false - hsetprop ${scobj_hpath}/grp_stuff/boardinfo mutable true - hsetprop ${scobj_hpath}/grp_stuff/boardinfo nxsave false - hsetprop ${scobj_hpath}/grp_stuff/boardinfo oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/boardinfo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/boardinfo type "part" - hsetprop ${scobj_hpath}/grp_stuff/boardinfo nxalias "${name}_grp_stuff_boardinfo" - - hfactory ${scobj_hpath}/grp_stuff/config plain user text - hsetprop ${scobj_hpath}/grp_stuff/config read ${ns}::getValue ${scobj_hpath} rdValue {CONFIG?} - hsetprop ${scobj_hpath}/grp_stuff/config rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/config control false - hsetprop ${scobj_hpath}/grp_stuff/config data false - hsetprop ${scobj_hpath}/grp_stuff/config mutable true - hsetprop ${scobj_hpath}/grp_stuff/config nxsave false - hsetprop ${scobj_hpath}/grp_stuff/config oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/config sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/config type "part" - hsetprop ${scobj_hpath}/grp_stuff/config nxalias "${name}_grp_stuff_config" - - hfactory ${scobj_hpath}/grp_stuff/cprofinfo plain user text - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo read ${ns}::getValue ${scobj_hpath} rdValue {CPROFINFO?} - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo control false - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo data false - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo mutable true - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo nxsave false - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo type "part" - hsetprop ${scobj_hpath}/grp_stuff/cprofinfo nxalias "${name}_grp_stuff_cprofinfo" - - hfactory ${scobj_hpath}/grp_stuff/dout plain user text - hsetprop ${scobj_hpath}/grp_stuff/dout read ${ns}::getValue ${scobj_hpath} rdValue {DOUT?} - hsetprop ${scobj_hpath}/grp_stuff/dout rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/dout control false - hsetprop ${scobj_hpath}/grp_stuff/dout data false - hsetprop ${scobj_hpath}/grp_stuff/dout mutable true - hsetprop ${scobj_hpath}/grp_stuff/dout nxsave false - hsetprop ${scobj_hpath}/grp_stuff/dout oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/dout sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/dout type "part" - hsetprop ${scobj_hpath}/grp_stuff/dout nxalias "${name}_grp_stuff_dout" - - hfactory ${scobj_hpath}/grp_stuff/error plain user text - hsetprop ${scobj_hpath}/grp_stuff/error read ${ns}::getValue ${scobj_hpath} rdValue {ERROR?} - hsetprop ${scobj_hpath}/grp_stuff/error rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/error control false - hsetprop ${scobj_hpath}/grp_stuff/error data false - hsetprop ${scobj_hpath}/grp_stuff/error mutable true - hsetprop ${scobj_hpath}/grp_stuff/error nxsave false - hsetprop ${scobj_hpath}/grp_stuff/error oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/error sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/error type "part" - hsetprop ${scobj_hpath}/grp_stuff/error nxalias "${name}_grp_stuff_error" - - hfactory ${scobj_hpath}/grp_stuff/errors plain user text - hsetprop ${scobj_hpath}/grp_stuff/errors read ${ns}::getValue ${scobj_hpath} rdValue {ERRORS?} - hsetprop ${scobj_hpath}/grp_stuff/errors rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/errors control false - hsetprop ${scobj_hpath}/grp_stuff/errors data false - hsetprop ${scobj_hpath}/grp_stuff/errors mutable true - hsetprop ${scobj_hpath}/grp_stuff/errors nxsave false - hsetprop ${scobj_hpath}/grp_stuff/errors oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/errors sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/errors type "part" - hsetprop ${scobj_hpath}/grp_stuff/errors nxalias "${name}_grp_stuff_errors" - - hfactory ${scobj_hpath}/grp_stuff/flushpmp plain user text - hsetprop ${scobj_hpath}/grp_stuff/flushpmp read ${ns}::getValue ${scobj_hpath} rdValue {FLUSHPMP?} - hsetprop ${scobj_hpath}/grp_stuff/flushpmp rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/flushpmp control false - hsetprop ${scobj_hpath}/grp_stuff/flushpmp data false - hsetprop ${scobj_hpath}/grp_stuff/flushpmp mutable true - hsetprop ${scobj_hpath}/grp_stuff/flushpmp nxsave false - hsetprop ${scobj_hpath}/grp_stuff/flushpmp oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/flushpmp sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/flushpmp type "part" - hsetprop ${scobj_hpath}/grp_stuff/flushpmp nxalias "${name}_grp_stuff_flushpmp" - - hfactory ${scobj_hpath}/grp_stuff/head plain user text - hsetprop ${scobj_hpath}/grp_stuff/head read ${ns}::getValue ${scobj_hpath} rdValue {HEAD?} - hsetprop ${scobj_hpath}/grp_stuff/head rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/head control false - hsetprop ${scobj_hpath}/grp_stuff/head data false - hsetprop ${scobj_hpath}/grp_stuff/head mutable true - hsetprop ${scobj_hpath}/grp_stuff/head nxsave false - hsetprop ${scobj_hpath}/grp_stuff/head oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/head sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/head type "part" - hsetprop ${scobj_hpath}/grp_stuff/head nxalias "${name}_grp_stuff_head" - - hfactory ${scobj_hpath}/grp_stuff/head_par plain user text - hsetprop ${scobj_hpath}/grp_stuff/head_par read ${ns}::getValue ${scobj_hpath} rdValue {HEAD_PAR?} - hsetprop ${scobj_hpath}/grp_stuff/head_par rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/head_par control false - hsetprop ${scobj_hpath}/grp_stuff/head_par data false - hsetprop ${scobj_hpath}/grp_stuff/head_par mutable true - hsetprop ${scobj_hpath}/grp_stuff/head_par nxsave false - hsetprop ${scobj_hpath}/grp_stuff/head_par oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/head_par sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/head_par type "part" - hsetprop ${scobj_hpath}/grp_stuff/head_par nxalias "${name}_grp_stuff_head_par" - - hfactory ${scobj_hpath}/grp_stuff/identify plain user text - hsetprop ${scobj_hpath}/grp_stuff/identify read ${ns}::getValue ${scobj_hpath} rdValue {IDENTIFY?} - hsetprop ${scobj_hpath}/grp_stuff/identify rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/identify control false - hsetprop ${scobj_hpath}/grp_stuff/identify data false - hsetprop ${scobj_hpath}/grp_stuff/identify mutable true - hsetprop ${scobj_hpath}/grp_stuff/identify nxsave false - hsetprop ${scobj_hpath}/grp_stuff/identify oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/identify sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/identify type "part" - hsetprop ${scobj_hpath}/grp_stuff/identify nxalias "${name}_grp_stuff_identify" - - hfactory ${scobj_hpath}/grp_stuff/lpg plain user text - hsetprop ${scobj_hpath}/grp_stuff/lpg read ${ns}::getValue ${scobj_hpath} rdValue {LPG?} - hsetprop ${scobj_hpath}/grp_stuff/lpg rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/lpg control false - hsetprop ${scobj_hpath}/grp_stuff/lpg data false - hsetprop ${scobj_hpath}/grp_stuff/lpg mutable true - hsetprop ${scobj_hpath}/grp_stuff/lpg nxsave false - hsetprop ${scobj_hpath}/grp_stuff/lpg oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/lpg sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/lpg type "part" - hsetprop ${scobj_hpath}/grp_stuff/lpg nxalias "${name}_grp_stuff_lpg" - - hfactory ${scobj_hpath}/grp_stuff/oem plain user text - hsetprop ${scobj_hpath}/grp_stuff/oem read ${ns}::getValue ${scobj_hpath} rdValue {OEM?} - hsetprop ${scobj_hpath}/grp_stuff/oem rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/oem control false - hsetprop ${scobj_hpath}/grp_stuff/oem data false - hsetprop ${scobj_hpath}/grp_stuff/oem mutable true - hsetprop ${scobj_hpath}/grp_stuff/oem nxsave false - hsetprop ${scobj_hpath}/grp_stuff/oem oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/oem sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/oem type "part" - hsetprop ${scobj_hpath}/grp_stuff/oem nxalias "${name}_grp_stuff_oem" - - hfactory ${scobj_hpath}/grp_stuff/opt plain user text - hsetprop ${scobj_hpath}/grp_stuff/opt read ${ns}::getValue ${scobj_hpath} rdValue {OPT?} - hsetprop ${scobj_hpath}/grp_stuff/opt rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/opt control false - hsetprop ${scobj_hpath}/grp_stuff/opt data false - hsetprop ${scobj_hpath}/grp_stuff/opt mutable true - hsetprop ${scobj_hpath}/grp_stuff/opt nxsave false - hsetprop ${scobj_hpath}/grp_stuff/opt oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/opt sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/opt type "part" - hsetprop ${scobj_hpath}/grp_stuff/opt nxalias "${name}_grp_stuff_opt" - - hfactory ${scobj_hpath}/grp_stuff/plim plain user text - hsetprop ${scobj_hpath}/grp_stuff/plim read ${ns}::getValue ${scobj_hpath} rdValue {PLIM?} - hsetprop ${scobj_hpath}/grp_stuff/plim rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/plim control false - hsetprop ${scobj_hpath}/grp_stuff/plim data false - hsetprop ${scobj_hpath}/grp_stuff/plim mutable true - hsetprop ${scobj_hpath}/grp_stuff/plim nxsave false - hsetprop ${scobj_hpath}/grp_stuff/plim oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/plim sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/plim type "part" - hsetprop ${scobj_hpath}/grp_stuff/plim nxalias "${name}_grp_stuff_plim" - - hfactory ${scobj_hpath}/grp_stuff/pressure plain user text - hsetprop ${scobj_hpath}/grp_stuff/pressure read ${ns}::getValue ${scobj_hpath} rdValue {PRESSURE?} - hsetprop ${scobj_hpath}/grp_stuff/pressure rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/pressure control false - hsetprop ${scobj_hpath}/grp_stuff/pressure data false - hsetprop ${scobj_hpath}/grp_stuff/pressure mutable true - hsetprop ${scobj_hpath}/grp_stuff/pressure nxsave false - hsetprop ${scobj_hpath}/grp_stuff/pressure oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/pressure sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/pressure type "part" - hsetprop ${scobj_hpath}/grp_stuff/pressure nxalias "${name}_grp_stuff_pressure" - - hfactory ${scobj_hpath}/grp_stuff/prfastacq plain user text - hsetprop ${scobj_hpath}/grp_stuff/prfastacq read ${ns}::getValue ${scobj_hpath} rdValue {PRFASTACQ?} - hsetprop ${scobj_hpath}/grp_stuff/prfastacq rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/prfastacq control false - hsetprop ${scobj_hpath}/grp_stuff/prfastacq data false - hsetprop ${scobj_hpath}/grp_stuff/prfastacq mutable true - hsetprop ${scobj_hpath}/grp_stuff/prfastacq nxsave false - hsetprop ${scobj_hpath}/grp_stuff/prfastacq oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/prfastacq sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/prfastacq type "part" - hsetprop ${scobj_hpath}/grp_stuff/prfastacq nxalias "${name}_grp_stuff_prfastacq" - - hfactory ${scobj_hpath}/grp_stuff/purge plain user text - hsetprop ${scobj_hpath}/grp_stuff/purge read ${ns}::getValue ${scobj_hpath} rdValue {PURGE?} - hsetprop ${scobj_hpath}/grp_stuff/purge rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/purge control false - hsetprop ${scobj_hpath}/grp_stuff/purge data false - hsetprop ${scobj_hpath}/grp_stuff/purge mutable true - hsetprop ${scobj_hpath}/grp_stuff/purge nxsave false - hsetprop ${scobj_hpath}/grp_stuff/purge oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/purge sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/purge type "part" - hsetprop ${scobj_hpath}/grp_stuff/purge nxalias "${name}_grp_stuff_purge" - - hfactory ${scobj_hpath}/grp_stuff/remote plain user text - hsetprop ${scobj_hpath}/grp_stuff/remote read ${ns}::getValue ${scobj_hpath} rdValue {REMOTE?} - hsetprop ${scobj_hpath}/grp_stuff/remote rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/remote control false - hsetprop ${scobj_hpath}/grp_stuff/remote data false - hsetprop ${scobj_hpath}/grp_stuff/remote mutable true - hsetprop ${scobj_hpath}/grp_stuff/remote nxsave false - hsetprop ${scobj_hpath}/grp_stuff/remote oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/remote sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/remote type "part" - hsetprop ${scobj_hpath}/grp_stuff/remote nxalias "${name}_grp_stuff_remote" - - hfactory ${scobj_hpath}/grp_stuff/rfid plain user text - hsetprop ${scobj_hpath}/grp_stuff/rfid read ${ns}::getValue ${scobj_hpath} rdValue {RFID?} - hsetprop ${scobj_hpath}/grp_stuff/rfid rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/rfid control false - hsetprop ${scobj_hpath}/grp_stuff/rfid data false - hsetprop ${scobj_hpath}/grp_stuff/rfid mutable true - hsetprop ${scobj_hpath}/grp_stuff/rfid nxsave false - hsetprop ${scobj_hpath}/grp_stuff/rfid oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/rfid sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/rfid type "part" - hsetprop ${scobj_hpath}/grp_stuff/rfid nxalias "${name}_grp_stuff_rfid" - - hfactory ${scobj_hpath}/grp_stuff/service plain user text - hsetprop ${scobj_hpath}/grp_stuff/service read ${ns}::getValue ${scobj_hpath} rdValue {SERVICE?} - hsetprop ${scobj_hpath}/grp_stuff/service rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/service control false - hsetprop ${scobj_hpath}/grp_stuff/service data false - hsetprop ${scobj_hpath}/grp_stuff/service mutable true - hsetprop ${scobj_hpath}/grp_stuff/service nxsave false - hsetprop ${scobj_hpath}/grp_stuff/service oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/service sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/service type "part" - hsetprop ${scobj_hpath}/grp_stuff/service nxalias "${name}_grp_stuff_service" - - hfactory ${scobj_hpath}/grp_stuff/sysinfo plain user text - hsetprop ${scobj_hpath}/grp_stuff/sysinfo read ${ns}::getValue ${scobj_hpath} rdValue {SYSINFO?} - hsetprop ${scobj_hpath}/grp_stuff/sysinfo rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/sysinfo control false - hsetprop ${scobj_hpath}/grp_stuff/sysinfo data false - hsetprop ${scobj_hpath}/grp_stuff/sysinfo mutable true - hsetprop ${scobj_hpath}/grp_stuff/sysinfo nxsave false - hsetprop ${scobj_hpath}/grp_stuff/sysinfo oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/sysinfo sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/sysinfo type "part" - hsetprop ${scobj_hpath}/grp_stuff/sysinfo nxalias "${name}_grp_stuff_sysinfo" - - hfactory ${scobj_hpath}/grp_stuff/units plain user text - hsetprop ${scobj_hpath}/grp_stuff/units read ${ns}::getValue ${scobj_hpath} rdValue {UNITS?} - hsetprop ${scobj_hpath}/grp_stuff/units rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/units control false - hsetprop ${scobj_hpath}/grp_stuff/units data false - hsetprop ${scobj_hpath}/grp_stuff/units mutable true - hsetprop ${scobj_hpath}/grp_stuff/units nxsave false - hsetprop ${scobj_hpath}/grp_stuff/units oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/units sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/units type "part" - hsetprop ${scobj_hpath}/grp_stuff/units nxalias "${name}_grp_stuff_units" - - hfactory ${scobj_hpath}/grp_stuff/valves plain user text - hsetprop ${scobj_hpath}/grp_stuff/valves read ${ns}::getValue ${scobj_hpath} rdValue {VALVES?} - hsetprop ${scobj_hpath}/grp_stuff/valves rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/grp_stuff/valves control false - hsetprop ${scobj_hpath}/grp_stuff/valves data false - hsetprop ${scobj_hpath}/grp_stuff/valves mutable true - hsetprop ${scobj_hpath}/grp_stuff/valves nxsave false - hsetprop ${scobj_hpath}/grp_stuff/valves oldval UNKNOWN - hsetprop ${scobj_hpath}/grp_stuff/valves sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/grp_stuff/valves type "part" - hsetprop ${scobj_hpath}/grp_stuff/valves nxalias "${name}_grp_stuff_valves" - - if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/grp_stuff/an_out 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/boardinfo 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/config 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/cprofinfo 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/dout 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/error 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/errors 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/flushpmp 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/head 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/head_par 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/identify 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/lpg 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/oem 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/opt 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/plim 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/pressure 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/prfastacq 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/purge 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/remote 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/rfid 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/service 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/sysinfo 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/units 600 - ${sct_controller} poll ${scobj_hpath}/grp_stuff/valves 600 - } else { - ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" - } - hfactory ${scobj_hpath}/pump plain spy none hsetprop ${scobj_hpath}/pump data "true" hsetprop ${scobj_hpath}/pump klass "@none" @@ -1746,7 +897,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/flow/setp mutable true hsetprop ${scobj_hpath}/pump/flow/setp nxsave true hsetprop ${scobj_hpath}/pump/flow/setp lowerlimit 0 - hsetprop ${scobj_hpath}/pump/flow/setp upperlimit 10 + hsetprop ${scobj_hpath}/pump/flow/setp upperlimit 9.999 hsetprop ${scobj_hpath}/pump/flow/setp oldval 1.0 hset ${scobj_hpath}/pump/flow/setp 1.0 hsetprop ${scobj_hpath}/pump/flow/setp klass "parameter" @@ -1824,15 +975,15 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/volume/pval nxalias "${name}_pump_volume_pval" hfactory ${scobj_hpath}/pump/volume/setp plain user float - hsetprop ${scobj_hpath}/pump/volume/setp read ${ns}::pump_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/volume/setp read ${ns}::volume_fsm ${scobj_hpath} rdValue { } hsetprop ${scobj_hpath}/pump/volume/setp rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume/setp write ${ns}::pump_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/volume/setp write ${ns}::volume_write ${scobj_hpath} noResponse { } hsetprop ${scobj_hpath}/pump/volume/setp noResponse ${ns}::noResponse ${scobj_hpath} hsetprop ${scobj_hpath}/pump/volume/setp check ${ns}::checkrange ${scobj_hpath} hsetprop ${scobj_hpath}/pump/volume/setp driving 0 hsetprop ${scobj_hpath}/pump/volume/setp checklimits ${ns}::checklimits ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume/setp checkstatus ${ns}::pump_checkstatus ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume/setp halt ${ns}::pump_halt ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp checkstatus ${ns}::volume_checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp halt ${ns}::volume_halt ${scobj_hpath} hsetprop ${scobj_hpath}/pump/volume/setp driveable pump/volume/pval hsetprop ${scobj_hpath}/pump/volume/setp control true hsetprop ${scobj_hpath}/pump/volume/setp data true From b0e4c3a85bfaa99f55b72d4a601ed535292107b4 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Tue, 7 Oct 2014 14:59:21 +1100 Subject: [PATCH 06/54] Better checks and state machine for Knauer pump --- .../config/environment/knauer_pump.sct | 63 ++++++-- .../config/environment/sct_knauer_pump.tcl | 136 ++++++++++++++++-- 2 files changed, 175 insertions(+), 24 deletions(-) diff --git a/site_ansto/instrument/config/environment/knauer_pump.sct b/site_ansto/instrument/config/environment/knauer_pump.sct index 63a616f5..881caa4c 100644 --- a/site_ansto/instrument/config/environment/knauer_pump.sct +++ b/site_ansto/instrument/config/environment/knauer_pump.sct @@ -39,6 +39,7 @@ driver knauer_pump = { readable = 1; read_command = ' '; fetch_function = volume_fetch; + read_function = volume_read; property 'units' = 'mL'; } var setp = { @@ -46,6 +47,7 @@ driver knauer_pump = { writeable = 1; write_command = ' '; write_function = volume_write; + check_function = volume_check; driveable = pump/volume/pval; checkstatus_function = volume_checkstatus; halt_function = volume_halt; @@ -53,6 +55,7 @@ driver knauer_pump = { readable = 1; read_command = ' '; fetch_function = volume_fsm; + read_function = volume_store; property 'units' = 'mL'; property this_state = 0; } @@ -90,7 +93,7 @@ driver knauer_pump = { # Ensure the pump starts up in REMOTE mode # code mkDriver = {%% - hset ${scobj_hpath}/pump/remote 1 + #hset ${scobj_hpath}/pump/remote 1 %%} # # These functions handle the real_data returned by the pump for the GLP? command @@ -194,9 +197,21 @@ driver knauer_pump = { sct geterror "${setpoint} has [llength ${rlist}] components, needs 4" error [sct geterror] } - set sum [expr [lindex ${rlist} 0] + [lindex ${rlist} 1] + [lindex ${rlist} 2] + [lindex ${rlist} 3]] + set sum 0 + for {set i 0} {$i < 4} {incr i} { + set cmp [lindex ${rlist} ${i}] + if { ![string is integer -strict ${cmp}] } { + sct geterror "component [expr {${i} + 1}] is not integer: \"${cmp}\"" + error [sct geterror] + } + if { !(${cmp} >= 0 && ${cmp} <= 100) } { + sct geterror "component [expr {${i} + 1}] is not between 0 and 100: \"${cmp}\"" + error [sct geterror] + } + set sum [expr {${sum} + ${cmp}}] + } if { ${sum} != 100 } { - sct geterror "sum is ${sum}, must be 100" + sct geterror "sum of components is ${sum}, must be 100" error [sct geterror] } %%} @@ -262,7 +277,6 @@ driver knauer_pump = { %%} code volume_write = {%% - hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] hset ${tc_root}/[sct driveable] 0.0 set cmd "REMOTE" sct this_state 1 @@ -283,20 +297,25 @@ driver knauer_pump = { set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] set time_1 [expr {${time_tgt} - 500}] set time_2 [expr {${time_tgt} + 500}] - set nextState noResponse + set saveState ${nextState} + set nextState "noResponse" if { [sct this_state] == 1 } { - set cmd "TT_LOAD:1" + set cmd "GLP?" + set nextState ${saveState} sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 2 } { - set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + set cmd "TT_LOAD:1" sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 3 } { - set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 4 } { - set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" + set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 5 } { + set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 6 } { set cmd "START:1,0" sct this_state 0 } elseif { [sct this_state] == 91 } { @@ -304,6 +323,13 @@ driver knauer_pump = { sct this_state 92 } elseif { [sct this_state] == 92 } { set cmd "STOP:0,0" + sct this_state 93 + } elseif { [sct this_state] == 93 } { + if { !([hpropexists ${tc_root}/pump/remote target] && [hgetpropval ${tc_root}/pump/remote target] == 1) } { + set cmd "LOCAL" + } else { + set cmd "@@NOSEND@@" + } sct this_state 0 } else { sct this_state 0 @@ -331,6 +357,25 @@ driver knauer_pump = { } %%} + code volume_store = {%% + if { [sct this_state] == 2 } { + set ns [namespace current] + # store the GLP result + hsetprop ${tc_root}/dummy/glp result "${data}" + sct with ${tc_root}/dummy/glp "${ns}::read_glp ${tc_root}" + # extract the volume + sct with ${tc_root}/[sct driveable] "${ns}::volume_fetch ${tc_root} ${nextState} @@NOSEND@@" + sct with ${tc_root}/[sct driveable] "${ns}::volume_read ${tc_root}" + # copy it to base_volume + hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] + } + if { [hpropexists [sct] target] } { + set data [sct target] + } else { + set data 0.0 + } + %%} + code volume_halt = {%% set cmd "STOP:0,0" sct this_state 91 diff --git a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl index 32f1d88c..1f269659 100644 --- a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl +++ b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl @@ -202,9 +202,21 @@ proc ::scobj::knauer_pump::ratio_check {tc_root} { sct geterror "${setpoint} has [llength ${rlist}] components, needs 4" error [sct geterror] } - set sum [expr [lindex ${rlist} 0] + [lindex ${rlist} 1] + [lindex ${rlist} 2] + [lindex ${rlist} 3]] + set sum 0 + for {set i 0} {$i < 4} {incr i} { + set cmp [lindex ${rlist} ${i}] + if { ![string is integer -strict ${cmp}] } { + sct geterror "component [expr {${i} + 1}] is not integer: \"${cmp}\"" + error [sct geterror] + } + if { !(${cmp} >= 0 && ${cmp} <= 100) } { + sct geterror "component [expr {${i} + 1}] is not between 0 and 100: \"${cmp}\"" + error [sct geterror] + } + set sum [expr {${sum} + ${cmp}}] + } if { ${sum} != 100 } { - sct geterror "sum is ${sum}, must be 100" + sct geterror "sum of components is ${sum}, must be 100" error [sct geterror] } # ratio_check hook code ends @@ -555,6 +567,16 @@ proc ::scobj::knauer_pump::status_fetch {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } +# function to check the write parameter on a device +proc ::scobj::knauer_pump::volume_check {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_check tc_root=${tc_root} sct=[sct] resp=[sct result]" +# volume_check hook code goes here + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # checkstatus function for driveable interface proc ::scobj::knauer_pump::volume_checkstatus {tc_root} { set catch_status [ catch { @@ -644,20 +666,25 @@ proc ::scobj::knauer_pump::volume_fsm {tc_root nextState cmd_str} { set time_tgt [expr {int(60000.0 * 1000.0 * [sct target] / ${flow_tgt})}] set time_1 [expr {${time_tgt} - 500}] set time_2 [expr {${time_tgt} + 500}] - set nextState noResponse + set saveState ${nextState} + set nextState "noResponse" if { [sct this_state] == 1 } { - set cmd "TT_LOAD:1" + set cmd "GLP?" + set nextState ${saveState} sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 2 } { - set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + set cmd "TT_LOAD:1" sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 3 } { - set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" + set cmd "TT_SET:0,0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 4 } { - set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" + set cmd "TT_SET:1,${time_1},${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0" sct this_state [expr {[sct this_state] + 1}] } elseif { [sct this_state] == 5 } { + set cmd "TT_SET:2,${time_2},0,${ratio_tgt},0,0,0,0,0,0,0,0" + sct this_state [expr {[sct this_state] + 1}] + } elseif { [sct this_state] == 6 } { set cmd "START:1,0" sct this_state 0 } elseif { [sct this_state] == 91 } { @@ -665,6 +692,13 @@ proc ::scobj::knauer_pump::volume_fsm {tc_root nextState cmd_str} { sct this_state 92 } elseif { [sct this_state] == 92 } { set cmd "STOP:0,0" + sct this_state 93 + } elseif { [sct this_state] == 93 } { + if { !([hpropexists ${tc_root}/pump/remote target] && [hgetpropval ${tc_root}/pump/remote target] == 1) } { + set cmd "LOCAL" + } else { + set cmd "@@NOSEND@@" + } sct this_state 0 } else { sct this_state 0 @@ -721,6 +755,79 @@ proc ::scobj::knauer_pump::volume_halt {tc_root} { handle_exception ${catch_status} ${catch_message} } +# function to parse the read of a parameter on a device +proc ::scobj::knauer_pump::volume_read {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_read tc_root=${tc_root} sct=[sct] result=[sct result]" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set data [sct result] + set nextState "idle" + if {[string equal -nocase -length 7 ${data} "ASCERR:"]} { + # the protocol driver has reported an error + sct geterror "${data}" + error "[sct geterror]" + } +# volume_read hook code goes here + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to parse the read of a parameter on a device +proc ::scobj::knauer_pump::volume_store {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_store tc_root=${tc_root} sct=[sct] result=[sct result]" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set data [sct result] + set nextState "idle" + if {[string equal -nocase -length 7 ${data} "ASCERR:"]} { + # the protocol driver has reported an error + sct geterror "${data}" + error "[sct geterror]" + } +# volume_store hook code starts + if { [sct this_state] == 2 } { + set ns [namespace current] + # store the GLP result + hsetprop ${tc_root}/dummy/glp result "${data}" + sct with ${tc_root}/dummy/glp "${ns}::read_glp ${tc_root}" + # extract the volume + sct with ${tc_root}/[sct driveable] "${ns}::volume_fetch ${tc_root} ${nextState} @@NOSEND@@" + sct with ${tc_root}/[sct driveable] "${ns}::volume_read ${tc_root}" + # copy it to base_volume + hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] + } + if { [hpropexists [sct] target] } { + set data [sct target] + } else { + set data 0.0 + } +# volume_store hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # function to write a parameter value on a device proc ::scobj::knauer_pump::volume_write {tc_root nextState cmd_str} { set catch_status [ catch { @@ -731,7 +838,6 @@ proc ::scobj::knauer_pump::volume_write {tc_root nextState cmd_str} { set par [sct target] set cmd "${cmd_str}${par}" # volume_write hook code starts - hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] hset ${tc_root}/[sct driveable] 0.0 set cmd "REMOTE" sct this_state 1 @@ -961,8 +1067,8 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/volume type "part" hfactory ${scobj_hpath}/pump/volume/pval plain user float - hsetprop ${scobj_hpath}/pump/volume/pval read ${ns}::volume_fetch ${scobj_hpath} rdValue { } - hsetprop ${scobj_hpath}/pump/volume/pval rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/pval read ${ns}::volume_fetch ${scobj_hpath} volume_read { } + hsetprop ${scobj_hpath}/pump/volume/pval volume_read ${ns}::volume_read ${scobj_hpath} hsetprop ${scobj_hpath}/pump/volume/pval control true hsetprop ${scobj_hpath}/pump/volume/pval data true hsetprop ${scobj_hpath}/pump/volume/pval mutable true @@ -975,10 +1081,10 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/pump/volume/pval nxalias "${name}_pump_volume_pval" hfactory ${scobj_hpath}/pump/volume/setp plain user float - hsetprop ${scobj_hpath}/pump/volume/setp read ${ns}::volume_fsm ${scobj_hpath} rdValue { } - hsetprop ${scobj_hpath}/pump/volume/setp rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/pump/volume/setp write ${ns}::volume_write ${scobj_hpath} noResponse { } - hsetprop ${scobj_hpath}/pump/volume/setp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp read ${ns}::volume_fsm ${scobj_hpath} volume_store { } + hsetprop ${scobj_hpath}/pump/volume/setp volume_store ${ns}::volume_store ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume/setp write ${ns}::volume_write ${scobj_hpath} volume_check { } + hsetprop ${scobj_hpath}/pump/volume/setp volume_check ${ns}::volume_check ${scobj_hpath} hsetprop ${scobj_hpath}/pump/volume/setp check ${ns}::checkrange ${scobj_hpath} hsetprop ${scobj_hpath}/pump/volume/setp driving 0 hsetprop ${scobj_hpath}/pump/volume/setp checklimits ${ns}::checklimits ${scobj_hpath} @@ -1014,7 +1120,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio ansto_makesctdrive ${name}_pump_volume_setp ${scobj_hpath}/pump/volume/setp ${scobj_hpath}/pump/volume/pval ${sct_controller} } # mkDriver hook code starts - hset ${scobj_hpath}/pump/remote 1 + #hset ${scobj_hpath}/pump/remote 1 # mkDriver hook code ends } catch_message ] handle_exception ${catch_status} ${catch_message} From 6ff638b36ebc55bdf1dca574546871af3c67d292 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 19:36:35 +1100 Subject: [PATCH 07/54] SICS-793: Bring GIT up to date with changes made on ics1-taipan --- site_ansto/instrument/tas/taipan_configuration.tcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/site_ansto/instrument/tas/taipan_configuration.tcl b/site_ansto/instrument/tas/taipan_configuration.tcl index 189815c0..84bf3fc0 100644 --- a/site_ansto/instrument/tas/taipan_configuration.tcl +++ b/site_ansto/instrument/tas/taipan_configuration.tcl @@ -35,10 +35,16 @@ namespace eval anticollider { proc ::anticollider::init {} {} } #fileeval $cfPath(anticollider)/anticollider.tcl #fileeval $cfPath(tasmad)/taspub_sics/tasp.tcl #fileeval $cfPath(tasmad)/taspub_sics/tasscript.tcl + +fileeval $cfPath(environment)/sct_agilent_33220A.tcl +fileeval $cfPath(environment)/sct_protek_common.tcl +fileeval $cfPath(environment)/sct_protekmm.tcl fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl fileeval $cfPath(environment)/temperature/sct_julabo_lh45.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl +fileeval $cfPath(environment)/temperature/sct_ls336.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl +fileeval $cfPath(environment)/temperature/sct_ls340.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl @@ -50,6 +56,7 @@ fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl fileeval $cfPath(environment)/temperature/west400.tcl fileeval $cfPath(environment)/he3/sct_he3.tcl fileeval $cfPath(environment)/magneticField/oxford_labview.tcl +fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl fileeval config/load_setup.tcl fileeval log.tcl publish logbook spy @@ -64,6 +71,8 @@ puts "doing tasub" MakeTasUB tasub m1 m2 mvfocus mhfocus s1 s2 sgu sgl a1 a2 avfocus ahfocus tasub mono dd 3.35416 tasub ana dd 3.35416 +# NOTE Autofocussing parameters persist in status.tcl +# You must set them in extraconfig.tcl to override this behaviour tasub mono vb1 102.2 tasub mono vb2 1.78 tasub mono hb1 184.42 From 3b35308bf2a45c013e04fe652a44dda69439d202 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 19:44:29 +1100 Subject: [PATCH 08/54] SICS-786 SICS locked up while counting on Taipan An in-situ hack that was done on Wombat was accidentally committed. --- site_ansto/instrument/config/counter/counter_common_1.tcl | 1 - 1 file changed, 1 deletion(-) diff --git a/site_ansto/instrument/config/counter/counter_common_1.tcl b/site_ansto/instrument/config/counter/counter_common_1.tcl index 1a16dd32..9ad2782c 100644 --- a/site_ansto/instrument/config/counter/counter_common_1.tcl +++ b/site_ansto/instrument/config/counter/counter_common_1.tcl @@ -7,7 +7,6 @@ namespace eval counter { proc ::counter::transferscript {} { variable isc_numchannels - bm status set val [SplitReply [bm1 gettime]] for {set i 1} {$i <= $isc_numchannels} {incr i} { append val " [SplitReply [bm$i getcounts] ]" From 3a475196a01cb225a6e464780b48f8b9ca868424 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 19:56:59 +1100 Subject: [PATCH 09/54] SICS-788: Some divisions in Tcl macros will be truncated if the values are integers. An integer division was caused here by the fix to SICS-785 --- .../instrument/config/hmm/hmm_configuration_common_1.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl index cbe97274..24d0b707 100644 --- a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl +++ b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl @@ -390,7 +390,7 @@ namespace eval histogram_memory { if [ catch { set det_height_mm [SplitReply [detector_active_height_mm]] set max_chan [OAT_TABLE Y -getdata MAX_CHAN] - set scale_factor [expr {$det_height_mm / $max_chan}] + set scale_factor [expr {1.0 * $det_height_mm / $max_chan}] set offset 0.0 ::histogram_memory::calc_axis "y_pixel_offset" $scale_factor $offset [OAT_TABLE Y -getdata BOUNDARIES] if {$args == "-get_data_ref"} { @@ -426,7 +426,7 @@ namespace eval histogram_memory { if [ catch { set det_width_mm [SplitReply [detector_active_width_mm]] set max_chan [OAT_TABLE X -getdata MAX_CHAN] - set scale_factor [expr {$det_width_mm / $max_chan}] + set scale_factor [expr {1.0 * $det_width_mm / $max_chan}] set offset 0.0 ::histogram_memory::calc_axis "x_pixel_offset" $scale_factor $offset [OAT_TABLE X -getdata BOUNDARIES] if {$args == "-get_data_ref"} { From 9720f1d0f0bf8561776f31975916b3b4178c5444 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 19:59:22 +1100 Subject: [PATCH 10/54] SICS-788 Guard against integer division. --- site_ansto/instrument/config/motors/sct_positmotor_common.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site_ansto/instrument/config/motors/sct_positmotor_common.tcl b/site_ansto/instrument/config/motors/sct_positmotor_common.tcl index 7e78e281..b4511d83 100644 --- a/site_ansto/instrument/config/motors/sct_positmotor_common.tcl +++ b/site_ansto/instrument/config/motors/sct_positmotor_common.tcl @@ -124,7 +124,7 @@ proc ::scobj::positmotor::mot2ID {mot precision table} { if {abs($mot - $m) <= $precision} { return $i } elseif {[expr {$sign * ($mot - $m)} ] < 0} { - return [expr {($mot-$mprev)*($i - $iprev)/($m - $mprev)+$iprev}] + return [expr {1.0 * ($mot-$mprev)*($i - $iprev)/($m - $mprev)+$iprev}] } set iprev $i set mprev $m From d8f5030a8d18da8014c3857d9e12842973c304fd Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 20:29:23 +1100 Subject: [PATCH 11/54] SICS-795 Bring GIT up to date with changes made on ics1-wombat. --- .../environment/temperature/west400.tcl | 8 +- .../hipd/config/commands/commands.tcl | 86 +++++++++++++++++-- .../instrument/hipd/config/hmm/hmm_rapid.tcl | 20 ++++- .../config/motors/euler_configuration.tcl | 14 +-- .../config/motors/motor_configuration.tcl | 7 +- .../hipd/config/motors/tilt_configuration.tcl | 3 +- .../instrument/hipd/util/sics_config.ini | 31 ++----- .../instrument/hipd/wombat_configuration.tcl | 1 + 8 files changed, 122 insertions(+), 48 deletions(-) diff --git a/site_ansto/instrument/config/environment/temperature/west400.tcl b/site_ansto/instrument/config/environment/temperature/west400.tcl index 586247a3..71945a84 100644 --- a/site_ansto/instrument/config/environment/temperature/west400.tcl +++ b/site_ansto/instrument/config/environment/temperature/west400.tcl @@ -20,10 +20,12 @@ MakeRS232Controller sertemp $IP 502 sertemp timeout 300 sertemp sendterminator 0x0 sertemp replyterminator 0x0 -EvFactory new tc1 west4100 sertemp $ID 2 +#ffr 2014-09-22: The modbus addr should be 1 for single port moxas (Not $ID which is a SICS ID) +# EvFactory new tc1 west4100 sertemp $ID 2 +EvFactory new $temp_sobj west4100 sertemp 1 2 -sicslist setatt tc1 units kelvin -sicslist setatt tc1 klass @none +sicslist setatt $temp_sobj units kelvin +sicslist setatt $temp_sobj klass @none } # @brief Adds a west400 temperature controller object. diff --git a/site_ansto/instrument/hipd/config/commands/commands.tcl b/site_ansto/instrument/hipd/config/commands/commands.tcl index 75bd42d8..45411a95 100644 --- a/site_ansto/instrument/hipd/config/commands/commands.tcl +++ b/site_ansto/instrument/hipd/config/commands/commands.tcl @@ -6,7 +6,7 @@ namespace eval motor { } namespace eval ajscmds { -namespace export SetRadColl SimpleRun SimpleScan RadCollRun RadCollTimed RadCollScan +namespace export SetRadColl SimpleRun SimpleScan RadCollRun RadCollTimed RadCollScan RadCollBiScan # SetRadColl command SetRadColl { @@ -34,13 +34,13 @@ catch { } msg clientput $msg } + # SimpleRun command SimpleRun { float=0:inf steptime int=1:inf numsteps } { -# RadCollOff histmem mode time histmem preset $steptime newfile HISTOGRAM_XY @@ -49,6 +49,7 @@ int=1:inf numsteps save $i } } + # SimpleScan command SimpleScan { text=drivable motor @@ -58,7 +59,6 @@ int=1:inf numsteps float=0:inf steptime } { -# RadCollOff histmem mode time histmem preset $steptime newfile HISTOGRAM_XY @@ -68,13 +68,13 @@ float=0:inf steptime save $i } } + # RadCollRun command RadCollRun { int=1:inf oscno int=1:inf reps } { -# RadCollOn $oscno histmem mode unlimited newfile HISTOGRAM_XY for {set i 0} {$i < $reps} {incr i} { @@ -83,8 +83,8 @@ int=1:inf reps hmm countblock save $i } -# RadCollOff } + # RadCollTimed command RadCollTimed { int=1:inf oscno @@ -99,14 +99,16 @@ float=0:inf time set i 0 set timsecs [expr $time*60] while {$bool == 0} { + oct oscillate_count $oscno + oct oscillate start histmem start block save $i incr i set tim2 [expr [clock seconds] - $tim1] if {$tim2 > $timsecs} {set bool 1} } - RadCollOff } + # RadCollScan command RadCollScan { text=drivable motor @@ -115,8 +117,6 @@ float step int=1:inf numsteps int=1:inf oscno } { - -# RadCollOn $oscno histmem mode unlimited newfile HISTOGRAM_XY for {set i 0} {$i < $numsteps} {incr i} { @@ -126,8 +126,12 @@ int=1:inf oscno hmm countblock save $i } -# RadCollOff } + + + + + } namespace import ::ajscmds::* publish SetRadColl user @@ -140,3 +144,67 @@ publish RadCollScan user proc ::commands::isc_initialize {} { ::commands::ic_initialize } + + +# RadCollScanRange +proc RadCollScanRange {motor start step fin oscno} { + if {$step==0} {break} + if {($start > $fin) && ($step > 0)} {break} + if {($start < $fin) && ($step < 0)} {break} + set i_bool 0 + histmem mode unlimited + set currentmot $start + set i 0 + newfile HISTOGRAM_XY + while {$i_bool==0} { + drive $motor $currentmot + oct oscillate_count $oscno + oct oscillate start + hmm countblock + save $i + set currentmot [expr {$currentmot + $step}] + if {($step > 0) && ($currentmot > $fin)} {set i_bool 1} + if {($step < 0) && ($currentmot < $fin)} {set i_bool 1} + incr i + } +} + +publish RadCollScanRange user + +#RadCollScanBi +proc RadCollScanBi {motor start step fin oscno motdir} { + set i_bool 0 + histmem mode unlimited + if {$motdir == 1} { + set currentmot $start + set i 0 + } else { + set currentmot $fin + set i [expr {int(($fin-$start)/$step)}] + } + newfile HISTOGRAM_XY + while {$i_bool==0} { +# drive $motor $currentmot + oct oscillate_count $oscno + oct oscillate start + hmm countblock + + if {($motdir > 0)} { + set currentmot [expr {$currentmot + $step}] + if {$currentmot > $fin} {set i_bool 1} + incr i + } else { + set currentmot [expr {$currentmot - $step}] + if {$currentmot < $start} {set i_bool 1} + incr i -1 + } + run $motor $currentmot + save $i + } +} + +publish RadCollScanBi user + + + + diff --git a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl index fd7c040f..d8b6931f 100644 --- a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl +++ b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl @@ -148,7 +148,7 @@ proc SetHistoOneShot {frq framenum } { bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 } fat_table -set NOS_PERIODS $framenum oat_table -set T {0 2200000} NTC 1 - oat_table -set Y {-0.5 15.5} NYC 16 + oat_table -set Y {-0.5 31.5} NYC 16 histmem freq $frq histmem loadconf @@ -160,4 +160,22 @@ proc SetHistoOneShot {frq framenum } { publish SetHistoOneShot user +proc SetHistoStd {} { + histmem stop + hmm astop + FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED + OAT_TABLE -set X { 991.5 987.5 } NXC 248 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1 + histmem loadconf +} +publish SetHistoStd user + +proc SetHistoDX {} { + histmem stop + hmm astop + FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 16 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED + OAT_TABLE -set X { 991.5 989.5 } NXC 496 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1 + histmem loadconf +} + +publish SetHistoDX user diff --git a/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl b/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl index cb4b340e..4d59dad1 100644 --- a/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl @@ -56,20 +56,20 @@ Motor ephi $motor_driver_type [params \ asyncqueue mc2\ axis C\ units degrees\ - hardlowerlim -185\ - hardupperlim 185\ + hardlowerlim -365\ + hardupperlim 365\ maxSpeed 5\ maxAccel 5\ - maxDecel 1\ + maxDecel 5\ stepsPerX -12500\ absEnc 1\ absEncHome $ephi_Home\ cntsPerX -4096] -setHomeandRange -motor ephi -home 0 -lowrange 180 -uprange 180 -ephi softlowerlim -180 -ephi softupperlim 180 +setHomeandRange -motor ephi -home 0 -lowrange -360 -uprange 360 +ephi softlowerlim -360 +ephi softupperlim 360 ephi home 0 -ephi speed 1 +ephi speed 3 ephi movecount $move_count ephi precision 0.01 ephi part sample diff --git a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl index e3953a9f..6dddff24 100644 --- a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl @@ -24,8 +24,9 @@ if {$sim_mode == "true"} { #set mx_Home 23263535 set mx_Home 8390583 #set mom_Home 9274794 -#set mom_Home 8391038 -set mom_Home 8147038 +##set mom_Home 8391038 +#set mom_Home 8147038 +set mom_Home 7736816 set mtth_Home 19927837 #set mphi_Home 7613516 #set mphi_Home 27847793 @@ -291,7 +292,7 @@ Motor mom $motor_driver_type [params \ absEnc 1\ absEncHome $mom_Home\ cntsPerX -2048] -setHomeandRange -motor mom -home 0 -lowrange 5 -uprange 165 +setHomeandRange -motor mom -home 59.5066 -lowrange 5 -uprange 165 #setHomeandRange -motor mom -home 60.08 -lowrange 5 -uprange 165 mom speed 1 mom movecount $move_count diff --git a/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl b/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl index f4d77b6e..6681b7a6 100644 --- a/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/tilt_configuration.tcl @@ -1,7 +1,8 @@ # This must be loaded by motor_configuration.tcl set sphi_Home 7938520 -set schi_Home 7586052 +#set schi_Home 7586052 +set schi_Home 9932404 set sy_Home 7790194 set sx_Home 7556649 diff --git a/site_ansto/instrument/hipd/util/sics_config.ini b/site_ansto/instrument/hipd/util/sics_config.ini index ab40aac9..809696ff 100644 --- a/site_ansto/instrument/hipd/util/sics_config.ini +++ b/site_ansto/instrument/hipd/util/sics_config.ini @@ -103,9 +103,11 @@ implementation = normal_sample_stage name = sample_stage optype = motion_axis [12tmagnet_oxford] +asyncqueue = sct desc = "12 Tesla Oxford Magnet" -driver = "oxford_labview" +driver = "oxford12tlv" imptype = magnetic_field +interval = 5 ip = 10.157.205.3 port = 55001 @@ -291,40 +293,21 @@ desc = "Load the small omega configuration" imptype = motion_axis [vf1_west4100] -asyncqueue = sct +asyncprotocol = modbus_ap desc = "VF1 Blue furnace temperature controller" dev_id = 1 -driver = "west4100" -imptype = temperature -ip = 10.157.205.24 -port = 502 - -[vf1_west6100] -asyncprotocol = modbus_ap -desc = "VF1 Blue furnace 6100 temperature controller" -dev_id = 1 -driver = "west_6100" +driver = "west6100" imptype = temperature ip = 10.157.205.24 port = 502 timeout = 2000 [vf2_west4100] -asyncqueue = sct +asyncprotocol = modbus_ap desc = "VF2 Blue furnace temperature controller" dev_id = 1 -driver = "west4100" -imptype = temperature -ip = 10.157.205.25 -port = 502 - -[vf2_west6100] -asyncprotocol = modbus_ap -desc = "VF2 Blue furnace 6100 temperature controller" -dev_id = 1 -driver = "west_6100" +driver = "west6100" imptype = temperature ip = 10.157.205.25 port = 502 timeout = 2000 - diff --git a/site_ansto/instrument/hipd/wombat_configuration.tcl b/site_ansto/instrument/hipd/wombat_configuration.tcl index e92da140..8657ccb0 100644 --- a/site_ansto/instrument/hipd/wombat_configuration.tcl +++ b/site_ansto/instrument/hipd/wombat_configuration.tcl @@ -52,6 +52,7 @@ fileeval $cfPath(environment)/temperature/sct_julabo_lh45_gen.tcl fileeval $cfPath(environment)/temperature/sct_qlink.tcl fileeval $cfPath(environment)/temperature/west400.tcl fileeval $cfPath(environment)/temperature/sct_west4100.tcl +fileeval $cfPath(environment)/temperature/sct_west_6100.tcl fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl fileeval $cfPath(environment)/he3/sct_he3.tcl From 542be52d74996d989deb98bc7880844c28c65c40 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 20:36:13 +1100 Subject: [PATCH 12/54] SICS-794: Bring GIT up to date with changes made on ics1-echidna. --- .../instrument/hrpd/util/sics_config.ini | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/site_ansto/instrument/hrpd/util/sics_config.ini b/site_ansto/instrument/hrpd/util/sics_config.ini index 41b97e48..8113a01e 100644 --- a/site_ansto/instrument/hrpd/util/sics_config.ini +++ b/site_ansto/instrument/hrpd/util/sics_config.ini @@ -5,7 +5,7 @@ enabled = False cascade = T1:CF1_ls340,sample_stage:normal_sample_stage enabled = False [CF8] -cascade = T1:ls336_01,T2:ls340_11,sample_stage:normal_sample_stage +cascade = T1:ls336_08,T2:ls336_05,sample_stage:normal_sample_stage enabled = False [Default] cascade = sample_stage:normal_sample_stage @@ -95,8 +95,8 @@ implementation = none name = volts2 optype = multimeter [robot] -enabled = True -implementation = robbie +enabled = False +implementation = none name = robot optype = pickandplace [sample_stage] @@ -176,7 +176,7 @@ asyncqueue = sct desc = "Lakeshore 336 temperature controller" driver = "ls336" imptype = temperature -ip = 137.157.201.21 +ip = 10.157.205.54 port = 7777 terminator = \r\n tol1 = 1.0 @@ -193,6 +193,17 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 +[ls336_08] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.55 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + [ls336_11] desc = "Lakeshore 336 temperature controller" driver = "ls336" @@ -296,14 +307,14 @@ imptype = multimeter ip = 10.157.205.37 port = 4001 -[robbie] +[robby] asyncqueue = sct desc = "Robbie: Epson Pick and Place Robot" driver = epson_pandp imptype = pickandplace ip = 137.157.201.26 port = 6000 -robot_name = robbie +robot_name = robby [rosie] asyncqueue = sct From 2ebefc2b2977a5936774592bd4e87ecc156ad2c6 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 8 Oct 2014 20:46:16 +1100 Subject: [PATCH 13/54] SICS-796: Bring GIT up to date with changes made on ics1-dingo. --- .../instrument/dingo/config/plc/plc.tcl | 34 +++++++++++++++---- .../instrument/dingo/dingo_configuration.tcl | 23 +++++++++++-- .../instrument/dingo/sics_simulation.tcl | 2 +- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/site_ansto/instrument/dingo/config/plc/plc.tcl b/site_ansto/instrument/dingo/config/plc/plc.tcl index 1386c276..531c7902 100644 --- a/site_ansto/instrument/dingo/config/plc/plc.tcl +++ b/site_ansto/instrument/dingo/config/plc/plc.tcl @@ -5,8 +5,6 @@ if {$sim_mode == "false"} { MakeSafetyPLC plc plc_chan 0 } -makesctcontroller sct_shutter std 137.157.204.213:30000 - # Configuration Note: # # A default setting has been set in safetyplc.c code. following configuration @@ -51,14 +49,38 @@ proc focuslight {args} { sct_shutter transact $cmd } -proc tertiary_shutter {args} { - set cmd "set tertiary shutter=$args\r\n" - sct_shutter transact $cmd +proc tertiary {sw} { + set sw [string tolower $sw] + switch $sw { + "open" { + wait 1 + plc_chan send set output=0 + wait 1 + plc_chan send set output=3 + wait 1 + plc_chan send set output=1 + wait 1 + plc_chan send set output=3 + } + "close" { + wait 1 + plc_chan send set output=0 + wait 1 + plc_chan send set output=3 + wait 1 + plc_chan send set output=2 + wait 1 + plc_chan send set output=3 + } + default { + clientput ERROR: [info level 0] command should be open or close not $sw + } + } } publish shutter user publish focuslight user -publish tertiary_shutter user +publish tertiary user source $cfPath(plc)/plc_common_1.tcl diff --git a/site_ansto/instrument/dingo/dingo_configuration.tcl b/site_ansto/instrument/dingo/dingo_configuration.tcl index 7e044f44..144390ee 100644 --- a/site_ansto/instrument/dingo/dingo_configuration.tcl +++ b/site_ansto/instrument/dingo/dingo_configuration.tcl @@ -24,11 +24,30 @@ fileeval $cfPath(motors)/motor_configuration.tcl fileeval $cfPath(plc)/plc.tcl #fileeval $cfPath(counter)/counter.tcl #fileeval $cfPath(hmm)/hmm_configuration.tcl +fileeval $cfPath(environment)/sct_agilent_33220A.tcl +fileeval $cfPath(environment)/sct_isotech_ps.tcl +fileeval $cfPath(environment)/sct_keithley_2700.tcl +fileeval $cfPath(environment)/sct_keithley_m2700.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_218.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl +fileeval $cfPath(environment)/temperature/sct_ls336.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl +fileeval $cfPath(environment)/temperature/sct_ls340.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_base.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_level.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_pres.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_scpi.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_temp.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl +fileeval $cfPath(environment)/sct_protek_common.tcl +fileeval $cfPath(environment)/sct_protekmm.tcl +fileeval $cfPath(environment)/temperature/west400.tcl +fileeval $cfPath(environment)/temperature/sct_west4100.tcl fileeval $cfPath(nexus)/nxscripts.tcl fileeval $cfPath(scan)/scan.tcl fileeval $cfPath(commands)/commands.tcl -#fileeval $cfPath(commands)/pulser.tcl -#fileeval $cfPath(commands)/hvcommands.tcl +fileeval $cfPath(commands)/pulser.tcl +fileeval $cfPath(commands)/hvcommands.tcl fileeval $cfPath(anticollider)/anticollider.tcl source gumxml.tcl diff --git a/site_ansto/instrument/dingo/sics_simulation.tcl b/site_ansto/instrument/dingo/sics_simulation.tcl index d1fad2a9..400867c3 100644 --- a/site_ansto/instrument/dingo/sics_simulation.tcl +++ b/site_ansto/instrument/dingo/sics_simulation.tcl @@ -12,7 +12,7 @@ foreach {simflag icsval fakedev} { motor_simulation false false chopper_simulation false true velsel_simulation false true - plc_simulation true true + plc_simulation false true rfgen_simulation false true goniometer_simulation false true magnetic_simulation false true From 7d35f7e6960825261ec06cd3999056c7d2aa39e2 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Thu, 9 Oct 2014 14:21:10 +1100 Subject: [PATCH 14/54] SICS-797: Bring GIT up to date with changes made on ics1-quokka --- .../instrument/sans/util/sics_config.ini | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/sans/util/sics_config.ini b/site_ansto/instrument/sans/util/sics_config.ini index 2f4734ef..da595975 100644 --- a/site_ansto/instrument/sans/util/sics_config.ini +++ b/site_ansto/instrument/sans/util/sics_config.ini @@ -45,6 +45,13 @@ id = 1 implementation = none name = dsc_val optype = multimeter +[Flow Control] +datype = FC +enabled = False +id = 1 +implementation = none +name = fc1 +optype = flowcontrol [Function_Generator] datype = V enabled = False @@ -200,8 +207,8 @@ imptype = temperature ip = 10.157.205.43 port = 4001 terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 +tol1 = 0.2 +tol2 = 0.2 [Oxford_12tmagnet_sample_insert] desc = "som will be redefined as the magnet sample insert rotation. Sample stage will be renamed to somss" @@ -235,6 +242,13 @@ ip = 10.157.205.13 port = 4444 type = B +[hiden_xcs] +desc = "Hiden XCS Relative Humidity Flow Control" +driver = "hiden_xcs" +imptype = flowcontrol +ip = 137.157.202.79 +port = 4001 + [isotech_ps] desc = "Isotech Power Supply:Baud=2400,Data=8,Stop=1,Parity=None,Flow=None" driver = "isotech_ps" From e396657851972b115a314f0afe0488a57d0b0e80 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Sun, 12 Oct 2014 17:26:54 +1100 Subject: [PATCH 15/54] Fix west 6100 driver name in Wombat sics_config.ini --- site_ansto/instrument/hipd/util/sics_config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/hipd/util/sics_config.ini b/site_ansto/instrument/hipd/util/sics_config.ini index 809696ff..28d7c390 100644 --- a/site_ansto/instrument/hipd/util/sics_config.ini +++ b/site_ansto/instrument/hipd/util/sics_config.ini @@ -296,7 +296,7 @@ imptype = motion_axis asyncprotocol = modbus_ap desc = "VF1 Blue furnace temperature controller" dev_id = 1 -driver = "west6100" +driver = "west_6100" imptype = temperature ip = 10.157.205.24 port = 502 @@ -306,7 +306,7 @@ timeout = 2000 asyncprotocol = modbus_ap desc = "VF2 Blue furnace temperature controller" dev_id = 1 -driver = "west6100" +driver = "west_6100" imptype = temperature ip = 10.157.205.25 port = 502 From de7b1d40e70698cc5b909aaabee7e5b46fd12bd9 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Sun, 12 Oct 2014 17:31:01 +1100 Subject: [PATCH 16/54] Add CF4 configuration from ics1-taipan --- site_ansto/instrument/tas/util/sics_config.ini | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/site_ansto/instrument/tas/util/sics_config.ini b/site_ansto/instrument/tas/util/sics_config.ini index 2051ff37..4ca3248b 100644 --- a/site_ansto/instrument/tas/util/sics_config.ini +++ b/site_ansto/instrument/tas/util/sics_config.ini @@ -4,6 +4,9 @@ enabled = False [CF1] cascade = T1:CF1_ls340,sample_stage:normal_sample_stage enabled = False +[CF4] +cascade = T1:CF4_ls340,sample_stage:normal_sample_stage +enabled = False [Default] cascade = sample_stage:normal_sample_stage enabled = True @@ -105,6 +108,16 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 +[CF4_ls340] +desc = "cf4: cryofurnace" +driver = "ls340" +imptype = temperature +ip = 137.157.203.137 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + [agilent_33220A] asyncqueue = sct desc = "Function Generator" From 7b522c0a7bb2a133c39bd6b003defccae83e3f84 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 13 Oct 2014 11:25:34 +1100 Subject: [PATCH 17/54] A sics_config.ini for Dingo. --- .../instrument/dingo/util/sics_config.ini | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 site_ansto/instrument/dingo/util/sics_config.ini diff --git a/site_ansto/instrument/dingo/util/sics_config.ini b/site_ansto/instrument/dingo/util/sics_config.ini new file mode 100644 index 00000000..2ec8f692 --- /dev/null +++ b/site_ansto/instrument/dingo/util/sics_config.ini @@ -0,0 +1,243 @@ +[CF5] +cascade = T1:CF5_ls340,sample_stage:normal_sample_stage +enabled = False +[Default] +cascade = sample_stage:normal_sample_stage +enabled = True +[Function_Generator] +datype = V +enabled = False +id = 1 +implementation = none +name = pulser +optype = function_generator +[I1] +datype = I +enabled = False +id = 1 +implementation = none +name = curr1 +optype = multimeter +[I2] +datype = I +enabled = False +id = 2 +implementation = none +name = curr2 +optype = multimeter +[T1] +datype = T +enabled = False +id = 1 +implementation = none +name = tc1 +optype = temperature +[T2] +datype = T +enabled = False +id = 2 +implementation = none +name = tc2 +optype = temperature +[T3] +datype = T +enabled = False +id = 3 +implementation = none +name = tc3 +optype = temperature +[T4] +datype = T +enabled = False +id = 4 +implementation = none +name = tc4 +optype = temperature +[V1] +datype = V +enabled = False +id = 1 +implementation = none +name = volts1 +optype = multimeter +[V2] +datype = V +enabled = False +id = 2 +implementation = none +name = volts2 +optype = multimeter +[sample_stage] +enabled = Always +implementation = normal_sample_stage +name = sample_stage +optype = motion_axis +[CF5_ls340] +asyncqueue = sct +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 10.157.205.34 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[agilent_33220A] +asyncqueue = sct +desc = "Function Generator" +driver = agilent_33220A +imptype = function_generator +ip = 10.157.205.16 +port = 5025 + +[ls336_01] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.28 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_02] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.29 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_04] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.30 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_05] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 137.157.201.21 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_06] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 137.157.201.21 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_11] +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.27 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_12] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.31 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_01] +asyncqueue = sct +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_02] +asyncqueue = sct +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4002 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_11] +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[mercury_scpi_01] +desc = "Oxford Mercury temperature controller with three temperature loops." +driver = "mercury_base" +imptype = temperature +ip = 10.157.205.5 +permlink = LT +port = 7020 +terminator = \r\n +tol = 1.0 +valve_tol = 2 + +[mercury_scpi_02] +desc = "Oxford Mercury temperature controller with four temperature loops and needle valve control" +driver = "mercury_scpi" +imptype = temperature +ip = 10.157.205.47 +permlink = LT +port = 7020 +terminator = \r\n +tol = 1.0 +valve_tol = 2 + +[normal_sample_stage] +desc = "This is the default sample stage configuration" +imptype = motion_axis + +[protek_01] +asyncqueue = sct +desc = "Protek Multimeter" +driver = "protekmm" +imptype = multimeter +ip = 10.157.205.36 +port = 4001 + +[protek_02] +asyncqueue = sct +desc = "Protek Multimeter" +driver = "protekmm" +imptype = multimeter +ip = 10.157.205.37 +port = 4001 + From c5dc9ca61504f3c832f6c182338df55ce7394769 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 13 Oct 2014 11:35:20 +1100 Subject: [PATCH 18/54] A generic sics_config.ini for Kookaburra. --- .../kookaburra/util/sics_config.ini | 281 ++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 site_ansto/instrument/kookaburra/util/sics_config.ini diff --git a/site_ansto/instrument/kookaburra/util/sics_config.ini b/site_ansto/instrument/kookaburra/util/sics_config.ini new file mode 100644 index 00000000..c943ffc4 --- /dev/null +++ b/site_ansto/instrument/kookaburra/util/sics_config.ini @@ -0,0 +1,281 @@ +[Default] +cascade = sample_stage:normal_sample_stage +enabled = True +[B1] +datype = B +enabled = False +id = 1 +implementation = none +name = magnet1 +optype = magnetic_field +[Function_Generator] +datype = V +enabled = False +id = 1 +implementation = none +name = pulser +optype = function_generator +[High_Voltage] +datype = V +enabled = False +id = 1 +implementation = none +name = hv_val +optype = multimeter +[I1] +datype = I +enabled = False +id = 1 +implementation = none +name = curr1 +optype = multimeter +[I2] +datype = I +enabled = False +id = 2 +implementation = none +name = curr2 +optype = multimeter +[Power Supply] +datype = V +enabled = False +id = 1 +implementation = none +name = power_supply +optype = power_supply +[T1] +datype = T +enabled = False +id = 1 +implementation = none +name = tc1 +optype = temperature +[T2] +datype = T +enabled = False +id = 2 +implementation = none +name = tc2 +optype = temperature +[T3] +datype = T +enabled = False +id = 3 +implementation = none +name = tc3 +optype = temperature +[T4] +datype = T +enabled = False +id = 4 +implementation = none +name = tc4 +optype = temperature +[T5] +datype = T +enabled = False +id = 5 +implementation = none +name = tc5 +optype = temperature +[T6] +datype = T +enabled = False +id = 6 +implementation = none +name = tc6 +optype = temperature +[V1] +datype = V +enabled = False +id = 1 +implementation = none +name = volts1 +optype = multimeter +[V2] +datype = V +enabled = False +id = 2 +implementation = none +name = volts2 +optype = multimeter +[sample_stage] +enabled = Always +implementation = normal_sample_stage +name = sample_stage +optype = motion_axis +[agilent_33220A] +asyncqueue = sct +desc = "Function Generator" +driver = agilent_33220A +imptype = function_generator +ip = 10.157.205.16 +port = 5025 + +[isotech_ps] +desc = "Isotech Power Supply:Baud=2400,Data=8,Stop=1,Parity=None,Flow=None" +driver = "isotech_ps" +imptype = power_supply +ip = 137.157.202.79 +port = 4001 + +[julabo_lh45] +ctrl_sensor = "bath" +desc = "Julabo temperature controller" +driver = "julabo_lh45" +imptype = temperature +ip = 10.157.205.39 +port = 4001 +tol = 5.0 +type = T + +[ls336_01] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.28 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_02] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.29 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_04] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.30 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_05] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 137.157.201.21 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_06] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 137.157.201.21 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_12] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.31 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_01] +asyncqueue = sct +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_02] +asyncqueue = sct +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4002 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_09] +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.202.79 +port = 4002 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_11] +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[mercury_scpi_01] +desc = "Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" +imptype = temperature +ip = 10.157.205.5 +permlink = LT +port = 7020 +terminator = \r\n +tol = 1.0 +valve_tol = 2 + +[mercury_scpi_02] +desc = "Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" +imptype = temperature +ip = 10.157.205.47 +permlink = LT +port = 7020 +terminator = \r\n +tol = 1.0 +valve_tol = 2 + +[normal_sample_stage] +desc = "This is the default sample stage configuration xyz translation omega rotation but no tilt axes" +imptype = motion_axis + +[protek_01] +asyncqueue = sct +desc = "Protek Multimeter" +driver = "protekmm" +imptype = multimeter +ip = 10.157.205.36 +port = 4001 + +[protek_02] +asyncqueue = sct +desc = "Protek Multimeter" +driver = "protekmm" +imptype = multimeter +ip = 10.157.205.37 +port = 4001 + From 6183182c78a801d3c9e7954dfe91bef331257998 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 13 Oct 2014 14:16:27 +1100 Subject: [PATCH 19/54] A sics_config.ini for Platypus with the new Knauer pump driver. --- .../reflectometer/platypus_configuration.tcl | 1 + .../reflectometer/util/sics_config.ini | 329 ++++++++++++++++++ 2 files changed, 330 insertions(+) create mode 100644 site_ansto/instrument/reflectometer/util/sics_config.ini diff --git a/site_ansto/instrument/reflectometer/platypus_configuration.tcl b/site_ansto/instrument/reflectometer/platypus_configuration.tcl index 94ffd7a8..c5b25e7c 100644 --- a/site_ansto/instrument/reflectometer/platypus_configuration.tcl +++ b/site_ansto/instrument/reflectometer/platypus_configuration.tcl @@ -26,6 +26,7 @@ fileeval $cfPath(parameters)/parameters.tcl fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(counter)/counter.tcl fileeval $cfPath(environment)/sct_syr.tcl +fileeval $cfPath(environment)/sct_knauer_pump.tcl fileeval $cfPath(environment)/sct_mvp.tcl fileeval $cfPath(environment)/sct_protek_common.tcl fileeval $cfPath(environment)/sct_omron_hldc.tcl diff --git a/site_ansto/instrument/reflectometer/util/sics_config.ini b/site_ansto/instrument/reflectometer/util/sics_config.ini new file mode 100644 index 00000000..752b7562 --- /dev/null +++ b/site_ansto/instrument/reflectometer/util/sics_config.ini @@ -0,0 +1,329 @@ +[CF6] +cascade = T1:CF6_ls340,sample_stage:normal_sample_stage +enabled = False +[Default] +cascade = sample_stage:normal_sample_stage +enabled = True +[bruker_setup] +cascade = B1:bruker_bec1,sample_stage:normal_sample_stage +enabled = False +[B1] +datype = B +enabled = False +id = 1 +implementation = none +name = magnet1 +optype = magnetic_field +[Function_Generator] +datype = V +enabled = False +id = 1 +implementation = none +name = pulser +optype = function_generator +[High_Voltage] +datype = V +enabled = False +id = 1 +implementation = none +name = hv_val +optype = multimeter +[I1] +datype = I +enabled = False +id = 1 +implementation = none +name = curr1 +optype = multimeter +[I2] +datype = I +enabled = False +id = 2 +implementation = none +name = curr2 +optype = multimeter +[Power Supply] +datype = V +enabled = False +id = 1 +implementation = none +name = power_supply +optype = power_supply +[Pump 1] +datype = pump +enabled = False +id = 1 +implementation = none +name = hplc +optype = pump +[T1] +datype = T +enabled = False +id = 1 +implementation = none +name = tc1 +optype = temperature +[T2] +datype = T +enabled = False +id = 2 +implementation = none +name = tc2 +optype = temperature +[T3] +datype = T +enabled = False +id = 3 +implementation = none +name = tc3 +optype = temperature +[T4] +datype = T +enabled = False +id = 4 +implementation = none +name = tc4 +optype = temperature +[T5] +datype = T +enabled = False +id = 5 +implementation = none +name = tc5 +optype = temperature +[T6] +datype = T +enabled = False +id = 6 +implementation = none +name = tc6 +optype = temperature +[V1] +datype = V +enabled = False +id = 1 +implementation = none +name = volts1 +optype = multimeter +[V2] +datype = V +enabled = False +id = 2 +implementation = none +name = volts2 +optype = multimeter +[sample_stage] +enabled = Always +implementation = normal_sample_stage +name = sample_stage +optype = motion_axis +[5Tmagnet] +desc = "The New Zealand magnet" +driver = tsi_smc +imptype = magnetic_field +ip = 137.157.202.79 +port = 4004 +timeout = 2000 + +[CF6_ls340] +desc = "cf6: Bottom loading cryocooler" +driver = "ls340" +imptype = temperature +ip = 10.157.205.38 +port = 4001 +terminator = \r\n +tol1 = 0.2 +tol2 = 0.2 + +[agilent_33220A] +asyncqueue = sct +desc = "Function Generator" +driver = agilent_33220A +imptype = function_generator +ip = 10.157.205.16 +port = 5025 + +[bruker_bec1] +desc = "Bruker Magnet" +driver = "bruker_bec1" +imptype = magnetic_field +ip = 10.157.205.13 +port = 4444 +type = B + +[isotech_ps] +desc = "Isotech Power Supply:Baud=2400,Data=8,Stop=1,Parity=None,Flow=None" +driver = "isotech_ps" +imptype = power_supply +ip = 137.157.202.79 +port = 4001 + +[julabo_lh45] +ctrl_sensor = "bath" +desc = "Julabo temperature controller" +driver = "julabo_lh45" +imptype = temperature +ip = 10.157.205.39 +port = 4001 +tol = 5.0 +type = T + +[knauer_01] +asyncprotocol = knauer_ap +desc = "Knauer BlueShadow Pump 40P (High Performance/Pressure Liquid Chromatography)" +driver = knauer_pump +imptype = pump +ip = 10.157.205.51 +port = 10001 +timeout = 1000 + +[ls336_01] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.28 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_02] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.29 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_04] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.30 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_05] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 137.157.201.21 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_06] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 137.157.201.21 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls336_12] +asyncqueue = sct +desc = "Lakeshore 336 temperature controller" +driver = "ls336" +imptype = temperature +ip = 10.157.205.31 +port = 7777 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_01] +asyncqueue = sct +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_02] +asyncqueue = sct +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4002 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_09] +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.202.79 +port = 4002 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[ls340_11] +desc = "Lakeshore 340 temperature controller" +driver = "ls340" +imptype = temperature +ip = 137.157.201.86 +port = 4001 +terminator = \r\n +tol1 = 1.0 +tol2 = 1.0 + +[mercury_scpi_01] +desc = "Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" +imptype = temperature +ip = 10.157.205.5 +permlink = LT +port = 7020 +terminator = \r\n +tol = 1.0 +valve_tol = 2 + +[mercury_scpi_02] +desc = "Oxford Mercury temperature controller in Mercury mode" +driver = "mercury_scpi" +imptype = temperature +ip = 10.157.205.47 +permlink = LT +port = 7020 +terminator = \r\n +tol = 1.0 +valve_tol = 2 + +[normal_sample_stage] +desc = "This is the default sample stage configuration xyz translation omega rotation but no tilt axes" +imptype = motion_axis + +[protek_01] +asyncqueue = sct +desc = "Protek Multimeter" +driver = "protekmm" +imptype = multimeter +ip = 10.157.205.36 +port = 4001 + +[protek_02] +asyncqueue = sct +desc = "Protek Multimeter" +driver = "protekmm" +imptype = multimeter +ip = 10.157.205.37 +port = 4001 + From 11d008620ae28539e6a034d0f9935d138f52c4e8 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 15 Oct 2014 09:14:58 +1100 Subject: [PATCH 20/54] SICS-742 spin flipper is instructed to power up but doesn't reach the target current. --- .../instrument/reflectometer/config/beamline/sct_RFGen.tcl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl b/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl index a2603048..7f66455c 100644 --- a/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl +++ b/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl @@ -146,6 +146,9 @@ proc ::scobj::rfgen::set_frequency {basePath} { ## # @brief Request a state report from the RF generator proc ::scobj::rfgen::rqStatFunc {} { + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } sct send "L:[sct address]" return rdState } @@ -167,7 +170,6 @@ proc ::scobj::rfgen::rdStatFunc {} { set statStr [sct result] if {[string match "ASCERR:*" $statStr]} { sct geterror $statStr - sct ramping $RAMPIDLE return stateChange } set statList [split $statStr "|="] @@ -402,6 +404,8 @@ proc ::scobj::rfgen::mkRFGen {argList} { if {[SplitReply [rfgen_simulation]] == "false"} { set SCT_RFGEN sct_rfgen_$pa(NAME) makesctcontroller $SCT_RFGEN rfamp $pa(IP):$pa(PORT) + # The RFGen has been observed to fail to respond within the default timeout of 2 sec + $SCT_RFGEN timeout 5 hsetprop /sics/$pa(NAME) contname $SCT_RFGEN # mkStatArr stateArr [split [$SCT_RFGEN transact "L:$pa(ADDRESS)"] "|="] From 0cd3e85607c6c304b3e6e415ed376a038d58a671 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 16 Oct 2014 15:52:30 +1100 Subject: [PATCH 21/54] Add a driver for the 3He Polariser/Analyser (rudimentary) --- .../config/beamline/he3_polanal.sct | 78 ++++ .../config/beamline/sct_he3_polanal.tcl | 355 ++++++++++++++++++ 2 files changed, 433 insertions(+) create mode 100644 site_ansto/instrument/config/beamline/he3_polanal.sct create mode 100644 site_ansto/instrument/config/beamline/sct_he3_polanal.tcl diff --git a/site_ansto/instrument/config/beamline/he3_polanal.sct b/site_ansto/instrument/config/beamline/he3_polanal.sct new file mode 100644 index 00000000..58541495 --- /dev/null +++ b/site_ansto/instrument/config/beamline/he3_polanal.sct @@ -0,0 +1,78 @@ +# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent +driver he3_polanal = { + protocol = std; + class = instrument; + simulation_group = rfgen_simulation; + group = { + var spin = { + type = text; + readable = 10; + read_command = 'spin 0 0'; + writeable = 1; + write_command = 'spin '; + check_function = chkWrite; + } + } + code chkWrite = {%% + rdValue ${tc_root} + %%} + + code rdValue = {%% + set dlist [split ${data}] + if {[lindex ${dlist} 0] != "Spin"} { + sct geterror "Unexpected 'Spin' response '${data}'" + error "[sct geterror]" + } + set idx [lsearch ${dlist} "and"] + if { ${idx} < 0 } { + sct geterror "Unexpected 'and' response '${data}'" + error "[sct geterror]" + } + set plist [lrange ${dlist} 1 ${idx}-1] + set alist [lrange ${dlist} ${idx}+1 end] + if {[lindex ${plist} 0] != "Polariser"} { + sct geterror "Unexpected 'Polariser' response '${data}'" + error "[sct geterror]" + } elseif {[lindex ${plist} 1] == "In" && [lindex ${plist} 3] == "State"} { + set pstate [string index [lindex ${plist} 2] 1] + } elseif {[lindex ${plist} 1] == "Not" && [lindex ${plist} 2] == "Active"} { + set pstate 0 + } else { + sct geterror "Unexpected 'Polariser State' response '${data}'" + error "[sct geterror]" + } + if {[lindex ${alist} 0] != "Analyser"} { + sct geterror "Unexpected 'Analyser' response '${data}'" + error "[sct geterror]" + } elseif {[lindex ${alist} 1] == "In" && [lindex ${alist} 3] == "State"} { + set astate [string index [lindex ${alist} 2] 1] + } elseif {[lindex ${alist} 1] == "Not" && [lindex ${alist} 2] == "Active."} { + set astate 0 + } else { + sct geterror "Unexpected 'Analyser State' response '${data}'" + error "[sct geterror]" + } + set data "${pstate} ${astate}" + %%} + + code setValue = {%% + set geterror "Spin target must be 'x/y', where x,y are 0,+,- and not '[sct target]'" + set dlist [split [sct target]] + if {[llength ${dlist}] != 2} { + set dlist [split [sct target] /] + if {[llength ${dlist}] != 2} { + sct geterror ${geterror} + error "[sct geterror]" + } + } + if { [lindex ${dlist} 0] != "+" && [lindex ${dlist} 0] != "-" && [lindex ${dlist} 0] != "0" } { + sct geterror ${geterror} + error "[sct geterror]" + } + if { [lindex ${dlist} 1] != "+" && [lindex ${dlist} 1] != "-" && [lindex ${dlist} 1] != "0" } { + sct geterror ${geterror} + error "[sct geterror]" + } + set cmd "spin [lindex ${dlist} 0] [lindex ${dlist} 1]" + %%} +} diff --git a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl new file mode 100644 index 00000000..2930048d --- /dev/null +++ b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl @@ -0,0 +1,355 @@ +# Generated driver for he3_polanal +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::he3_polanal { + set debug_threshold 5 +} + +proc ::scobj::he3_polanal::debug_log {tc_root debug_level debug_string} { + set catch_status [ catch { + set debug_threshold [hgetpropval ${tc_root} debug_threshold] + if {${debug_level} >= ${debug_threshold}} { + set fd [open "../log/he3_polanal_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::he3_polanal::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::he3_polanal::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::he3_polanal::${debug_string}" + } + } catch_message ] +} + +# check function for hset change +proc ::scobj::he3_polanal::checkrange {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "checkrange tc_root=${tc_root} sct=[sct] target=[sct target]" + set setpoint [sct target] + if { [hpropexists [sct] lowerlimit] } { + set lolimit [sct lowerlimit] + } else { + # lowerlimit not set, use target + set lolimit [sct target] + } + if { [hpropexists [sct] upperlimit] } { + set hilimit [sct upperlimit] + } else { + # upperlimit not set, use target + set hilimit [sct target] + } +# checkrange hook code goes here + if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { + error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" + } + return OK + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to check the write parameter on a device +proc ::scobj::he3_polanal::chkWrite {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "chkWrite tc_root=${tc_root} sct=[sct] resp=[sct result]" +# chkWrite hook code starts + rdValue ${tc_root} +# chkWrite hook code ends + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to request the read of a parameter on a device +proc ::scobj::he3_polanal::getValue {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "getValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# getValue hook code goes here + debug_log ${tc_root} 1 "getValue sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to parse the read of a parameter on a device +proc ::scobj::he3_polanal::rdValue {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} sct=[sct] result=[sct result]" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set data [sct result] + set nextState "idle" + if {[string equal -nocase -length 7 ${data} "ASCERR:"]} { + # the protocol driver has reported an error + sct geterror "${data}" + error "[sct geterror]" + } +# rdValue hook code starts + set dlist [split ${data}] + if {[lindex ${dlist} 0] != "Spin"} { + sct geterror "Unexpected 'Spin' response '${data}'" + error "[sct geterror]" + } + set idx [lsearch ${dlist} "and"] + if { ${idx} < 0 } { + sct geterror "Unexpected 'and' response '${data}'" + error "[sct geterror]" + } + set plist [lrange ${dlist} 1 ${idx}-1] + set alist [lrange ${dlist} ${idx}+1 end] + if {[lindex ${plist} 0] != "Polariser"} { + sct geterror "Unexpected 'Polariser' response '${data}'" + error "[sct geterror]" + } elseif {[lindex ${plist} 1] == "In" && [lindex ${plist} 3] == "State"} { + set pstate [string index [lindex ${plist} 2] 1] + } elseif {[lindex ${plist} 1] == "Not" && [lindex ${plist} 2] == "Active"} { + set pstate 0 + } else { + sct geterror "Unexpected 'Polariser State' response '${data}'" + error "[sct geterror]" + } + if {[lindex ${alist} 0] != "Analyser"} { + sct geterror "Unexpected 'Analyser' response '${data}'" + error "[sct geterror]" + } elseif {[lindex ${alist} 1] == "In" && [lindex ${alist} 3] == "State"} { + set astate [string index [lindex ${alist} 2] 1] + } elseif {[lindex ${alist} 1] == "Not" && [lindex ${alist} 2] == "Active."} { + set astate 0 + } else { + sct geterror "Unexpected 'Analyser State' response '${data}'" + error "[sct geterror]" + } + set data "${pstate} ${astate}" +# rdValue hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::he3_polanal::setValue {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "setValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# setValue hook code starts + set geterror "Spin target must be 'x/y', where x,y are 0,+,- and not '[sct target]'" + set dlist [split [sct target]] + if {[llength ${dlist}] != 2} { + set dlist [split [sct target] /] + if {[llength ${dlist}] != 2} { + sct geterror ${geterror} + error "[sct geterror]" + } + } + if { [lindex ${dlist} 0] != "+" && [lindex ${dlist} 0] != "-" && [lindex ${dlist} 0] != "0" } { + sct geterror ${geterror} + error "[sct geterror]" + } + if { [lindex ${dlist} 1] != "+" && [lindex ${dlist} 1] != "-" && [lindex ${dlist} 1] != "0" } { + sct geterror ${geterror} + error "[sct geterror]" + } + set cmd "spin [lindex ${dlist} 0] [lindex ${dlist} 1]" +# setValue hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "setValue sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } { + ::scobj::he3_polanal::sics_log 9 "::scobj::he3_polanal::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + set ns "[namespace current]" + set catch_status [ catch { + + MakeSICSObj ${name} SCT_OBJECT + + sicslist setatt ${name} klass ${device_class} + sicslist setatt ${name} long_name ${name} + + set scobj_hpath /sics/${name} + + hfactory ${scobj_hpath}/spin plain user text + hsetprop ${scobj_hpath}/spin read ${ns}::getValue ${scobj_hpath} rdValue {spin 0 0} + hsetprop ${scobj_hpath}/spin rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/spin write ${ns}::setValue ${scobj_hpath} chkWrite {spin } + hsetprop ${scobj_hpath}/spin chkWrite ${ns}::chkWrite ${scobj_hpath} + hsetprop ${scobj_hpath}/spin check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/spin control true + hsetprop ${scobj_hpath}/spin data true + hsetprop ${scobj_hpath}/spin mutable true + hsetprop ${scobj_hpath}/spin nxsave true + hsetprop ${scobj_hpath}/spin oldval UNKNOWN + hsetprop ${scobj_hpath}/spin klass "parameter" + hsetprop ${scobj_hpath}/spin sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/spin type "part" + hsetprop ${scobj_hpath}/spin nxalias "${name}_spin" + + hsetprop ${scobj_hpath} data "true" + hsetprop ${scobj_hpath} klass "@none" + hsetprop ${scobj_hpath} type "part" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/spin 10 + ${sct_controller} write ${scobj_hpath}/spin + } else { + ::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal" + } + hsetprop ${scobj_hpath} klass ${device_class} + hsetprop ${scobj_hpath} data true + hsetprop ${scobj_hpath} debug_threshold 5 +# mkDriver hook code goes here + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::he3_polanal::add_driver {name device_class simulation_flag ip_address tcp_port} { + set catch_status [ catch { + ::scobj::he3_polanal::sics_log 9 "::scobj::he3_polanal::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::he3_polanal::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::he3_polanal::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} std ${ip_address}:${tcp_port} + } + } else { + ::scobj::he3_polanal::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for he3_polanal" + } + ::scobj::he3_polanal::sics_log 1 "::scobj::he3_polanal::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + ::scobj::he3_polanal::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::he3_polanal { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_he3_polanal {name ip_address tcp_port} { + set simulation_flag "[string tolower [SplitReply [rfgen_simulation]]]" + ::scobj::he3_polanal::add_driver ${name} "instrument" "${simulation_flag}" ${ip_address} ${tcp_port} +} + +clientput "file evaluation of sct_he3_polanal.tcl" +::scobj::he3_polanal::sics_log 9 "file evaluation of sct_he3_polanal.tcl" + +proc ::scobj::he3_polanal::read_config {} { + set catch_status [ catch { + set ns "::scobj::he3_polanal" + dict for {k u} $::config_dict { + if { [dict exists $u "implementation"] } { + set simulation_flag "[string tolower [SplitReply [rfgen_simulation]]]" + set device_class "instrument" + if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } { + continue + } + set enabled [string tolower [dict get $u "enabled"]] + if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } { + continue + } + if { [dict exists $u "simulation_group"] } { + set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]] + } + if { [dict exists $u "device_class"] } { + set device_class "[dict get $u "device_class"]" + } + set name [dict get $u name] + set implementation [dict get $u "implementation"] + if { !([dict exists $::config_dict $implementation]) } { + continue + } + set v [dict get $::config_dict $implementation] + if { !([dict exists $v "driver"]) } { + continue + } + if { [string equal -nocase [dict get $v "driver"] "he3_polanal"] } { + if { ![string equal -nocase "${simulation_flag}" "false"] } { + set asyncqueue "null" + ${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue" + } elseif { [dict exists $v "asyncqueue"] } { + set asyncqueue [dict get $v "asyncqueue"] + if { [string equal -nocase ${asyncqueue} "sct"] } { + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + } + } else { + if { [dict exists $v "asyncprotocol"] } { + set asyncprotocol [dict get $v "asyncprotocol"] + } else { + set asyncprotocol ${name}_protocol + MakeAsyncProtocol ${asyncprotocol} + if { [dict exists $v "terminator"] } { + ${asyncprotocol} sendterminator "[dict get $v "terminator"]" + ${asyncprotocol} replyterminator "[dict get $v "terminator"]" + } + } + set asyncqueue ${name}_queue + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port} + if { [dict exists $v "timeout"] } { + ${asyncqueue} timeout "[dict get $v "timeout"]" + } + } + if { [string equal -nocase ${asyncqueue} "sct"] } { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} + } else { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} + } + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::he3_polanal::read_config +} else { + ::scobj::he3_polanal::sics_log 5 "No config dict" +} From e7f2070737f6a3d2de8003129edabad89c9da85a Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 15 Oct 2014 12:20:13 +1100 Subject: [PATCH 22/54] SICS-806 Add extra parameters to Kookaburra hdf. --- .../instrument/kookaburra/config/parameters/parameters.tcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl b/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl index 6ee343e6..ad2a57da 100644 --- a/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl +++ b/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl @@ -10,7 +10,10 @@ foreach {var lname type priv units klass} { wavelength wavelength float user Angstrom crystal dOmega dOmega float user degrees crystal gDQv gDQv float user none crystal + gDQh gDQh float user none crystal + scan_variable scan_variable text user none crystal MainDeadTime MainDeadTime float user s detector + TransBackground TransBackground int user none detector TransDeadTime TransDeadTime float user s detector TransmissionTube TransmissionTube int user none detector bkgLevel bkgLevel float user 1 experiment From a6ff6346ed9635e33c203911f21ef3c4efaf2ad3 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 15 Oct 2014 12:20:42 +1100 Subject: [PATCH 23/54] Fix typo in Platypus motor_configuration.tcl --- .../reflectometer/config/motors/motor_configuration.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl b/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl index f313d300..01e0a22a 100644 --- a/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl @@ -98,7 +98,7 @@ set ss4d_home_mm 0.0 set ss4l_home_mm 0.0 set ss4r_home_mm 0.0 -Default upper and lower ranges for vertical slits +#Default upper and lower ranges for vertical slits set vSlitHome 0 set vSlitLoRange 5 set vSlitHiRange 25 From 73181a43d91bcd2004f4b9d699f368cbf635ae2e Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 08:59:35 +1100 Subject: [PATCH 24/54] Wrapper templates to load syringe pump and mvp valve via sics_config.ini. --- .../instrument/config/environment/mvp_valve.sct | 12 ++++++++++++ .../instrument/config/environment/syringe_pump.sct | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 site_ansto/instrument/config/environment/mvp_valve.sct create mode 100644 site_ansto/instrument/config/environment/syringe_pump.sct diff --git a/site_ansto/instrument/config/environment/mvp_valve.sct b/site_ansto/instrument/config/environment/mvp_valve.sct new file mode 100644 index 00000000..ce83b422 --- /dev/null +++ b/site_ansto/instrument/config/environment/mvp_valve.sct @@ -0,0 +1,12 @@ +# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent +driver mvp_valve = { + protocol = hamilton + wrapper_property nosctcontroller = True + class = environment + simulation_group = environment_simulation + add_args = 'id datype' + make_args = 'id datype' + code mkWrapper = {%% + add_mvp $name $ip_address $tcp_port a + %%} +} diff --git a/site_ansto/instrument/config/environment/syringe_pump.sct b/site_ansto/instrument/config/environment/syringe_pump.sct new file mode 100644 index 00000000..08998230 --- /dev/null +++ b/site_ansto/instrument/config/environment/syringe_pump.sct @@ -0,0 +1,11 @@ +# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent +driver syringe_pump = { + protocol = syringe + class = environment + simulation_group = environment_simulation + add_args = 'id datype' + make_args = 'id datype' + code mkWrapper = {%% + ::scobj::syr::mk_sct_syr $sct_controller environment $name + %%} +} From 2afcb043c31df431d3e3ec8121dfe6d76dbcfc75 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 09:00:01 +1100 Subject: [PATCH 25/54] Generate TCL code for syringe and mvp wrappers. --- .../config/environment/sct_mvp_valve.tcl | 157 ++++++++++++++++ .../config/environment/sct_syringe_pump.tcl | 167 ++++++++++++++++++ 2 files changed, 324 insertions(+) create mode 100644 site_ansto/instrument/config/environment/sct_mvp_valve.tcl create mode 100644 site_ansto/instrument/config/environment/sct_syringe_pump.tcl diff --git a/site_ansto/instrument/config/environment/sct_mvp_valve.tcl b/site_ansto/instrument/config/environment/sct_mvp_valve.tcl new file mode 100644 index 00000000..0bd5761d --- /dev/null +++ b/site_ansto/instrument/config/environment/sct_mvp_valve.tcl @@ -0,0 +1,157 @@ +# Generated driver for mvp_valve +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::mvp_valve { + set debug_threshold 5 +} + +proc ::scobj::mvp_valve::debug_log {tc_root debug_level debug_string} { + set catch_status [ catch { + set debug_threshold [hgetpropval ${tc_root} debug_threshold] + if {${debug_level} >= ${debug_threshold}} { + set fd [open "../log/mvp_valve_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::mvp_valve::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::mvp_valve::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::mvp_valve::${debug_string}" + } + } catch_message ] +} + +proc ::scobj::mvp_valve::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype } { + ::scobj::mvp_valve::sics_log 9 "::scobj::mvp_valve::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype}" + set ns "[namespace current]" + set catch_status [ catch { + +# mkWrapper hook code starts + add_mvp $name $ip_address $tcp_port a +# mkWrapper hook code ends + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::mvp_valve::add_driver {name device_class simulation_flag ip_address tcp_port id datype} { + set catch_status [ catch { + ::scobj::mvp_valve::sics_log 9 "::scobj::mvp_valve::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype}" + ::scobj::mvp_valve::sics_log 9 "No sctcontroller for mvp_valve" + ::scobj::mvp_valve::sics_log 1 "::scobj::mvp_valve::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype}" + ::scobj::mvp_valve::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::mvp_valve { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_mvp_valve {name ip_address tcp_port id datype} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::mvp_valve::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" +} + +clientput "file evaluation of sct_mvp_valve.tcl" +::scobj::mvp_valve::sics_log 9 "file evaluation of sct_mvp_valve.tcl" + +proc ::scobj::mvp_valve::read_config {} { + set catch_status [ catch { + set ns "::scobj::mvp_valve" + dict for {k u} $::config_dict { + if { [dict exists $u "implementation"] } { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + set device_class "environment" + if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } { + continue + } + set enabled [string tolower [dict get $u "enabled"]] + if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } { + continue + } + if { [dict exists $u "simulation_group"] } { + set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]] + } + if { [dict exists $u "device_class"] } { + set device_class "[dict get $u "device_class"]" + } + set name [dict get $u name] + set implementation [dict get $u "implementation"] + if { !([dict exists $::config_dict $implementation]) } { + continue + } + set v [dict get $::config_dict $implementation] + if { !([dict exists $v "driver"]) } { + continue + } + if { [string equal -nocase [dict get $v "driver"] "mvp_valve"] } { + if { ![string equal -nocase "${simulation_flag}" "false"] } { + set asyncqueue "null" + ${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue" + } elseif { [dict exists $v "asyncqueue"] } { + set asyncqueue [dict get $v "asyncqueue"] + if { [string equal -nocase ${asyncqueue} "sct"] } { + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + } + } else { + if { [dict exists $v "asyncprotocol"] } { + set asyncprotocol [dict get $v "asyncprotocol"] + } else { + set asyncprotocol ${name}_protocol + MakeAsyncProtocol ${asyncprotocol} + if { [dict exists $v "terminator"] } { + ${asyncprotocol} sendterminator "[dict get $v "terminator"]" + ${asyncprotocol} replyterminator "[dict get $v "terminator"]" + } + } + set asyncqueue ${name}_queue + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port} + if { [dict exists $v "timeout"] } { + ${asyncqueue} timeout "[dict get $v "timeout"]" + } + } + set arg_list [list] + set missing_list [list] + foreach arg {id datype} { + if {[dict exists $u $arg]} { + lappend arg_list "[dict get $u $arg]" + } elseif {[dict exists $v $arg]} { + lappend arg_list "[dict get $v $arg]" + } else { + ${ns}::sics_log 9 "Missing configuration value $arg" + lappend missing_list $arg + } + } + if { [llength $missing_list] > 0 } { + error "$name is missing configuration values $missing_list" + } + if { [string equal -nocase ${asyncqueue} "sct"] } { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list + } else { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list + } + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::mvp_valve::read_config +} else { + ::scobj::mvp_valve::sics_log 5 "No config dict" +} diff --git a/site_ansto/instrument/config/environment/sct_syringe_pump.tcl b/site_ansto/instrument/config/environment/sct_syringe_pump.tcl new file mode 100644 index 00000000..dd4a923d --- /dev/null +++ b/site_ansto/instrument/config/environment/sct_syringe_pump.tcl @@ -0,0 +1,167 @@ +# Generated driver for syringe_pump +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::syringe_pump { + set debug_threshold 5 +} + +proc ::scobj::syringe_pump::debug_log {tc_root debug_level debug_string} { + set catch_status [ catch { + set debug_threshold [hgetpropval ${tc_root} debug_threshold] + if {${debug_level} >= ${debug_threshold}} { + set fd [open "../log/syringe_pump_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::syringe_pump::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::syringe_pump::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::syringe_pump::${debug_string}" + } + } catch_message ] +} + +proc ::scobj::syringe_pump::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype } { + ::scobj::syringe_pump::sics_log 9 "::scobj::syringe_pump::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype}" + set ns "[namespace current]" + set catch_status [ catch { + +# mkWrapper hook code starts + ::scobj::syr::mk_sct_syr $sct_controller environment $name +# mkWrapper hook code ends + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::syringe_pump::add_driver {name device_class simulation_flag ip_address tcp_port id datype} { + set catch_status [ catch { + ::scobj::syringe_pump::sics_log 9 "::scobj::syringe_pump::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::syringe_pump::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::syringe_pump::sics_log 9 "makesctcontroller sct_${name} syringe ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} syringe ${ip_address}:${tcp_port} + } + } else { + ::scobj::syringe_pump::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for syringe_pump" + } + ::scobj::syringe_pump::sics_log 1 "::scobj::syringe_pump::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype}" + ::scobj::syringe_pump::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::syringe_pump { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_syringe_pump {name ip_address tcp_port id datype} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::syringe_pump::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" +} + +clientput "file evaluation of sct_syringe_pump.tcl" +::scobj::syringe_pump::sics_log 9 "file evaluation of sct_syringe_pump.tcl" + +proc ::scobj::syringe_pump::read_config {} { + set catch_status [ catch { + set ns "::scobj::syringe_pump" + dict for {k u} $::config_dict { + if { [dict exists $u "implementation"] } { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + set device_class "environment" + if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } { + continue + } + set enabled [string tolower [dict get $u "enabled"]] + if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } { + continue + } + if { [dict exists $u "simulation_group"] } { + set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]] + } + if { [dict exists $u "device_class"] } { + set device_class "[dict get $u "device_class"]" + } + set name [dict get $u name] + set implementation [dict get $u "implementation"] + if { !([dict exists $::config_dict $implementation]) } { + continue + } + set v [dict get $::config_dict $implementation] + if { !([dict exists $v "driver"]) } { + continue + } + if { [string equal -nocase [dict get $v "driver"] "syringe_pump"] } { + if { ![string equal -nocase "${simulation_flag}" "false"] } { + set asyncqueue "null" + ${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue" + } elseif { [dict exists $v "asyncqueue"] } { + set asyncqueue [dict get $v "asyncqueue"] + if { [string equal -nocase ${asyncqueue} "sct"] } { + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + } + } else { + if { [dict exists $v "asyncprotocol"] } { + set asyncprotocol [dict get $v "asyncprotocol"] + } else { + set asyncprotocol ${name}_protocol + MakeAsyncProtocol ${asyncprotocol} + if { [dict exists $v "terminator"] } { + ${asyncprotocol} sendterminator "[dict get $v "terminator"]" + ${asyncprotocol} replyterminator "[dict get $v "terminator"]" + } + } + set asyncqueue ${name}_queue + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port} + if { [dict exists $v "timeout"] } { + ${asyncqueue} timeout "[dict get $v "timeout"]" + } + } + set arg_list [list] + set missing_list [list] + foreach arg {id datype} { + if {[dict exists $u $arg]} { + lappend arg_list "[dict get $u $arg]" + } elseif {[dict exists $v $arg]} { + lappend arg_list "[dict get $v $arg]" + } else { + ${ns}::sics_log 9 "Missing configuration value $arg" + lappend missing_list $arg + } + } + if { [llength $missing_list] > 0 } { + error "$name is missing configuration values $missing_list" + } + if { [string equal -nocase ${asyncqueue} "sct"] } { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list + } else { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list + } + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::syringe_pump::read_config +} else { + ::scobj::syringe_pump::sics_log 5 "No config dict" +} From f1397cc1f9702c91525867bb4b775d70f96d4de1 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 09:01:25 +1100 Subject: [PATCH 26/54] Wrapper template which configures bruker via sics_config.ini --- .../config/environment/magneticField/bruker.sct | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 site_ansto/instrument/config/environment/magneticField/bruker.sct diff --git a/site_ansto/instrument/config/environment/magneticField/bruker.sct b/site_ansto/instrument/config/environment/magneticField/bruker.sct new file mode 100644 index 00000000..c1daa165 --- /dev/null +++ b/site_ansto/instrument/config/environment/magneticField/bruker.sct @@ -0,0 +1,11 @@ +# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent +driver bruker = { + protocol = astvelsel + class = environment + simulation_group = environment_simulation + add_args = 'id datype {tol 0.1}' + make_args = 'id datype tol' + code mkWrapper = {%% + add_bruker_BEC1 $name $ip_address $tcp_port $tol + %%} +} From 998e49d8b2178dae1924ca8276d84fe940292ba6 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 09:02:02 +1100 Subject: [PATCH 27/54] Generate new wrapper TCL code for Bruker magnet. --- .../environment/magneticField/sct_bruker.tcl | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl diff --git a/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl b/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl new file mode 100644 index 00000000..a195b1dc --- /dev/null +++ b/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl @@ -0,0 +1,167 @@ +# Generated driver for bruker +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::bruker { + set debug_threshold 5 +} + +proc ::scobj::bruker::debug_log {tc_root debug_level debug_string} { + set catch_status [ catch { + set debug_threshold [hgetpropval ${tc_root} debug_threshold] + if {${debug_level} >= ${debug_threshold}} { + set fd [open "../log/bruker_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::bruker::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::bruker::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::bruker::${debug_string}" + } + } catch_message ] +} + +proc ::scobj::bruker::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype tol } { + ::scobj::bruker::sics_log 9 "::scobj::bruker::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}" + set ns "[namespace current]" + set catch_status [ catch { + +# mkWrapper hook code starts + add_bruker_BEC1 $name $ip_address $tcp_port $tol +# mkWrapper hook code ends + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::bruker::add_driver {name device_class simulation_flag ip_address tcp_port id datype {tol 0.1}} { + set catch_status [ catch { + ::scobj::bruker::sics_log 9 "::scobj::bruker::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port} + } + } else { + ::scobj::bruker::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for bruker" + } + ::scobj::bruker::sics_log 1 "::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}" + ::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::bruker { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_bruker {name ip_address tcp_port id datype {tol 0.1}} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::bruker::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${{tol}" "${0.1}}" +} + +clientput "file evaluation of sct_bruker.tcl" +::scobj::bruker::sics_log 9 "file evaluation of sct_bruker.tcl" + +proc ::scobj::bruker::read_config {} { + set catch_status [ catch { + set ns "::scobj::bruker" + dict for {k u} $::config_dict { + if { [dict exists $u "implementation"] } { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + set device_class "environment" + if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } { + continue + } + set enabled [string tolower [dict get $u "enabled"]] + if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } { + continue + } + if { [dict exists $u "simulation_group"] } { + set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]] + } + if { [dict exists $u "device_class"] } { + set device_class "[dict get $u "device_class"]" + } + set name [dict get $u name] + set implementation [dict get $u "implementation"] + if { !([dict exists $::config_dict $implementation]) } { + continue + } + set v [dict get $::config_dict $implementation] + if { !([dict exists $v "driver"]) } { + continue + } + if { [string equal -nocase [dict get $v "driver"] "bruker"] } { + if { ![string equal -nocase "${simulation_flag}" "false"] } { + set asyncqueue "null" + ${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue" + } elseif { [dict exists $v "asyncqueue"] } { + set asyncqueue [dict get $v "asyncqueue"] + if { [string equal -nocase ${asyncqueue} "sct"] } { + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + } + } else { + if { [dict exists $v "asyncprotocol"] } { + set asyncprotocol [dict get $v "asyncprotocol"] + } else { + set asyncprotocol ${name}_protocol + MakeAsyncProtocol ${asyncprotocol} + if { [dict exists $v "terminator"] } { + ${asyncprotocol} sendterminator "[dict get $v "terminator"]" + ${asyncprotocol} replyterminator "[dict get $v "terminator"]" + } + } + set asyncqueue ${name}_queue + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port} + if { [dict exists $v "timeout"] } { + ${asyncqueue} timeout "[dict get $v "timeout"]" + } + } + set arg_list [list] + set missing_list [list] + foreach arg {id datype tol} { + if {[dict exists $u $arg]} { + lappend arg_list "[dict get $u $arg]" + } elseif {[dict exists $v $arg]} { + lappend arg_list "[dict get $v $arg]" + } else { + ${ns}::sics_log 9 "Missing configuration value $arg" + lappend missing_list $arg + } + } + if { [llength $missing_list] > 0 } { + error "$name is missing configuration values $missing_list" + } + if { [string equal -nocase ${asyncqueue} "sct"] } { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list + } else { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list + } + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::bruker::read_config +} else { + ::scobj::bruker::sics_log 5 "No config dict" +} From ea8ed30eb836a0304406c4531c8463b2ebb33538 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 09:02:45 +1100 Subject: [PATCH 28/54] Revert obsolete read_config code for bruker_BEC1 driver. --- .../magneticField/sct_bruker_BEC1.tcl | 83 ------------------- 1 file changed, 83 deletions(-) diff --git a/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl b/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl index fa1dc6fd..cebab88c 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl @@ -1366,88 +1366,5 @@ proc add_bruker_bec1 {name IP port {_tol 0.1} {CID 1} {CTYPE B} } { handle_exception $catch_status $message "In subroutine add_bruker_bec1()." } -namespace eval ::scobj::bruker_bec1 { -set debug_threshold 5 -} -proc ::scobj::bruker_bec1::sics_log {debug_level debug_string} { - set catch_status [ catch { - set debug_threshold ${::scobj::bruker_bec1::debug_threshold} - if {${debug_level} >= ${debug_threshold}} { - sicslog "::scobj::bruker_bec1::${debug_string}" - } - } catch_message ] -} - clientput "file evaluation of sct_bruker_bec1.tcl" -::scobj::bruker_bec1::sics_log 9 "file evaluation of sct_bruker_bec1.tcl" - -proc ::scobj::bruker_bec1::read_config {} { - set catch_status [ catch { - set ns "::scobj::bruker_bec1" - dict for {k v} $::config_dict { - if { [dict exists $v "implementation"] } { - if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } { - continue - } - set name [dict get $v name] - set enabled [string tolower [dict get $v "enabled"]] - set implementation [dict get $v "implementation"] - if { !([dict exists $::config_dict $implementation]) } { - continue - } - set v [dict get $::config_dict $implementation] - if { !([dict exists $v "driver"]) } { - continue - } - if { [string equal -nocase [dict get $v "driver"] "bruker_bec1"] } { - if { [string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"] } { - if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } { - set asyncqueue "null" - ${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue" - } elseif { [dict exists $v "asyncqueue"] } { - set asyncqueue [dict get $v "asyncqueue"] - } else { - if { [dict exists $v "asyncprotocol"] } { - set asyncprotocol [dict get $v "asyncprotocol"] - } else { - set asyncprotocol ${name}_protocol - MakeAsyncProtocol ${asyncprotocol} - if { [dict exists $v "terminator"] } { - ${asyncprotocol} sendterminator "[dict get $v "terminator"]" - ${asyncprotocol} replyterminator "[dict get $v "terminator"]" - } - } - set asyncqueue ${name}_queue - set IP [dict get $v ip] - set PORT [dict get $v port] - MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT} - if { [dict exists $v "timeout"] } { - ${asyncqueue} timeout "[dict get $v "timeout"]" - } - } - set arg_list [list] - foreach arg {tol id type} { - if {[dict exists $v $arg]} { - lappend arg_list "[dict get $v $arg]" - } else { - ${ns}::sics_log 9 "Missing configuration value $arg" - error "Missing configuration value $arg" - } - } - add_bruker_bec1 ${name} "aqadapter" ${asyncqueue} {*}$arg_list - } - } - } - } - } catch_message ] - handle_exception ${catch_status} ${catch_message} -} - -if { [info exists ::config_dict] } { - ::scobj::bruker_bec1::read_config -} else { - ::scobj::bruker_bec1::sics_log 5 "No config dict" -} - - namespace import ::scobj::bruker_BEC1::* From 80ad9cff2adfab8f720e5a0dcbf3b0b89c20e6d2 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 09:04:26 +1100 Subject: [PATCH 29/54] Load sics_config.ini wrapper code for Legacy drivers on Playtpus and update config. --- .../reflectometer/platypus_configuration.tcl | 8 +- .../reflectometer/util/sics_config.ini | 149 ++++++++---------- 2 files changed, 69 insertions(+), 88 deletions(-) diff --git a/site_ansto/instrument/reflectometer/platypus_configuration.tcl b/site_ansto/instrument/reflectometer/platypus_configuration.tcl index c5b25e7c..5234f5e1 100644 --- a/site_ansto/instrument/reflectometer/platypus_configuration.tcl +++ b/site_ansto/instrument/reflectometer/platypus_configuration.tcl @@ -26,14 +26,20 @@ fileeval $cfPath(parameters)/parameters.tcl fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(counter)/counter.tcl fileeval $cfPath(environment)/sct_syr.tcl +fileeval $cfPath(environment)/sct_syringe_pump.tcl fileeval $cfPath(environment)/sct_knauer_pump.tcl fileeval $cfPath(environment)/sct_mvp.tcl +fileeval $cfPath(environment)/sct_mvp_valve.tcl fileeval $cfPath(environment)/sct_protek_common.tcl +fileeval $cfPath(environment)/sct_protekmm.tcl fileeval $cfPath(environment)/sct_omron_hldc.tcl fileeval $cfPath(environment)/magneticField/sct_bruker_BEC1.tcl +fileeval $cfPath(environment)/magneticField/sct_bruker.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl +fileeval $cfPath(environment)/temperature/sct_ls336.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl -fileeval $cfPath(environment)/temperature/sct_julabo_lh45.tcl +fileeval $cfPath(environment)/temperature/sct_ls340.tcl +fileeval $cfPath(environment)/temperature/sct_julabo_lh45_gen.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl fileeval $cfPath(nexus)/nxscripts.tcl fileeval $cfPath(hmm)/detector.tcl diff --git a/site_ansto/instrument/reflectometer/util/sics_config.ini b/site_ansto/instrument/reflectometer/util/sics_config.ini index 752b7562..7ac26977 100644 --- a/site_ansto/instrument/reflectometer/util/sics_config.ini +++ b/site_ansto/instrument/reflectometer/util/sics_config.ini @@ -1,18 +1,21 @@ -[CF6] -cascade = T1:CF6_ls340,sample_stage:normal_sample_stage +[Bruker_CF6] +cascade = T1:CF6_ls340,B1:bruker_bec1,sample_stage:normal_sample_stage enabled = False [Default] cascade = sample_stage:normal_sample_stage enabled = True -[bruker_setup] -cascade = B1:bruker_bec1,sample_stage:normal_sample_stage +[Knauer and Syringe] +cascade = HPLC:knauer_01,Syringe:syringe,sample_stage:normal_sample_stage +enabled = False +[Knauer, Syringe and MVP] +cascade = HPLC:knauer_01,Syringe:syringe,MVP:mvp,sample_stage:normal_sample_stage enabled = False [B1] datype = B enabled = False id = 1 implementation = none -name = magnet1 +name = ma1 optype = magnetic_field [Function_Generator] datype = V @@ -21,6 +24,13 @@ id = 1 implementation = none name = pulser optype = function_generator +[HPLC] +datype = pump +enabled = False +id = 1 +implementation = none +name = hplc +optype = hplc [High_Voltage] datype = V enabled = False @@ -42,6 +52,13 @@ id = 2 implementation = none name = curr2 optype = multimeter +[MVP] +datype = valve +enabled = False +id = 1 +implementation = none +name = mvp +optype = valve [Power Supply] datype = V enabled = False @@ -49,13 +66,13 @@ id = 1 implementation = none name = power_supply optype = power_supply -[Pump 1] +[Syringe] datype = pump enabled = False id = 1 implementation = none -name = hplc -optype = pump +name = syr +optype = syringe [T1] datype = T enabled = False @@ -121,7 +138,7 @@ optype = motion_axis desc = "The New Zealand magnet" driver = tsi_smc imptype = magnetic_field -ip = 137.157.202.79 +ip = 137.157.202.151 port = 4004 timeout = 2000 @@ -145,34 +162,31 @@ port = 5025 [bruker_bec1] desc = "Bruker Magnet" -driver = "bruker_bec1" +driver = "bruker" imptype = magnetic_field ip = 10.157.205.13 port = 4444 -type = B +tol = 0.1 + +[hiden_xcs] +desc = "Hiden XCS Relative Humidity Flow Control" +driver = "hiden_xcs" +imptype = flowcontrol +ip = 137.157.202.151 +port = 4001 [isotech_ps] desc = "Isotech Power Supply:Baud=2400,Data=8,Stop=1,Parity=None,Flow=None" driver = "isotech_ps" imptype = power_supply -ip = 137.157.202.79 +ip = 137.157.202.151 port = 4001 -[julabo_lh45] -ctrl_sensor = "bath" -desc = "Julabo temperature controller" -driver = "julabo_lh45" -imptype = temperature -ip = 10.157.205.39 -port = 4001 -tol = 5.0 -type = T - [knauer_01] asyncprotocol = knauer_ap desc = "Knauer BlueShadow Pump 40P (High Performance/Pressure Liquid Chromatography)" driver = knauer_pump -imptype = pump +imptype = hplc ip = 10.157.205.51 port = 10001 timeout = 1000 @@ -210,28 +224,6 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls336_05] -asyncqueue = sct -desc = "Lakeshore 336 temperature controller" -driver = "ls336" -imptype = temperature -ip = 137.157.201.21 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls336_06] -asyncqueue = sct -desc = "Lakeshore 336 temperature controller" -driver = "ls336" -imptype = temperature -ip = 137.157.201.21 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - [ls336_12] asyncqueue = sct desc = "Lakeshore 336 temperature controller" @@ -243,48 +235,6 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls340_01] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_02] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4002 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_09] -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.202.79 -port = 4002 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_11] -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - [mercury_scpi_01] desc = "Oxford Mercury temperature controller in Mercury mode" driver = "mercury_scpi" @@ -307,10 +257,27 @@ terminator = \r\n tol = 1.0 valve_tol = 2 +[mvp] +desc = "Valve controller" +driver = mvp_valve +imptype = valve +ip = 137.157.202.151 +port = 4004 + [normal_sample_stage] desc = "This is the default sample stage configuration xyz translation omega rotation but no tilt axes" imptype = motion_axis +[platypus_julabo] +ctrl_sensor = "bath" +desc = "Julabo temperature controller" +driver = "julabo_lh45" +imptype = temperature +ip = 137.157.202.151 +port = 4002 +tol = 2.0 +type = T + [protek_01] asyncqueue = sct desc = "Protek Multimeter" @@ -327,3 +294,11 @@ imptype = multimeter ip = 10.157.205.37 port = 4001 +[syringe] +desc = "Syringe Pump" +driver = syringe_pump +imptype = syringe +ip = 137.157.202.151 +port = 4003 +timeout = 1000 + From 2d9e377f5f7e30c8447e800a05bdc18b02017900 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 16:34:20 +1100 Subject: [PATCH 30/54] Clean up Dingo sics_config.ini --- .../instrument/dingo/util/sics_config.ini | 54 ------------------- 1 file changed, 54 deletions(-) diff --git a/site_ansto/instrument/dingo/util/sics_config.ini b/site_ansto/instrument/dingo/util/sics_config.ini index 2ec8f692..1cd45e2d 100644 --- a/site_ansto/instrument/dingo/util/sics_config.ini +++ b/site_ansto/instrument/dingo/util/sics_config.ini @@ -124,28 +124,6 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls336_05] -asyncqueue = sct -desc = "Lakeshore 336 temperature controller" -driver = "ls336" -imptype = temperature -ip = 137.157.201.21 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls336_06] -asyncqueue = sct -desc = "Lakeshore 336 temperature controller" -driver = "ls336" -imptype = temperature -ip = 137.157.201.21 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - [ls336_11] desc = "Lakeshore 336 temperature controller" driver = "ls336" @@ -167,38 +145,6 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls340_01] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_02] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4002 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_11] -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - [mercury_scpi_01] desc = "Oxford Mercury temperature controller with three temperature loops." driver = "mercury_base" From 35ea3704b7a43b0d5bf94e857ebff9af42322d47 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 16:35:38 +1100 Subject: [PATCH 31/54] Load available environment controller configurations for kowari --- .../instrument/rsd/kowari_configuration.tcl | 23 ++++++++++++--- .../instrument/rsd/util/sics_config.ini | 28 ------------------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/site_ansto/instrument/rsd/kowari_configuration.tcl b/site_ansto/instrument/rsd/kowari_configuration.tcl index 0ef12ec1..ec763a80 100644 --- a/site_ansto/instrument/rsd/kowari_configuration.tcl +++ b/site_ansto/instrument/rsd/kowari_configuration.tcl @@ -23,12 +23,27 @@ source $cfPath(hipadaba)/hipadaba_configuration.tcl fileeval $cfPath(motors)/positmotor_configuration.tcl fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(counter)/counter.tcl -fileeval $cfPath(environment)/sct_keithley_2700.tcl -fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl -fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl -fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl +fileeval $cfPath(environment)/sct_agilent_33220A.tcl +fileeval $cfPath(environment)/sct_isotech_ps.tcl fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl +fileeval $cfPath(environment)/temperature/sct_eurotherm_m2000.tcl +fileeval $cfPath(environment)/sct_keithley_2700.tcl +fileeval $cfPath(environment)/sct_keithley_m2700.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_218.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl +fileeval $cfPath(environment)/temperature/sct_ls336.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl +fileeval $cfPath(environment)/temperature/sct_ls340.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_m370.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_base.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_level.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_pres.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_scpi.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_temp.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl fileeval $cfPath(environment)/sct_protek_common.tcl +fileeval $cfPath(environment)/sct_protekmm.tcl fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl diff --git a/site_ansto/instrument/rsd/util/sics_config.ini b/site_ansto/instrument/rsd/util/sics_config.ini index f8aa9b8d..bd3b1e37 100644 --- a/site_ansto/instrument/rsd/util/sics_config.ini +++ b/site_ansto/instrument/rsd/util/sics_config.ini @@ -80,34 +80,6 @@ tol1 = 1.0 tol2 = 1.0 type = T -[ls336_5] -desc = "tc5: Lakeshore 336 temperature controller" -driver = "ls336" -enabled = False -group = environment:temperature -id = 5 -ip = 137.157.201.21 -name = tc5 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 -type = T - -[ls336_6] -desc = "tc6: Lakeshore 336 temperature controller" -driver = "ls336" -enabled = False -group = environment:temperature -id = 6 -ip = 137.157.201.21 -name = tc6 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 -type = T - [mercury_scpi] desc = "tc25: Oxford Mercury temperature controller in Mercury mode" driver = "mercury_scpi" From a8b2df51a5ef35e9e88b9f716b061eca150fd35d Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 16:36:11 +1100 Subject: [PATCH 32/54] Load some missing environment controller configurations for Echidna. --- .../instrument/hrpd/util/sics_config.ini | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/site_ansto/instrument/hrpd/util/sics_config.ini b/site_ansto/instrument/hrpd/util/sics_config.ini index 8113a01e..5cfd4c2a 100644 --- a/site_ansto/instrument/hrpd/util/sics_config.ini +++ b/site_ansto/instrument/hrpd/util/sics_config.ini @@ -225,38 +225,6 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls340_01] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_02] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4002 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_11] -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - [ls370_1] desc = "Lakeshore 370 Resistance Bridge" driver = "lakeshore_m370" From e40b053c7064fc1ae329f83a78b9f26031b15d81 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 16:41:06 +1100 Subject: [PATCH 33/54] Load available environment controller configurations for Kookaburra. --- .../kookaburra/kookaburra_configuration.tcl | 23 ++++++- .../kookaburra/util/sics_config.ini | 64 ------------------- 2 files changed, 22 insertions(+), 65 deletions(-) diff --git a/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl b/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl index 40d330f1..b719b85e 100644 --- a/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl +++ b/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl @@ -23,7 +23,28 @@ fileeval $cfPath(motors)/motor_configuration.tcl #fileeval $cfPath(motors)/extraconfig.tcl fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(counter)/counter.tcl -#fileeval $cfPath(environment)/temperature/sct_lakeshore_218.tcl +fileeval $cfPath(environment)/sct_agilent_33220A.tcl +fileeval $cfPath(environment)/sct_isotech_ps.tcl +fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl +fileeval $cfPath(environment)/temperature/sct_eurotherm_m2000.tcl +fileeval $cfPath(environment)/sct_keithley_2700.tcl +fileeval $cfPath(environment)/sct_keithley_m2700.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_218.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl +fileeval $cfPath(environment)/temperature/sct_ls336.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl +fileeval $cfPath(environment)/temperature/sct_ls340.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_m370.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_base.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_level.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_pres.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_scpi.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_temp.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl +fileeval $cfPath(environment)/sct_protek_common.tcl +fileeval $cfPath(environment)/sct_protekmm.tcl +fileeval $cfPath(environment)/temperature/sct_julabo_lh45_gen.tcl fileeval $cfPath(counter)/sct_bm.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl fileeval $cfPath(nexus)/nxscripts.tcl diff --git a/site_ansto/instrument/kookaburra/util/sics_config.ini b/site_ansto/instrument/kookaburra/util/sics_config.ini index c943ffc4..8d16baf6 100644 --- a/site_ansto/instrument/kookaburra/util/sics_config.ini +++ b/site_ansto/instrument/kookaburra/util/sics_config.ini @@ -162,28 +162,6 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls336_05] -asyncqueue = sct -desc = "Lakeshore 336 temperature controller" -driver = "ls336" -imptype = temperature -ip = 137.157.201.21 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls336_06] -asyncqueue = sct -desc = "Lakeshore 336 temperature controller" -driver = "ls336" -imptype = temperature -ip = 137.157.201.21 -port = 7777 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - [ls336_12] asyncqueue = sct desc = "Lakeshore 336 temperature controller" @@ -195,48 +173,6 @@ terminator = \r\n tol1 = 1.0 tol2 = 1.0 -[ls340_01] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_02] -asyncqueue = sct -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4002 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_09] -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.202.79 -port = 4002 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - -[ls340_11] -desc = "Lakeshore 340 temperature controller" -driver = "ls340" -imptype = temperature -ip = 137.157.201.86 -port = 4001 -terminator = \r\n -tol1 = 1.0 -tol2 = 1.0 - [mercury_scpi_01] desc = "Oxford Mercury temperature controller in Mercury mode" driver = "mercury_scpi" From d9660d1f7bd4da9da9ca6b220b9b0cf090d1228b Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 17 Oct 2014 16:41:34 +1100 Subject: [PATCH 34/54] Add west6100 driver to Pelican. --- site_ansto/instrument/pelican/pelican_configuration.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site_ansto/instrument/pelican/pelican_configuration.tcl b/site_ansto/instrument/pelican/pelican_configuration.tcl index 2598608d..7194c5d5 100644 --- a/site_ansto/instrument/pelican/pelican_configuration.tcl +++ b/site_ansto/instrument/pelican/pelican_configuration.tcl @@ -24,7 +24,6 @@ source $cfPath(hipadaba)/hipadaba_configuration.tcl fileeval $cfPath(source)/source.tcl fileeval $cfPath(motors)/motor_configuration.tcl fileeval $cfPath(motors)/positmotor_configuration.tcl -#fileeval $cfPath(motors)/extraconfig.tcl fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(counter)/counter.tcl #fileeval $cfPath(beamline)/sct_power.tcl @@ -55,6 +54,7 @@ fileeval $cfPath(environment)/temperature/sct_julabo_lh45_gen.tcl fileeval $cfPath(environment)/temperature/sct_qlink.tcl fileeval $cfPath(environment)/temperature/west400.tcl fileeval $cfPath(environment)/temperature/sct_west4100.tcl +fileeval $cfPath(environment)/temperature/sct_west_6100.tcl fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl fileeval $cfPath(environment)/he3/sct_he3.tcl From 2ed8269a0f253f2f8ebe30635b61f26927758933 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 22 Oct 2014 11:56:28 +1100 Subject: [PATCH 35/54] Changes to 3He driver --- .../config/beamline/he3_polanal.sct | 87 +++++------ .../config/beamline/sct_he3_polanal.tcl | 141 ++++++++++-------- 2 files changed, 117 insertions(+), 111 deletions(-) diff --git a/site_ansto/instrument/config/beamline/he3_polanal.sct b/site_ansto/instrument/config/beamline/he3_polanal.sct index 58541495..fe428deb 100644 --- a/site_ansto/instrument/config/beamline/he3_polanal.sct +++ b/site_ansto/instrument/config/beamline/he3_polanal.sct @@ -1,16 +1,31 @@ # vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent driver he3_polanal = { + debug_threshold = 0; protocol = std; class = instrument; simulation_group = rfgen_simulation; - group = { + group polariser = { var spin = { type = text; readable = 10; - read_command = 'spin 0 0'; + read_command = 'polariser'; + read_function = rdValue; writeable = 1; - write_command = 'spin '; + write_command = 'polariser'; check_function = chkWrite; + allowed = "+,-,0" + } + } + group analyser = { + var spin = { + type = text; + readable = 10; + read_command = 'analyser'; + read_function = rdValue; + writeable = 1; + write_command = 'analyser'; + check_function = chkWrite; + allowed = "+,-,0" } } code chkWrite = {%% @@ -19,60 +34,40 @@ driver he3_polanal = { code rdValue = {%% set dlist [split ${data}] - if {[lindex ${dlist} 0] != "Spin"} { - sct geterror "Unexpected 'Spin' response '${data}'" + if {[llength ${dlist}] < 2} { + sct geterror "Syntax Error: '${data}'" error "[sct geterror]" } - set idx [lsearch ${dlist} "and"] - if { ${idx} < 0 } { - sct geterror "Unexpected 'and' response '${data}'" - error "[sct geterror]" + set my_name [basename [pathname [sct]]] + if {![string equal -nocase "[lindex ${dlist} 0]" "${my_name}"]} { + error "[lindex ${dlist} 0] is not ${my_name}" } - set plist [lrange ${dlist} 1 ${idx}-1] - set alist [lrange ${dlist} ${idx}+1 end] - if {[lindex ${plist} 0] != "Polariser"} { - sct geterror "Unexpected 'Polariser' response '${data}'" + if {[string match "*Not Active*" "${data}"]} { + set data 0 + } elseif {[string match -nocase "*Error:*" "${data}"]} { + sct geterror "${data}" error "[sct geterror]" - } elseif {[lindex ${plist} 1] == "In" && [lindex ${plist} 3] == "State"} { - set pstate [string index [lindex ${plist} 2] 1] - } elseif {[lindex ${plist} 1] == "Not" && [lindex ${plist} 2] == "Active"} { - set pstate 0 } else { - sct geterror "Unexpected 'Polariser State' response '${data}'" - error "[sct geterror]" + set data [lindex ${dlist} 1] } - if {[lindex ${alist} 0] != "Analyser"} { - sct geterror "Unexpected 'Analyser' response '${data}'" - error "[sct geterror]" - } elseif {[lindex ${alist} 1] == "In" && [lindex ${alist} 3] == "State"} { - set astate [string index [lindex ${alist} 2] 1] - } elseif {[lindex ${alist} 1] == "Not" && [lindex ${alist} 2] == "Active."} { - set astate 0 - } else { - sct geterror "Unexpected 'Analyser State' response '${data}'" - error "[sct geterror]" - } - set data "${pstate} ${astate}" %%} code setValue = {%% - set geterror "Spin target must be 'x/y', where x,y are 0,+,- and not '[sct target]'" - set dlist [split [sct target]] - if {[llength ${dlist}] != 2} { - set dlist [split [sct target] /] - if {[llength ${dlist}] != 2} { - sct geterror ${geterror} - error "[sct geterror]" - } + set cmd "${cmd_str}" + if {[string equal -nocase [sct target] "dn"]} { + set cmd "${cmd_str} -" } - if { [lindex ${dlist} 0] != "+" && [lindex ${dlist} 0] != "-" && [lindex ${dlist} 0] != "0" } { - sct geterror ${geterror} - error "[sct geterror]" + if {[string equal -nocase [sct target] "down"]} { + set cmd "${cmd_str} -" } - if { [lindex ${dlist} 1] != "+" && [lindex ${dlist} 1] != "-" && [lindex ${dlist} 1] != "0" } { - sct geterror ${geterror} - error "[sct geterror]" + if {[sct target] == "-" || [sct target] == -1} { + set cmd "${cmd_str} -" + } + if {[string equal -nocase [sct target] "up"]} { + set cmd "${cmd_str} +" + } + if {[sct target] == "+" || [sct target] == 1} { + set cmd "${cmd_str} +" } - set cmd "spin [lindex ${dlist} 0] [lindex ${dlist} 1]" %%} } diff --git a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl index 2930048d..e4ee096a 100644 --- a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl +++ b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl @@ -3,7 +3,7 @@ # namespace eval ::scobj::he3_polanal { - set debug_threshold 5 + set debug_threshold 0 } proc ::scobj::he3_polanal::debug_log {tc_root debug_level debug_string} { @@ -99,40 +99,22 @@ proc ::scobj::he3_polanal::rdValue {tc_root} { } # rdValue hook code starts set dlist [split ${data}] - if {[lindex ${dlist} 0] != "Spin"} { - sct geterror "Unexpected 'Spin' response '${data}'" + if {[llength ${dlist}] < 2} { + sct geterror "Syntax Error: '${data}'" error "[sct geterror]" } - set idx [lsearch ${dlist} "and"] - if { ${idx} < 0 } { - sct geterror "Unexpected 'and' response '${data}'" - error "[sct geterror]" + set my_name [basename [pathname [sct]]] + if {![string equal -nocase "[lindex ${dlist} 0]" "${my_name}"]} { + error "[lindex ${dlist} 0] is not ${my_name}" } - set plist [lrange ${dlist} 1 ${idx}-1] - set alist [lrange ${dlist} ${idx}+1 end] - if {[lindex ${plist} 0] != "Polariser"} { - sct geterror "Unexpected 'Polariser' response '${data}'" + if {[string match "*Not Active*" "${data}"]} { + set data 0 + } elseif {[string match -nocase "*Error:*" "${data}"]} { + sct geterror "${data}" error "[sct geterror]" - } elseif {[lindex ${plist} 1] == "In" && [lindex ${plist} 3] == "State"} { - set pstate [string index [lindex ${plist} 2] 1] - } elseif {[lindex ${plist} 1] == "Not" && [lindex ${plist} 2] == "Active"} { - set pstate 0 } else { - sct geterror "Unexpected 'Polariser State' response '${data}'" - error "[sct geterror]" + set data [lindex ${dlist} 1] } - if {[lindex ${alist} 0] != "Analyser"} { - sct geterror "Unexpected 'Analyser' response '${data}'" - error "[sct geterror]" - } elseif {[lindex ${alist} 1] == "In" && [lindex ${alist} 3] == "State"} { - set astate [string index [lindex ${alist} 2] 1] - } elseif {[lindex ${alist} 1] == "Not" && [lindex ${alist} 2] == "Active."} { - set astate 0 - } else { - sct geterror "Unexpected 'Analyser State' response '${data}'" - error "[sct geterror]" - } - set data "${pstate} ${astate}" # rdValue hook code ends if { [hpropexists [sct] geterror] } { debug_log ${tc_root} 9 "[sct] error: [sct geterror]" @@ -159,24 +141,22 @@ proc ::scobj::he3_polanal::setValue {tc_root nextState cmd_str} { set par [sct target] set cmd "${cmd_str}${par}" # setValue hook code starts - set geterror "Spin target must be 'x/y', where x,y are 0,+,- and not '[sct target]'" - set dlist [split [sct target]] - if {[llength ${dlist}] != 2} { - set dlist [split [sct target] /] - if {[llength ${dlist}] != 2} { - sct geterror ${geterror} - error "[sct geterror]" - } + set cmd "${cmd_str}" + if {[string equal -nocase [sct target] "dn"]} { + set cmd "${cmd_str} -" } - if { [lindex ${dlist} 0] != "+" && [lindex ${dlist} 0] != "-" && [lindex ${dlist} 0] != "0" } { - sct geterror ${geterror} - error "[sct geterror]" + if {[string equal -nocase [sct target] "down"]} { + set cmd "${cmd_str} -" } - if { [lindex ${dlist} 1] != "+" && [lindex ${dlist} 1] != "-" && [lindex ${dlist} 1] != "0" } { - sct geterror ${geterror} - error "[sct geterror]" + if {[sct target] == "-" || [sct target] == -1} { + set cmd "${cmd_str} -" + } + if {[string equal -nocase [sct target] "up"]} { + set cmd "${cmd_str} +" + } + if {[sct target] == "+" || [sct target] == 1} { + set cmd "${cmd_str} +" } - set cmd "spin [lindex ${dlist} 0] [lindex ${dlist} 1]" # setValue hook code ends if { [hpropexists [sct] geterror] } { debug_log ${tc_root} 9 "[sct] error: [sct geterror]" @@ -208,35 +188,66 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio set scobj_hpath /sics/${name} - hfactory ${scobj_hpath}/spin plain user text - hsetprop ${scobj_hpath}/spin read ${ns}::getValue ${scobj_hpath} rdValue {spin 0 0} - hsetprop ${scobj_hpath}/spin rdValue ${ns}::rdValue ${scobj_hpath} - hsetprop ${scobj_hpath}/spin write ${ns}::setValue ${scobj_hpath} chkWrite {spin } - hsetprop ${scobj_hpath}/spin chkWrite ${ns}::chkWrite ${scobj_hpath} - hsetprop ${scobj_hpath}/spin check ${ns}::checkrange ${scobj_hpath} - hsetprop ${scobj_hpath}/spin control true - hsetprop ${scobj_hpath}/spin data true - hsetprop ${scobj_hpath}/spin mutable true - hsetprop ${scobj_hpath}/spin nxsave true - hsetprop ${scobj_hpath}/spin oldval UNKNOWN - hsetprop ${scobj_hpath}/spin klass "parameter" - hsetprop ${scobj_hpath}/spin sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/spin type "part" - hsetprop ${scobj_hpath}/spin nxalias "${name}_spin" + hfactory ${scobj_hpath}/analyser plain spy none + hsetprop ${scobj_hpath}/analyser data "true" + hsetprop ${scobj_hpath}/analyser klass "@none" + hsetprop ${scobj_hpath}/analyser type "part" - hsetprop ${scobj_hpath} data "true" - hsetprop ${scobj_hpath} klass "@none" - hsetprop ${scobj_hpath} type "part" + hfactory ${scobj_hpath}/analyser/spin plain user text + hsetprop ${scobj_hpath}/analyser/spin read ${ns}::getValue ${scobj_hpath} rdValue {analyser} + hsetprop ${scobj_hpath}/analyser/spin rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/analyser/spin write ${ns}::setValue ${scobj_hpath} chkWrite {analyser} + hsetprop ${scobj_hpath}/analyser/spin chkWrite ${ns}::chkWrite ${scobj_hpath} + hsetprop ${scobj_hpath}/analyser/spin check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/analyser/spin control true + hsetprop ${scobj_hpath}/analyser/spin data true + hsetprop ${scobj_hpath}/analyser/spin mutable true + hsetprop ${scobj_hpath}/analyser/spin nxsave true + hsetprop ${scobj_hpath}/analyser/spin values -1,+1 + hsetprop ${scobj_hpath}/analyser/spin oldval UNKNOWN + hsetprop ${scobj_hpath}/analyser/spin klass "parameter" + hsetprop ${scobj_hpath}/analyser/spin sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/analyser/spin type "part" + hsetprop ${scobj_hpath}/analyser/spin nxalias "${name}_analyser_spin" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/spin 10 - ${sct_controller} write ${scobj_hpath}/spin + ${sct_controller} poll ${scobj_hpath}/analyser/spin 10 + ${sct_controller} write ${scobj_hpath}/analyser/spin + } else { + ::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal" + } + + hfactory ${scobj_hpath}/polariser plain spy none + hsetprop ${scobj_hpath}/polariser data "true" + hsetprop ${scobj_hpath}/polariser klass "@none" + hsetprop ${scobj_hpath}/polariser type "part" + + hfactory ${scobj_hpath}/polariser/spin plain user text + hsetprop ${scobj_hpath}/polariser/spin read ${ns}::getValue ${scobj_hpath} rdValue {polariser} + hsetprop ${scobj_hpath}/polariser/spin rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/polariser/spin write ${ns}::setValue ${scobj_hpath} chkWrite {polariser} + hsetprop ${scobj_hpath}/polariser/spin chkWrite ${ns}::chkWrite ${scobj_hpath} + hsetprop ${scobj_hpath}/polariser/spin check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/polariser/spin control true + hsetprop ${scobj_hpath}/polariser/spin data true + hsetprop ${scobj_hpath}/polariser/spin mutable true + hsetprop ${scobj_hpath}/polariser/spin nxsave true + hsetprop ${scobj_hpath}/polariser/spin values -1,+1 + hsetprop ${scobj_hpath}/polariser/spin oldval UNKNOWN + hsetprop ${scobj_hpath}/polariser/spin klass "parameter" + hsetprop ${scobj_hpath}/polariser/spin sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/polariser/spin type "part" + hsetprop ${scobj_hpath}/polariser/spin nxalias "${name}_polariser_spin" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/polariser/spin 10 + ${sct_controller} write ${scobj_hpath}/polariser/spin } else { ::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal" } hsetprop ${scobj_hpath} klass ${device_class} hsetprop ${scobj_hpath} data true - hsetprop ${scobj_hpath} debug_threshold 5 + hsetprop ${scobj_hpath} debug_threshold 0 # mkDriver hook code goes here } catch_message ] handle_exception ${catch_status} ${catch_message} From 07116a4ef46907030459f2b274d6bc3667a50028 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 22 Oct 2014 12:09:13 +1100 Subject: [PATCH 36/54] Change driveable nodes from text to int to satisfy new checks --- site_ansto/instrument/config/environment/sct_mvp.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/environment/sct_mvp.tcl b/site_ansto/instrument/config/environment/sct_mvp.tcl index 36e12f43..50a5b29b 100755 --- a/site_ansto/instrument/config/environment/sct_mvp.tcl +++ b/site_ansto/instrument/config/environment/sct_mvp.tcl @@ -455,7 +455,7 @@ debug_log "Registering node $nodeName for write callback" hsetprop $scobj_hpath device "$dev" set deviceCommand {\ - Display Position 1 0 1 1 0 text internal {LQP} {rdValue} {} {} {}\ + Display Position 1 0 1 1 0 int internal {LQP} {rdValue} {} {} {}\ Display Angle 1 0 1 1 0 text internal {LQA} {rdValue} {} {} {}\ Display Hertz 1 0 1 1 0 text internal {LQF} {rdValue} {} {} {}\ Display Finished 1 0 1 1 0 text internal {F} {rdValue} {} {} {}\ @@ -465,7 +465,7 @@ debug_log "Registering node $nodeName for write callback" Display Device 1 0 1 1 0 text internal {E3} {rdValue} {} {} {}\ Display Encoder 1 0 1 1 0 text internal {E4} {rdValue} {} {} {}\ Control Direction 0 1 1 1 0 text user {} {} {} {setDirn} {}\ - Control SetPoint 0 1 1 1 1 text user {} {} {} {setPoint} {}\ + Control SetPoint 0 1 1 1 1 int user {} {} {} {setPoint} {}\ Control Command 0 1 1 1 0 text user {} {} {} {setCmnd.chkWrite} {}\ } From 2723ed92795bd7bef4b3d72f298319b5a27f38c8 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 22 Oct 2014 12:09:49 +1100 Subject: [PATCH 37/54] Changes add_bruker_BEC1 to add_bruker_bec1 --- .../instrument/config/environment/magneticField/sct_bruker.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl b/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl index a195b1dc..2420d0b6 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl @@ -33,7 +33,7 @@ proc ::scobj::bruker::mkDriver { sct_controller name device_class simulation_fla set catch_status [ catch { # mkWrapper hook code starts - add_bruker_BEC1 $name $ip_address $tcp_port $tol + add_bruker_bec1 $name $ip_address $tcp_port $tol # mkWrapper hook code ends } catch_message ] handle_exception ${catch_status} ${catch_message} From 9350f4023be8dca8804246ca716072b8971cc9cc Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 22 Oct 2014 12:11:01 +1100 Subject: [PATCH 38/54] Anticollider changes from Platypus --- .../anticollider/anticollider_common.tcl | 118 ++++++------------ 1 file changed, 35 insertions(+), 83 deletions(-) diff --git a/site_ansto/instrument/config/anticollider/anticollider_common.tcl b/site_ansto/instrument/config/anticollider/anticollider_common.tcl index 209a3522..bde0f0c9 100644 --- a/site_ansto/instrument/config/anticollider/anticollider_common.tcl +++ b/site_ansto/instrument/config/anticollider/anticollider_common.tcl @@ -1,6 +1,10 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # TODO Handle sequencing when simultaneously moving multiple axes +# TODO Handle functional dependencies (just write your own tcl script) +# or get the generic acscript to call a user proc +# FIXME The anticollider module does not report the error messages from the +# anticollision script, we currently get around this by using broadcast. AntiCollisionInstall namespace eval anticollider { @@ -9,54 +13,19 @@ namespace eval anticollider { array unset ::anticollider::veto_region array set ::anticollider::veto_region "" -# Don't show 'acscript' call on error. This is done by the anticollider -# module. -proc handle_acscript_exception {status message args} { - switch $status { - 0 { - # TCL_OK, This is raised when you just drop out of the - # bottom of a 'catch' command. - return -code ok - } - 1 { - # TCL_ERROR - return -code error "$message: $args" - } - 2 { - # TCL_RETURN - return -code return "$message" - } - 3 { - # TCL_BREAK - return -code break - } - 4 { - # TCL_CONTINUE - return -code continue - } - default { - # Propogate user defined return codes with message - return -code $status "$message" - } - } -} ## # @brief Load an anticollider script proc ::anticollider::loadscript {args} { - variable veto_rules + variable prog + set prog "" - catch { - set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] - while {[gets $fh line] >= 0} { - # Skip empty lines and comments - if [regexp {^\s*$|^ *#} $line] { - continue - } - lappend veto_rules $line + set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] + while {[gets $fh line] >= 0} { + # Skip empty lines and comments + if [regexp {^\s*$|^ *#} $line] { + continue } - } - catch { - close $fh + lappend prog $line } } @@ -64,7 +33,7 @@ proc ::anticollider::loadscript {args} { # @brief Compile compile an anticollider declaration into a veto region table # for the anticollider script. # -# @param veto_rules, an anticollider declaration as a list of quote enclosed lines. +# @param vprog, an anticollider declaration as a list of quote enclosed lines. # @return Generates the ::anticollider::veto_region lookup table. # # Example\n @@ -75,16 +44,14 @@ proc ::anticollider::loadscript {args} { # for sphi forbid { {0 5} {10 15} } when schi in { {5 10} {15 20} }\n # forbid {-inf 5} when mtth in {0 10} for sphi\n # forbid {0 10} for samx whenall { samrot in {0 5} samy in {0 15} }\n -proc ::anticollider::genveto {veto_rules} { +proc ::anticollider::genveto {vprog} { variable veto_region array unset veto_region set lnum 1 - foreach line $veto_rules { + foreach line $vprog { array unset vp array set vp $line - clientput "::anticollider::veto_rule: $line" - if [info exists vp(whenall)] { foreach {mot in range} $vp(whenall) { # if {[llength [join $range]] != 2} { @@ -121,14 +88,16 @@ proc ::anticollider::enable {args} { # # The ::anticollider::veto_region is a hash indexed by the names of the motors # which have been registered with the anticollision module. -proc ::anticollider::veto_region_acscript {args} { +proc ::anticollider::acscript {args} { variable veto_region - set catch_status [ catch { - foreach {regmot target} $args { - if { ! [info exists veto_region($regmot)] } { - continue + if {[::anticollider::enable $args] == "false"} { + foreach {regmot target} $args { + anticollision add 0 $regmot $target } + return + } + foreach {regmot target} $args { foreach row $veto_region($regmot) { if { [lindex $row 1] == "@and"} { set forbid [lindex $row 0] @@ -147,6 +116,7 @@ proc ::anticollider::veto_region_acscript {args} { } else { foreach {min max} $forbid {} if {$min <= $target && $target <= $max} { + broadcast "ERROR:The range ($forbid) is forbidden for $regmot when [lindex $row 2]" error "ERROR:The range ($forbid) is forbidden for $regmot when [lindex $row 2]" } } @@ -156,14 +126,17 @@ proc ::anticollider::veto_region_acscript {args} { if {$obstrange == "@all"} { foreach {min max} [join $forbidden_range] { if {$min <= $target && $target <= $max} { + broadcast "ERROR: $regmot target ($target) is in the forbidden region ($forbidden_range)" error "ERROR: $regmot target ($target) is in the forbidden region ($forbidden_range)" } } } else { + broadcast "ERROR: veto table must use @all with @any" error "ERROR: veto table must use @all with @any" } } else { if {$obstrange == "@all"} { + broadcast "ERROR: veto table must use @any with @all" error "ERROR: veto table must use @any with @all" } else { foreach {lower upper} [join $obstrange] { @@ -171,6 +144,7 @@ proc ::anticollider::veto_region_acscript {args} { if {$lower <= $pos && $pos <= $upper} { foreach {min max} [join $forbidden_range] { if {$min <= $target && $target <= $max} { + broadcast "ERROR:The range $min to $max is forbidden for $regmot when $obstmot is in this region ($obstrange)" error "ERROR:The range $min to $max is forbidden for $regmot when $obstmot is in this region ($obstrange)" } @@ -182,9 +156,8 @@ proc ::anticollider::veto_region_acscript {args} { } } } + anticollision add 0 $regmot $target } - } message ] - handle_exception $catch_status $message } ## @@ -193,37 +166,16 @@ proc ::anticollider::init {} { variable evp variable veto_region - set catch_status [ catch { - if { ![info exists ::anticollider::veto_rules] } { - return - } - clientput Load anticollider rules: - if { [info procs ::anticollider::load_acrules] == "::anticollider::load_acrules" } { - ::anticollider::load_acrules - } - ::anticollider::genveto $::anticollider::veto_rules + if [ catch { + ::anticollider::genveto $::anticollider::prog foreach motor [array names veto_region] { anticollision register $motor } - } message ] - handle_exception $catch_status $message -} - -lappend ::anticollider::scripts ::anticollider::veto_region_acscript -proc ::anticollider::acscript {args} { - set catch_status [ catch { - if {[::anticollider::enable $args] == "false"} { - return - } else { - foreach {regmot target} $args { - anticollision add 0 $regmot $target - } - } - foreach script $::anticollider::scripts { - $script {*}$args - } - } message ] - handle_acscript_exception $catch_status $message + } message ] { + clientput [info level 0] ERROR: $message + if {$::errorCode=="NONE"} {return $message} + return -code error $message + } } publish ::anticollider::acscript user From 1b7eddc01504f573ea7f55f3871237fd0dc14439 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 22 Oct 2014 12:42:14 +1100 Subject: [PATCH 39/54] Add whatsthere.py to RELEASE-3_1 --- site_ansto/instrument/util/whatsthere.py | 192 +++++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100755 site_ansto/instrument/util/whatsthere.py diff --git a/site_ansto/instrument/util/whatsthere.py b/site_ansto/instrument/util/whatsthere.py new file mode 100755 index 00000000..79427a65 --- /dev/null +++ b/site_ansto/instrument/util/whatsthere.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python +# vim: ft=python ts=8 sts=4 sw=4 expandtab autoindent smartindent nocindent +# author: Douglas Clowes (douglas.clowes@ansto.gov.au) 2014 +# Connect to each instrument and get the DEPLOYMENT.TXT contents and "SICServer -v" response. +import os +import subprocess +import shlex +import traceback +import git + +hosts = [] +hosts += ["bilby"] +hosts += ["dingo"] +hosts += ["echidna"] +hosts += ["kookaburra"] +hosts += ["kowari"] +#hosts += ["lyrebird"] +hosts += ["pelican"] +hosts += ["platypus"] +hosts += ["quokka"] +hosts += ["taipan"] +hosts += ["wombat"] + + +class Instrument(object): + + def __init__(self, fqdn, txt): + self.host = fqdn + try: + self.deployed_date = txt[0][6:16] + self.built_date = txt[4][0:10] + self.deployed_branch = txt[2].split()[2] + self.deployed_hash = txt[2].split()[3] + self.built_branch = txt[3].split()[1].split("=")[1] + self.built_hash = txt[3].split()[2].split("=")[1] + self.deployed_refs = [] + self.built_refs = [] + self.full_deployed_hash = None + self.full_built_hash = None + try: + self.full_deployed_hash = repo.commit(self.deployed_hash.split('+')[0]).hexsha + for ref in repo.refs: + if ref.commit.hexsha == self.full_deployed_hash: + self.deployed_refs.append(ref) + except: + pass + try: + self.full_built_hash = repo.commit(self.built_hash.split('+')[0]).hexsha + for ref in repo.refs: + if ref.commit.hexsha == self.full_built_hash: + self.built_refs.append(ref) + except: + pass + + except Exception, err: + print traceback.format_exc() + print err + + def display(self): + global Verbose + print "Host:", self.host + if self.deployed_date != self.built_date: + print "** Date:", self.deployed_date, self.built_date + else: + print " Date:", self.deployed_date + if self.deployed_branch != self.built_branch: + print "** Branch:", self.deployed_branch, self.built_branch + else: + print " Branch:", self.deployed_branch + if self.deployed_hash != self.built_hash: + print "** Hash:", self.deployed_hash, + if len(self.deployed_refs): + print "(", ", ".join([ref.name for ref in self.deployed_refs]), ")", + elif self.full_deployed_hash is not None: + print "(", self.full_deployed_hash, ")", + print self.built_hash, + if len(self.built_refs) > 0: + print "(", ", ".join([ref.name for ref in self.built_refs]), ")", + elif self.full_built_hash is not None: + print "(", self.full_built_hash, ")", + print + else: + print " Hash:", self.deployed_hash, + if len(self.deployed_refs) > 0: + print "(", ", ".join([ref.name for ref in self.deployed_refs]), ")", + print + if Verbose: + print " Built:", self.full_built_hash, self.built_refs + print " Depld:", self.full_deployed_hash, self.deployed_refs + +def do_one_host(host): + global instrument_list + global cmd_list + global Verbose + print "Host:", host + if host in ["ics2-platypus"]: + return + host_fqdn = host + ".nbi.ansto.gov.au" + + cmd = "host " + host_fqdn + txt, err = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + txt = txt.splitlines() + err = err.splitlines() + if Verbose: + for line in txt: + print " Txt: %s" % line + for line in err: + print " Err: %s" % line + + user = os.getlogin() + cmd = "ssh -i /home/%s/.ssh/id_rsa %s" % (user, user) + cmd += "@%s \"%s\"" % (host_fqdn, ";".join(cmd_list)) + if Verbose: + print " Cmd: %s" % cmd + txt, err = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + txt = txt.splitlines() + err = err.splitlines() + if Verbose: + for line in txt: + print " Txt: %s" % line + for line in err: + print " Err: %s" % line + if len(err) > 0: + if not Verbose: + for line in err: + print " Err: %s" % line + return + try: + inst = Instrument(host_fqdn, txt) + instrument_list.append(inst) + except Exception, err: + print traceback.format_exc() + print err + + +def main_program(): + global instrument_list + global cmd_list + global repo + global Verbose + import argparse + instrument_list = [] + parser = argparse.ArgumentParser() + parser.add_argument("-b", "--buildorder", action="store_true", help="list in build order") + parser.add_argument("-n", "--newserver", action="store_true", help="use newserver instead of server") + parser.add_argument("-t", "--test", action="store_true", help="add -test to host") + parser.add_argument("-v", "--verbose", action="store_true", help="more output") + parser.add_argument("-d", "--directory", default="server", help="use directory instead of server [server]") + parser.add_argument("targets", nargs="*", help="select host target") + args = parser.parse_args() + Test = False + if args.test: + Test = True + Verbose = False + if args.verbose: + Verbose = True + print "Args:", args + if args.newserver: + cmd_list = [] + cmd_list += ["cat /usr/local/sics/newserver/DEPLOYMENT.TXT"] + cmd_list += ["/usr/local/sics/newserver/SICServer -v"] + cmd_list += ["stat --printf=%y" + "\\" * 4 + "n /usr/local/sics/newserver/SICServer"] + else: + cmd_list = [] + cmd_list += ["cat /usr/local/sics/%s/DEPLOYMENT.TXT" % args.directory] + cmd_list += ["/usr/local/sics/%s/SICServer -v" % args.directory] + cmd_list += ["stat --printf=%y" + ("\\" * 4 + "n") + (" /usr/local/sics/%s/SICServer" % args.directory)] + + repo = git.Repo() + if len(args.targets) > 0: + selected_hosts = [] + for target in args.targets: + new_hosts = [h for h in hosts if h.startswith(target)] + selected_hosts += new_hosts + else: + selected_hosts = [h for h in hosts] + if Verbose: + print "Selected Hosts:", selected_hosts + for host in sorted(selected_hosts): + if Test: + host += "-test" + for pre in ['ics1']: + do_one_host('-'.join([pre, host])) + if args.buildorder: + for inst in sorted(instrument_list, key = lambda x: x.built_date): + inst.display() + else: + for inst in sorted(instrument_list, key = lambda x: x.deployed_date): + inst.display() + +if __name__ == "__main__": + main_program() From 62481b76c5792826424540b26539f70903550c74 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 27 Oct 2014 14:35:16 +1100 Subject: [PATCH 40/54] Add fields to 3He driver --- .../config/beamline/he3_polanal.sct | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/beamline/he3_polanal.sct b/site_ansto/instrument/config/beamline/he3_polanal.sct index fe428deb..b02734cb 100644 --- a/site_ansto/instrument/config/beamline/he3_polanal.sct +++ b/site_ansto/instrument/config/beamline/he3_polanal.sct @@ -15,6 +15,11 @@ driver he3_polanal = { check_function = chkWrite; allowed = "+,-,0" } + var Amplitude = { type = text; } + var Freq = { type = text; units = 'Hertz'; } + var Phase = { type = text; units = 'Degree'; } + var Time2 = { type = text; units = 'Second'; } + var Field = { type = text; units = 'Oersted'; } } group analyser = { var spin = { @@ -27,9 +32,14 @@ driver he3_polanal = { check_function = chkWrite; allowed = "+,-,0" } + var Amplitude = { type = text; } + var Freq = { type = text; units = 'Hertz'; } + var Phase = { type = text; units = 'Degree'; } + var Time2 = { type = text; units = 'Second'; } + var Field = { type = text; units = 'Oersted'; } } code chkWrite = {%% - rdValue ${tc_root} + [namespace current]::rdValue ${tc_root} %%} code rdValue = {%% @@ -40,7 +50,7 @@ driver he3_polanal = { } set my_name [basename [pathname [sct]]] if {![string equal -nocase "[lindex ${dlist} 0]" "${my_name}"]} { - error "[lindex ${dlist} 0] is not ${my_name}" + error "[lindex ${dlist} 0] is not my name (${my_name})" } if {[string match "*Not Active*" "${data}"]} { set data 0 @@ -50,6 +60,26 @@ driver he3_polanal = { } else { set data [lindex ${dlist} 1] } + set path [pathname [sct]] + if {[llength ${dlist}] > 2} { + set new_value [lindex ${dlist} 2] + if { "${new_value}" == "NaN" } { + set new_value 0 + } + hupdateif ${path}/Amplitude "${new_value}" + } + if {[llength ${dlist}] > 3} { + hupdateif ${path}/Freq "[lindex ${dlist} 3]" + } + if {[llength ${dlist}] > 4} { + hupdateif ${path}/Phase "[lindex ${dlist} 4]" + } + if {[llength ${dlist}] > 5} { + hupdateif ${path}/Time2 "[lindex ${dlist} 5]" + } + if {[llength ${dlist}] > 6} { + hupdateif ${path}/Field "[lindex ${dlist} 6]" + } %%} code setValue = {%% From fa2eb775acca9015aa0d9e583954498cb6478f12 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 27 Oct 2014 14:35:37 +1100 Subject: [PATCH 41/54] Regen 3He SC driver --- .../config/beamline/sct_he3_polanal.tcl | 156 +++++++++++++++++- 1 file changed, 152 insertions(+), 4 deletions(-) diff --git a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl index e4ee096a..7388a93d 100644 --- a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl +++ b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl @@ -58,7 +58,7 @@ proc ::scobj::he3_polanal::chkWrite {tc_root} { set catch_status [ catch { debug_log ${tc_root} 1 "chkWrite tc_root=${tc_root} sct=[sct] resp=[sct result]" # chkWrite hook code starts - rdValue ${tc_root} + [namespace current]::rdValue ${tc_root} # chkWrite hook code ends return "idle" } catch_message ] @@ -83,6 +83,16 @@ proc ::scobj::he3_polanal::getValue {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } +# function to check the write parameter on a device +proc ::scobj::he3_polanal::noResponse {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "noResponse tc_root=${tc_root} sct=[sct] resp=[sct result]" +# noResponse hook code goes here + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # function to parse the read of a parameter on a device proc ::scobj::he3_polanal::rdValue {tc_root} { set catch_status [ catch { @@ -105,7 +115,7 @@ proc ::scobj::he3_polanal::rdValue {tc_root} { } set my_name [basename [pathname [sct]]] if {![string equal -nocase "[lindex ${dlist} 0]" "${my_name}"]} { - error "[lindex ${dlist} 0] is not ${my_name}" + error "[lindex ${dlist} 0] is not my name (${my_name})" } if {[string match "*Not Active*" "${data}"]} { set data 0 @@ -115,6 +125,26 @@ proc ::scobj::he3_polanal::rdValue {tc_root} { } else { set data [lindex ${dlist} 1] } + set path [pathname [sct]] + if {[llength ${dlist}] > 2} { + set new_value [lindex ${dlist} 2] + if { "${new_value}" == "NaN" } { + set new_value 0 + } + hupdateif ${path}/Amplitude "${new_value}" + } + if {[llength ${dlist}] > 3} { + hupdateif ${path}/Freq "[lindex ${dlist} 3]" + } + if {[llength ${dlist}] > 4} { + hupdateif ${path}/Phase "[lindex ${dlist} 4]" + } + if {[llength ${dlist}] > 5} { + hupdateif ${path}/Time2 "[lindex ${dlist} 5]" + } + if {[llength ${dlist}] > 6} { + hupdateif ${path}/Field "[lindex ${dlist} 6]" + } # rdValue hook code ends if { [hpropexists [sct] geterror] } { debug_log ${tc_root} 9 "[sct] error: [sct geterror]" @@ -193,6 +223,65 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/analyser klass "@none" hsetprop ${scobj_hpath}/analyser type "part" + hfactory ${scobj_hpath}/analyser/Amplitude plain user text + hsetprop ${scobj_hpath}/analyser/Amplitude control true + hsetprop ${scobj_hpath}/analyser/Amplitude data true + hsetprop ${scobj_hpath}/analyser/Amplitude mutable true + hsetprop ${scobj_hpath}/analyser/Amplitude nxsave true + hsetprop ${scobj_hpath}/analyser/Amplitude oldval UNKNOWN + hsetprop ${scobj_hpath}/analyser/Amplitude klass "parameter" + hsetprop ${scobj_hpath}/analyser/Amplitude sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/analyser/Amplitude type "part" + hsetprop ${scobj_hpath}/analyser/Amplitude nxalias "${name}_analyser_Amplitude" + + hfactory ${scobj_hpath}/analyser/Field plain user text + hsetprop ${scobj_hpath}/analyser/Field control true + hsetprop ${scobj_hpath}/analyser/Field data true + hsetprop ${scobj_hpath}/analyser/Field mutable true + hsetprop ${scobj_hpath}/analyser/Field nxsave true + hsetprop ${scobj_hpath}/analyser/Field units Oersted + hsetprop ${scobj_hpath}/analyser/Field oldval UNKNOWN + hsetprop ${scobj_hpath}/analyser/Field klass "parameter" + hsetprop ${scobj_hpath}/analyser/Field sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/analyser/Field type "part" + hsetprop ${scobj_hpath}/analyser/Field nxalias "${name}_analyser_Field" + + hfactory ${scobj_hpath}/analyser/Freq plain user text + hsetprop ${scobj_hpath}/analyser/Freq control true + hsetprop ${scobj_hpath}/analyser/Freq data true + hsetprop ${scobj_hpath}/analyser/Freq mutable true + hsetprop ${scobj_hpath}/analyser/Freq nxsave true + hsetprop ${scobj_hpath}/analyser/Freq units Hertz + hsetprop ${scobj_hpath}/analyser/Freq oldval UNKNOWN + hsetprop ${scobj_hpath}/analyser/Freq klass "parameter" + hsetprop ${scobj_hpath}/analyser/Freq sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/analyser/Freq type "part" + hsetprop ${scobj_hpath}/analyser/Freq nxalias "${name}_analyser_Freq" + + hfactory ${scobj_hpath}/analyser/Phase plain user text + hsetprop ${scobj_hpath}/analyser/Phase control true + hsetprop ${scobj_hpath}/analyser/Phase data true + hsetprop ${scobj_hpath}/analyser/Phase mutable true + hsetprop ${scobj_hpath}/analyser/Phase nxsave true + hsetprop ${scobj_hpath}/analyser/Phase units Degree + hsetprop ${scobj_hpath}/analyser/Phase oldval UNKNOWN + hsetprop ${scobj_hpath}/analyser/Phase klass "parameter" + hsetprop ${scobj_hpath}/analyser/Phase sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/analyser/Phase type "part" + hsetprop ${scobj_hpath}/analyser/Phase nxalias "${name}_analyser_Phase" + + hfactory ${scobj_hpath}/analyser/Time2 plain user text + hsetprop ${scobj_hpath}/analyser/Time2 control true + hsetprop ${scobj_hpath}/analyser/Time2 data true + hsetprop ${scobj_hpath}/analyser/Time2 mutable true + hsetprop ${scobj_hpath}/analyser/Time2 nxsave true + hsetprop ${scobj_hpath}/analyser/Time2 units Second + hsetprop ${scobj_hpath}/analyser/Time2 oldval UNKNOWN + hsetprop ${scobj_hpath}/analyser/Time2 klass "parameter" + hsetprop ${scobj_hpath}/analyser/Time2 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/analyser/Time2 type "part" + hsetprop ${scobj_hpath}/analyser/Time2 nxalias "${name}_analyser_Time2" + hfactory ${scobj_hpath}/analyser/spin plain user text hsetprop ${scobj_hpath}/analyser/spin read ${ns}::getValue ${scobj_hpath} rdValue {analyser} hsetprop ${scobj_hpath}/analyser/spin rdValue ${ns}::rdValue ${scobj_hpath} @@ -203,7 +292,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/analyser/spin data true hsetprop ${scobj_hpath}/analyser/spin mutable true hsetprop ${scobj_hpath}/analyser/spin nxsave true - hsetprop ${scobj_hpath}/analyser/spin values -1,+1 + hsetprop ${scobj_hpath}/analyser/spin values +,-,0 hsetprop ${scobj_hpath}/analyser/spin oldval UNKNOWN hsetprop ${scobj_hpath}/analyser/spin klass "parameter" hsetprop ${scobj_hpath}/analyser/spin sdsinfo "::nexus::scobj::sdsinfo" @@ -222,6 +311,65 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/polariser klass "@none" hsetprop ${scobj_hpath}/polariser type "part" + hfactory ${scobj_hpath}/polariser/Amplitude plain user text + hsetprop ${scobj_hpath}/polariser/Amplitude control true + hsetprop ${scobj_hpath}/polariser/Amplitude data true + hsetprop ${scobj_hpath}/polariser/Amplitude mutable true + hsetprop ${scobj_hpath}/polariser/Amplitude nxsave true + hsetprop ${scobj_hpath}/polariser/Amplitude oldval UNKNOWN + hsetprop ${scobj_hpath}/polariser/Amplitude klass "parameter" + hsetprop ${scobj_hpath}/polariser/Amplitude sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/polariser/Amplitude type "part" + hsetprop ${scobj_hpath}/polariser/Amplitude nxalias "${name}_polariser_Amplitude" + + hfactory ${scobj_hpath}/polariser/Field plain user text + hsetprop ${scobj_hpath}/polariser/Field control true + hsetprop ${scobj_hpath}/polariser/Field data true + hsetprop ${scobj_hpath}/polariser/Field mutable true + hsetprop ${scobj_hpath}/polariser/Field nxsave true + hsetprop ${scobj_hpath}/polariser/Field units Oersted + hsetprop ${scobj_hpath}/polariser/Field oldval UNKNOWN + hsetprop ${scobj_hpath}/polariser/Field klass "parameter" + hsetprop ${scobj_hpath}/polariser/Field sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/polariser/Field type "part" + hsetprop ${scobj_hpath}/polariser/Field nxalias "${name}_polariser_Field" + + hfactory ${scobj_hpath}/polariser/Freq plain user text + hsetprop ${scobj_hpath}/polariser/Freq control true + hsetprop ${scobj_hpath}/polariser/Freq data true + hsetprop ${scobj_hpath}/polariser/Freq mutable true + hsetprop ${scobj_hpath}/polariser/Freq nxsave true + hsetprop ${scobj_hpath}/polariser/Freq units Hertz + hsetprop ${scobj_hpath}/polariser/Freq oldval UNKNOWN + hsetprop ${scobj_hpath}/polariser/Freq klass "parameter" + hsetprop ${scobj_hpath}/polariser/Freq sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/polariser/Freq type "part" + hsetprop ${scobj_hpath}/polariser/Freq nxalias "${name}_polariser_Freq" + + hfactory ${scobj_hpath}/polariser/Phase plain user text + hsetprop ${scobj_hpath}/polariser/Phase control true + hsetprop ${scobj_hpath}/polariser/Phase data true + hsetprop ${scobj_hpath}/polariser/Phase mutable true + hsetprop ${scobj_hpath}/polariser/Phase nxsave true + hsetprop ${scobj_hpath}/polariser/Phase units Degree + hsetprop ${scobj_hpath}/polariser/Phase oldval UNKNOWN + hsetprop ${scobj_hpath}/polariser/Phase klass "parameter" + hsetprop ${scobj_hpath}/polariser/Phase sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/polariser/Phase type "part" + hsetprop ${scobj_hpath}/polariser/Phase nxalias "${name}_polariser_Phase" + + hfactory ${scobj_hpath}/polariser/Time2 plain user text + hsetprop ${scobj_hpath}/polariser/Time2 control true + hsetprop ${scobj_hpath}/polariser/Time2 data true + hsetprop ${scobj_hpath}/polariser/Time2 mutable true + hsetprop ${scobj_hpath}/polariser/Time2 nxsave true + hsetprop ${scobj_hpath}/polariser/Time2 units Second + hsetprop ${scobj_hpath}/polariser/Time2 oldval UNKNOWN + hsetprop ${scobj_hpath}/polariser/Time2 klass "parameter" + hsetprop ${scobj_hpath}/polariser/Time2 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/polariser/Time2 type "part" + hsetprop ${scobj_hpath}/polariser/Time2 nxalias "${name}_polariser_Time2" + hfactory ${scobj_hpath}/polariser/spin plain user text hsetprop ${scobj_hpath}/polariser/spin read ${ns}::getValue ${scobj_hpath} rdValue {polariser} hsetprop ${scobj_hpath}/polariser/spin rdValue ${ns}::rdValue ${scobj_hpath} @@ -232,7 +380,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/polariser/spin data true hsetprop ${scobj_hpath}/polariser/spin mutable true hsetprop ${scobj_hpath}/polariser/spin nxsave true - hsetprop ${scobj_hpath}/polariser/spin values -1,+1 + hsetprop ${scobj_hpath}/polariser/spin values +,-,0 hsetprop ${scobj_hpath}/polariser/spin oldval UNKNOWN hsetprop ${scobj_hpath}/polariser/spin klass "parameter" hsetprop ${scobj_hpath}/polariser/spin sdsinfo "::nexus::scobj::sdsinfo" From 09cedac66d5b697043194d5cf0dd04061e1ed00b Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 27 Oct 2014 14:40:40 +1100 Subject: [PATCH 42/54] Make West 4100 driveable and add permlinks --- .../config/environment/temperature/west_6100.sct | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/site_ansto/instrument/config/environment/temperature/west_6100.sct b/site_ansto/instrument/config/environment/temperature/west_6100.sct index 178d25b7..fdebe8b4 100644 --- a/site_ansto/instrument/config/environment/temperature/west_6100.sct +++ b/site_ansto/instrument/config/environment/temperature/west_6100.sct @@ -3,8 +3,8 @@ driver west_6100 = { protocol = modbus_ap class = environment simulation_group = environment_simulation - add_args = 'dev_id' - make_args = 'dev_id' + add_args = 'id' + make_args = 'id' Group = { priv = user; data = true; control = true; mutable = true; type = float; @@ -12,8 +12,12 @@ driver west_6100 = { fetch_function = getDecimal; read_function = rdDecimal; write_function = wrDecimal; - var sensor = { read_command = "1"; } - var setpoint = { read_command = "2"; write_command = "2"; writeable = 1; } + var sensor = { read_command = "1"; permlink = "T.S01"; } + var setpoint = { + read_command = "2"; permlink = "T.SP01"; + write_command = "2"; writeable = 1; + driveable = sensor; lowerlimit = 0; upperlimit = 1600; + tolerance = 1; property settle_time = 30; } var w_sp = { read_command = "21"; write_command = "21"; writeable = 1; } var ramprate = { read_command = "24"; write_command = "24"; writeable = 1; } var alarm1 = { read_command = "13"; write_command = "13"; writeable = 1; } From 3bcd3fa0fb5e71c435021f533a2249926b6c81f8 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 27 Oct 2014 14:41:46 +1100 Subject: [PATCH 43/54] Regen SC driver for west 4100/6100 --- .../environment/temperature/sct_west_6100.tcl | 109 ++++++++++++++++-- 1 file changed, 99 insertions(+), 10 deletions(-) diff --git a/site_ansto/instrument/config/environment/temperature/sct_west_6100.tcl b/site_ansto/instrument/config/environment/temperature/sct_west_6100.tcl index 1372950a..2453af03 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_west_6100.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_west_6100.tcl @@ -27,6 +27,33 @@ proc ::scobj::west_6100::sics_log {debug_level debug_string} { } catch_message ] } +# checklimits function for driveable interface +proc ::scobj::west_6100::checklimits {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "checklimits tc_root=${tc_root} sct=[sct] target=[sct target]" + set setpoint [sct target] + if { [hpropexists [sct] lowerlimit] } { + set lolimit [sct lowerlimit] + } else { + # lowerlimit not set, use target + set lolimit [sct target] + } + if { [hpropexists [sct] upperlimit] } { + set hilimit [sct upperlimit] + } else { + # upperlimit not set, use target + set hilimit [sct target] + } +# checklimits hook code goes here + if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { + sct driving 0 + error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" + } + return OK + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # check function for hset change proc ::scobj::west_6100::checkrange {tc_root} { set catch_status [ catch { @@ -53,6 +80,40 @@ proc ::scobj::west_6100::checkrange {tc_root} { handle_exception ${catch_status} ${catch_message} } +# checkstatus function for driveable interface +proc ::scobj::west_6100::checkstatus {tc_root} { + set catch_status [ catch { +# checkstatus hook code goes here + if {[sct driving]} { + set sp "[sct target]" + set pv "[hval ${tc_root}/[sct driveable]]" + if { abs(${pv} - ${sp}) <= [sct tolerance] } { + if { [hpropexists [sct] settle_time] } { + if { [hpropexists [sct] settle_time_start] } { + if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} { + sct driving 0 + return "idle" + } + return "busy" + } else { + sct utime settle_time_start + return "busy" + } + } + sct driving 0 + return "idle" + } + if { [hpropexists [sct] settle_time_start] } { + hdelprop [sct] settle_time_start + } + return "busy" + } else { + return "idle" + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # function to request the read of a parameter on a device proc ::scobj::west_6100::getDecimal {tc_root nextState cmd_str} { set catch_status [ catch { @@ -101,6 +162,18 @@ proc ::scobj::west_6100::getInteger {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } +# halt function for driveable interface +proc ::scobj::west_6100::halt {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" + ### TODO hset [sct] [hval [sct]] +# halt hook code goes here + sct driving 0 + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + # function to check the write parameter on a device proc ::scobj::west_6100::noResponse {tc_root} { set catch_status [ catch { @@ -262,8 +335,8 @@ proc ::scobj::west_6100::wrInteger {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } -proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port dev_id } { - ::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}" +proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id } { + ::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}" set ns "[namespace current]" set catch_status [ catch { @@ -358,6 +431,8 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_ hsetprop ${scobj_hpath}/sensor data true hsetprop ${scobj_hpath}/sensor mutable true hsetprop ${scobj_hpath}/sensor nxsave true + hsetprop ${scobj_hpath}/sensor permlink data_set "T[format "%02d" ${id}]S01" + hsetprop ${scobj_hpath}/sensor @description "T[format "%02d" ${id}]S01" hsetprop ${scobj_hpath}/sensor oldval 0.0 hsetprop ${scobj_hpath}/sensor klass "parameter" hsetprop ${scobj_hpath}/sensor sdsinfo "::nexus::scobj::sdsinfo" @@ -370,14 +445,25 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_ hsetprop ${scobj_hpath}/setpoint write ${ns}::wrDecimal ${scobj_hpath} noResponse {2} hsetprop ${scobj_hpath}/setpoint noResponse ${ns}::noResponse ${scobj_hpath} hsetprop ${scobj_hpath}/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/setpoint driving 0 + hsetprop ${scobj_hpath}/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/setpoint driveable sensor hsetprop ${scobj_hpath}/setpoint control true hsetprop ${scobj_hpath}/setpoint data true hsetprop ${scobj_hpath}/setpoint mutable true hsetprop ${scobj_hpath}/setpoint nxsave true + hsetprop ${scobj_hpath}/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/setpoint upperlimit 1600 + hsetprop ${scobj_hpath}/setpoint tolerance 1 + hsetprop ${scobj_hpath}/setpoint permlink data_set "T[format "%02d" ${id}]SP01" + hsetprop ${scobj_hpath}/setpoint @description "T[format "%02d" ${id}]SP01" hsetprop ${scobj_hpath}/setpoint oldval 0.0 hsetprop ${scobj_hpath}/setpoint klass "parameter" hsetprop ${scobj_hpath}/setpoint sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/setpoint type "part" + hsetprop ${scobj_hpath}/setpoint settle_time "30" + hsetprop ${scobj_hpath}/setpoint type "drivable" hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint" hfactory ${scobj_hpath}/w_sp plain user float @@ -471,14 +557,17 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_ hsetprop ${scobj_hpath} klass ${device_class} hsetprop ${scobj_hpath} data true hsetprop ${scobj_hpath} debug_threshold 5 + if {[string equal -nocase "${simulation_flag}" "false"]} { + ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor ${sct_controller} + } # mkDriver hook code goes here } catch_message ] handle_exception ${catch_status} ${catch_message} } -proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_address tcp_port dev_id} { +proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_address tcp_port id} { set catch_status [ catch { - ::scobj::west_6100::sics_log 9 "::scobj::west_6100::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}" + ::scobj::west_6100::sics_log 9 "::scobj::west_6100::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}" if {[string equal -nocase "${simulation_flag}" "false"]} { if {[string equal -nocase "aqadapter" "${ip_address}"]} { ::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" @@ -490,8 +579,8 @@ proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_addres } else { ::scobj::west_6100::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for west_6100" } - ::scobj::west_6100::sics_log 1 "::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}" - ::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id} + ::scobj::west_6100::sics_log 1 "::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}" + ::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} } catch_message ] handle_exception ${catch_status} ${catch_message} } @@ -504,9 +593,9 @@ namespace eval ::scobj::west_6100 { namespace export add_driver } -proc add_west_6100 {name ip_address tcp_port dev_id} { +proc add_west_6100 {name ip_address tcp_port id} { set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" - ::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${dev_id}" + ::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" } clientput "file evaluation of sct_west_6100.tcl" @@ -572,7 +661,7 @@ proc ::scobj::west_6100::read_config {} { } set arg_list [list] set missing_list [list] - foreach arg {dev_id} { + foreach arg {id} { if {[dict exists $u $arg]} { lappend arg_list "[dict get $u $arg]" } elseif {[dict exists $v $arg]} { From 81a425e293f63da6c1d3ceee002e23e615e93c9e Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 27 Oct 2014 15:01:23 +1100 Subject: [PATCH 44/54] Revert "Anticollider changes from Platypus" This reverts commit f47c6fec812eece9f68c7bee2bcc314bcadf32ca. --- .../anticollider/anticollider_common.tcl | 118 ++++++++++++------ 1 file changed, 83 insertions(+), 35 deletions(-) diff --git a/site_ansto/instrument/config/anticollider/anticollider_common.tcl b/site_ansto/instrument/config/anticollider/anticollider_common.tcl index bde0f0c9..209a3522 100644 --- a/site_ansto/instrument/config/anticollider/anticollider_common.tcl +++ b/site_ansto/instrument/config/anticollider/anticollider_common.tcl @@ -1,10 +1,6 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # TODO Handle sequencing when simultaneously moving multiple axes -# TODO Handle functional dependencies (just write your own tcl script) -# or get the generic acscript to call a user proc -# FIXME The anticollider module does not report the error messages from the -# anticollision script, we currently get around this by using broadcast. AntiCollisionInstall namespace eval anticollider { @@ -13,19 +9,54 @@ namespace eval anticollider { array unset ::anticollider::veto_region array set ::anticollider::veto_region "" +# Don't show 'acscript' call on error. This is done by the anticollider +# module. +proc handle_acscript_exception {status message args} { + switch $status { + 0 { + # TCL_OK, This is raised when you just drop out of the + # bottom of a 'catch' command. + return -code ok + } + 1 { + # TCL_ERROR + return -code error "$message: $args" + } + 2 { + # TCL_RETURN + return -code return "$message" + } + 3 { + # TCL_BREAK + return -code break + } + 4 { + # TCL_CONTINUE + return -code continue + } + default { + # Propogate user defined return codes with message + return -code $status "$message" + } + } +} ## # @brief Load an anticollider script proc ::anticollider::loadscript {args} { - variable prog - set prog "" + variable veto_rules - set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] - while {[gets $fh line] >= 0} { - # Skip empty lines and comments - if [regexp {^\s*$|^ *#} $line] { - continue + catch { + set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] + while {[gets $fh line] >= 0} { + # Skip empty lines and comments + if [regexp {^\s*$|^ *#} $line] { + continue + } + lappend veto_rules $line } - lappend prog $line + } + catch { + close $fh } } @@ -33,7 +64,7 @@ proc ::anticollider::loadscript {args} { # @brief Compile compile an anticollider declaration into a veto region table # for the anticollider script. # -# @param vprog, an anticollider declaration as a list of quote enclosed lines. +# @param veto_rules, an anticollider declaration as a list of quote enclosed lines. # @return Generates the ::anticollider::veto_region lookup table. # # Example\n @@ -44,14 +75,16 @@ proc ::anticollider::loadscript {args} { # for sphi forbid { {0 5} {10 15} } when schi in { {5 10} {15 20} }\n # forbid {-inf 5} when mtth in {0 10} for sphi\n # forbid {0 10} for samx whenall { samrot in {0 5} samy in {0 15} }\n -proc ::anticollider::genveto {vprog} { +proc ::anticollider::genveto {veto_rules} { variable veto_region array unset veto_region set lnum 1 - foreach line $vprog { + foreach line $veto_rules { array unset vp array set vp $line + clientput "::anticollider::veto_rule: $line" + if [info exists vp(whenall)] { foreach {mot in range} $vp(whenall) { # if {[llength [join $range]] != 2} { @@ -88,16 +121,14 @@ proc ::anticollider::enable {args} { # # The ::anticollider::veto_region is a hash indexed by the names of the motors # which have been registered with the anticollision module. -proc ::anticollider::acscript {args} { +proc ::anticollider::veto_region_acscript {args} { variable veto_region - if {[::anticollider::enable $args] == "false"} { - foreach {regmot target} $args { - anticollision add 0 $regmot $target - } - return - } + set catch_status [ catch { foreach {regmot target} $args { + if { ! [info exists veto_region($regmot)] } { + continue + } foreach row $veto_region($regmot) { if { [lindex $row 1] == "@and"} { set forbid [lindex $row 0] @@ -116,7 +147,6 @@ proc ::anticollider::acscript {args} { } else { foreach {min max} $forbid {} if {$min <= $target && $target <= $max} { - broadcast "ERROR:The range ($forbid) is forbidden for $regmot when [lindex $row 2]" error "ERROR:The range ($forbid) is forbidden for $regmot when [lindex $row 2]" } } @@ -126,17 +156,14 @@ proc ::anticollider::acscript {args} { if {$obstrange == "@all"} { foreach {min max} [join $forbidden_range] { if {$min <= $target && $target <= $max} { - broadcast "ERROR: $regmot target ($target) is in the forbidden region ($forbidden_range)" error "ERROR: $regmot target ($target) is in the forbidden region ($forbidden_range)" } } } else { - broadcast "ERROR: veto table must use @all with @any" error "ERROR: veto table must use @all with @any" } } else { if {$obstrange == "@all"} { - broadcast "ERROR: veto table must use @any with @all" error "ERROR: veto table must use @any with @all" } else { foreach {lower upper} [join $obstrange] { @@ -144,7 +171,6 @@ proc ::anticollider::acscript {args} { if {$lower <= $pos && $pos <= $upper} { foreach {min max} [join $forbidden_range] { if {$min <= $target && $target <= $max} { - broadcast "ERROR:The range $min to $max is forbidden for $regmot when $obstmot is in this region ($obstrange)" error "ERROR:The range $min to $max is forbidden for $regmot when $obstmot is in this region ($obstrange)" } @@ -156,8 +182,9 @@ proc ::anticollider::acscript {args} { } } } - anticollision add 0 $regmot $target } + } message ] + handle_exception $catch_status $message } ## @@ -166,16 +193,37 @@ proc ::anticollider::init {} { variable evp variable veto_region - if [ catch { - ::anticollider::genveto $::anticollider::prog + set catch_status [ catch { + if { ![info exists ::anticollider::veto_rules] } { + return + } + clientput Load anticollider rules: + if { [info procs ::anticollider::load_acrules] == "::anticollider::load_acrules" } { + ::anticollider::load_acrules + } + ::anticollider::genveto $::anticollider::veto_rules foreach motor [array names veto_region] { anticollision register $motor } - } message ] { - clientput [info level 0] ERROR: $message - if {$::errorCode=="NONE"} {return $message} - return -code error $message - } + } message ] + handle_exception $catch_status $message +} + +lappend ::anticollider::scripts ::anticollider::veto_region_acscript +proc ::anticollider::acscript {args} { + set catch_status [ catch { + if {[::anticollider::enable $args] == "false"} { + return + } else { + foreach {regmot target} $args { + anticollision add 0 $regmot $target + } + } + foreach script $::anticollider::scripts { + $script {*}$args + } + } message ] + handle_acscript_exception $catch_status $message } publish ::anticollider::acscript user From 155d24588a7abbb3e31b99117a84cf78496253eb Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 27 Oct 2014 17:50:55 +1100 Subject: [PATCH 45/54] Extend 3He poll to 900 seconds and add refresh command --- site_ansto/instrument/config/beamline/he3_polanal.sct | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/beamline/he3_polanal.sct b/site_ansto/instrument/config/beamline/he3_polanal.sct index b02734cb..1a2b7e10 100644 --- a/site_ansto/instrument/config/beamline/he3_polanal.sct +++ b/site_ansto/instrument/config/beamline/he3_polanal.sct @@ -7,7 +7,7 @@ driver he3_polanal = { group polariser = { var spin = { type = text; - readable = 10; + readable = 900; read_command = 'polariser'; read_function = rdValue; writeable = 1; @@ -24,7 +24,7 @@ driver he3_polanal = { group analyser = { var spin = { type = text; - readable = 10; + readable = 900; read_command = 'analyser'; read_function = rdValue; writeable = 1; @@ -84,6 +84,9 @@ driver he3_polanal = { code setValue = {%% set cmd "${cmd_str}" + if {[string equal -nocase [sct target] "refresh"]} { + set cmd "${cmd_str}" + } if {[string equal -nocase [sct target] "dn"]} { set cmd "${cmd_str} -" } From 13d37720786d7961fac2c99074d0b656c59cdb44 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 27 Oct 2014 17:51:14 +1100 Subject: [PATCH 46/54] Regen 3He SCT driver --- site_ansto/instrument/config/beamline/sct_he3_polanal.tcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl index 7388a93d..9de60842 100644 --- a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl +++ b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl @@ -172,6 +172,9 @@ proc ::scobj::he3_polanal::setValue {tc_root nextState cmd_str} { set cmd "${cmd_str}${par}" # setValue hook code starts set cmd "${cmd_str}" + if {[string equal -nocase [sct target] "refresh"]} { + set cmd "${cmd_str}" + } if {[string equal -nocase [sct target] "dn"]} { set cmd "${cmd_str} -" } @@ -300,7 +303,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/analyser/spin nxalias "${name}_analyser_spin" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/analyser/spin 10 + ${sct_controller} poll ${scobj_hpath}/analyser/spin 1100 ${sct_controller} write ${scobj_hpath}/analyser/spin } else { ::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal" @@ -388,7 +391,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/polariser/spin nxalias "${name}_polariser_spin" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/polariser/spin 10 + ${sct_controller} poll ${scobj_hpath}/polariser/spin 900 ${sct_controller} write ${scobj_hpath}/polariser/spin } else { ::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal" From 71475199d9e6d6b435e9446e1636a0806edef2f9 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 3 Nov 2014 11:46:51 +1100 Subject: [PATCH 47/54] Formatting, typo, and speedup from RELEASE-3_2 compareSICS.py --- site_ansto/instrument/compareSICS.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/site_ansto/instrument/compareSICS.py b/site_ansto/instrument/compareSICS.py index 927dcde7..d9fd0bac 100755 --- a/site_ansto/instrument/compareSICS.py +++ b/site_ansto/instrument/compareSICS.py @@ -119,7 +119,7 @@ def load_dir(theDir): if file.endswith((".swp", ".swo", ".hdf", "~", ".bck", ".pyc")): continue if file.startswith(("core.", "SICServer")): - continue + continue if not file in myDirs: myDirs[file] = {} myDirs[file][root[theLen:]] = {} @@ -184,7 +184,7 @@ if __name__ == "__main__": if key.endswith((".swp", ".swo", ".hdf", "~", ".bck", ".pyc")): continue if key.startswith(("core.", "SICServer")): - continue + continue for entry in sorted(gmap[key]): if entry.endswith(("/data", "/log")): continue @@ -202,7 +202,7 @@ if __name__ == "__main__": if key.endswith((".swp", ".swo", ".hdf", "~", ".bck", ".pyc")): continue if key.startswith(("core.", "SICServer")): - continue + continue for entry in sorted(gmap[key]): target = os.path.join(entry, key) #print "Looking in fmap for", os.path.join(entry, key) @@ -219,7 +219,8 @@ if __name__ == "__main__": if not os.path.exists(destin): print " ", destin, "does not exist" continue - delta = list(difflib.unified_diff(\ + if args.show: + delta = list(difflib.unified_diff(\ open(source).read().splitlines(),\ open(destin).read().splitlines(),\ fromfile=source,\ @@ -227,6 +228,10 @@ if __name__ == "__main__": fromfiledate=datetime.datetime.fromtimestamp(os.path.getmtime(source)),\ tofiledate=datetime.datetime.fromtimestamp(os.path.getmtime(destin)),\ lineterm="")) + elif open(source).read() == open(destin).read(): + delta = [] + else: + delta = [""] delta_len = len(delta) if delta_len > 0: print_list[destin] = (source, list(delta)) @@ -240,7 +245,7 @@ if __name__ == "__main__": else: print args.command, source, destin else: - print source, destin, "#%d" % len(delta) + print source, destin if args.show: for line in delta: print line @@ -267,7 +272,7 @@ if __name__ == "__main__": if key.endswith((".swp", ".swo", ".hdf", "~", ".bck", ".pyc")): continue if key.startswith(("core.", "SICServer")): - continue + continue for entry in sorted(gmap[key]): target = os.path.join(entry, key) #print "Looking in fmap for", os.path.join(entry, key) @@ -286,7 +291,7 @@ if __name__ == "__main__": if len(lines) > 0: tgt = "/tmp/link_%s" % str(os.getpid()) if (os.path.exists(tgt)): - for root, disr, files in os.walk(tgt, topdown=False): + for root, dirs, files in os.walk(tgt, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: @@ -327,7 +332,7 @@ if __name__ == "__main__": if key.endswith((".swp", ".swo", ".hdf", "~", ".bck", ".pyc")): continue if key.startswith(("core.", "SICServer")): - continue + continue for entry in sorted(gmap[key]): target = os.path.join(entry, key) #print "Looking in fmap for", os.path.join(entry, key) @@ -378,5 +383,3 @@ if __name__ == "__main__": except: pass print "Copies (%d) in: %s" % (count, tgt) - - From 9daf62c299cefb22a2de77bcbdf2906fb9584dc7 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 3 Nov 2014 11:53:20 +1100 Subject: [PATCH 48/54] Fix for the Lakeshore LS-340 RELAY command on Pelican It's not the same as on the LS-336 --- .../config/environment/temperature/sct_lakeshore_340.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 77c10c3a..54ec67dd 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_340.tcl @@ -1906,8 +1906,8 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p other selftest 1 0 0 0 0 1 1 int user {*TST?} {rdValue} {} {setValue} {} other relayStatusHi 1 0 1 0 1 1 1 int spy {RELAYST? 1} {rdValue} {} {setValue} {} other relayStatusLo 1 0 1 0 2 1 1 int spy {RELAYST? 2} {rdValue} {} {setValue} {} - other relayCtrlParmHi 1 1 1 0 0 1 1 int spy {RELAY? 1} {rdValue} {RELAY 1,} {setValue} {} - other relayCtrlParmLo 1 1 1 0 0 1 1 int spy {RELAY? 2} {rdValue} {RELAY 2,} {setValue} {} + other relayCtrlParmHi 1 1 1 0 0 1 1 int spy {RELAY? 1} {rdValue} {RELAY 1,2,} {setValue} {} + other relayCtrlParmLo 1 1 1 0 0 1 1 int spy {RELAY? 2} {rdValue} {RELAY 2,2,} {setValue} {} other statusByte 1 0 1 0 0 1 1 int spy {*STB?} {rdValue} {} {setValue} {} } # The following 2 commands take no parameter - this makes them difficult to implement in a hipadaba structure From 16ad9ed8e29814a5a93bc612589ca7cac64c9326 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 3 Nov 2014 12:34:56 +1100 Subject: [PATCH 49/54] Pull back address change on Pelican --- site_ansto/instrument/pelican/config/hmm/sct_hv.tcl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl b/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl index 2aa761c7..8e21185e 100644 --- a/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl +++ b/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl @@ -418,7 +418,7 @@ publish set_data_record user MakeAsyncProtocol std -MakeAsyncQueue hvport std 10.157.205.10 4001 +MakeAsyncQueue hvport std 137.157.202.215 55011 # Main process call to create the driver ::scobj::hv::mkHV { name "hv" @@ -427,9 +427,3 @@ MakeAsyncQueue hvport std 10.157.205.10 4001 tuning 1 interval 5 } - - - - - - From 9adb5cb9072e4e22c35a369d2eb1cee400f9e3c1 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 3 Nov 2014 14:25:42 +1100 Subject: [PATCH 50/54] Handle missing read_command --- site_ansto/instrument/util/gen_sct.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site_ansto/instrument/util/gen_sct.py b/site_ansto/instrument/util/gen_sct.py index a4130931..050897cd 100755 --- a/site_ansto/instrument/util/gen_sct.py +++ b/site_ansto/instrument/util/gen_sct.py @@ -1283,7 +1283,10 @@ def put_group(MyDriver, MyGroup): if fetch_func == 'none': fetch_func = 'getValue' read_func = MyVar['read_function'] - read_command = MyVar['read_command'] + if 'read_command' in MyVar: + read_command = MyVar['read_command'] + else: + read_command = '' txt += [' hsetprop ${scobj_hpath}/%s read ${ns}::%s ${scobj_hpath} %s {%s}' % (nodename, fetch_func, read_func, read_command)] txt += [' hsetprop ${scobj_hpath}/%s %s ${ns}::%s ${scobj_hpath}' % (nodename, read_func, read_func)] if MyVar['writeable'] > 0 or MyVar['driveable']: From 4620c7b079e492f0bf9dbef7740048af27591152 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 3 Nov 2014 14:26:25 +1100 Subject: [PATCH 51/54] Regenerate SCT drivers --- site_ansto/instrument/config/beamline/sct_he3_polanal.tcl | 2 +- .../instrument/config/environment/magneticField/sct_bruker.tcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl index 9de60842..7f2b486a 100644 --- a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl +++ b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl @@ -303,7 +303,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio hsetprop ${scobj_hpath}/analyser/spin nxalias "${name}_analyser_spin" if {[string equal -nocase "${simulation_flag}" "false"]} { - ${sct_controller} poll ${scobj_hpath}/analyser/spin 1100 + ${sct_controller} poll ${scobj_hpath}/analyser/spin 900 ${sct_controller} write ${scobj_hpath}/analyser/spin } else { ::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal" diff --git a/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl b/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl index 2420d0b6..a195b1dc 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_bruker.tcl @@ -33,7 +33,7 @@ proc ::scobj::bruker::mkDriver { sct_controller name device_class simulation_fla set catch_status [ catch { # mkWrapper hook code starts - add_bruker_bec1 $name $ip_address $tcp_port $tol + add_bruker_BEC1 $name $ip_address $tcp_port $tol # mkWrapper hook code ends } catch_message ] handle_exception ${catch_status} ${catch_message} From 1f6d28637d13a556c9d78666de61edebb7defb68 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 6 Nov 2014 11:13:32 +1100 Subject: [PATCH 52/54] Trim the He-3 response before splitting to remove empty list elements Damn you, TCL ... --- site_ansto/instrument/config/beamline/he3_polanal.sct | 2 +- site_ansto/instrument/config/beamline/sct_he3_polanal.tcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/beamline/he3_polanal.sct b/site_ansto/instrument/config/beamline/he3_polanal.sct index 1a2b7e10..1d38fc98 100644 --- a/site_ansto/instrument/config/beamline/he3_polanal.sct +++ b/site_ansto/instrument/config/beamline/he3_polanal.sct @@ -43,7 +43,7 @@ driver he3_polanal = { %%} code rdValue = {%% - set dlist [split ${data}] + set dlist [split [string trim ${data}]] if {[llength ${dlist}] < 2} { sct geterror "Syntax Error: '${data}'" error "[sct geterror]" diff --git a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl index 7f2b486a..1eda955e 100644 --- a/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl +++ b/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl @@ -108,7 +108,7 @@ proc ::scobj::he3_polanal::rdValue {tc_root} { error "[sct geterror]" } # rdValue hook code starts - set dlist [split ${data}] + set dlist [split [string trim ${data}]] if {[llength ${dlist}] < 2} { sct geterror "Syntax Error: '${data}'" error "[sct geterror]" From 0010cef1797f1fbe47453dd1f45b951559a110ab Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 6 Nov 2014 12:34:45 +1100 Subject: [PATCH 53/54] Call the add instead of make function for the Eurotherm 2000 wrapper --- .../config/environment/temperature/eurotherm_m2000.sct | 2 +- .../config/environment/temperature/sct_eurotherm_m2000.tcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/config/environment/temperature/eurotherm_m2000.sct b/site_ansto/instrument/config/environment/temperature/eurotherm_m2000.sct index 4db47fd1..996cf943 100644 --- a/site_ansto/instrument/config/environment/temperature/eurotherm_m2000.sct +++ b/site_ansto/instrument/config/environment/temperature/eurotherm_m2000.sct @@ -7,6 +7,6 @@ driver eurotherm_m2000 = { add_args = 'id datype dev_id tol' make_args = 'id datype dev_id tol' code mkDriver = {%% - mk_sct_eurotherm_et2000 sct_controller environment $name $dev_id $tol $id $datype + add_eurotherm_2000 $name $ip_address $tcp_port $dev_id $tol $id $datype %%} } diff --git a/site_ansto/instrument/config/environment/temperature/sct_eurotherm_m2000.tcl b/site_ansto/instrument/config/environment/temperature/sct_eurotherm_m2000.tcl index 0d8f901c..37c7c852 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_eurotherm_m2000.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_eurotherm_m2000.tcl @@ -42,7 +42,7 @@ proc ::scobj::eurotherm_m2000::mkDriver { sct_controller name device_class simul hsetprop ${scobj_hpath} data true hsetprop ${scobj_hpath} debug_threshold 5 # mkDriver hook code starts - mk_sct_eurotherm_et2000 sct_controller environment $name $dev_id $tol $id $datype + add_eurotherm_2000 $name $ip_address $tcp_port $dev_id $tol $id $datype # mkDriver hook code ends } catch_message ] handle_exception ${catch_status} ${catch_message} From 8a61f657015c8d6eb4264c0c98a79b14e5741318 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 6 Nov 2014 12:35:21 +1100 Subject: [PATCH 54/54] Developing the Eurotherm 3200 SCT driver --- .../temperature/eurotherm_3200.sct | 57 ++ .../temperature/sct_eurotherm_3200.tcl | 620 ++++++++++++++++++ 2 files changed, 677 insertions(+) create mode 100644 site_ansto/instrument/config/environment/temperature/eurotherm_3200.sct create mode 100644 site_ansto/instrument/config/environment/temperature/sct_eurotherm_3200.tcl diff --git a/site_ansto/instrument/config/environment/temperature/eurotherm_3200.sct b/site_ansto/instrument/config/environment/temperature/eurotherm_3200.sct new file mode 100644 index 00000000..5f99100e --- /dev/null +++ b/site_ansto/instrument/config/environment/temperature/eurotherm_3200.sct @@ -0,0 +1,57 @@ +# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent +driver eurotherm_3200 = { + protocol = modbus_ap; + class = environment; + simulation_group = environment_simulation; + add_args = 'id datype dev_id tol'; + make_args = 'id datype dev_id tol'; + + group util = { + data = false; control = false; nxsave = false; mutable = false; + var unit = { type = int; value = '${dev_id}'; } + var mode = { type = text; allowed = "int,float"; value = 'int'; } + } + group loop1 = { + readable = 1; + type = float; + var sensor = { read_command = '1'; permlink = 'T.S01'; }; + writeable = 1; + var setpoint = { read_command = '2'; write_command = '2'; permlink = 'T.SP01'; + driveable = loop1/sensor; lowerlimit = 0; upperlimit =40; tolerance = '${tol}'; + }; + } + group loop1_extra = { + readable = 1; + type = float; + data = false; control = false; nxsave = false; mutable = false; + var manual_output = { read_command = '3'; } + var working_output = { read_command = '4'; } + var working_setpoint = { read_command = '5'; } + var active_setpoint = { read_command = '15'; } + writeable = 1; + var alarm1_thresh = { read_command = '13'; write_command = '13'; } + var alarm2_thresh = { read_command = '14'; write_command = '14'; } + var power_limit_high = { read_command = '30'; write_command = '30'; } + var power_limit_low = { read_command = '31'; write_command = '31'; } + var setpoint_slew_rate = { read_command = '35'; write_command = '35'; } + var power_slew_rate = { read_command = '37'; write_command = '37'; } + } + code getValue = { + @TCL + if { [string equal -nocase [hval ${tc_root}/util/mode] "float"] } { + set cmd "[hval ${tc_root}/util/unit]:3:[expr {32768+2*${cmd_str}}]:1:F32" + } else { + set cmd "[hval ${tc_root}/util/unit]:3:${cmd_str}:1:U16" + } + @END + } + code setValue = { + @TCL + if { [string equal -nocase [hval ${tc_root}/util/mode] "float"] } { + set cmd "[hval ${tc_root}/util/unit]:16:[expr {32768+2*${cmd_str}}]:1:F32:${par}" + } else { + set cmd "[hval ${tc_root}/util/unit]:16:${cmd_str}:1:U16:${par}" + } + @END + } +} diff --git a/site_ansto/instrument/config/environment/temperature/sct_eurotherm_3200.tcl b/site_ansto/instrument/config/environment/temperature/sct_eurotherm_3200.tcl new file mode 100644 index 00000000..bf629afc --- /dev/null +++ b/site_ansto/instrument/config/environment/temperature/sct_eurotherm_3200.tcl @@ -0,0 +1,620 @@ +# Generated driver for eurotherm_3200 +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::eurotherm_3200 { + set debug_threshold 5 +} + +proc ::scobj::eurotherm_3200::debug_log {tc_root debug_level debug_string} { + set catch_status [ catch { + set debug_threshold [hgetpropval ${tc_root} debug_threshold] + if {${debug_level} >= ${debug_threshold}} { + set fd [open "../log/eurotherm_3200_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::eurotherm_3200::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::eurotherm_3200::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::eurotherm_3200::${debug_string}" + } + } catch_message ] +} + +# checklimits function for driveable interface +proc ::scobj::eurotherm_3200::checklimits {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "checklimits tc_root=${tc_root} sct=[sct] target=[sct target]" + set setpoint [sct target] + if { [hpropexists [sct] lowerlimit] } { + set lolimit [sct lowerlimit] + } else { + # lowerlimit not set, use target + set lolimit [sct target] + } + if { [hpropexists [sct] upperlimit] } { + set hilimit [sct upperlimit] + } else { + # upperlimit not set, use target + set hilimit [sct target] + } +# checklimits hook code goes here + if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { + sct driving 0 + error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" + } + return OK + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# check function for hset change +proc ::scobj::eurotherm_3200::checkrange {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "checkrange tc_root=${tc_root} sct=[sct] target=[sct target]" + set setpoint [sct target] + if { [hpropexists [sct] lowerlimit] } { + set lolimit [sct lowerlimit] + } else { + # lowerlimit not set, use target + set lolimit [sct target] + } + if { [hpropexists [sct] upperlimit] } { + set hilimit [sct upperlimit] + } else { + # upperlimit not set, use target + set hilimit [sct target] + } +# checkrange hook code goes here + if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { + error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" + } + return OK + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# checkstatus function for driveable interface +proc ::scobj::eurotherm_3200::checkstatus {tc_root} { + set catch_status [ catch { +# checkstatus hook code goes here + if {[sct driving]} { + set sp "[sct target]" + set pv "[hval ${tc_root}/[sct driveable]]" + if { abs(${pv} - ${sp}) <= [sct tolerance] } { + if { [hpropexists [sct] settle_time] } { + if { [hpropexists [sct] settle_time_start] } { + if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} { + sct driving 0 + return "idle" + } + return "busy" + } else { + sct utime settle_time_start + return "busy" + } + } + sct driving 0 + return "idle" + } + if { [hpropexists [sct] settle_time_start] } { + hdelprop [sct] settle_time_start + } + return "busy" + } else { + return "idle" + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to request the read of a parameter on a device +proc ::scobj::eurotherm_3200::getValue {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "getValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# getValue hook code starts + if { [string equal -nocase [hval ${tc_root}/util/mode] "float"] } { + set cmd "[hval ${tc_root}/util/unit]:3:[expr {32768+2*${cmd_str}}]:1:F32" + } else { + set cmd "[hval ${tc_root}/util/unit]:3:${cmd_str}:1:U16" + } +# getValue hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "getValue sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# halt function for driveable interface +proc ::scobj::eurotherm_3200::halt {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" + ### TODO hset [sct] [hval [sct]] +# halt hook code goes here + sct driving 0 + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to check the write parameter on a device +proc ::scobj::eurotherm_3200::noResponse {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "noResponse tc_root=${tc_root} sct=[sct] resp=[sct result]" +# noResponse hook code goes here + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to parse the read of a parameter on a device +proc ::scobj::eurotherm_3200::rdValue {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} sct=[sct] result=[sct result]" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set data [sct result] + set nextState "idle" + if {[string equal -nocase -length 7 ${data} "ASCERR:"]} { + # the protocol driver has reported an error + sct geterror "${data}" + error "[sct geterror]" + } +# rdValue hook code goes here + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::eurotherm_3200::setValue {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "setValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# setValue hook code starts + if { [string equal -nocase [hval ${tc_root}/util/mode] "float"] } { + set cmd "[hval ${tc_root}/util/unit]:16:[expr {32768+2*${cmd_str}}]:1:F32:${par}" + } else { + set cmd "[hval ${tc_root}/util/unit]:16:${cmd_str}:1:U16:${par}" + } +# setValue hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "setValue sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id tol } { + ::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}" + set ns "[namespace current]" + set catch_status [ catch { + + MakeSICSObj ${name} SCT_OBJECT + + sicslist setatt ${name} klass ${device_class} + sicslist setatt ${name} long_name ${name} + + set scobj_hpath /sics/${name} + + hfactory ${scobj_hpath}/loop1 plain spy none + hsetprop ${scobj_hpath}/loop1 data "true" + hsetprop ${scobj_hpath}/loop1 klass "@none" + hsetprop ${scobj_hpath}/loop1 type "part" + + hfactory ${scobj_hpath}/loop1/sensor plain user float + hsetprop ${scobj_hpath}/loop1/sensor read ${ns}::getValue ${scobj_hpath} rdValue {1} + hsetprop ${scobj_hpath}/loop1/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1/sensor control true + hsetprop ${scobj_hpath}/loop1/sensor data true + hsetprop ${scobj_hpath}/loop1/sensor mutable true + hsetprop ${scobj_hpath}/loop1/sensor nxsave true + hsetprop ${scobj_hpath}/loop1/sensor permlink data_set "T[format "%02d" ${id}]S01" + hsetprop ${scobj_hpath}/loop1/sensor @description "T[format "%02d" ${id}]S01" + hsetprop ${scobj_hpath}/loop1/sensor oldval 0.0 + hsetprop ${scobj_hpath}/loop1/sensor klass "parameter" + hsetprop ${scobj_hpath}/loop1/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1/sensor type "part" + hsetprop ${scobj_hpath}/loop1/sensor nxalias "${name}_loop1_sensor" + + hfactory ${scobj_hpath}/loop1/setpoint plain user float + hsetprop ${scobj_hpath}/loop1/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {2} + hsetprop ${scobj_hpath}/loop1/setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1/setpoint write ${ns}::setValue ${scobj_hpath} noResponse {2} + hsetprop ${scobj_hpath}/loop1/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1/setpoint driving 0 + hsetprop ${scobj_hpath}/loop1/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1/setpoint driveable loop1/sensor + hsetprop ${scobj_hpath}/loop1/setpoint control true + hsetprop ${scobj_hpath}/loop1/setpoint data true + hsetprop ${scobj_hpath}/loop1/setpoint mutable true + hsetprop ${scobj_hpath}/loop1/setpoint nxsave true + hsetprop ${scobj_hpath}/loop1/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/loop1/setpoint upperlimit 40 + hsetprop ${scobj_hpath}/loop1/setpoint tolerance ${tol} + hsetprop ${scobj_hpath}/loop1/setpoint permlink data_set "T[format "%02d" ${id}]SP01" + hsetprop ${scobj_hpath}/loop1/setpoint @description "T[format "%02d" ${id}]SP01" + hsetprop ${scobj_hpath}/loop1/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/loop1/setpoint klass "parameter" + hsetprop ${scobj_hpath}/loop1/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1/setpoint type "drivable" + hsetprop ${scobj_hpath}/loop1/setpoint nxalias "${name}_loop1_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/loop1/sensor 1 + ${sct_controller} poll ${scobj_hpath}/loop1/setpoint 1 + ${sct_controller} write ${scobj_hpath}/loop1/setpoint + } else { + ::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200" + } + + hfactory ${scobj_hpath}/loop1_extra plain spy none + hsetprop ${scobj_hpath}/loop1_extra data "false" + hsetprop ${scobj_hpath}/loop1_extra klass "@none" + hsetprop ${scobj_hpath}/loop1_extra type "part" + + hfactory ${scobj_hpath}/loop1_extra/active_setpoint plain user float + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint read ${ns}::getValue ${scobj_hpath} rdValue {15} + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint control false + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint data false + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint mutable false + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint nxsave false + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint type "part" + hsetprop ${scobj_hpath}/loop1_extra/active_setpoint nxalias "${name}_loop1_extra_active_setpoint" + + hfactory ${scobj_hpath}/loop1_extra/alarm1_thresh plain user float + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh read ${ns}::getValue ${scobj_hpath} rdValue {13} + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh write ${ns}::setValue ${scobj_hpath} noResponse {13} + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh control false + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh data false + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh mutable false + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh nxsave false + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh type "part" + hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh nxalias "${name}_loop1_extra_alarm1_thresh" + + hfactory ${scobj_hpath}/loop1_extra/alarm2_thresh plain user float + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh read ${ns}::getValue ${scobj_hpath} rdValue {14} + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh write ${ns}::setValue ${scobj_hpath} noResponse {14} + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh control false + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh data false + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh mutable false + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh nxsave false + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh type "part" + hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh nxalias "${name}_loop1_extra_alarm2_thresh" + + hfactory ${scobj_hpath}/loop1_extra/manual_output plain user float + hsetprop ${scobj_hpath}/loop1_extra/manual_output read ${ns}::getValue ${scobj_hpath} rdValue {3} + hsetprop ${scobj_hpath}/loop1_extra/manual_output rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/manual_output control false + hsetprop ${scobj_hpath}/loop1_extra/manual_output data false + hsetprop ${scobj_hpath}/loop1_extra/manual_output mutable false + hsetprop ${scobj_hpath}/loop1_extra/manual_output nxsave false + hsetprop ${scobj_hpath}/loop1_extra/manual_output oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/manual_output sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/manual_output type "part" + hsetprop ${scobj_hpath}/loop1_extra/manual_output nxalias "${name}_loop1_extra_manual_output" + + hfactory ${scobj_hpath}/loop1_extra/power_limit_high plain user float + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high read ${ns}::getValue ${scobj_hpath} rdValue {30} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high write ${ns}::setValue ${scobj_hpath} noResponse {30} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high control false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high data false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high mutable false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high nxsave false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high type "part" + hsetprop ${scobj_hpath}/loop1_extra/power_limit_high nxalias "${name}_loop1_extra_power_limit_high" + + hfactory ${scobj_hpath}/loop1_extra/power_limit_low plain user float + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low read ${ns}::getValue ${scobj_hpath} rdValue {31} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low write ${ns}::setValue ${scobj_hpath} noResponse {31} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low control false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low data false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low mutable false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low nxsave false + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low type "part" + hsetprop ${scobj_hpath}/loop1_extra/power_limit_low nxalias "${name}_loop1_extra_power_limit_low" + + hfactory ${scobj_hpath}/loop1_extra/power_slew_rate plain user float + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate read ${ns}::getValue ${scobj_hpath} rdValue {37} + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate write ${ns}::setValue ${scobj_hpath} noResponse {37} + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate control false + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate data false + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate mutable false + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate nxsave false + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate type "part" + hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate nxalias "${name}_loop1_extra_power_slew_rate" + + hfactory ${scobj_hpath}/loop1_extra/setpoint_slew_rate plain user float + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate read ${ns}::getValue ${scobj_hpath} rdValue {35} + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate write ${ns}::setValue ${scobj_hpath} noResponse {35} + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate control false + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate data false + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate mutable false + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate nxsave false + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate type "part" + hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate nxalias "${name}_loop1_extra_setpoint_slew_rate" + + hfactory ${scobj_hpath}/loop1_extra/working_output plain user float + hsetprop ${scobj_hpath}/loop1_extra/working_output read ${ns}::getValue ${scobj_hpath} rdValue {4} + hsetprop ${scobj_hpath}/loop1_extra/working_output rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/working_output control false + hsetprop ${scobj_hpath}/loop1_extra/working_output data false + hsetprop ${scobj_hpath}/loop1_extra/working_output mutable false + hsetprop ${scobj_hpath}/loop1_extra/working_output nxsave false + hsetprop ${scobj_hpath}/loop1_extra/working_output oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/working_output sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/working_output type "part" + hsetprop ${scobj_hpath}/loop1_extra/working_output nxalias "${name}_loop1_extra_working_output" + + hfactory ${scobj_hpath}/loop1_extra/working_setpoint plain user float + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint read ${ns}::getValue ${scobj_hpath} rdValue {5} + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint control false + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint data false + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint mutable false + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint nxsave false + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint oldval 0.0 + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint type "part" + hsetprop ${scobj_hpath}/loop1_extra/working_setpoint nxalias "${name}_loop1_extra_working_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/loop1_extra/active_setpoint 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/alarm1_thresh 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/alarm2_thresh 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/manual_output 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/power_limit_high 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/power_limit_low 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/power_slew_rate 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/setpoint_slew_rate 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/working_output 1 + ${sct_controller} poll ${scobj_hpath}/loop1_extra/working_setpoint 1 + ${sct_controller} write ${scobj_hpath}/loop1_extra/alarm1_thresh + ${sct_controller} write ${scobj_hpath}/loop1_extra/alarm2_thresh + ${sct_controller} write ${scobj_hpath}/loop1_extra/power_limit_high + ${sct_controller} write ${scobj_hpath}/loop1_extra/power_limit_low + ${sct_controller} write ${scobj_hpath}/loop1_extra/power_slew_rate + ${sct_controller} write ${scobj_hpath}/loop1_extra/setpoint_slew_rate + } else { + ::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200" + } + + hfactory ${scobj_hpath}/util plain spy none + hsetprop ${scobj_hpath}/util data "false" + hsetprop ${scobj_hpath}/util klass "@none" + hsetprop ${scobj_hpath}/util type "part" + + hfactory ${scobj_hpath}/util/mode plain user text + hsetprop ${scobj_hpath}/util/mode control false + hsetprop ${scobj_hpath}/util/mode data false + hsetprop ${scobj_hpath}/util/mode mutable false + hsetprop ${scobj_hpath}/util/mode nxsave false + hsetprop ${scobj_hpath}/util/mode values int,float + hsetprop ${scobj_hpath}/util/mode oldval int + hset ${scobj_hpath}/util/mode int + hsetprop ${scobj_hpath}/util/mode sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/util/mode type "part" + hsetprop ${scobj_hpath}/util/mode nxalias "${name}_util_mode" + + hfactory ${scobj_hpath}/util/unit plain user int + hsetprop ${scobj_hpath}/util/unit control false + hsetprop ${scobj_hpath}/util/unit data false + hsetprop ${scobj_hpath}/util/unit mutable false + hsetprop ${scobj_hpath}/util/unit nxsave false + hsetprop ${scobj_hpath}/util/unit oldval ${dev_id} + hset ${scobj_hpath}/util/unit ${dev_id} + hsetprop ${scobj_hpath}/util/unit sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/util/unit type "part" + hsetprop ${scobj_hpath}/util/unit nxalias "${name}_util_unit" + hsetprop ${scobj_hpath} klass ${device_class} + hsetprop ${scobj_hpath} data true + hsetprop ${scobj_hpath} debug_threshold 5 + if {[string equal -nocase "${simulation_flag}" "false"]} { + ansto_makesctdrive ${name}_loop1_setpoint ${scobj_hpath}/loop1/setpoint ${scobj_hpath}/loop1/sensor ${sct_controller} + } +# mkDriver hook code goes here + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id tol} { + set catch_status [ catch { + ::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::eurotherm_3200::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::eurotherm_3200::sics_log 9 "makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port} + } + } else { + ::scobj::eurotherm_3200::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for eurotherm_3200" + } + ::scobj::eurotherm_3200::sics_log 1 "::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}" + ::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::eurotherm_3200 { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_eurotherm_3200 {name ip_address tcp_port id datype dev_id tol} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::eurotherm_3200::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${dev_id}" "${tol}" +} + +clientput "file evaluation of sct_eurotherm_3200.tcl" +::scobj::eurotherm_3200::sics_log 9 "file evaluation of sct_eurotherm_3200.tcl" + +proc ::scobj::eurotherm_3200::read_config {} { + set catch_status [ catch { + set ns "::scobj::eurotherm_3200" + dict for {k u} $::config_dict { + if { [dict exists $u "implementation"] } { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + set device_class "environment" + if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } { + continue + } + set enabled [string tolower [dict get $u "enabled"]] + if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } { + continue + } + if { [dict exists $u "simulation_group"] } { + set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]] + } + if { [dict exists $u "device_class"] } { + set device_class "[dict get $u "device_class"]" + } + set name [dict get $u name] + set implementation [dict get $u "implementation"] + if { !([dict exists $::config_dict $implementation]) } { + continue + } + set v [dict get $::config_dict $implementation] + if { !([dict exists $v "driver"]) } { + continue + } + if { [string equal -nocase [dict get $v "driver"] "eurotherm_3200"] } { + if { ![string equal -nocase "${simulation_flag}" "false"] } { + set asyncqueue "null" + ${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue" + } elseif { [dict exists $v "asyncqueue"] } { + set asyncqueue [dict get $v "asyncqueue"] + if { [string equal -nocase ${asyncqueue} "sct"] } { + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + } + } else { + if { [dict exists $v "asyncprotocol"] } { + set asyncprotocol [dict get $v "asyncprotocol"] + } else { + set asyncprotocol ${name}_protocol + MakeAsyncProtocol ${asyncprotocol} + if { [dict exists $v "terminator"] } { + ${asyncprotocol} sendterminator "[dict get $v "terminator"]" + ${asyncprotocol} replyterminator "[dict get $v "terminator"]" + } + } + set asyncqueue ${name}_queue + set ip_address [dict get $v ip] + set tcp_port [dict get $v port] + MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port} + if { [dict exists $v "timeout"] } { + ${asyncqueue} timeout "[dict get $v "timeout"]" + } + } + set arg_list [list] + set missing_list [list] + foreach arg {id datype dev_id tol} { + if {[dict exists $u $arg]} { + lappend arg_list "[dict get $u $arg]" + } elseif {[dict exists $v $arg]} { + lappend arg_list "[dict get $v $arg]" + } else { + ${ns}::sics_log 9 "Missing configuration value $arg" + lappend missing_list $arg + } + } + if { [llength $missing_list] > 0 } { + error "$name is missing configuration values $missing_list" + } + if { [string equal -nocase ${asyncqueue} "sct"] } { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list + } else { + ${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list + } + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::eurotherm_3200::read_config +} else { + ::scobj::eurotherm_3200::sics_log 5 "No config dict" +}