102 lines
2.6 KiB
Plaintext
102 lines
2.6 KiB
Plaintext
# 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;
|
|
type = float;
|
|
readable = 1;
|
|
mutable = true;
|
|
var setpoint = {
|
|
read_command = '00';
|
|
read_function = rdTemp;
|
|
writeable = 1;
|
|
write_command = '00';
|
|
driveable = Loop1/sensor_int;
|
|
lowerlimit = 5.0; upperlimit = 30.0; tolerance = 0.5;
|
|
property settle_time = 10;
|
|
permlink = 'T.SP01';
|
|
}
|
|
var sensor_int = {
|
|
read_command = '01';
|
|
read_function = rdTemp;
|
|
permlink = 'T.S01';
|
|
}
|
|
var vTE = {
|
|
read_command = '07';
|
|
read_function = rdTemp;
|
|
permlink = 'T.S07';
|
|
}
|
|
var vTmpMode = {
|
|
type = int;
|
|
read_command = '13';
|
|
read_function = rdStatus;
|
|
}
|
|
var vTmpActive = {
|
|
type = int;
|
|
read_command = '14';
|
|
read_function = rdStatus;
|
|
}
|
|
var vMinSP = {
|
|
read_command = '30';
|
|
read_function = rdTemp;
|
|
}
|
|
var vMaxSP = {
|
|
read_command = '31';
|
|
read_function = rdTemp;
|
|
}
|
|
}
|
|
|
|
code getValue = {%%
|
|
set cmd "M${cmd_str}****"
|
|
%%}
|
|
|
|
code rdStatus = {%%
|
|
if {[string length ${data}] < 7} {
|
|
sct geterror "rdValue short response ${data}"
|
|
} elseif { ![string equal -nocase [string range ${data} 0 0] "S"] } {
|
|
sct geterror "rdValue syntax error ${data}"
|
|
} else {
|
|
set resp [scan [string range ${data} 3 end] "%x" val]
|
|
if { ${resp} < 1 } {
|
|
sct geterror "rdValue scan error ${data}"
|
|
} else {
|
|
set data ${val}
|
|
}
|
|
}
|
|
%%}
|
|
|
|
code rdTemp = {%%
|
|
if {[string length ${data}] < 7} {
|
|
sct geterror "rdValue short response ${data}"
|
|
} elseif { ![string equal -nocase [string range ${data} 0 0] "S"] } {
|
|
sct geterror "rdValue syntax error ${data}"
|
|
} else {
|
|
set resp [scan [string range ${data} 3 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}"
|
|
%%}
|
|
|
|
}
|