Fix the Pfeiffer/mercury driver

This commit is contained in:
Douglas Clowes
2014-04-24 09:49:00 +10:00
parent 29bee0a057
commit 7e6b5a3a9f

View File

@ -30,11 +30,14 @@ driver pfeiffer_hg = {
code pid_function pid_pressure = {
@ if { [hpropexists [sct] pid_control] } {
@ hsetprop [hgetpropval [sct] pid_control] pid_bias ${pid}
@ if { [hpropexists [hgetpropval [sct] pid_control] target] } {
@ hset [hgetpropval [sct] pid_control] [hgetpropval [hgetpropval [sct] pid_control] target]
@ set co [hgetpropval [sct] pid_control]
@ if { !([hpropexists ${co} pid_bias] && [hgetpropval ${co} pid_bias] == ${pid}) } {
@ hsetprop ${co} pid_bias ${pid}
@ if { [hpropexists ${co} target] } {
@ hset ${co} [hgetpropval ${co} target]
@ } else {
@ hset [hgetpropval [sct] pid_control] [hval [hgetpropval [sct] pid_control]]
@ hset ${co} [hval ${co}]
@ }
@ }
@ }
}
@ -61,6 +64,9 @@ driver pfeiffer_hg = {
code write_function setPoint = {
@ sct pid_control /sample/tc9/Valve/Setpoint
@ sct update [sct target]
@ set cmd "@@NOSEND@@"
@ set nextState "idle"
}
code mkDriver = {