Add some more read-only fields to the huber

This commit is contained in:
Douglas Clowes
2014-06-17 17:17:41 +10:00
parent 171342c97e
commit bcb28e68c1
2 changed files with 182 additions and 32 deletions

View File

@@ -12,29 +12,69 @@ driver huber_pilot = {
type = float;
readable = 1;
mutable = true;
var sensor = {
read_command = '01';
permlink = 'T.S01';
}
var setpoint = {
read_command = '00';
read_function = rdTemp;
writeable = 1;
write_command = '00';
driveable = Loop1/sensor;
lowerlimit = 5.0; upperlimit = 30.0;
tolerance = 0.5; property settle_time = 10;
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 rdValue = {%%
code rdStatus = {%%
if {[string length ${data}] < 8} {
sct geterror "rdValue short response ${data}"
} elseif { ![string equal -nocase [string range ${data} 1 2] "S0"] } {
} elseif { ![string equal -nocase [string range ${data} 1 1] "S"] } {
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 {
set data ${val}
}
}
%%}
code rdTemp = {%%
if {[string length ${data}] < 8} {
sct geterror "rdValue short response ${data}"
} elseif { ![string equal -nocase [string range ${data} 1 1] "S"] } {
sct geterror "rdValue syntax error ${data}"
} else {
set resp [scan [string range ${data} 4 end] "%x" val]