53 lines
1.8 KiB
Tcl
53 lines
1.8 KiB
Tcl
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
|
|
|
namespace eval ::environment::temperature { }
|
|
|
|
# @brief Make a simulated temperature controller object.
|
|
#
|
|
# @param temp_sobj, name for temperature controller object.
|
|
proc ::environment::temperature::mkwest400sim {temp_sobj} {
|
|
EvFactory new $temp_sobj sim
|
|
sicslist setatt $temp_sobj numsensors 1
|
|
sicslist setatt $temp_sobj controlsensor sensora
|
|
sicslist setatt $temp_sobj sensorlist sensora
|
|
sicslist setatt $temp_sobj units kelvin
|
|
sicslist setatt $temp_sobj klass @none
|
|
}
|
|
|
|
#WEST4100 tempcontroller creation
|
|
proc ::environment::temperature::mkwest400 {temp_sobj IP ID} {
|
|
MakeRS232Controller sertemp $IP 502
|
|
sertemp timeout 300
|
|
sertemp sendterminator 0x0
|
|
sertemp replyterminator 0x0
|
|
#ffr 2014-09-22: The modbus addr should be 1 for single port moxas (Not $ID which is a SICS ID)
|
|
# EvFactory new tc1 west4100 sertemp $ID 2
|
|
EvFactory new $temp_sobj west4100 sertemp 1 2
|
|
|
|
sicslist setatt $temp_sobj units kelvin
|
|
sicslist setatt $temp_sobj klass @none
|
|
}
|
|
|
|
# @brief Adds a west400 temperature controller object.
|
|
#
|
|
# This must be called when the instrument configuration is loaded and before\n
|
|
# the buildHDB function is called. Currently there is no way to add and remove\n
|
|
# environment controllers and their hdb paths at runtime.
|
|
proc ::environment::temperature::add_west4100 {IP ID} {
|
|
set sim_mode [SplitReply [environment_simulation]]
|
|
if {$sim_mode == "true"} {
|
|
::environment::temperature::mkwest400sim tc1
|
|
} else {
|
|
::environment::temperature::mkwest400 tc1 $IP $ID
|
|
tc1 Upperlimit 1500
|
|
tc1 Lowerlimit 0
|
|
tc1 tolerance 10
|
|
}
|
|
|
|
sicslist setatt tc1 environment_name tc1
|
|
sicslist setatt tc1 long_name control_sensor_reading
|
|
::environment::mkenvinfo tc1 {ramprate {priv user} powerlimit {priv manager} }
|
|
#::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager} }
|
|
|
|
}
|