diff --git a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl index 1f269659..bc80d54a 100644 --- a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl +++ b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl @@ -3,7 +3,7 @@ # namespace eval ::scobj::knauer_pump { - set debug_threshold 0 + set debug_threshold 5 } proc ::scobj::knauer_pump::debug_log {tc_root debug_level debug_string} { @@ -1115,7 +1115,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio } hsetprop ${scobj_hpath} klass ${device_class} hsetprop ${scobj_hpath} data true - hsetprop ${scobj_hpath} debug_threshold 0 + hsetprop ${scobj_hpath} debug_threshold 5 if {[string equal -nocase "${simulation_flag}" "false"]} { ansto_makesctdrive ${name}_pump_volume_setp ${scobj_hpath}/pump/volume/setp ${scobj_hpath}/pump/volume/pval ${sct_controller} } diff --git a/site_ansto/instrument/config/environment/sct_omron_hldc.tcl b/site_ansto/instrument/config/environment/sct_omron_hldc.tcl index d78fffb3..6c51a2bb 100644 --- a/site_ansto/instrument/config/environment/sct_omron_hldc.tcl +++ b/site_ansto/instrument/config/environment/sct_omron_hldc.tcl @@ -10,9 +10,12 @@ proc ::scobj::omron_hldc::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/omron_hldc_[basename ${tc_root}].log" "a"] - set line "[clock format [clock seconds] -format "%T"] ${debug_string}" - puts ${fd} "${line}" + set now [clock seconds] + set ts [clock format ${now} -format "%Y%m%d"] + set log_file_name "../log/omron_hldc_[basename ${tc_root}]_${ts}.log" + set fd [open "${log_file_name}" "a"] + set ts [clock format ${now} -format "%T"] + puts ${fd} "${ts} ${debug_string}" close ${fd} } } catch_message ] @@ -197,6 +200,7 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name device_class simulation MakeSICSObj ${name} SCT_OBJECT + sicslist setatt ${name} driver omron_hldc sicslist setatt ${name} klass ${device_class} sicslist setatt ${name} long_name ${name} @@ -215,6 +219,14 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name device_class simulation hsetprop ${scobj_hpath}/distance type "part" hsetprop ${scobj_hpath}/distance nxalias "${name}_distance" + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/distance 1 + hsetprop ${scobj_hpath}/distance simulated false + } else { + ::scobj::omron_hldc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for omron_hldc" + hsetprop ${scobj_hpath}/distance simulated true + } + hfactory ${scobj_hpath}/id plain user text hsetprop ${scobj_hpath}/id read ${ns}::getValue ${scobj_hpath} read_id {0501} hsetprop ${scobj_hpath}/id read_id ${ns}::read_id ${scobj_hpath} @@ -228,16 +240,18 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name device_class simulation hsetprop ${scobj_hpath}/id type "part" hsetprop ${scobj_hpath}/id nxalias "${name}_id" + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/id 10 + hsetprop ${scobj_hpath}/id simulated false + } else { + ::scobj::omron_hldc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for omron_hldc" + hsetprop ${scobj_hpath}/id simulated true + } + 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}/distance 1 - ${sct_controller} poll ${scobj_hpath}/id 10 - } else { - ::scobj::omron_hldc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for omron_hldc" - } + hsetprop ${scobj_hpath} driver omron_hldc hsetprop ${scobj_hpath} klass ${device_class} hsetprop ${scobj_hpath} data true hsetprop ${scobj_hpath} debug_threshold 5 @@ -258,7 +272,9 @@ proc ::scobj::omron_hldc::add_driver {name device_class simulation_flag ip_addre makesctcontroller sct_${name} std ${ip_address}:${tcp_port} } } else { - ::scobj::omron_hldc::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for omron_hldc" + ::scobj::omron_hldc::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for omron_hldc" + ::scobj::omron_hldc::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL" + makesctcontroller sct_${name} aqadapter NULL } ::scobj::omron_hldc::sics_log 1 "::scobj::omron_hldc::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" ::scobj::omron_hldc::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} @@ -276,7 +292,7 @@ namespace eval ::scobj::omron_hldc { proc add_omron_hldc {name ip_address tcp_port} { set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" - ::scobj::omron_hldc::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} + ::scobj::omron_hldc::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} } clientput "file evaluation of sct_omron_hldc.tcl" @@ -315,20 +331,31 @@ proc ::scobj::omron_hldc::read_config {} { if { ![string equal -nocase "${simulation_flag}" "false"] } { set asyncqueue "null" ${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue" + ${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL" + makesctcontroller sct_${name} aqadapter NULL } 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] - } + makesctcontroller sct_${name} std ${ip_address}:${tcp_port} + } else { + makesctcontroller sct_${name} aqadapter ${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"] } { + if { [dict exists $v "sendterminator"] } { + ${asyncprotocol} sendterminator "[dict get $v "sendterminator"]" + } elseif { [dict exists $v "terminator"] } { ${asyncprotocol} sendterminator "[dict get $v "terminator"]" + } + if { [dict exists $v "replyterminator"] } { + ${asyncprotocol} replyterminator "[dict get $v "replyterminator"]" + } elseif { [dict exists $v "terminator"] } { ${asyncprotocol} replyterminator "[dict get $v "terminator"]" } } @@ -339,12 +366,9 @@ proc ::scobj::omron_hldc::read_config {} { if { [dict exists $v "timeout"] } { ${asyncqueue} timeout "[dict get $v "timeout"]" } + makesctcontroller sct_${name} aqadapter ${asyncqueue} } - 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} - } + ${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} } } } diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl index 74233b4a..6fe63945 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl @@ -50,7 +50,7 @@ namespace eval ::scobj::[set vendor]_[set device] { proc debug_log {debug_level arg_string} { # write a timestamped string message to a log file for debugging - set debug_threshold 0 + set debug_threshold 5 if {$debug_level >= $debug_threshold} { set fd [open "[set [namespace current]::log_file]" "a"] set line "[clock format [clock seconds] -format "%T"] $arg_string" diff --git a/site_ansto/instrument/config/environment/temperature/sct_ls340.tcl b/site_ansto/instrument/config/environment/temperature/sct_ls340.tcl index f607f937..4cd951b9 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_ls340.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_ls340.tcl @@ -57,7 +57,7 @@ proc ::scobj::ls340::add_driver {name device_class simulation_flag ip_address tc makesctcontroller sct_${name} aqadapter ${tcp_port} } else { ::scobj::ls340::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}" - makesctcontroller sct_${name} std ${ip_address}:${tcp_port} + makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \r\n } } else { ::scobj::ls340::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for ls340" diff --git a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl index 22ebad6b..67266192 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl @@ -58,7 +58,7 @@ namespace eval ::scobj::[set vendor]_[set device] { proc debug_log {debug_level arg_string} { # write a timestamped string message to a log file for debugging - set debug_threshold 0 + set debug_threshold 5 if {$debug_level >= $debug_threshold} { set fd [open "[set [namespace current]::log_file]" "a"] set line "[clock format [clock seconds] -format "%T"] $arg_string" diff --git a/site_ansto/instrument/reflectometer/config/hmm/detector.tcl b/site_ansto/instrument/reflectometer/config/hmm/detector.tcl index d9d29c41..0938a1ab 100644 --- a/site_ansto/instrument/reflectometer/config/hmm/detector.tcl +++ b/site_ansto/instrument/reflectometer/config/hmm/detector.tcl @@ -14,10 +14,14 @@ evfactory new dhv1 nhq200 acq 1 dhv1 tolerance 5 dhv1 rate 25 dhv1 upper 3000 +dhv1 max 3000 +dhv1 upperlimit 3000 #dhv1 lock evfactory new dhv2 nhq200 acq 2 dhv2 tolerance 5 dhv2 rate 25 dhv2 upper 1500 +dhv1 max 1500 +dhv1 upperlimit 1500 #dhv2 lock } diff --git a/site_ansto/instrument/reflectometer/platypus_configuration.tcl b/site_ansto/instrument/reflectometer/platypus_configuration.tcl index 5234f5e1..7cefb18d 100644 --- a/site_ansto/instrument/reflectometer/platypus_configuration.tcl +++ b/site_ansto/instrument/reflectometer/platypus_configuration.tcl @@ -33,6 +33,7 @@ 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)/sct_keysight_N8740A.tcl fileeval $cfPath(environment)/magneticField/sct_bruker_BEC1.tcl fileeval $cfPath(environment)/magneticField/sct_bruker.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl @@ -48,6 +49,7 @@ fileeval $cfPath(chopper)/chopper.tcl fileeval $cfPath(commands)/commands.tcl fileeval $cfPath(anticollider)/anticollider.tcl fileeval $cfPath(beamline)/polanal.tcl +fileeval $cfPath(beamline)/he3_polanal_sct.tcl fileeval $cfPath(commands)/pulser.tcl fileeval $cfPath(commands)/hvcommands.tcl diff --git a/site_ansto/instrument/reflectometer/sics_simulation.tcl b/site_ansto/instrument/reflectometer/sics_simulation.tcl index e940d6ae..94913622 100644 --- a/site_ansto/instrument/reflectometer/sics_simulation.tcl +++ b/site_ansto/instrument/reflectometer/sics_simulation.tcl @@ -4,7 +4,7 @@ # icsval column = settings when running on the Instrument Control Server (ie SICS_SIMULATION not defined) # fakedev column = settings for test platforms (ie SICS_SIMULATION=fakedev) foreach {simflag icsval fakedev} { - opal_simulation true true + opal_simulation false true detector_simulation false true hmm_simulation false true environment_simulation false true