Load drivers which have been enabled in the SICS config ini files.

Lakeshore 336 drivers with known IP addresses have been added to the ini files with unique IDs.
All entries in the ini files now have unique IDs
The wombat ini now has radio buttons to select sample stage motor configurations.
This commit is contained in:
Ferdi Franceschini
2014-05-05 12:20:53 +10:00
parent a52835379d
commit d7acb7c16c
13 changed files with 699 additions and 159 deletions

View File

@@ -163,7 +163,7 @@ debug_log "halt $tc_root"
return idle
}
proc mk_sct_eurotherm_et2000 {sct_controller klass tempobj dev_id tol} {
proc mk_sct_eurotherm_et2000 {sct_controller klass tempobj dev_id tol CID CTYPE} {
if {[ catch {
set ns ::scobj::et2000
@@ -185,6 +185,7 @@ debug_log "halt $tc_root"
hsetprop $scobj_hpath/setpoint checklimits ${ns}::check $scobj_hpath
hsetprop $scobj_hpath/setpoint checkstatus ${ns}::drivestatus $scobj_hpath
hsetprop $scobj_hpath/setpoint halt ${ns}::halt $scobj_hpath
hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1
hfactory $scobj_hpath/overtemp_warnlimit plain user float
hsetprop $scobj_hpath/overtemp_warnlimit read ${ns}::getValue $scobj_hpath rdValue "14"
@@ -206,6 +207,7 @@ debug_log "halt $tc_root"
hsetprop $scobj_hpath/sensor/value rdValue ${ns}::rdValue
hsetprop $scobj_hpath/sensor/value oldval UNKNOWN
hsetprop $scobj_hpath/sensor/value units "C"
hsetprop $scobj_hpath/sensor/value permlink data_set ${CTYPE}${CID}S1
hfactory $scobj_hpath/setpoint_slew_rate plain user float
hsetprop $scobj_hpath/setpoint_slew_rate read ${ns}::getValue $scobj_hpath rdValue "35"
@@ -346,14 +348,14 @@ debug_log "halt $tc_root"
# @param IP, the IP address of the device, this can be a hostname, (eg ca5-kowari)
# @param port, the IP protocol port number of the device (502 for modbus)
# @param _tol (optional), this is the initial tolerance setting
proc add_et2000 {name IP port dev_id {_tol 5.0}} {
proc add_et2000 {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/et2000.log" a]
if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port"
makesctcontroller sct_${name} modbus ${IP}:$port
}
puts $fd "mk_sct_eurotherm_et2000 sct_${name} environment $name $dev_id $_tol"
mk_sct_eurotherm_et2000 sct_${name} environment $name $dev_id $_tol
mk_sct_eurotherm_et2000 sct_${name} environment $name $dev_id $_tol $CID $CTYPE
puts $fd "makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler"
makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler
close $fd
@@ -364,6 +366,27 @@ set fd [open "/tmp/et2000.log" w]
puts $fd "file evaluation of sct_eurotherm_2000.tcl"
close $fd
if {[ catch {
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "et2000") } {
if { [ dict get $::secinfo enabled ] } {
set name [dict get $::secinfo name]
set IP [dict get $::secinfo ip]
set PORT [dict get $::secinfo port]
set devid [dict get $::secinfo devid]
set tol [dict get $::secinfo tol]
set cid [dict get $::secinfo id]
set ctype [dict get $::secinfo type]
add_et2000 $name $IP $PORT $devid $tol $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"
}
namespace import ::scobj::et2000::*
#add_et2000 et2000 137.157.201.213 502 1 5