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

View File

@@ -238,7 +238,7 @@ namespace eval ::scobj::lh45 {
return idle
}
proc mk_sct_julabo_lh45 {sct_controller klass tempobj tol} {
proc mk_sct_julabo_lh45 {sct_controller klass tempobj tol CID CTYPE} {
if {[ catch {
set ns ::scobj::lh45
@@ -258,6 +258,7 @@ namespace eval ::scobj::lh45 {
hsetprop $scobj_hpath/setpoint writestatus UNKNOWN
hsetprop $scobj_hpath/setpoint type drivable
hsetprop $scobj_hpath/setpoint setpoint_pending 0
hsetprop $scobj_hpath/setpoint permlink data_set ${CTYPE}${CID}SP1
# Drive adapter interface
hsetprop $scobj_hpath/setpoint checklimits ${ns}::check $scobj_hpath
hsetprop $scobj_hpath/setpoint checkstatus ${ns}::drivestatus $scobj_hpath
@@ -285,6 +286,7 @@ namespace eval ::scobj::lh45 {
hsetprop $scobj_hpath/sensor/value rdValue ${ns}::rdValue "double"
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/sensor/bathtemp plain internal float
hsetprop $scobj_hpath/sensor/bathtemp read ${ns}::getValue rdValue "in_pv_00"
@@ -412,11 +414,11 @@ namespace eval ::scobj::lh45 {
# @param port, the IP protocol port number of the device
# @param sensor (optional), select the 'bath' sensor or an external sensor 'ext'
# @param _tol (optional), this is the initial tolerance setting
proc add_lh45 {name IP port {sensor "bath"} {_tol 5.0}} {
proc add_lh45 { name IP port {sensor "bath"} {_tol 5.0} {CID 1} {CTYPE T} } {
if {[SplitReply [environment_simulation]]=="false"} {
makesctcontroller sct_lh45 std ${IP}:$port "\r"
}
mk_sct_julabo_lh45 sct_lh45 environment $name $_tol
mk_sct_julabo_lh45 sct_lh45 environment $name $_tol $CID $CTYPE
set scobj_hpath /sics/$name
switch $sensor {
"bath" {
@@ -432,4 +434,25 @@ proc add_lh45 {name IP port {sensor "bath"} {_tol 5.0}} {
makesctemon $name /sics/$name/emon/monmode /sics/$name/emon/isintol /sics/$name/emon/errhandler
}
if {[ catch {
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "lh45") } {
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_lh45 $name $IP $PORT $sensor $tol $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"
}
namespace import ::scobj::lh45::*

View File

@@ -1912,31 +1912,23 @@ proc add_sct_ls336 {name IP port terminator {_tol1 1.0} {_tol2 1.0} {CID 1} {CTY
}
if {[ catch {
if { [ info exists ::config_dict ] } {
if { [ dict get $::config_dict ls336_1 enabled ] } {
set IP [dict get $::config_dict ls336_1 ip]
set PORT [dict get $::config_dict ls336_1 port]
set name [dict get $::config_dict ls336_1 name]
set ctype [dict get $::config_dict ls336_1 type]
set cid [dict get $::config_dict ls336_1 id]
set term [dict get $::config_dict ls336_1 terminator]
set tol1 [dict get $::config_dict ls336_1 tol1]
set tol2 [dict get $::config_dict ls336_1 tol2]
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "ls336") } {
if { [ dict get $::secinfo enabled ] } {
set IP [dict get $::secinfo ip]
set PORT [dict get $::secinfo port]
set name [dict get $::secinfo name]
set ctype [dict get $::secinfo type]
set cid [dict get $::secinfo id]
set term [dict get $::secinfo terminator]
set tol1 [dict get $::secinfo tol1]
set tol2 [dict get $::secinfo tol2]
add_sct_ls336 $name $IP $PORT $term $tol1 $tol2 $cid $ctype
}
if { [ dict get $::config_dict ls336_2 enabled ] } {
set IP [dict get $::config_dict ls336_2 ip]
set PORT [dict get $::config_dict ls336_2 port]
set name [dict get $::config_dict ls336_2 name]
set ctype [dict get $::config_dict ls336_2 type]
set cid [dict get $::config_dict ls336_2 id]
set term [dict get $::config_dict ls336_2 terminator]
set tol1 [dict get $::config_dict ls336_2 tol1]
set tol2 [dict get $::config_dict ls336_2 tol2]
add_sct_ls336 $name $IP $PORT $term $tol1 $tol2 $cid $ctype
}
add_sct_ls336 $name $IP $PORT $term $tol1 $tol2 $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"

View File

@@ -2116,31 +2116,23 @@ proc add_sct_ls340 {name IP port terminator {_tol1 1.0} {_tol2 1.0} {CID 1} {CTY
}
if {[ catch {
if { [ info exists ::config_dict ] } {
if { [ dict get $::config_dict ls340_1 enabled ] } {
set IP [dict get $::config_dict ls340_1 ip]
set PORT [dict get $::config_dict ls340_1 port]
set name [dict get $::config_dict ls340_1 name]
set ctype [dict get $::config_dict ls340_1 type]
set cid [dict get $::config_dict ls340_1 id]
set term [dict get $::config_dict ls340_1 terminator]
set tol1 [dict get $::config_dict ls340_1 tol1]
set tol2 [dict get $::config_dict ls340_1 tol2]
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "ls340") } {
if { [ dict get $::secinfo enabled ] } {
set IP [dict get $::secinfo ip]
set PORT [dict get $::secinfo port]
set name [dict get $::secinfo name]
set ctype [dict get $::secinfo type]
set cid [dict get $::secinfo id]
set term [dict get $::secinfo terminator]
set tol1 [dict get $::secinfo tol1]
set tol2 [dict get $::secinfo tol2]
add_sct_ls340 $name $IP $PORT $term $tol1 $tol2 $cid $ctype
}
if { [ dict get $::config_dict ls340_2 enabled ] } {
set IP [dict get $::config_dict ls340_2 ip]
set PORT [dict get $::config_dict ls340_2 port]
set name [dict get $::config_dict ls340_2 name]
set ctype [dict get $::config_dict ls340_2 type]
set cid [dict get $::config_dict ls340_2 id]
set term [dict get $::config_dict ls340_2 terminator]
set tol1 [dict get $::config_dict ls340_2 tol1]
set tol2 [dict get $::config_dict ls340_2 tol2]
add_sct_ls340 $name $IP $PORT $term $tol1 $tol2 $cid $ctype
}
add_sct_ls340 $name $IP $PORT $term $tol1 $tol2 $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"

View File

@@ -399,7 +399,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
return OK
}
proc mk_sct_watlow_pm {sct_controller klass tempobj dev_id tol} {
proc mk_sct_watlow_pm {sct_controller klass tempobj dev_id tol CID CTYPE} {
set catch_status [ catch {
set ns "[namespace current]"
@@ -428,6 +428,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
@@ -520,14 +522,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_pm {name IP port dev_id {_tol 5.0}} {
proc add_watlow_pm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/watlow_pm.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_pm sct_${name} environment $name $dev_id $_tol"
mk_sct_watlow_pm sct_${name} environment $name $dev_id $_tol
mk_sct_watlow_pm 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
@@ -538,7 +540,25 @@ set fd [open "/tmp/watlow_pm.log" w]
puts $fd "file evaluation of sct_watlow_pm.tcl"
close $fd
namespace import ::scobj::watlow_pm::*
if {[ catch {
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "watlow_pm") } {
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_pm $name $IP $PORT $devid $tol $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"
}
#add_watlow_pm watlow_pm 137.157.201.213 502 1 5
#add_watlow_pm watlow_pm localhost 30502 1 5
namespace import ::scobj::watlow_pm::*

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::*

View File

@@ -593,7 +593,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
return OK
}
proc mk_sct_watlow_st {sct_controller klass tempobj dev_id tol} {
proc mk_sct_watlow_st {sct_controller klass tempobj dev_id tol CID CTYPE} {
set catch_status [ catch {
set ns "[namespace current]"
@@ -653,6 +653,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
@@ -761,14 +763,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_st {name IP port dev_id {_tol 5.0}} {
proc add_watlow_st {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/watlow_st.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_st sct_${name} environment $name $dev_id $_tol"
mk_sct_watlow_st sct_${name} environment $name $dev_id $_tol
mk_sct_watlow_st 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
@@ -779,7 +781,25 @@ set fd [open "/tmp/watlow_st.log" w]
puts $fd "file evaluation of sct_watlow_st4.tcl"
close $fd
namespace import ::scobj::watlow_st::*
if {[ catch {
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "watlow_st") } {
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_st $name $IP $PORT $devid $tol $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"
}
#add_watlow_st watlow_st 137.157.201.213 502 1 5
#add_watlow_st watlow_st localhost 30502 1 5
namespace import ::scobj::watlow_st::*