diff --git a/site_ansto/instrument/bilby/config/chopper/astrium_chopper.sct b/site_ansto/instrument/bilby/config/chopper/astrium_chopper.sct index a25a2902..64e4bd47 100644 --- a/site_ansto/instrument/bilby/config/chopper/astrium_chopper.sct +++ b/site_ansto/instrument/bilby/config/chopper/astrium_chopper.sct @@ -2,7 +2,7 @@ driver astrium_chopper = { vendor = astrium; device = chopper; protocol = std; class = NXdisk_chopper; simulation_group = chopper_simulation; - group blade_1 = { + group disk_1 = { var state = { type = text; mutable = true; priv = user; readable = 1; read_command = '1'; fetch_function = fetchState; read_function = readState; @@ -13,9 +13,10 @@ driver astrium_chopper = { var aspeed = { type = float; mutable = true; } var rphase = { type = float; } var aphase = { type = float; mutable = true; } + var frequency = { type = float; mutable = true; } } - group blade_2 = { + group disk_2 = { var state = { type = text; mutable = true; priv = user; readable = 1; read_command = '2'; fetch_function = fetchState; read_function = readState; @@ -26,9 +27,10 @@ driver astrium_chopper = { var aspeed = { type = float; mutable = true; } var rphase = { type = float; } var aphase = { type = float; mutable = true; } + var frequency = { type = float; mutable = true; } } - group blade_3 = { + group disk_3 = { var state = { type = text; mutable = true; priv = user; readable = 1; read_command = '3'; fetch_function = fetchState; read_function = readState; @@ -39,9 +41,10 @@ driver astrium_chopper = { var aspeed = { type = float; mutable = true; } var rphase = { type = float; } var aphase = { type = float; mutable = true; } + var frequency = { type = float; mutable = true; } } - group blade_4 = { + group disk_4 = { var state = { type = text; mutable = true; priv = user; readable = 1; read_command = '4'; fetch_function = fetchState; read_function = readState; @@ -52,6 +55,7 @@ driver astrium_chopper = { var aspeed = { type = float; mutable = true; } var rphase = { type = float; } var aphase = { type = float; mutable = true; } + var frequency = { type = float; mutable = true; } } code fetch_function fetchState = {%% @@ -87,8 +91,16 @@ driver astrium_chopper = { set rhs "[string trim [lindex ${lst} 1]]" sct "attr_${lhs}" "${rhs}" set base [pathname [sct]] - foreach node [list ASPEED RSPEED APHASE RPHASE MASTER] { - if { [string equal -nocase "${lhs}" "${node}"] } { + switch [string toupper ${lhs}] { + "ASPEED" { + if [string is double "${rhs}"] { + set freq [expr "${rhs}" / 60.0] + if { "[hval ${base}/frequency]" != "${freq}" } { + hset ${base}/frequency ${freq} + } + } + } + "RSPEED" - "APHASE" - "RPHASE" - "MASTER" { if { "[hval ${base}/${node}]" != "${rhs}" } { hset ${base}/${node} "${rhs}" } diff --git a/site_ansto/instrument/config/beamline/he3_polanal.sct b/site_ansto/instrument/config/beamline/he3_polanal.sct index 68ba2a24..b0f784c0 100644 --- a/site_ansto/instrument/config/beamline/he3_polanal.sct +++ b/site_ansto/instrument/config/beamline/he3_polanal.sct @@ -16,14 +16,14 @@ driver he3_polanal = { writeable = 1; write_command = 'polariser'; check_function = chkWrite; - allowed = "+,-,Refresh" + allowed = "-1,0,+1" } var amplitude = { } var freq = { units = 'Hertz'; } var phase = { units = 'Degree'; } var time2 = { units = 'Second'; } var field = { units = 'Oersted'; } - var timestamp = { } + var timestamp = { type = int; } } group polariser_start = { conditional = '[string equal -nocase ${has_pol} "true"]'; @@ -34,7 +34,7 @@ driver he3_polanal = { var phase = { units = 'Degree'; } var time2 = { units = 'Second'; } var field = { units = 'Oersted'; } - var timestamp = { } + var timestamp = { type = int; } } group analyser = { @@ -54,7 +54,7 @@ driver he3_polanal = { var phase = { units = 'Degree'; } var time2 = { units = 'Second'; } var field = { units = 'Oersted'; } - var timestamp = { } + var timestamp = { type = int; } } group analyser_start = { conditional = '[string equal -nocase ${has_anal} "true"]'; @@ -65,7 +65,7 @@ driver he3_polanal = { var phase = { units = 'Degree'; } var time2 = { units = 'Second'; } var field = { units = 'Oersted'; } - var timestamp = { } + var timestamp = { type = int; } } code chkWrite = {%% @@ -103,27 +103,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] "minus"]} { - set cmd "${cmd_str} -" - } - if {[string equal -nocase [sct target] "dn"]} { - set cmd "${cmd_str} -" - } - if {[string equal -nocase [sct target] "down"]} { - set cmd "${cmd_str} -" - } if {[sct target] == "-" || [sct target] == -1} { set cmd "${cmd_str} -" } - if {[string equal -nocase [sct target] "plus"]} { - 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} +" } diff --git a/site_ansto/instrument/config/environment/isotech_ps.sct b/site_ansto/instrument/config/environment/isotech_ps.sct index b50e60e7..ea3672f4 100644 --- a/site_ansto/instrument/config/environment/isotech_ps.sct +++ b/site_ansto/instrument/config/environment/isotech_ps.sct @@ -5,7 +5,7 @@ driver isotech_ps = { vendor = isotech; device = ps; protocol = std; class = environment; simulation_group = environment_simulation; - protocol_args = '{terminator "\r"}'; + protocol_args = '{terminator \r}'; group = { readable = 5 mutable = true