Merge tag 'Taipan_2014-09-19' into Taipan_R31

Deployed to Taipan

Conflicts:
	sics/site_ansto/instrument/tas/config/motors/motor_configuration.tcl
	sics/site_ansto/instrument/tas/taipan_configuration.tcl
This commit is contained in:
Douglas Clowes
2015-04-17 11:36:01 +10:00
8 changed files with 2259 additions and 29 deletions

View File

@ -0,0 +1,332 @@
#
# Template driver for the Knauer BlueShadow Pump 40P
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
#
driver knauer_pump = {
debug_threshold = 0;
vendor = knauer; device = pump40p; protocol = knauer_ap;
class = environment;
simulation_group = environment_simulation;
#
group dummy = {
type = text; readable = 1; data = false; control = false; nxsave = false;
var status = { read_command = 'STATUS?'; read_function = read_status; }
var glp = { read_command = 'GLP?'; read_function = read_glp; }
}
group pump = {
var state = {
type = text;
readable = 1;
read_command = ' ';
fetch_function = state_fetch;
}
var status = {
type = text;
readable = 1;
read_command = ' ';
fetch_function = status_fetch;
}
var volume_pv = {
type = float;
readable = 1;
read_command = ' ';
fetch_function = volume_fetch;
#checkrange_function = volume_reject;
property 'units' = 'mL';
}
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;
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;
writeable = 1; write_command = ' '; write_function = flow_write;
lowerlimit = 0; upperlimit = 10;
property 'units' = 'mL/min';
}
}
group stuff = {
readable = 60;
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 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;
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 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'; }
}
code fetch_from_glp = {%%
set index ${cmd_str}
set data [hgetpropval ${tc_root}/dummy/glp real_data]
set dlist [split ${data} ","]
sct result [lindex ${dlist} ${index}]
set cmd "@@NOSEND@@"
%%}
code fetch_from_status = {%%
set index ${cmd_str}
set data [hgetpropval ${tc_root}/dummy/status real_data]
set dlist [split ${data} ","]
sct result [lindex ${dlist} ${index}]
set cmd "@@NOSEND@@"
%%}
code read_glp = {%%
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"
%%}
code status_fetch = {%%
set index 1
set data [hgetpropval ${tc_root}/dummy/status real_data]
set dlist [split ${data} ","]
set status_code [lindex ${dlist} ${index}]
set cmd "@@NOSEND@@"
if { ${status_code} == 3 } {
sct result "PUMPING"
} else {
sct result "IDLE"
}
%%}
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}]
set cmd "@@NOSEND@@"
if { ${state_code} < 0 || ${state_code} > 9 } {
sct geterror "Invalid device_state ${state_code}"
error "[sct geterror]"
}
set slist [list "SYS_ST_INITIALIZING" \
"SYS_ST_OFF" \
"SYS_ST_IDLE" \
"SYS_ST_RUN" \
"SYS_ST_HOLD" \
"SYS_ST_PURGE" \
"SYS_ST_STANDBY" \
"SYS_ST_FAILED" \
"SYS_ST_RUNATEND" \
]
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 data [hgetpropval ${tc_root}/dummy/status real_data]
set dlist [split ${data} ","]
set flow_pv [lindex ${dlist} 4]
sct result [expr {0.001 * ${flow_pv}}]
set cmd "@@NOSEND@@"
%%}
code flow_write = {%%
set data [sct target]
set cmd "@@NOSEND@@"
set nextState idle
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 ratios_check = {%%
set rlist [split ${setpoint} /]
if { [llength ${rlist}] != 4 } {
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]]
if { ${sum} != 100 } {
sct geterror "sum is ${sum}, must be 100"
error [sct geterror]
}
%%}
code ratios_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 = {%%
set data [sct target]
set cmd "@@NOSEND@@"
set nextState idle
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_fetch = {%%
set data [hgetpropval ${tc_root}/dummy/glp real_data]
set dlist [split ${data} ","]
if { [llength ${dlist}] > 11 } {
set pump_volm [lindex ${dlist} 10]
set pump_voln [lindex ${dlist} 11]
set pump_volume [expr {${pump_volm} + 0.000001 * ${pump_voln}}]
} else {
set pump_volume 0.0
}
sct raw_volume ${pump_volume}
if { [hpropexists [sct] base_volume] } {
set pump_volume [expr {${pump_volume} - [sct base_volume]}]
} else {
sct base_volume [sct raw_volume]
}
sct result ${pump_volume}
set cmd "@@NOSEND@@"
%%}
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
%%}
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 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"
sct send ${cmd}
%%}
code volume_reject = {%%
sct geterror "cannot use hset on [sct]"
error "[sct geterror]"
%%}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,16 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent # vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver lakeshore_m370 = { driver lakeshore_m370 = {
protocol = std protocol = std
sobj_priv_type = 'user float' sobj_priv_type = 'user none'
class = environment class = environment
simulation_group = environment_simulation simulation_group = environment_simulation
add_args = 'id tol' add_args = 'id tol'
make_args = 'id tol' make_args = 'tol'
mkdriver_args = 'id'
code mkDriver = {%% code mkDriver = {%%
::scobj::lakeshore_370::mk_sct_driver $sct_controller environment $name $tol ::scobj::lakeshore_370::mk_sct_driver $sct_controller environment $name $tol
hsetprop ${scobj_hpath}/setpoint permlink data_set T[format "%02d" ${id}]SP01 hsetprop ${scobj_hpath}/Loop1/setpoint permlink data_set T[format "%02d" ${id}]SP01
hsetprop ${scobj_hpath}/setpoint @description T[format "%02d" ${id}]SP01 hsetprop ${scobj_hpath}/Loop1/setpoint @description T[format "%02d" ${id}]SP01
hsetprop ${scobj_hpath}/Sensor/value permlink data_set T[format "%02d" ${id}]S01 hsetprop ${scobj_hpath}/Sensor/value permlink data_set T[format "%02d" ${id}]S01
hsetprop ${scobj_hpath}/Sensor/value @description T[format "%02d" ${id}]S01 hsetprop ${scobj_hpath}/Sensor/value @description T[format "%02d" ${id}]S01
%%} %%}

View File

@ -25,19 +25,37 @@ source $cfPath(hipadaba)/hipadaba_configuration.tcl
fileeval $cfPath(motors)/positmotor_configuration.tcl fileeval $cfPath(motors)/positmotor_configuration.tcl
fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(plc)/plc.tcl
fileeval $cfPath(counter)/counter.tcl fileeval $cfPath(counter)/counter.tcl
#TODO Provide method for choosing environment controller fileeval $cfPath(environment)/sct_agilent_33220A.tcl
fileeval $cfPath(environment)/sct_hiden_xcs.tcl
fileeval $cfPath(environment)/sct_huber_pilot.tcl
fileeval $cfPath(environment)/sct_isotech_ps.tcl
fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.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_2700.tcl
fileeval $cfPath(environment)/magneticField/sct_green_magnet.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/west400.tcl
fileeval $cfPath(environment)/temperature/sct_west4100.tcl
fileeval $cfPath(environment)/temperature/sct_watlow_pm.tcl
fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl
fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl
fileeval $cfPath(environment)/sct_keithley_2700.tcl fileeval $cfPath(environment)/he3/sct_he3.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl fileeval $cfPath(environment)/magneticField/sct_green_magnet.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl fileeval $cfPath(environment)/magneticField/sct_green_magnet_labview.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
fileeval $cfPath(environment)/temperature/sct_mercury_scpi.tcl
fileeval $cfPath(environment)/temperature/west400.tcl
fileeval $cfPath(environment)/temperature/sct_watlow_pm.tcl
fileeval $cfPath(hmm)/hmm_configuration.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl
fileeval $cfPath(nexus)/nxscripts.tcl fileeval $cfPath(nexus)/nxscripts.tcl
fileeval $cfPath(scan)/scan.tcl fileeval $cfPath(scan)/scan.tcl

View File

@ -246,6 +246,14 @@ terminator = \r\n
tol1 = 1.0 tol1 = 1.0
tol2 = 1.0 tol2 = 1.0
[ls370_1]
desc = "Lakeshore 370 Resistance Bridge"
driver = "lakeshore_m370"
imptype = temperature
ip = 10.157.205.42
port = 4001
tol = 1.0
[mercury_scpi_01] [mercury_scpi_01]
desc = "Oxford Mercury temperature controller in Mercury mode" desc = "Oxford Mercury temperature controller in Mercury mode"
driver = "mercury_scpi" driver = "mercury_scpi"

View File

@ -418,7 +418,7 @@ publish set_data_record user
MakeAsyncProtocol std 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 # Main process call to create the driver
::scobj::hv::mkHV { ::scobj::hv::mkHV {
name "hv" name "hv"
@ -427,9 +427,3 @@ MakeAsyncQueue hvport std 10.157.205.10 4001
tuning 1 tuning 1
interval 5 interval 5
} }

View File

@ -479,7 +479,7 @@ Motor mhfocus $motor_driver_type [params \
maxSpeed 3.6\ maxSpeed 3.6\
maxAccel 1.728\ maxAccel 1.728\
maxDecel 1.728\ maxDecel 1.728\
stepsPerX [expr 25000.0 * 50.0 / 360.0]\ stepsPerX [expr -25000.0 * 50.0 / 360.0]\
absEnc 1\ absEnc 1\
bias_bits 12\ bias_bits 12\
bias_bias 1300\ bias_bias 1300\

16
tasub.c
View File

@ -370,14 +370,14 @@ int TasUBFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
/* /*
curvature motors may be missing, anything else is a serious problem curvature motors may be missing, anything else is a serious problem
*/ */
status += testMotor(pNew, pCon, "a1", A1); status += testMotor(pNew, pCon, pNew->motname[A1], A1);
status += testMotor(pNew, pCon, "a2", A2); status += testMotor(pNew, pCon, pNew->motname[A2], A2);
status += testMotor(pNew, pCon, "a3", A3); status += testMotor(pNew, pCon, pNew->motname[A3], A3);
status += testMotor(pNew, pCon, "a4", A4); status += testMotor(pNew, pCon, pNew->motname[A4], A4);
status += testMotor(pNew, pCon, "sgu", SGU); status += testMotor(pNew, pCon, pNew->motname[SGU], SGU);
status += testMotor(pNew, pCon, "sgl", SGL); status += testMotor(pNew, pCon, pNew->motname[SGL], SGL);
status += testMotor(pNew, pCon, "a5", A5); status += testMotor(pNew, pCon, pNew->motname[A5], A5);
status += testMotor(pNew, pCon, "a6", A6); status += testMotor(pNew, pCon, pNew->motname[A6], A6);
if (status != 8) { if (status != 8) {
SCWrite(pCon, "ERROR: a required motor is missing, tasub NOT installed", SCWrite(pCon, "ERROR: a required motor is missing, tasub NOT installed",
eError); eError);