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

@@ -407,7 +407,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
return OK
}
proc mk_sct_watlow_rm {sct_controller klass tempobj dev_id tol} {
proc mk_sct_watlow_rm {sct_controller klass tempobj dev_id tol CID CTYPE} {
set catch_status [ catch {
set ns "[namespace current]"
@@ -457,6 +457,8 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
hsetprop $scobj_hpath/sensor/value lowerlimit 0
hsetprop $scobj_hpath/sensor/value upperlimit 500
hsetprop $scobj_hpath/sensor/value units "C"
hsetprop $scobj_hpath/sensor/value permlink data_set ${CTYPE}${CID}S1
hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1
hfactory $scobj_hpath/apply_tolerance plain user int
hsetprop $scobj_hpath/apply_tolerance values 0,1
@@ -550,14 +552,14 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
# @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_watlow_rm {name IP port dev_id {_tol 5.0}} {
proc add_watlow_rm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/watlow_rm.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_watlow_rm sct_${name} environment $name $dev_id $_tol"
mk_sct_watlow_rm sct_${name} environment $name $dev_id $_tol
mk_sct_watlow_rm 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
@@ -568,7 +570,25 @@ set fd [open "/tmp/watlow_rm.log" w]
puts $fd "file evaluation of sct_watlow_rm.tcl"
close $fd
namespace import ::scobj::watlow_rm::*
if {[ catch {
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "watlow_rm") } {
if { [ dict get $::secinfo enabled ] } {
set name [dict get $::secinfo name]
set IP [dict get $::secinfo ip]
set PORT [dict get $::secinfo port]
set sensor [dict get $::secinfo sensor]
set tol [dict get $::secinfo tol]
set cid [dict get $::secinfo id]
set ctype [dict get $::secinfo type]
add_watlow_rm $name $IP $PORT $devid $tol $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"
}
#add_watlow_rm watlow_rm 137.157.201.213 502 1 5
#add_watlow_rm watlow_rm localhost 30502 1 5
namespace import ::scobj::watlow_rm::*