Add the huber bath Pilot ONE driver

This commit is contained in:
Douglas Clowes
2014-06-17 14:02:05 +10:00
parent 27ed29aea5
commit ed7c371080
3 changed files with 455 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
# Simple driver generator for the Huber Pilot ONE Temperature Controller
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent
#
driver huber_pilot = {
debug_threshold = 1;
vendor = Huber; device = 'Pilot ONE'; protocol = std;
class = environment;
simulation_group = environment_simulation;
group Loop1 = {
priv = user;
readable = 1;
var sensor = {
type = float;
read_command = '01';
permlink = 'T.S01';
}
var setpoint = {
type = float;
read_command = '00';
writeable = 1;
write_command = '00';
driveable = Loop1/sensor
lowerlimit = -25.0; upperlimit = 30.0;
tolerance = 0.5; property settle_time = 10;
permlink = 'T.SP01';
}
}
code getValue = {%%
set cmd "\{M${cmd_str}****"
%%}
code rdValue = {%%
if {[string length ${data}] < 8} {
sct geterror "rdValue short response ${data}"
} elseif { ![string equal -nocase [string range ${data} 1 2] "S0"] } {
sct geterror "rdValue syntax error ${data}"
} else {
set resp [scan [string range ${data} 4 end] "%x" val]
if { ${resp} < 1 } {
sct geterror "rdValue scan error ${data}"
} else {
if { ${val} >= 0x8000 } {
set val [expr ${val} - 0x10000]
}
set data [expr 0.01 * ${val}]
if { ${data} <= -151.00 } {
sct geterror "rdValue value error ${data}"
}
}
}
%%}
code setValue = {%%
set param [expr { round(100.0 * [sct target]) }]
set param [string range [format "%04X" ${param}] end-3 end]
set cmd "\{M${cmd_str}${param}"
%%}
}