diff --git a/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct b/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct index c7eac615..39bb4b70 100644 --- a/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct +++ b/site_ansto/instrument/config/environment/temperature/pfeiffer_hg.sct @@ -30,12 +30,15 @@ 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 = {