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,12 +30,15 @@ driver pfeiffer_hg = {
code pid_function pid_pressure = { code pid_function pid_pressure = {
@ if { [hpropexists [sct] pid_control] } { @ if { [hpropexists [sct] pid_control] } {
@ hsetprop [hgetpropval [sct] pid_control] pid_bias ${pid} @ set co [hgetpropval [sct] pid_control]
@ if { [hpropexists [hgetpropval [sct] pid_control] target] } { @ if { !([hpropexists ${co} pid_bias] && [hgetpropval ${co} pid_bias] == ${pid}) } {
@ hset [hgetpropval [sct] pid_control] [hgetpropval [hgetpropval [sct] pid_control] target] @ hsetprop ${co} pid_bias ${pid}
@ if { [hpropexists ${co} target] } {
@ hset ${co} [hgetpropval ${co} target]
@ } else { @ } 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 = { code write_function setPoint = {
@ sct pid_control /sample/tc9/Valve/Setpoint @ sct pid_control /sample/tc9/Valve/Setpoint
@ sct update [sct target]
@ set cmd "@@NOSEND@@"
@ set nextState "idle"
} }
code mkDriver = { code mkDriver = {