Files
sics/site_ansto/instrument/config/environment/temperature/eurotherm_3200.sct
2014-11-06 12:35:21 +11:00

58 lines
2.1 KiB
Plaintext

# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver eurotherm_3200 = {
protocol = modbus_ap;
class = environment;
simulation_group = environment_simulation;
add_args = 'id datype dev_id tol';
make_args = 'id datype dev_id tol';
group util = {
data = false; control = false; nxsave = false; mutable = false;
var unit = { type = int; value = '${dev_id}'; }
var mode = { type = text; allowed = "int,float"; value = 'int'; }
}
group loop1 = {
readable = 1;
type = float;
var sensor = { read_command = '1'; permlink = 'T.S01'; };
writeable = 1;
var setpoint = { read_command = '2'; write_command = '2'; permlink = 'T.SP01';
driveable = loop1/sensor; lowerlimit = 0; upperlimit =40; tolerance = '${tol}';
};
}
group loop1_extra = {
readable = 1;
type = float;
data = false; control = false; nxsave = false; mutable = false;
var manual_output = { read_command = '3'; }
var working_output = { read_command = '4'; }
var working_setpoint = { read_command = '5'; }
var active_setpoint = { read_command = '15'; }
writeable = 1;
var alarm1_thresh = { read_command = '13'; write_command = '13'; }
var alarm2_thresh = { read_command = '14'; write_command = '14'; }
var power_limit_high = { read_command = '30'; write_command = '30'; }
var power_limit_low = { read_command = '31'; write_command = '31'; }
var setpoint_slew_rate = { read_command = '35'; write_command = '35'; }
var power_slew_rate = { read_command = '37'; write_command = '37'; }
}
code getValue = {
@TCL
if { [string equal -nocase [hval ${tc_root}/util/mode] "float"] } {
set cmd "[hval ${tc_root}/util/unit]:3:[expr {32768+2*${cmd_str}}]:1:F32"
} else {
set cmd "[hval ${tc_root}/util/unit]:3:${cmd_str}:1:U16"
}
@END
}
code setValue = {
@TCL
if { [string equal -nocase [hval ${tc_root}/util/mode] "float"] } {
set cmd "[hval ${tc_root}/util/unit]:16:[expr {32768+2*${cmd_str}}]:1:F32:${par}"
} else {
set cmd "[hval ${tc_root}/util/unit]:16:${cmd_str}:1:U16:${par}"
}
@END
}
}