Major revision of the Knauer pump driver
This commit is contained in:
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user