34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
|
|
driver mercury_valve = {
|
|
vendor = oxford; device = mercury; protocol = std;
|
|
class = environment; simulation_group = environment_simulation;
|
|
add_args = '{id 99} {valve_tol 2}'
|
|
make_args = 'id valve_tol'
|
|
|
|
group Valve = {
|
|
priv = user; type = float;
|
|
var sensor = {
|
|
readable = 5;
|
|
read_command = 'READ:DEV:DB4.G1:AUX:SIG:OPEN';
|
|
permlink = 'G.S07';
|
|
}
|
|
var setpoint = {
|
|
driveable = Valve/sensor; lowerlimit = 0; upperlimit = 100; tolerance = '${valve_tol}'; property settle_time = 30;
|
|
writeable = 1; write_function = setValve; write_command = 'SET:DEV:DB4.G1:AUX:SIG:OPEN:';
|
|
permlink = 'G.SP07';
|
|
}
|
|
}
|
|
|
|
code read_function rdValue = {
|
|
@ scan [lindex [split "$data" ":"] end] "%g" data
|
|
}
|
|
|
|
code Write_function setValve = {
|
|
@ if { [hpropexists [sct] pid_bias] } {
|
|
@ set par [expr ${par} + [hgetpropval [sct] pid_bias]]
|
|
@ set cmd "${cmd_str}${par}"
|
|
@ }
|
|
@ sct update [sct target]
|
|
}
|
|
}
|