Merged in-situ modifications for Release 2.5 candidate 5
r2895 | ffr | 2010-04-29 16:02:15 +1000 (Thu, 29 Apr 2010) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
a2ca46ab67
commit
e6e3c3be52
@@ -3,6 +3,8 @@
|
|||||||
# MakeSICSObj $obj SCT_<class>
|
# MakeSICSObj $obj SCT_<class>
|
||||||
# The MakeSICSObj cmd adds a /sics/$obj node. NOTE the /sics node is not browsable.
|
# The MakeSICSObj cmd adds a /sics/$obj node. NOTE the /sics node is not browsable.
|
||||||
|
|
||||||
|
#include <tcl.h>
|
||||||
|
|
||||||
##
|
##
|
||||||
# /*--------------------------------------------------------------------------
|
# /*--------------------------------------------------------------------------
|
||||||
# B R U K E R B - E C 1 D R I V E R
|
# B R U K E R B - E C 1 D R I V E R
|
||||||
@@ -19,6 +21,11 @@
|
|||||||
# ----------------------------------------------------------------------------*/
|
# ----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
|
# Uses the astvelsel protocol handler (from ./site_ansto/hardsup/sct_velselprot.c)
|
||||||
|
# instead of the standard script context handler. This is necessary because replies
|
||||||
|
# from the device have no terminator while queries to the device need a line terminator
|
||||||
|
# (CR 0x0D). am2010-04-07
|
||||||
|
#
|
||||||
# Hdb nodes which report data readings should have a "get" script attached to the
|
# Hdb nodes which report data readings should have a "get" script attached to the
|
||||||
# "read" property of the node. This ensures that we can update the reading on demand
|
# "read" property of the node. This ensures that we can update the reading on demand
|
||||||
# which is necessary for logging data.
|
# which is necessary for logging data.
|
||||||
@@ -35,7 +42,7 @@
|
|||||||
|
|
||||||
# Bugs, limitations, changes:
|
# Bugs, limitations, changes:
|
||||||
# - checks whether the reply from the device matches the query - if not, it discards the reply.
|
# - checks whether the reply from the device matches the query - if not, it discards the reply.
|
||||||
# - added LSB_Err byte 1 interpretation (water failure). Added help notes
|
# - added lsb_err byte 1 interpretation (water failure). Added help notes
|
||||||
# for the user for the status byte text nodes.
|
# for the user for the status byte text nodes.
|
||||||
# - MAJOR PROBLEM: Although the driver seems to be doing just about everything
|
# - MAJOR PROBLEM: Although the driver seems to be doing just about everything
|
||||||
# right, the BEC1 device shuts itself off (changes to DCpower=0) and goes
|
# right, the BEC1 device shuts itself off (changes to DCpower=0) and goes
|
||||||
@@ -56,7 +63,8 @@
|
|||||||
# - proc drivestatus now sets a retval variable that is returned. Default
|
# - proc drivestatus now sets a retval variable that is returned. Default
|
||||||
# action for drivable when paused is lazy instead of pause to avoid
|
# action for drivable when paused is lazy instead of pause to avoid
|
||||||
# stopping the histogram server.
|
# stopping the histogram server.
|
||||||
|
# - source code syntax checked with nagelfar - removed a couple of potential
|
||||||
|
# problems, 20100121
|
||||||
##
|
##
|
||||||
# @brief Handle exceptions caught by a 'catch' command.
|
# @brief Handle exceptions caught by a 'catch' command.
|
||||||
# Note: You must use 'error' not 'return -code error' to
|
# Note: You must use 'error' not 'return -code error' to
|
||||||
@@ -104,7 +112,8 @@ namespace eval ::scobj::bruker_BEC1 {
|
|||||||
# if necessary. If commands come in too fast, the DCpower may switch itself off.
|
# if necessary. If commands come in too fast, the DCpower may switch itself off.
|
||||||
set bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS 50
|
set bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS 50
|
||||||
# set a start value for the time of the last command send to or read from the device
|
# set a start value for the time of the last command send to or read from the device
|
||||||
set bruker_BEC1_timeLastCommand [clock clicks -milliseconds]
|
#set bruker_BEC1_timeLastCommand 0
|
||||||
|
#set bruker_BEC1_timeLastCommand [clock clicks -milliseconds]
|
||||||
|
|
||||||
# Some global variables that are useful as default initilisation values or for tracking
|
# Some global variables that are useful as default initilisation values or for tracking
|
||||||
# Name of the scriptcontext object created from calling this driver - an instrument may use more than one
|
# Name of the scriptcontext object created from calling this driver - an instrument may use more than one
|
||||||
@@ -203,19 +212,13 @@ proc bruker_BEC1_init {sct_controller tc_root} {
|
|||||||
# @param idx indicates which control loop or which input channel
|
# @param idx indicates which control loop or which input channel
|
||||||
# the command belongs to
|
# the command belongs to
|
||||||
# @return nextState The next function to call after this one (typically 'rdValue')
|
# @return nextState The next function to call after this one (typically 'rdValue')
|
||||||
|
|
||||||
proc getValue {tc_root nextState cmd expectedLen} {
|
proc getValue {tc_root nextState cmd expectedLen} {
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd "$cmd"
|
set ::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd "$cmd"
|
||||||
set tNow [clock clicks -milliseconds]
|
after $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS
|
||||||
#set diff1 [expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand]
|
|
||||||
while {[expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand] < $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS} {
|
|
||||||
set tNow [clock clicks -milliseconds]
|
|
||||||
}
|
|
||||||
#set diff2 [expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand]
|
|
||||||
sct send $cmd
|
sct send $cmd
|
||||||
# puts "sct send !$cmd!"
|
# puts "sct send !$cmd!"
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand $tNow
|
|
||||||
#puts "diff1:$diff1, diff2:$diff2 $cmd"
|
|
||||||
return $nextState
|
return $nextState
|
||||||
} message ]
|
} message ]
|
||||||
handle_exception $catch_status $message "in getValue(). Last query command: $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd"
|
handle_exception $catch_status $message "in getValue(). Last query command: $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd"
|
||||||
@@ -297,7 +300,7 @@ proc getValue {tc_root nextState cmd expectedLen} {
|
|||||||
set data [ExtractValue $orgdata $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd]
|
set data [ExtractValue $orgdata $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd]
|
||||||
#puts "rdValue: Interpreting status byte information: $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd"
|
#puts "rdValue: Interpreting status byte information: $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd"
|
||||||
#pwrCtrl EthernetAddrHex 1 0 1 0 text spy {ETH/} {rdValue} {} {setValue} {}\
|
#pwrCtrl EthernetAddrHex 1 0 1 0 text spy {ETH/} {rdValue} {} {setValue} {}\
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrCtrl/EthernetAddrDec "UNKNOWN"
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrctrl/EthernetAddrDec "UNKNOWN"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -314,7 +317,7 @@ proc getValue {tc_root nextState cmd expectedLen} {
|
|||||||
|
|
||||||
##
|
##
|
||||||
# @brief Does what rdValue() does plus it checks if the current is in tolerance.
|
# @brief Does what rdValue() does plus it checks if the current is in tolerance.
|
||||||
# inTolerance is the default nextState after getValue() for read node pwrCtrl/DC_power.
|
# inTolerance is the default nextState after getValue() for read node pwrctrl/dc_power.
|
||||||
# If the device is switched off, current is reported to be in tolerance so that
|
# If the device is switched off, current is reported to be in tolerance so that
|
||||||
# slow return to ambient conditions can be carried out
|
# slow return to ambient conditions can be carried out
|
||||||
# @return idle Always returns system state idle - command sequence completed.
|
# @return idle Always returns system state idle - command sequence completed.
|
||||||
@@ -328,8 +331,8 @@ proc inTolerance {expectedLength} {
|
|||||||
return idle
|
return idle
|
||||||
}
|
}
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
set oldval [sct oldval]
|
set oldvalue [sct oldval]
|
||||||
# puts "inTolerance(): data=$data oldval=$oldval"
|
# puts "inTolerance(): data=$data oldval=$oldvalue"
|
||||||
switch -glob -- $data {
|
switch -glob -- $data {
|
||||||
"ASCERR:*" {
|
"ASCERR:*" {
|
||||||
puts "ASCERR in inTolerance: Last query command: $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd"
|
puts "ASCERR in inTolerance: Last query command: $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd"
|
||||||
@@ -345,8 +348,8 @@ proc inTolerance {expectedLength} {
|
|||||||
return idle
|
return idle
|
||||||
}
|
}
|
||||||
set data [ExtractValue $data $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd]
|
set data [ExtractValue $data $::scobj::bruker_BEC1::bruker_BEC1_lastQueryCmd]
|
||||||
if {$data != $oldval} {
|
if {$data != $oldvalue} {
|
||||||
if {$oldval == "UNKNOWN"} {
|
if {$oldvalue == "UNKNOWN"} {
|
||||||
sct utime timecheck
|
sct utime timecheck
|
||||||
}
|
}
|
||||||
sct oldval $data
|
sct oldval $data
|
||||||
@@ -360,27 +363,27 @@ proc inTolerance {expectedLength} {
|
|||||||
# is within tolerance of the corresponding setpoint
|
# is within tolerance of the corresponding setpoint
|
||||||
if {$data == 0 } {
|
if {$data == 0 } {
|
||||||
# DC power switched off
|
# DC power switched off
|
||||||
hset $tc_root/emon/monMode "idle"
|
hset $tc_root/emon/mon_mode "idle"
|
||||||
hset $tc_root/emon/isInTolerance "inTolerance"
|
hset $tc_root/emon/is_in_tolerance "inTolerance"
|
||||||
hset $tc_root/status "idle"
|
hset $tc_root/status "idle"
|
||||||
} else {
|
} else {
|
||||||
set intol [checktol $tc_root]
|
set intol [checktol $tc_root]
|
||||||
if {$intol==0} { sct utime timecheck }
|
if {$intol==0} { sct utime timecheck }
|
||||||
set nodename $tc_root/sensor/NominalOutpCurrent
|
set nodename $tc_root/sensor/nominal_outp_current
|
||||||
set setpt [hval $nodename]
|
set setpt [hval $nodename]
|
||||||
set nodename $tc_root/sensor/DesiredCurrent
|
set nodename $tc_root/sensor/desired_current
|
||||||
set NominalOutpCurrent [hval $nodename]
|
set nominal_outp_current [hval $nodename]
|
||||||
# puts "inTolerance(): comparing sensor/setpoint=$setpt with actual sensorValue=$temp"
|
# puts "inTolerance(): comparing sensor/setpoint=$setpt with actual sensorValue=$temp"
|
||||||
set diff [expr abs($setpt - $NominalOutpCurrent)]
|
set diff [expr {abs($setpt - $NominalOutpCurrent)}]
|
||||||
if {$diff > $::scobj::bruker_BEC1::bruker_BEC1_driveTolerance} {
|
if {$diff > $::scobj::bruker_BEC1::bruker_BEC1_driveTolerance} {
|
||||||
# ERROR: node /sics/ma1/emon/monMode not found. Last query command: DCP/
|
# ERROR: node /sics/ma1/emon/mon_mode not found. Last query command: DCP/
|
||||||
set nodename $tc_root/emon/monMode
|
set nodename $tc_root/emon/mon_mode
|
||||||
hset $nodename "drive"
|
hset $nodename "drive"
|
||||||
hset $tc_root/status "busy"
|
hset $tc_root/status "busy"
|
||||||
} else {
|
} else {
|
||||||
set nodename $tc_root/sensor/NominalOutpCurrent
|
set nodename $tc_root/sensor/nominal_outp_current
|
||||||
hsetprop $nodename driving 0
|
hsetprop $nodename driving 0
|
||||||
set nodename $tc_root/emon/monMode
|
set nodename $tc_root/emon/mon_mode
|
||||||
hset $nodename "monitor"
|
hset $nodename "monitor"
|
||||||
hset $tc_root/status "idle"
|
hset $tc_root/status "idle"
|
||||||
}
|
}
|
||||||
@@ -407,18 +410,14 @@ proc setValue {tc_root nextState cmd } {
|
|||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
set par [sct target]
|
set par [sct target]
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd "$cmd$par"
|
set ::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd "$cmd$par"
|
||||||
set tNow [clock clicks -milliseconds]
|
after $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS
|
||||||
while {[expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand] < $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS} {
|
|
||||||
set tNow [clock clicks -milliseconds]
|
|
||||||
}
|
|
||||||
sct send "$cmd$par"
|
sct send "$cmd$par"
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand $tNow
|
|
||||||
if { 0 == [string compare -length 4 $cmd "RST=0"] } {
|
if { 0 == [string compare -length 4 $cmd "RST=0"] } {
|
||||||
# Reset error messages - also update the node displaying the last error
|
# Reset error messages - also update the node displaying the last error
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "none"
|
set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "none"
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_errMsg2 "none"
|
set ::scobj::bruker_BEC1::bruker_BEC1_errMsg2 "none"
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/lastErrorMsg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/lastErrorMsg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2
|
||||||
}
|
}
|
||||||
return $nextState
|
return $nextState
|
||||||
} message ]
|
} message ]
|
||||||
@@ -456,11 +455,7 @@ proc setDesiredField {tc_root nextState cmd} {
|
|||||||
hsetprop $nodename driving 1
|
hsetprop $nodename driving 1
|
||||||
}
|
}
|
||||||
#puts "setDesiredField(wrStatus=$wrStatus): sct send $cmd$par"
|
#puts "setDesiredField(wrStatus=$wrStatus): sct send $cmd$par"
|
||||||
set tNow [clock clicks -milliseconds]
|
after $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS
|
||||||
#set diff1 [expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand]
|
|
||||||
while {[expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand] < $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS} {
|
|
||||||
set tNow [clock clicks -milliseconds]
|
|
||||||
}
|
|
||||||
sct send "$cmd$par"
|
sct send "$cmd$par"
|
||||||
return $nextState
|
return $nextState
|
||||||
} message ]
|
} message ]
|
||||||
@@ -485,17 +480,12 @@ proc setDesiredCurrent {tc_root nextState cmd} {
|
|||||||
if {$wrStatus == "start"} {
|
if {$wrStatus == "start"} {
|
||||||
# Called by drive adapter
|
# Called by drive adapter
|
||||||
# puts "setDesiredCurrent(): driving set to 1"
|
# puts "setDesiredCurrent(): driving set to 1"
|
||||||
set nodename $tc_root/sensor/NominalOutpCurrent
|
set nodename $tc_root/sensor/nominal_outp_current
|
||||||
hsetprop $nodename driving 1
|
hsetprop $nodename driving 1
|
||||||
}
|
}
|
||||||
#puts "setDesiredCurrent(wrStatus=$wrStatus): sct send $cmd$par"
|
#puts "setDesiredCurrent(wrStatus=$wrStatus): sct send $cmd$par"
|
||||||
set tNow [clock clicks -milliseconds]
|
after $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS
|
||||||
#set diff1 [expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand]
|
|
||||||
while {[expr $tNow - $::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand] < $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS} {
|
|
||||||
set tNow [clock clicks -milliseconds]
|
|
||||||
}
|
|
||||||
sct send "$cmd$par"
|
sct send "$cmd$par"
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_timeLastCommand $tNow
|
|
||||||
return $nextState
|
return $nextState
|
||||||
} message ]
|
} message ]
|
||||||
handle_exception $catch_status $message "in setDesiredCurrent(). Last write command: $::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd"
|
handle_exception $catch_status $message "in setDesiredCurrent(). Last write command: $::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd"
|
||||||
@@ -512,7 +502,7 @@ proc setDesiredCurrent {tc_root nextState cmd} {
|
|||||||
proc drivestatus {tc_root} {
|
proc drivestatus {tc_root} {
|
||||||
# broadcast "DEBUG: in drivestatus. Last write command: $::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd"
|
# broadcast "DEBUG: in drivestatus. Last write command: $::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd"
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
if [sct driving] {
|
if {[sct driving]} {
|
||||||
set retval busy
|
set retval busy
|
||||||
} else {
|
} else {
|
||||||
set retval idle
|
set retval idle
|
||||||
@@ -529,8 +519,8 @@ proc drivestatus {tc_root} {
|
|||||||
# @return idle Indicates that the device is ready for the next command
|
# @return idle Indicates that the device is ready for the next command
|
||||||
proc halt {tc_root} {
|
proc halt {tc_root} {
|
||||||
# stop driving at current field strength or current
|
# stop driving at current field strength or current
|
||||||
set sensorValue $tc_root/sensor/DesiredCurrent
|
set sensorValue $tc_root/sensor/desired_current
|
||||||
set nodename $tc_root/sensor/NominalOutpCurrent
|
set nodename $tc_root/sensor/nominal_outp_current
|
||||||
hset $nodename [hval $sensorValue]
|
hset $nodename [hval $sensorValue]
|
||||||
hsetprop $nodename driving 0
|
hsetprop $nodename driving 0
|
||||||
return idle
|
return idle
|
||||||
@@ -571,7 +561,7 @@ proc ExtractValue {response lastQueryCmd} {
|
|||||||
"E01*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "FUNCTION ERROR - Function not supported, $response"}
|
"E01*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "FUNCTION ERROR - Function not supported, $response"}
|
||||||
"E02*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "ARGUMENT ERROR - command argument contains unexpected characters, $response"}
|
"E02*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "ARGUMENT ERROR - command argument contains unexpected characters, $response"}
|
||||||
"E03*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "PORT NOT AVAILABLE, $response"}
|
"E03*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "PORT NOT AVAILABLE, $response"}
|
||||||
"E04*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "LOCAL ERROR - access denied, check LocalRemoteState setting, $response"}
|
"E04*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "LOCAL ERROR - access denied, check local_remote_state setting, $response"}
|
||||||
"E05*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "RANGE ERROR - the arguments are out of the allowed range, $response"}
|
"E05*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "RANGE ERROR - the arguments are out of the allowed range, $response"}
|
||||||
"E06*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "MODE ERROR - access denied, external reference active, $response"}
|
"E06*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "MODE ERROR - access denied, external reference active, $response"}
|
||||||
"E07*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "ERROR PENDING, $response"}
|
"E07*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "ERROR PENDING, $response"}
|
||||||
@@ -579,9 +569,9 @@ proc ExtractValue {response lastQueryCmd} {
|
|||||||
"E99*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "NO TCP/IP COMMUNICATION, $response"}
|
"E99*" {set ::scobj::bruker_BEC1::bruker_BEC1_errMsg "NO TCP/IP COMMUNICATION, $response"}
|
||||||
}
|
}
|
||||||
set extractedValue $::scobj::bruker_BEC1::bruker_BEC1_errValue
|
set extractedValue $::scobj::bruker_BEC1::bruker_BEC1_errValue
|
||||||
# update the node lastErrorMsg
|
# update the node last_error_msg
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/lastErrorMsg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/lastErrorMsg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2
|
||||||
#if { 0 != [string compare -length 4 $lastQueryCmd "POL/"] \
|
#if { 0 != [string compare -length 4 $lastQueryCmd "POL/"] \
|
||||||
# || $::scobj::bruker_BEC1::bruker_BEC1_polarityUnitAbsent == false} {
|
# || $::scobj::bruker_BEC1::bruker_BEC1_polarityUnitAbsent == false} {
|
||||||
#}
|
#}
|
||||||
@@ -662,11 +652,14 @@ proc decodeErrByte {errByte errList} {
|
|||||||
#puts "decodeErrByte: errByte:$errByte"
|
#puts "decodeErrByte: errByte:$errByte"
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
# convert to decimal for calculations
|
# convert to decimal for calculations
|
||||||
set decErrByte [expr 0x$errByte]
|
set hexvar "0x$errByte"
|
||||||
|
set decErrByte [expr {$hexvar}]
|
||||||
|
# puts "errByte=$errByte, hexvar=$hexvar, decErrByte=$decErrByte"
|
||||||
foreach {hexVal errText} $errList {
|
foreach {hexVal errText} $errList {
|
||||||
#puts "errByte:$errByte hexVal:$hexVal errText:$errText"
|
#puts "errByte:$errByte hexVal:$hexVal errText:$errText"
|
||||||
# convert to decimal for calculations
|
# convert to decimal for calculations
|
||||||
set decVal [expr 0x$hexVal]
|
set hexvar "0x$hexVal"
|
||||||
|
set decVal [expr { $hexvar }]
|
||||||
#puts "decErrByte:$decErrByte decVal:$decVal errText:$errText"
|
#puts "decErrByte:$decErrByte decVal:$decVal errText:$errText"
|
||||||
if { $decErrByte >= $decVal } {
|
if { $decErrByte >= $decVal } {
|
||||||
if {[string length $errorText] > 1} {
|
if {[string length $errorText] > 1} {
|
||||||
@@ -674,11 +667,11 @@ proc decodeErrByte {errByte errList} {
|
|||||||
} else {
|
} else {
|
||||||
set errorText $errText
|
set errorText $errText
|
||||||
}
|
}
|
||||||
set decErrByte [expr $decErrByte - $decVal]
|
set decErrByte [expr {$decErrByte - $decVal}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if {2 > [string length $errText]} {
|
if {2 > [string length $errText]} {
|
||||||
set $errorText "Unknown error"
|
set errorText "Unknown error"
|
||||||
}
|
}
|
||||||
return $errorText
|
return $errorText
|
||||||
} message ]
|
} message ]
|
||||||
@@ -696,10 +689,10 @@ proc extractStatusByte {statusByteString whichByte} {
|
|||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
set statusByte "UNKNOWN"
|
set statusByte "UNKNOWN"
|
||||||
set statusByteStringLength [string length $statusByteString]
|
set statusByteStringLength [string length $statusByteString]
|
||||||
set offset [expr $whichByte*2]
|
set offset [expr {$whichByte*2}]
|
||||||
# allow for an initial offset of 4 char for 'STA/'
|
# allow for an initial offset of 4 char for 'STA/'
|
||||||
incr offset 4
|
incr offset 4
|
||||||
set statusByte [string range $statusByteString $offset [expr $offset+1]]
|
set statusByte [string range $statusByteString $offset [expr {$offset+1}]]
|
||||||
#puts "ExtractValue(): response:$response, extractedValue:$extractedValue"
|
#puts "ExtractValue(): response:$response, extractedValue:$extractedValue"
|
||||||
return $statusByte
|
return $statusByte
|
||||||
} message ]
|
} message ]
|
||||||
@@ -787,13 +780,13 @@ proc analyseStatusByte {statusByteString} {
|
|||||||
}
|
}
|
||||||
#puts "LSB_ErrByte :x$tmp_LSB_ErrByte: $LSB_ErrByteTxt"
|
#puts "LSB_ErrByte :x$tmp_LSB_ErrByte: $LSB_ErrByteTxt"
|
||||||
#puts "MSB_ErrByte :x$tmp_MSB_ErrByte: $MSB_ErrByteTxt"
|
#puts "MSB_ErrByte :x$tmp_MSB_ErrByte: $MSB_ErrByteTxt"
|
||||||
#puts "PwrSupplyStatus:x$tmp_PwrSupplyStatusByte: $PwrSupplyStatusByteTxt"
|
#puts "pwr_supply_status:x$tmp_PwrSupplyStatusByte: $PwrSupplyStatusByteTxt"
|
||||||
#puts "StateMachine :x$tmp_StateMachineStatusByte: $StateMachineStatusTxt"
|
#puts "StateMachine :x$tmp_StateMachineStatusByte: $StateMachineStatusTxt"
|
||||||
|
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrCtrl/LSB_Err "x$tmp_LSB_ErrByte: $LSB_ErrByteTxt"
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrctrl/lsb_err "x$tmp_LSB_ErrByte: $LSB_ErrByteTxt"
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrCtrl/MSB_Err "x$tmp_MSB_ErrByte: $MSB_ErrByteTxt"
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrctrl/msb_err "x$tmp_MSB_ErrByte: $MSB_ErrByteTxt"
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrCtrl/PwrSupplyStatus "x$tmp_PwrSupplyStatusByte: $PwrSupplyStatusByteTxt"
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrctrl/pwr_supply_status "x$tmp_PwrSupplyStatusByte: $PwrSupplyStatusByteTxt"
|
||||||
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrCtrl/StateMachineStatus "x$tmp_StateMachineStatusByte: $StateMachineStatusByteTxt"
|
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/pwrctrl/state_machine_status "x$tmp_StateMachineStatusByte: $StateMachineStatusByteTxt"
|
||||||
return "Ok"
|
return "Ok"
|
||||||
} message ]
|
} message ]
|
||||||
handle_exception $catch_status $message "in analyseStatusByte(). statusByteString: $statusByteString"
|
handle_exception $catch_status $message "in analyseStatusByte(). statusByteString: $statusByteString"
|
||||||
@@ -829,7 +822,7 @@ proc getValFromString {s element separator} {
|
|||||||
# startIdx points to the first non-blank character of the value we are interested in
|
# startIdx points to the first non-blank character of the value we are interested in
|
||||||
set returnval ""
|
set returnval ""
|
||||||
if {$startIdx < 0} {
|
if {$startIdx < 0} {
|
||||||
return returnval
|
return $returnval
|
||||||
}
|
}
|
||||||
set endIdx [string first $separator $s $startIdx]
|
set endIdx [string first $separator $s $startIdx]
|
||||||
incr endIdx -1
|
incr endIdx -1
|
||||||
@@ -854,18 +847,18 @@ proc getValFromString {s element separator} {
|
|||||||
proc checktol {tc_root} {
|
proc checktol {tc_root} {
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
set retVal 0
|
set retVal 0
|
||||||
set sensorValue $tc_root/sensor/DesiredCurrent
|
set sensorValue $tc_root/sensor/desired_current
|
||||||
set NominalOutpCurrent [hval $sensorValue]
|
set nominal_outp_current [hval $sensorValue]
|
||||||
set isetp $tc_root/sensor/NominalOutpCurrent
|
set isetp $tc_root/sensor/nominal_outp_current
|
||||||
set setpt [hval $isetp]
|
set setpt [hval $isetp]
|
||||||
set tol [hval $tc_root/emon/tolerance]
|
set tol [hval $tc_root/emon/tolerance]
|
||||||
set loField [expr $setpt - $tol]
|
set loField [expr {$setpt - $tol}]
|
||||||
set hiField [expr $setpt + $tol]
|
set hiField [expr {$setpt + $tol}]
|
||||||
if { $NominalOutpCurrent < $loField || $NominalOutpCurrent > $hiField} {
|
if { $NominalOutpCurrent < $loField || $NominalOutpCurrent > $hiField} {
|
||||||
hset $tc_root/emon/isInTolerance "outsideTolerance"
|
hset $tc_root/emon/is_in_tolerance "outsideTolerance"
|
||||||
set retVal 0
|
set retVal 0
|
||||||
} else {
|
} else {
|
||||||
hset $tc_root/emon/isInTolerance "inTolerance"
|
hset $tc_root/emon/is_in_tolerance "inTolerance"
|
||||||
set retVal 1
|
set retVal 1
|
||||||
}
|
}
|
||||||
return $retVal
|
return $retVal
|
||||||
@@ -926,23 +919,23 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
set helptext "No help available"
|
set helptext "No help available"
|
||||||
#puts "helpNotes4user $scobj_hpath/$cmdGroup varName"
|
#puts "helpNotes4user $scobj_hpath/$cmdGroup varName"
|
||||||
switch -glob $varName {
|
switch -glob $varName {
|
||||||
"LocalRemoteState*" {
|
"local_remote_state*" {
|
||||||
set h1 {REM: «n» Query or Set local/remote state.}
|
set h1 {REM: «n» Query or Set local/remote state.}
|
||||||
set h2 {«n» 0:local (local and remote comands allowed).}
|
set h2 {«n» 0:local (local and remote comands allowed).}
|
||||||
set h3 {«n» 1:remote state (only remote commands allowed).}
|
set h3 {«n» 1:remote state (only remote commands allowed).}
|
||||||
set helptext $h1$CRLF$h2$CRLF$h3
|
set helptext $h1$CRLF$h2$CRLF$h3
|
||||||
}
|
}
|
||||||
"DC_power*" {
|
"dc_power*" {
|
||||||
set h1 {DCP «off/on» DC power }
|
set h1 {DCP «off/on» DC power }
|
||||||
set h2 { 0:off, 1:on}
|
set h2 { 0:off, 1:on}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"DesiredCurrent*" {
|
"desired_current*" {
|
||||||
set h1 {CUR «nn.nn» Read and set DAC current}
|
set h1 {CUR «nn.nn» Read and set DAC current}
|
||||||
set h2 {«nn.nn» DAC current in Amperes}
|
set h2 {«nn.nn» DAC current in Amperes}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"PwrCtrlFrom*" {
|
"pwr_ctrl_from*" {
|
||||||
set h1 {EXT: «n» Query / Set source of reference for power supply control}
|
set h1 {EXT: «n» Query / Set source of reference for power supply control}
|
||||||
set h2 {«EXT:0» internal reference, DAC}
|
set h2 {«EXT:0» internal reference, DAC}
|
||||||
set h3 {«EXT:1» external reference voltage}
|
set h3 {«EXT:1» external reference voltage}
|
||||||
@@ -963,17 +956,17 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
set h3 {«POL:1» Set negative polarity}
|
set h3 {«POL:1» Set negative polarity}
|
||||||
set helptext $h1$CRLF$h2$CRLF$h3
|
set helptext $h1$CRLF$h2$CRLF$h3
|
||||||
}
|
}
|
||||||
"ActualDAC_Field*" {
|
"actual_dac_field*" {
|
||||||
set h1 {FLD «nn.nn» Query/Set magnetic field strength }
|
set h1 {FLD «nn.nn» Query/Set magnetic field strength }
|
||||||
set h2 {«nn.nn» magnetic field strength in Teslas (setpoint)}
|
set h2 {«nn.nn» magnetic field strength in Teslas (setpoint)}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"NominalOutpCurrent*" {
|
"nominal_outp_current*" {
|
||||||
set h1 {CHN «nn.nn» Query nominal output current.}
|
set h1 {CHN «nn.nn» Query nominal output current.}
|
||||||
set h2 {«nn.nn» Nominal output current in Amperes}
|
set h2 {«nn.nn» Nominal output current in Amperes}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"OutputVoltage*" {
|
"output_voltage*" {
|
||||||
set h1 {CHV «nn.nn» Query output voltage.}
|
set h1 {CHV «nn.nn» Query output voltage.}
|
||||||
set h2 { «nn.nn» Output voltage in Volts.}
|
set h2 { «nn.nn» Output voltage in Volts.}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
@@ -983,13 +976,13 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
set h2 {Returned: Load resistance in Ohms.}
|
set h2 {Returned: Load resistance in Ohms.}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"MeasuredField*" {
|
"measured_field*" {
|
||||||
set h1 {CHF/ Query measured magnetic field. }
|
set h1 {CHF/ Query measured magnetic field. }
|
||||||
set h2 {Returned: Measured magnetic field in Teslas.}
|
set h2 {Returned: Measured magnetic field in Teslas.}
|
||||||
set h3 {}
|
set h3 {}
|
||||||
set helptext $h1$CRLF$h2$CRLF$h3
|
set helptext $h1$CRLF$h2$CRLF$h3
|
||||||
}
|
}
|
||||||
"ResetErrorMsg*" {
|
"reset_error_msg*" {
|
||||||
set h1 {RST: «0» Reset error messages. }
|
set h1 {RST: «0» Reset error messages. }
|
||||||
set h2 { «0» Send zero to reset error messages.}
|
set h2 { «0» Send zero to reset error messages.}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
@@ -999,25 +992,25 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
set h2 {Returned: status byte in hexadecimal format. Note: DC power must be ON}
|
set h2 {Returned: status byte in hexadecimal format. Note: DC power must be ON}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"LSB_Err*" {
|
"lsb_err*" {
|
||||||
set h1 {Interpretation of the first 2 hexadecimal characters of the StatusByte string.}
|
set h1 {Interpretation of the first 2 hexadecimal characters of the StatusByte string.}
|
||||||
set h2 {LSB (lower status byte) contains interlock status conditions}
|
set h2 {LSB (lower status byte) contains interlock status conditions}
|
||||||
set h3 {such as water or partial power failure.}
|
set h3 {such as water or partial power failure.}
|
||||||
set helptext $h1$CRLF$h2$CRLF$h3
|
set helptext $h1$CRLF$h2$CRLF$h3
|
||||||
}
|
}
|
||||||
"MSB_Err*" {
|
"msb_err*" {
|
||||||
set h1 {Interpretation of the hexadecimal characters 3 and 4 of the StatusByte string.}
|
set h1 {Interpretation of the hexadecimal characters 3 and 4 of the StatusByte string.}
|
||||||
set h2 {MSB (machine status byte) contains interlock status conditions}
|
set h2 {MSB (machine status byte) contains interlock status conditions}
|
||||||
set h3 {such as an overcurrent condition.}
|
set h3 {such as an overcurrent condition.}
|
||||||
set helptext $h1$CRLF$h2$CRLF$h3
|
set helptext $h1$CRLF$h2$CRLF$h3
|
||||||
}
|
}
|
||||||
"PwrSupplyStatus*" {
|
"pwr_supply_status*" {
|
||||||
set h1 {Interpretation of the hexadecimal characters 5 and 6 of the StatusByte string.}
|
set h1 {Interpretation of the hexadecimal characters 5 and 6 of the StatusByte string.}
|
||||||
set h2 {Contains information about the power supply status}
|
set h2 {Contains information about the power supply status}
|
||||||
set h3 {such as DC power on or off.}
|
set h3 {such as DC power on or off.}
|
||||||
set helptext $h1$CRLF$h2$CRLF$h3
|
set helptext $h1$CRLF$h2$CRLF$h3
|
||||||
}
|
}
|
||||||
"StateMachineStatus*" {
|
"state_machine_status*" {
|
||||||
set h1 {Interpretation of the hexadecimal characters 7 and 8 of the StatusByte string.}
|
set h1 {Interpretation of the hexadecimal characters 7 and 8 of the StatusByte string.}
|
||||||
set h2 {Contains information about the power supply State Machines}
|
set h2 {Contains information about the power supply State Machines}
|
||||||
set h3 {such as the Inrush or Test DAC states.}
|
set h3 {such as the Inrush or Test DAC states.}
|
||||||
@@ -1031,7 +1024,7 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
set h2 {Returned: ethernet address in hexadecimal numbers.}
|
set h2 {Returned: ethernet address in hexadecimal numbers.}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"isInTolerance*" {
|
"is_in_tolerance*" {
|
||||||
set h1 {A flag that indicates whether the actual magnetic field strength is within tolerance}
|
set h1 {A flag that indicates whether the actual magnetic field strength is within tolerance}
|
||||||
set h2 {of the setpoint field strength.}
|
set h2 {of the setpoint field strength.}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
@@ -1045,7 +1038,7 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
set h1 {Tolerance specifies the magnetic field strength tolerance in Tesla applicable to the setpoint.}
|
set h1 {Tolerance specifies the magnetic field strength tolerance in Tesla applicable to the setpoint.}
|
||||||
set helptext $h1
|
set helptext $h1
|
||||||
}
|
}
|
||||||
"monMode*" {
|
"mon_mode*" {
|
||||||
set h1 {A flag that indicates whether the magnet's current is being actively changed to}
|
set h1 {A flag that indicates whether the magnet's current is being actively changed to}
|
||||||
set h2 {drive the magnetic field towards the setpoint or whether the current is stable}
|
set h2 {drive the magnetic field towards the setpoint or whether the current is stable}
|
||||||
set h3 {with the magnetic field in tolerance with the setpoint.}
|
set h3 {with the magnetic field in tolerance with the setpoint.}
|
||||||
@@ -1056,8 +1049,8 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
set h2 {The default action is always 'pause'.}
|
set h2 {The default action is always 'pause'.}
|
||||||
set helptext $h1$CRLF$h2
|
set helptext $h1$CRLF$h2
|
||||||
}
|
}
|
||||||
"lastErrorMsg*" {
|
"last_error_msg*" {
|
||||||
set helptext {lastErrorMsg and lastErrorMsg2 display the last 2 error messages received from the device.}
|
set helptext {last_error_msg and last_error_msg2 display the last 2 error messages received from the device.}
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
set helptext {Sorry mate. No help available.}
|
set helptext {Sorry mate. No help available.}
|
||||||
@@ -1089,11 +1082,11 @@ proc helpNotes4user {scobj_hpath cmdGroup varName} {
|
|||||||
# @param wrCmd actual device write command to be sent to the device
|
# @param wrCmd actual device write command to be sent to the device
|
||||||
# @param wrFunc Function to be called to send the wrCmd to the device, typically setValue()
|
# @param wrFunc Function to be called to send the wrCmd to the device, typically setValue()
|
||||||
# @param allowedValues allowed values for the node data - does not permit other
|
# @param allowedValues allowed values for the node data - does not permit other
|
||||||
# @param klass Nexus class name (?)
|
# @param klasse Nexus class name (?)
|
||||||
# @return OK
|
# @return OK
|
||||||
proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
|
proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
|
||||||
pollEnabled drivable replyLen dataType permission rdCmd rdFunc wrCmd\
|
pollEnabled drivable replyLen dataType permission rdCmd rdFunc wrCmd\
|
||||||
wrFunc allowedValues klass} {
|
wrFunc allowedValues klasse} {
|
||||||
#puts "createing node for: $scobj_hpath $cmdGroup $varName $readable $writable $pollEnabled $drivable $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc"
|
#puts "createing node for: $scobj_hpath $cmdGroup $varName $readable $writable $pollEnabled $drivable $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc"
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
set ns ::scobj::bruker_BEC1
|
set ns ::scobj::bruker_BEC1
|
||||||
@@ -1145,11 +1138,11 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
|
|||||||
##
|
##
|
||||||
# @brief mk_sct_bruker_BEC1() creates a scriptcontext object for a Bruker BEC1 power supply (for 1T magnet)
|
# @brief mk_sct_bruker_BEC1() creates a scriptcontext object for a Bruker BEC1 power supply (for 1T magnet)
|
||||||
# @param sct_controller name of the bruker_BEC1 scriptcontext object (typically sct_bruker_BEC1_tc1 or tc2)
|
# @param sct_controller name of the bruker_BEC1 scriptcontext object (typically sct_bruker_BEC1_tc1 or tc2)
|
||||||
# @param klass Nexus class name (?), typically 'environment'
|
# @param klasse Nexus class name (?), typically 'environment'
|
||||||
# @param tempobj short name for the magnet power supply scriptcontext object (typ. ma1 or ma2)
|
# @param tempobj short name for the magnet power supply scriptcontext object (typ. ma1 or ma2)
|
||||||
# @param tol magentic field strength tolerance in Tesla (typ. 1)
|
# @param tol magentic field strength tolerance in Tesla (typ. 1)
|
||||||
# @return nothing (well, the sct object)
|
# @return nothing (well, the sct object)
|
||||||
proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol} {
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
set ns ::scobj::bruker_BEC1
|
set ns ::scobj::bruker_BEC1
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_sct_obj_name $tempobj
|
set ::scobj::bruker_BEC1::bruker_BEC1_sct_obj_name $tempobj
|
||||||
@@ -1159,10 +1152,10 @@ proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
|||||||
#set LF "\n"
|
#set LF "\n"
|
||||||
|
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_tolerance $tol
|
set ::scobj::bruker_BEC1::bruker_BEC1_tolerance $tol
|
||||||
set ::scobj::bruker_BEC1::bruker_BEC1_driveTolerance [expr $tol * $::scobj::bruker_BEC1::bruker_BEC1_tolerance]
|
set ::scobj::bruker_BEC1::bruker_BEC1_driveTolerance [expr {$tol * $::scobj::bruker_BEC1::bruker_BEC1_tolerance}]
|
||||||
|
|
||||||
MakeSICSObj $tempobj SCT_OBJECT
|
MakeSICSObj $tempobj SCT_OBJECT
|
||||||
sicslist setatt $tempobj klass $klass
|
sicslist setatt $tempobj klass $klasse
|
||||||
sicslist setatt $tempobj long_name $tempobj
|
sicslist setatt $tempobj long_name $tempobj
|
||||||
# Create a base node for all the state machines of this sics object
|
# Create a base node for all the state machines of this sics object
|
||||||
set scobj_hpath /sics/$tempobj
|
set scobj_hpath /sics/$tempobj
|
||||||
@@ -1189,18 +1182,18 @@ proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
|||||||
# wrFunc Function to be called to send the wrCmd to the device, typically setValue()
|
# wrFunc Function to be called to send the wrCmd to the device, typically setValue()
|
||||||
# allowedValues allowed values for the node data - does not permit other
|
# allowedValues allowed values for the node data - does not permit other
|
||||||
set deviceCommandToplevel {\
|
set deviceCommandToplevel {\
|
||||||
sensor MeasuredField 1 0 1 0 13 float spy {CHF/} {rdValue} {} {setValue} {}\
|
sensor measured_field 1 0 1 0 13 float spy {CHF/} {rdValue} {} {setValue} {}\
|
||||||
sensor ActualDAC_Field 1 1 1 0 16 float user {FLD/} {rdValue} {FLD=} {setValue} {}\
|
sensor actual_dac_field 1 1 1 0 16 float user {FLD/} {rdValue} {FLD=} {setValue} {}\
|
||||||
sensor DesiredCurrent 1 1 1 1 15 float user {CUR/} {rdValue} {CUR=} {setDesiredCurrent} {}\
|
sensor desired_current 1 1 1 1 15 float user {CUR/} {rdValue} {CUR=} {setDesiredCurrent} {}\
|
||||||
sensor NominalOutpCurrent 1 0 1 0 13 float spy {CHN/} {rdValue} {} {setDesiredCurrent} {}\
|
sensor nominal_outp_current 1 0 1 0 13 float spy {CHN/} {rdValue} {} {setDesiredCurrent} {}\
|
||||||
}
|
}
|
||||||
set deviceCommand {\
|
set deviceCommand {\
|
||||||
pwrCtrl DC_power 1 1 1 0 7 int user {DCP/} {inTolerance} {DCP=} {setValue} {0,1}\
|
pwrctrl dc_power 1 1 1 0 7 int user {DCP/} {inTolerance} {DCP=} {setValue} {0,1}\
|
||||||
pwrCtrl PwrCtrlFrom 1 1 1 0 7 int user {EXT/} {rdValue} {EXT=} {setValue} {0,1,2}\
|
pwrctrl pwr_ctrl_from 1 1 1 0 7 int user {EXT/} {rdValue} {EXT=} {setValue} {0,1,2}\
|
||||||
pwrCtrl LocalRemoteState 1 1 1 0 7 int user {REM/} {rdValue} {REM=} {setValue} {0,1}\
|
pwrctrl local_remote_state 1 1 1 0 7 int user {REM/} {rdValue} {REM=} {setValue} {0,1}\
|
||||||
pwrCtrl OutputVoltage 1 0 1 0 12 float spy {CHV/} {rdValue} {} {setValue} {}\
|
pwrctrl output_voltage 1 0 1 0 12 float spy {CHV/} {rdValue} {} {setValue} {}\
|
||||||
pwrCtrl ResetErrorMsg 0 1 0 0 7 int user {} {rdValue} {RST=} {setValue} {0}\
|
pwrctrl reset_error_msg 0 1 0 0 7 int user {} {rdValue} {RST=} {setValue} {0}\
|
||||||
pwrCtrl statusByte 1 1 1 0 13 text user {STA/} {rdValue} {STA=} {setValue} {0}\
|
pwrctrl statusByte 1 1 1 0 13 text user {STA/} {rdValue} {STA=} {setValue} {0}\
|
||||||
}
|
}
|
||||||
# it seems these functions are not supported by our device
|
# it seems these functions are not supported by our device
|
||||||
#pwrCtrl EthernetAddrHex 1 0 1 0 text spy {ETH/} {rdValue} {} {setValue} {}\
|
#pwrCtrl EthernetAddrHex 1 0 1 0 text spy {ETH/} {rdValue} {} {setValue} {}\
|
||||||
@@ -1210,26 +1203,26 @@ proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
|||||||
|
|
||||||
hfactory $scobj_hpath/sensor plain spy none
|
hfactory $scobj_hpath/sensor plain spy none
|
||||||
foreach {cmdGroup varName readable writable pollEnabled drivable replyLen dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommandToplevel {
|
foreach {cmdGroup varName readable writable pollEnabled drivable replyLen dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommandToplevel {
|
||||||
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $replyLen $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klass
|
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $replyLen $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
|
||||||
}
|
}
|
||||||
|
|
||||||
# create a base node for each commandGroup element - these are all polled
|
# create a base node for each commandGroup element - these are all polled
|
||||||
hfactory $scobj_hpath/emon plain spy none
|
hfactory $scobj_hpath/emon plain spy none
|
||||||
hfactory $scobj_hpath/pwrCtrl plain spy none
|
hfactory $scobj_hpath/pwrctrl plain spy none
|
||||||
|
|
||||||
foreach {cmdGroup varName readable writable pollEnabled drivable replyLen dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand {
|
foreach {cmdGroup varName readable writable pollEnabled drivable replyLen dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand {
|
||||||
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $replyLen $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klass
|
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $replyLen $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create state machines for the following required nodes that do not correspond
|
# Create state machines for the following required nodes that do not correspond
|
||||||
# to device commands.
|
# to device commands.
|
||||||
hfactory $scobj_hpath/emon/lastErrorMsg plain user text
|
hfactory $scobj_hpath/emon/last_error_msg plain user text
|
||||||
#hsetprop $scobj_hpath/emon/lastErrorMsg values *any*
|
#hsetprop $scobj_hpath/emon/last_error_msg values *any*
|
||||||
hset $scobj_hpath/emon/lastErrorMsg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
|
hset $scobj_hpath/emon/last_error_msg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
|
||||||
helpNotes4user $scobj_hpath "emon" "lastErrorMsg"
|
helpNotes4user $scobj_hpath "emon" "last_error_msg"
|
||||||
hfactory $scobj_hpath/emon/lastErrorMsg2 plain user text
|
hfactory $scobj_hpath/emon/last_error_msg2 plain user text
|
||||||
hset $scobj_hpath/emon/lastErrorMsg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2
|
hset $scobj_hpath/emon/last_error_msg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2
|
||||||
helpNotes4user $scobj_hpath "emon" "lastErrorMsg2"
|
helpNotes4user $scobj_hpath "emon" "last_error_msg2"
|
||||||
|
|
||||||
#hfactory $scobj_hpath/emon/statusText plain user text
|
#hfactory $scobj_hpath/emon/statusText plain user text
|
||||||
#hset $scobj_hpath/emon/statusText $::scobj::bruker_BEC1::bruker_BEC1_statusText
|
#hset $scobj_hpath/emon/statusText $::scobj::bruker_BEC1::bruker_BEC1_statusText
|
||||||
@@ -1240,10 +1233,10 @@ proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
|||||||
hset $scobj_hpath/emon/apply_tolerance 1
|
hset $scobj_hpath/emon/apply_tolerance 1
|
||||||
helpNotes4user $scobj_hpath "emon" "apply_tolerance"
|
helpNotes4user $scobj_hpath "emon" "apply_tolerance"
|
||||||
|
|
||||||
hfactory $scobj_hpath/emon/isInTolerance plain spy text
|
hfactory $scobj_hpath/emon/is_in_tolerance plain spy text
|
||||||
hsetprop $scobj_hpath/emon/isInTolerance values idle,drive,monitor,error
|
hsetprop $scobj_hpath/emon/is_in_tolerance values idle,drive,monitor,error
|
||||||
hset $scobj_hpath/emon/isInTolerance "inTolerance"
|
hset $scobj_hpath/emon/is_in_tolerance "inTolerance"
|
||||||
helpNotes4user $scobj_hpath "emon" "isInTolerance"
|
helpNotes4user $scobj_hpath "emon" "is_in_tolerance"
|
||||||
|
|
||||||
hfactory $scobj_hpath/emon/tolerance plain user float
|
hfactory $scobj_hpath/emon/tolerance plain user float
|
||||||
hsetprop $scobj_hpath/emon/tolerance units $::scobj::bruker_BEC1::bruker_BEC1_magneticFiledUnits
|
hsetprop $scobj_hpath/emon/tolerance units $::scobj::bruker_BEC1::bruker_BEC1_magneticFiledUnits
|
||||||
@@ -1252,34 +1245,34 @@ proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
|||||||
helpNotes4user $scobj_hpath "emon" "tolerance"
|
helpNotes4user $scobj_hpath "emon" "tolerance"
|
||||||
|
|
||||||
# environment monitoring flags: shows if setpoints (field, current) are in tolerance
|
# environment monitoring flags: shows if setpoints (field, current) are in tolerance
|
||||||
hfactory $scobj_hpath/emon/monMode plain user text
|
hfactory $scobj_hpath/emon/mon_mode plain user text
|
||||||
hsetprop $scobj_hpath/emon/monMode values idle,drive,monitor,error
|
hsetprop $scobj_hpath/emon/mon_mode values idle,drive,monitor,error
|
||||||
hset $scobj_hpath/emon/monMode "idle"
|
hset $scobj_hpath/emon/mon_mode "idle"
|
||||||
helpNotes4user $scobj_hpath "emon" "monMode"
|
helpNotes4user $scobj_hpath "emon" "mon_mode"
|
||||||
|
|
||||||
hfactory $scobj_hpath/emon/errhandler plain spy text
|
hfactory $scobj_hpath/emon/errhandler plain spy text
|
||||||
hset $scobj_hpath/emon/errhandler "lazy"
|
hset $scobj_hpath/emon/errhandler "lazy"
|
||||||
helpNotes4user $scobj_hpath "emon" "errhandler"
|
helpNotes4user $scobj_hpath "emon" "errhandler"
|
||||||
|
|
||||||
hfactory $scobj_hpath/pwrCtrl/LSB_Err plain spy text
|
hfactory $scobj_hpath/pwrctrl/lsb_err plain spy text
|
||||||
hset $scobj_hpath/pwrCtrl/LSB_Err "UNKNOWN"
|
hset $scobj_hpath/pwrctrl/lsb_err "UNKNOWN"
|
||||||
helpNotes4user $scobj_hpath "pwrCtrl" "LSB_Err"
|
helpNotes4user $scobj_hpath "pwrctrl" "lsb_err"
|
||||||
|
|
||||||
hfactory $scobj_hpath/pwrCtrl/MSB_Err plain spy text
|
hfactory $scobj_hpath/pwrctrl/msb_err plain spy text
|
||||||
hset $scobj_hpath/pwrCtrl/MSB_Err "UNKNOWN"
|
hset $scobj_hpath/pwrctrl/msb_err "UNKNOWN"
|
||||||
helpNotes4user $scobj_hpath "pwrCtrl" "MSB_Err"
|
helpNotes4user $scobj_hpath "pwrctrl" "msb_err"
|
||||||
|
|
||||||
hfactory $scobj_hpath/pwrCtrl/PwrSupplyStatus plain spy text
|
hfactory $scobj_hpath/pwrctrl/pwr_supply_status plain spy text
|
||||||
hset $scobj_hpath/pwrCtrl/PwrSupplyStatus "UNKNOWN"
|
hset $scobj_hpath/pwrctrl/pwr_supply_status "UNKNOWN"
|
||||||
helpNotes4user $scobj_hpath "pwrCtrl" "PwrSupplyStatus"
|
helpNotes4user $scobj_hpath "pwrctrl" "pwr_supply_status"
|
||||||
|
|
||||||
hfactory $scobj_hpath/pwrCtrl/StateMachineStatus plain spy text
|
hfactory $scobj_hpath/pwrctrl/state_machine_status plain spy text
|
||||||
hset $scobj_hpath/pwrCtrl/StateMachineStatus "UNKNOWN"
|
hset $scobj_hpath/pwrctrl/state_machine_status "UNKNOWN"
|
||||||
helpNotes4user $scobj_hpath "pwrCtrl" "StateMachineStatus"
|
helpNotes4user $scobj_hpath "pwrctrl" "state_machine_status"
|
||||||
|
|
||||||
#hfactory $scobj_hpath/pwrCtrl/EthernetAddrDec plain user text
|
#hfactory $scobj_hpath/pwrctrl/EthernetAddrDec plain user text
|
||||||
#hset $scobj_hpath/pwrCtrl/EthernetAddrDec "UNKNOWN"
|
#hset $scobj_hpath/pwrctrl/EthernetAddrDec "UNKNOWN"
|
||||||
#helpNotes4user $scobj_hpath "pwrCtrl" "EthernetAddrDec"
|
#helpNotes4user $scobj_hpath "pwrctrl" "EthernetAddrDec"
|
||||||
|
|
||||||
hfactory $scobj_hpath/status plain spy text
|
hfactory $scobj_hpath/status plain spy text
|
||||||
hsetprop $scobj_hpath/status values busy,idle
|
hsetprop $scobj_hpath/status values busy,idle
|
||||||
@@ -1293,19 +1286,19 @@ proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
|||||||
# Note: node names longer than 8 characters cause eror messages - avoid
|
# Note: node names longer than 8 characters cause eror messages - avoid
|
||||||
set nxProperties "
|
set nxProperties "
|
||||||
$scobj_hpath sensor NXsensor spy
|
$scobj_hpath sensor NXsensor spy
|
||||||
$scobj_hpath sensor/MeasuredField sensor user
|
$scobj_hpath sensor/measured_field sensor user
|
||||||
$scobj_hpath sensor/ActualDAC_Field sensor user
|
$scobj_hpath sensor/actual_dac_field sensor user
|
||||||
$scobj_hpath sensor/DesiredCurrent sensor user
|
$scobj_hpath sensor/desired_current sensor user
|
||||||
$scobj_hpath sensor/NominalOutpCurrent sensor user
|
$scobj_hpath sensor/nominal_outp_current sensor user
|
||||||
"
|
"
|
||||||
set aliasProperties "
|
set aliasProperties "
|
||||||
$scobj_hpath MeasuredField sensor _sensor_MeasuredField
|
$scobj_hpath measured_field sensor _sensor_MeasuredField
|
||||||
$scobj_hpath ActualDAC_Field sensor _sensor_ActualDAC_Field
|
$scobj_hpath actual_dac_field sensor _sensor_ActualDAC_Field
|
||||||
$scobj_hpath DesiredCurrent sensor _sensor_DesiredCurrent
|
$scobj_hpath desired_current sensor _sensor_DesiredCurrent
|
||||||
$scobj_hpath NominalOutpCurrent sensor _sensor_NominalOutpCurrent
|
$scobj_hpath nominal_outp_current sensor _sensor_NominalOutpCurrent
|
||||||
"
|
"
|
||||||
foreach {rootpath hpath klass priv} $nxProperties {
|
foreach {rootpath hpath klasse priv} $nxProperties {
|
||||||
hsetprop $rootpath/$hpath klass $klass
|
hsetprop $rootpath/$hpath klass $klasse
|
||||||
hsetprop $rootpath/$hpath privilege $priv
|
hsetprop $rootpath/$hpath privilege $priv
|
||||||
hsetprop $rootpath/$hpath control true
|
hsetprop $rootpath/$hpath control true
|
||||||
hsetprop $rootpath/$hpath data true
|
hsetprop $rootpath/$hpath data true
|
||||||
@@ -1324,21 +1317,23 @@ proc mk_sct_bruker_BEC1 {sct_controller klass tempobj tol} {
|
|||||||
# for generating the GumTree interface and saving data for script context objects (hdf file)
|
# for generating the GumTree interface and saving data for script context objects (hdf file)
|
||||||
# @param scobj, name of script context object (path to a node)
|
# @param scobj, name of script context object (path to a node)
|
||||||
# @param par, optional parameter (name of the node variable)
|
# @param par, optional parameter (name of the node variable)
|
||||||
::scobj::hinitprops $tempobj/sensor NominalOutpCurrent
|
::scobj::hinitprops $tempobj/sensor nominal_outp_current
|
||||||
|
hsetprop $scobj_hpath/pwrctrl/statusByte control false
|
||||||
|
|
||||||
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/sensor/DesiredCurrent $scobj_hpath/sensor/NominalOutpCurrent $sct_controller
|
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/sensor/desired_current $scobj_hpath/sensor/nominal_outp_current $sct_controller
|
||||||
|
|
||||||
# initialise the device
|
# initialise the device
|
||||||
bruker_BEC1_init $sct_controller $scobj_hpath
|
bruker_BEC1_init $sct_controller $scobj_hpath
|
||||||
puts "Bruker BEC1 power supply for 1-Tesla magnet ready at /sample/$tempobj (Driver 20091209)"
|
puts "Bruker BEC1 power supply for 1-Tesla magnet ready at /sample/$tempobj (Driver 2010-04-07)"
|
||||||
} message ]
|
} message ]
|
||||||
handle_exception $catch_status $message "In subroutine mk_sct_bruker_BEC1()."
|
handle_exception $catch_status $message "In subroutine mk_sct_bruker_BEC1()."
|
||||||
}
|
}
|
||||||
namespace export mk_sct_bruker_BEC1
|
namespace export mk_sct_bruker_BEC1
|
||||||
# endproc mk_sct_bruker_BEC1 sct_controller klass tempobj tol bruker_BEC1_LSmodel
|
# endproc mk_sct_bruker_BEC1 sct_controller klasse tempobj tol bruker_BEC1_LSmodel
|
||||||
}
|
}
|
||||||
# end of namespace mk_sct_bruker_BEC1
|
# end of namespace mk_sct_bruker_BEC1
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# @brief add_bruker_BEC1() adds a scriptcontext object for a Bruker BEC1 power supply (1T magnet)
|
# @brief add_bruker_BEC1() adds a scriptcontext object for a Bruker BEC1 power supply (1T magnet)
|
||||||
# and makes it available to SICServer
|
# and makes it available to SICServer
|
||||||
@@ -1351,15 +1346,16 @@ proc add_bruker_BEC1 {name IP port {_tol 0.1} } {
|
|||||||
# Don't create a magnet controller for the script validator, this may cause the
|
# Don't create a magnet controller for the script validator, this may cause the
|
||||||
# the BEC1 to lock up.
|
# the BEC1 to lock up.
|
||||||
# NOTE: This is placed outside the catch block because "return" raises an exception
|
# NOTE: This is placed outside the catch block because "return" raises an exception
|
||||||
if [SplitReply [environment_simulation]] {
|
if {[SplitReply [environment_simulation]]} {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set catch_status [ catch {
|
set catch_status [ catch {
|
||||||
puts "\nadd_bruker_BEC1: makesctcontroller $name std ${IP}:$port for Bruker BEC1 1-Tesla magnet power supply"
|
puts "\nadd_bruker_BEC1: makesctcontroller $name astvelsel ${IP}:$port for Bruker BEC1 1-Tesla magnet power supply"
|
||||||
# Command terminator for Bruker unit is only carriage return without linefeed '\r'
|
# Command terminator for Bruker unit is always carriage return without linefeed '\r'
|
||||||
makesctcontroller sct_bruker_BEC1_$name std ${IP}:$port "\r"
|
makesctcontroller sct_bruker_BEC1_$name astvelsel ${IP}:$port "\r"
|
||||||
|
# proc mk_sct_bruker_BEC1 (sct_controller klasse tempobj tol)
|
||||||
mk_sct_bruker_BEC1 sct_bruker_BEC1_$name environment $name $_tol
|
mk_sct_bruker_BEC1 sct_bruker_BEC1_$name environment $name $_tol
|
||||||
makesctemon $name /sics/$name/emon/monMode /sics/$name/emon/isInTolerance /sics/$name/emon/errhandler
|
makesctemon $name /sics/$name/emon/mon_mode /sics/$name/emon/is_in_tolerance /sics/$name/emon/errhandler
|
||||||
} message ]
|
} message ]
|
||||||
handle_exception $catch_status $message "In subroutine add_bruker_BEC1()."
|
handle_exception $catch_status $message "In subroutine add_bruker_BEC1()."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace eval ::scobj::et2000 {
|
|||||||
# /tempcont/setpoint
|
# /tempcont/setpoint
|
||||||
# /tempcont/sensor/value
|
# /tempcont/sensor/value
|
||||||
proc debug_log {args} {
|
proc debug_log {args} {
|
||||||
set fd [open "/home/dcl/et2000.log" a]
|
set fd [open "/tmp/et2000.log" a]
|
||||||
puts $fd $args
|
puts $fd $args
|
||||||
close $fd
|
close $fd
|
||||||
}
|
}
|
||||||
@@ -317,6 +317,7 @@ debug_log "halt $tc_root"
|
|||||||
|
|
||||||
hsetprop $scobj_hpath privilege spy
|
hsetprop $scobj_hpath privilege spy
|
||||||
::scobj::hinitprops $tempobj setpoint
|
::scobj::hinitprops $tempobj setpoint
|
||||||
|
hsetprop $scobj_hpath/setpoint data true
|
||||||
if {[SplitReply [environment_simulation]]=="false"} {
|
if {[SplitReply [environment_simulation]]=="false"} {
|
||||||
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/setpoint $scobj_hpath/sensor/value $sct_controller
|
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/setpoint $scobj_hpath/sensor/value $sct_controller
|
||||||
}
|
}
|
||||||
@@ -335,7 +336,7 @@ debug_log "halt $tc_root"
|
|||||||
# @param port, the IP protocol port number of the device (502 for modbus)
|
# @param port, the IP protocol port number of the device (502 for modbus)
|
||||||
# @param _tol (optional), this is the initial tolerance setting
|
# @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}} {
|
||||||
set fd [open "/home/dcl/et2000.log" a]
|
set fd [open "/tmp/et2000.log" a]
|
||||||
if {[SplitReply [environment_simulation]]=="false"} {
|
if {[SplitReply [environment_simulation]]=="false"} {
|
||||||
puts $fd "makesctcontroller sct_et2000 modbus ${IP}:$port"
|
puts $fd "makesctcontroller sct_et2000 modbus ${IP}:$port"
|
||||||
makesctcontroller sct_et2000 modbus ${IP}:$port
|
makesctcontroller sct_et2000 modbus ${IP}:$port
|
||||||
@@ -348,11 +349,11 @@ proc add_et2000 {name IP port dev_id {_tol 5.0}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
puts stdout "file evaluation of sct_eurotherm_2000.tcl"
|
puts stdout "file evaluation of sct_eurotherm_2000.tcl"
|
||||||
set fd [open "/home/dcl/et2000.log" w]
|
set fd [open "/tmp/et2000.log" w]
|
||||||
puts $fd "file evaluation of sct_eurotherm_2000.tcl"
|
puts $fd "file evaluation of sct_eurotherm_2000.tcl"
|
||||||
close $fd
|
close $fd
|
||||||
|
|
||||||
namespace import ::scobj::et2000::*
|
namespace import ::scobj::et2000::*
|
||||||
|
|
||||||
add_et2000 et2000 137.157.201.213 502 1 5
|
#add_et2000 et2000 137.157.201.213 502 1 5
|
||||||
#add_et2000 et2000 localhost 30502 1 5
|
#add_et2000 et2000 localhost 30502 1 5
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ set instrument_dictionary [subst {
|
|||||||
datatype @none
|
datatype @none
|
||||||
property {data true control true nxsave true klass parameters type part}
|
property {data true control true nxsave true klass parameters type part}
|
||||||
}
|
}
|
||||||
|
instrument/reduce {
|
||||||
|
privilege spy
|
||||||
|
sobj {@any reduce}
|
||||||
|
datatype @none
|
||||||
|
property {data true control true nxsave true klass reduce type part}
|
||||||
|
}
|
||||||
instrument/parameters/parameters_group {
|
instrument/parameters/parameters_group {
|
||||||
privilege spy
|
privilege spy
|
||||||
datatype @none
|
datatype @none
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ set boolean {true false}
|
|||||||
#}
|
#}
|
||||||
|
|
||||||
# SICS OBJECTS MUST PROVIDE THE FOLLOWING INFORMATION
|
# SICS OBJECTS MUST PROVIDE THE FOLLOWING INFORMATION
|
||||||
set sobj_klass_list {@none aperture attenuator collimator command crystal data detector disk_chopper entry environment experiment graphics instrument slits monitor monochromator parameter plc sample scan sensor source user}
|
set sobj_klass_list {@none aperture attenuator collimator command crystal data detector disk_chopper entry environment experiment graphics instrument slits monitor monochromator parameter plc reduce sample scan sensor source user}
|
||||||
set sobj_sicstype_list {chopperadapter environment_controller sicsvariable macro motor configurablevirtualmotor singlecounter histmem nxscript sicsdata scanobject sct_object}
|
set sobj_sicstype_list {chopperadapter environment_controller sicsvariable macro motor configurablevirtualmotor singlecounter histmem nxscript sicsdata scanobject sct_object}
|
||||||
# Different kinds of things are added to the hdb in different ways.
|
# Different kinds of things are added to the hdb in different ways.
|
||||||
# command: This is something a client can run with hset /a/b/c start, it may have parameters and feedback.
|
# command: This is something a client can run with hset /a/b/c start, it may have parameters and feedback.
|
||||||
|
|||||||
@@ -42,12 +42,6 @@ namespace eval histogram_memory {
|
|||||||
set ic_count_methods [concat [list time unlimited period count frame] $::counter::isc_beam_monitor_list ]
|
set ic_count_methods [concat [list time unlimited period count frame] $::counter::isc_beam_monitor_list ]
|
||||||
if {$histmem_simulation == "true"} {
|
if {$histmem_simulation == "true"} {
|
||||||
MakeHM hmm SIM
|
MakeHM hmm SIM
|
||||||
# MakeHM hmm_xy SIM
|
|
||||||
# MakeHM hmm_xt SIM
|
|
||||||
# MakeHM hmm_yt SIM
|
|
||||||
# MakeHM hmm_x SIM
|
|
||||||
# MakeHM hmm_y SIM
|
|
||||||
# MakeHM hmm_t SIM
|
|
||||||
hmm configure daq Stopped
|
hmm configure daq Stopped
|
||||||
hmm configure statuscheck false
|
hmm configure statuscheck false
|
||||||
hmm configure num_events_filled_to_histo 12345
|
hmm configure num_events_filled_to_histo 12345
|
||||||
@@ -230,19 +224,6 @@ namespace eval histogram_memory {
|
|||||||
## Scan Callback Procedures ##
|
## Scan Callback Procedures ##
|
||||||
##############################################
|
##############################################
|
||||||
##############################################
|
##############################################
|
||||||
if {0} {
|
|
||||||
#XXX REMOVE
|
|
||||||
proc init {} {
|
|
||||||
}
|
|
||||||
proc graphics_hpath_setup {parent} {
|
|
||||||
}
|
|
||||||
proc commands_hpath_setup {parent} {
|
|
||||||
}
|
|
||||||
proc instrument_hpath_setup {parent} {
|
|
||||||
}
|
|
||||||
proc experiment_hpath_setup {parent} {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
proc set_sobj_attributes {} {
|
proc set_sobj_attributes {} {
|
||||||
if [ catch {
|
if [ catch {
|
||||||
# SICS commands
|
# SICS commands
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ proc ::scobj::dethvps::rdValue {vPath} {
|
|||||||
"ASCERR:*" {
|
"ASCERR:*" {
|
||||||
sct geterror $data
|
sct geterror $data
|
||||||
if {$currSuperState == $RAMPBUSY || $currSuperState == $RAMPSTART} {
|
if {$currSuperState == $RAMPBUSY || $currSuperState == $RAMPSTART} {
|
||||||
broadcast "ERROR: $data, dhv1 stopped ramping detector voltage"
|
broadcast "DHVERROR: $data, dhv1 stopped ramping detector voltage"
|
||||||
statemon stop dhv1
|
statemon stop dhv1
|
||||||
} else {
|
} else {
|
||||||
# broadcast "ERROR: $data"
|
# broadcast "DHVERROR: $data"
|
||||||
}
|
}
|
||||||
if {$currSuperState != $RAMPIDLE} {
|
if {$currSuperState != $RAMPIDLE} {
|
||||||
sct ramping $RAMPIDLE
|
sct ramping $RAMPIDLE
|
||||||
@@ -85,7 +85,7 @@ proc ::scobj::dethvps::rdValue {vPath} {
|
|||||||
return idle
|
return idle
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
broadcast "ERROR: dhv1([info level 0]) sct ramping = [sct ramping], STOPPING"
|
broadcast "DHVERROR: dhv1([info level 0]) sct ramping = [sct ramping], STOPPING"
|
||||||
sct ramping $RAMPIDLE
|
sct ramping $RAMPIDLE
|
||||||
statemon stop dhv1
|
statemon stop dhv1
|
||||||
return idle
|
return idle
|
||||||
@@ -107,8 +107,8 @@ proc ::scobj::dethvps::setValue {nextSubState} {
|
|||||||
set par [sct target]
|
set par [sct target]
|
||||||
set maxV [sct max]
|
set maxV [sct max]
|
||||||
if {$par < 0 || $par > $maxV} {
|
if {$par < 0 || $par > $maxV} {
|
||||||
broadcast "ERROR: dhv1 target must be between 0 and $maxV"
|
broadcast "DHVERROR: dhv1 target must be between 0 and $maxV"
|
||||||
sct seterror "ERROR: dhv1 target must be between 0 and $maxV"
|
sct seterror "DHVERROR: dhv1 target must be between 0 and $maxV"
|
||||||
return idle
|
return idle
|
||||||
}
|
}
|
||||||
set currSuperState [sct ramping]
|
set currSuperState [sct ramping]
|
||||||
@@ -147,10 +147,10 @@ proc ::scobj::dethvps::getACK {} {
|
|||||||
"ASCERR:*" {
|
"ASCERR:*" {
|
||||||
sct seterror $data
|
sct seterror $data
|
||||||
if {$currSuperState == $RAMPBUSY || $currSuperState == $RAMPSTART} {
|
if {$currSuperState == $RAMPBUSY || $currSuperState == $RAMPSTART} {
|
||||||
broadcast "ERROR: $data, dhv1 stopped ramping detector voltage"
|
broadcast "DHVERROR: $data, dhv1 stopped ramping detector voltage"
|
||||||
statemon stop dhv1
|
statemon stop dhv1
|
||||||
} else {
|
} else {
|
||||||
# broadcast "ERROR: $data"
|
# broadcast "DHVERROR: $data"
|
||||||
}
|
}
|
||||||
if {$currSuperState != $RAMPSTOP} {
|
if {$currSuperState != $RAMPSTOP} {
|
||||||
sct ramping $RAMPSTOP
|
sct ramping $RAMPSTOP
|
||||||
@@ -198,8 +198,8 @@ proc ::scobj::dethvps::ramping {cmd} {
|
|||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
sct ramping $RAMPSTOP
|
sct ramping $RAMPSTOP
|
||||||
broadcast "ERROR: dhv1, Invalid ramp step: $rampstep STOPPING"
|
broadcast "DHVERROR: dhv1, Invalid ramp step: $rampstep STOPPING"
|
||||||
sct seterror "ERROR: dhv1, Invalid ramp step: $rampstep"
|
sct seterror "DHVERROR: dhv1, Invalid ramp step: $rampstep"
|
||||||
return idle
|
return idle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,8 +235,8 @@ proc ::scobj::dethvps::drvCmd {} {
|
|||||||
hset $potValPath 0
|
hset $potValPath 0
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
clientput "ERROR: Unknown command $cmd"
|
clientput "DHVERROR: Unknown command $cmd"
|
||||||
sct seterror "ERROR: Unknown command $cmd"
|
sct seterror "DHVERROR: Unknown command $cmd"
|
||||||
return idle
|
return idle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,7 +304,7 @@ proc ::scobj::dethvps::dhv1 {{CMD getVoltage} {val ""} } {
|
|||||||
if {[SplitReply [config myrights]] == 0} {
|
if {[SplitReply [config myrights]] == 0} {
|
||||||
hsetprop $qsObjPath $CMD $val
|
hsetprop $qsObjPath $CMD $val
|
||||||
} else {
|
} else {
|
||||||
error "ERROR: $CMD can only be initialised from a configuration file"
|
error "DHVERROR: $CMD can only be initialised from a configuration file"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "dhv1.$CMD = [hgetpropval $qsObjPath $CMD]"
|
return "dhv1.$CMD = [hgetpropval $qsObjPath $CMD]"
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ proc ::scan::hmm_scan_finish {sobj uobj} {
|
|||||||
::histogram_memory::stop
|
::histogram_memory::stop
|
||||||
::scan::runscan_cmd -set feedback status IDLE
|
::scan::runscan_cmd -set feedback status IDLE
|
||||||
run_mode "normal"
|
run_mode "normal"
|
||||||
|
set ::histogram_memory::histmem_axes(SVAR) "/instrument/run_number"
|
||||||
# Make sure that the next save command doesn't overwrite our scan data.
|
# Make sure that the next save command doesn't overwrite our scan data.
|
||||||
# and clear any data links
|
# and clear any data links
|
||||||
::nexus::newfile clear data
|
::nexus::newfile clear data
|
||||||
@@ -260,6 +261,7 @@ proc ::scan::bm_scan_finish {sobj uobj} {
|
|||||||
variable reset_position
|
variable reset_position
|
||||||
::scan::hdb_bmonscan -set feedback status IDLE
|
::scan::hdb_bmonscan -set feedback status IDLE
|
||||||
run_mode "normal"
|
run_mode "normal"
|
||||||
|
set ::histogram_memory::histmem_axes(SVAR) "/instrument/run_number"
|
||||||
# Make sure that the next save command doesn't overwrite our scan data.
|
# Make sure that the next save command doesn't overwrite our scan data.
|
||||||
# and clear any data links
|
# and clear any data links
|
||||||
::nexus::newfile clear data
|
::nexus::newfile clear data
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ proc ::histogram_memory::isc_initialize {} {
|
|||||||
::histogram_memory::init_OAT_TABLE res "std_968x128"
|
::histogram_memory::init_OAT_TABLE res "std_968x128"
|
||||||
::histogram_memory::upload_config Filler_defaults
|
::histogram_memory::upload_config Filler_defaults
|
||||||
|
|
||||||
::nexus::data alias ::histogram_memory::vertical_axis ::histogram_memory::y_pixel_offset
|
set ::histogram_memory::histmem_axes(HOR) /instrument/detector/x_pixel_angular_offset
|
||||||
::nexus::data alias ::histogram_memory::horizontal_axis ::histogram_memory::x_pixel_angular_offset
|
set ::histogram_memory::histmem_axes(VER) /instrument/detector/y_pixel_offset
|
||||||
} message ] {
|
} message ] {
|
||||||
if {$::errorCode=="NONE"} {return $message}
|
if {$::errorCode=="NONE"} {return $message}
|
||||||
return -code error $message
|
return -code error $message
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Motor eom $motor_driver_type [params \
|
|||||||
axis A\
|
axis A\
|
||||||
units degrees\
|
units degrees\
|
||||||
hardlowerlim -45\
|
hardlowerlim -45\
|
||||||
hardupperlim 60\
|
hardupperlim 80\
|
||||||
maxSpeed 1\
|
maxSpeed 1\
|
||||||
maxAccel 1\
|
maxAccel 1\
|
||||||
maxDecel 1\
|
maxDecel 1\
|
||||||
@@ -18,7 +18,7 @@ Motor eom $motor_driver_type [params \
|
|||||||
absEnc 1\
|
absEnc 1\
|
||||||
absEncHome $eom_Home\
|
absEncHome $eom_Home\
|
||||||
cntsPerX -8192]
|
cntsPerX -8192]
|
||||||
setHomeandRange -motor eom -home 0 -lowrange 35 -uprange 55
|
setHomeandRange -motor eom -home 0 -lowrange 35 -uprange 80
|
||||||
eom speed 1
|
eom speed 1
|
||||||
eom movecount $move_count
|
eom movecount $move_count
|
||||||
eom precision 0.01
|
eom precision 0.01
|
||||||
|
|||||||
@@ -406,8 +406,8 @@ ss1r softlowerlim $ss1r_LoRange
|
|||||||
ss1r softupperlim $ss1r_HiRange
|
ss1r softupperlim $ss1r_HiRange
|
||||||
ss1r home 0
|
ss1r home 0
|
||||||
ss1r movecount $move_count
|
ss1r movecount $move_count
|
||||||
ss1r part slits.first
|
ss1r part slits
|
||||||
ss1r long_name right
|
ss1r long_name first_right
|
||||||
|
|
||||||
# Slit 1, left
|
# Slit 1, left
|
||||||
Motor ss1l $motor_driver_type [params \
|
Motor ss1l $motor_driver_type [params \
|
||||||
@@ -425,8 +425,8 @@ ss1l softlowerlim $ss1l_LoRange
|
|||||||
ss1l softupperlim $ss1l_HiRange
|
ss1l softupperlim $ss1l_HiRange
|
||||||
ss1l home 0
|
ss1l home 0
|
||||||
ss1l movecount $move_count
|
ss1l movecount $move_count
|
||||||
ss1l part slits.first
|
ss1l part slits
|
||||||
ss1l long_name left
|
ss1l long_name first_left
|
||||||
|
|
||||||
# Slit 1, up
|
# Slit 1, up
|
||||||
Motor ss1u $motor_driver_type [params \
|
Motor ss1u $motor_driver_type [params \
|
||||||
@@ -444,8 +444,8 @@ ss1u softlowerlim $ss1u_LoRange
|
|||||||
ss1u softupperlim $ss1u_HiRange
|
ss1u softupperlim $ss1u_HiRange
|
||||||
ss1u home 0
|
ss1u home 0
|
||||||
ss1u movecount $move_count
|
ss1u movecount $move_count
|
||||||
ss1u part slits.first
|
ss1u part slits
|
||||||
ss1u long_name top
|
ss1u long_name first_top
|
||||||
|
|
||||||
# Slit 1, down
|
# Slit 1, down
|
||||||
Motor ss1d $motor_driver_type [params \
|
Motor ss1d $motor_driver_type [params \
|
||||||
@@ -463,8 +463,8 @@ ss1d softlowerlim $ss1d_LoRange
|
|||||||
ss1d softupperlim $ss1d_HiRange
|
ss1d softupperlim $ss1d_HiRange
|
||||||
ss1d home 0
|
ss1d home 0
|
||||||
ss1d movecount $move_count
|
ss1d movecount $move_count
|
||||||
ss1d part slits.first
|
ss1d part slits
|
||||||
ss1d long_name bottom
|
ss1d long_name first_bottom
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# Motor Controller 4
|
# Motor Controller 4
|
||||||
@@ -495,8 +495,8 @@ ss2r softlowerlim $ss2r_LoRange
|
|||||||
ss2r softupperlim $ss2r_HiRange
|
ss2r softupperlim $ss2r_HiRange
|
||||||
ss2r home 0
|
ss2r home 0
|
||||||
ss2r movecount $move_count
|
ss2r movecount $move_count
|
||||||
ss2r part slits.second
|
ss2r part slits
|
||||||
ss2r long_name right
|
ss2r long_name second_right
|
||||||
|
|
||||||
# Slit 2, left
|
# Slit 2, left
|
||||||
Motor ss2l $motor_driver_type [params \
|
Motor ss2l $motor_driver_type [params \
|
||||||
@@ -514,8 +514,8 @@ ss2l softlowerlim $ss2l_LoRange
|
|||||||
ss2l softupperlim $ss2l_HiRange
|
ss2l softupperlim $ss2l_HiRange
|
||||||
ss2l home 0
|
ss2l home 0
|
||||||
ss2l movecount $move_count
|
ss2l movecount $move_count
|
||||||
ss2l part slits.second
|
ss2l part slits
|
||||||
ss2l long_name left
|
ss2l long_name second_left
|
||||||
|
|
||||||
# Slit 2, up
|
# Slit 2, up
|
||||||
Motor ss2u $motor_driver_type [params \
|
Motor ss2u $motor_driver_type [params \
|
||||||
@@ -533,8 +533,8 @@ ss2u softlowerlim $ss2u_LoRange
|
|||||||
ss2u softupperlim $ss2u_HiRange
|
ss2u softupperlim $ss2u_HiRange
|
||||||
ss2u home 0
|
ss2u home 0
|
||||||
ss2u movecount $move_count
|
ss2u movecount $move_count
|
||||||
ss2u part slits.second
|
ss2u part slits
|
||||||
ss2u long_name top
|
ss2u long_name second_top
|
||||||
|
|
||||||
# Slit 2, down
|
# Slit 2, down
|
||||||
Motor ss2d $motor_driver_type [params \
|
Motor ss2d $motor_driver_type [params \
|
||||||
@@ -552,8 +552,8 @@ ss2d softlowerlim $ss2d_LoRange
|
|||||||
ss2d softupperlim $ss2d_HiRange
|
ss2d softupperlim $ss2d_HiRange
|
||||||
ss2d home 0
|
ss2d home 0
|
||||||
ss2d movecount $move_count
|
ss2d movecount $move_count
|
||||||
ss2d part slits.second
|
ss2d part slits
|
||||||
ss2d long_name bottom
|
ss2d long_name second_bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
proc mthGet {} { return [expr [SplitReply [mtth]]/2.0]}
|
proc mthGet {} { return [expr [SplitReply [mtth]]/2.0]}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
|
|
||||||
# Required by server_config.tcl
|
# Required by server_config.tcl
|
||||||
@@ -30,6 +31,8 @@ fileeval $cfPath(hmm)/hmm_configuration.tcl
|
|||||||
fileeval $cfPath(nexus)/nxscripts.tcl
|
fileeval $cfPath(nexus)/nxscripts.tcl
|
||||||
fileeval $cfPath(scan)/scan.tcl
|
fileeval $cfPath(scan)/scan.tcl
|
||||||
fileeval $cfPath(commands)/commands.tcl
|
fileeval $cfPath(commands)/commands.tcl
|
||||||
|
fileeval $cfPath(commands)/pulser.tcl
|
||||||
|
fileeval $cfPath(commands)/hvcommands.tcl
|
||||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||||
fileeval $cfPath(hmm)/hmm_rapid.tcl
|
fileeval $cfPath(hmm)/hmm_rapid.tcl
|
||||||
source gumxml.tcl
|
source gumxml.tcl
|
||||||
@@ -41,14 +44,17 @@ source gumxml.tcl
|
|||||||
# ::environment::temperature::add_ls340 tc2 2
|
# ::environment::temperature::add_ls340 tc2 2
|
||||||
|
|
||||||
# New Lakeshore series driver for models 340 and 336 - (tcl-code, version 20090824) - beta status
|
# New Lakeshore series driver for models 340 and 336 - (tcl-code, version 20090824) - beta status
|
||||||
# driverName shortName IP-address portOnMoxa temperatureTolerance LakeshoreModel
|
# driverName shortName IP-address portOnMoxa temperatureTolerance1 Tolerance2 LakeshoreModel
|
||||||
# ffr 2009-11-11: NOTE I've added a line terminator argument to the ls3xx setup.
|
# ffr 2009-11-11: NOTE I've added a line terminator argument to the ls3xx setup.
|
||||||
# You need to set the line termintator to either "\r\n" for CRLF or "\r" for CR
|
# You need to set the line termintator to either "\r\n" for CRLF or "\r" for CR
|
||||||
# add_ls3xx tc1 137.157.201.85 7777 "\r\n" 0.5 336
|
# name IP-address port term LakeshoreModel tol1 tol2
|
||||||
# add_ls3xx tc2 137.157.201.85 4002 "\r\n" 0.5 340
|
add_ls3xx tc1 137.157.201.85 7777 "\r\n" 336 5 5
|
||||||
|
|
||||||
|
# add_ls3xx tc1 137.157.201.86 4001 "\r\" 400 340
|
||||||
|
# add_ls3xx tc2 137.157.201.86 4002 "\r" 5 5 340
|
||||||
|
|
||||||
|
|
||||||
#::environment::temperature::add_west400
|
#::environment::temperature::add_west400 137.157.201.88
|
||||||
server_init
|
server_init
|
||||||
###########################################
|
###########################################
|
||||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace eval robot {
|
|||||||
MakeAsyncProtocol robot
|
MakeAsyncProtocol robot
|
||||||
MakeAsyncQueue robby robot 137.157.201.26 6000
|
MakeAsyncQueue robby robot 137.157.201.26 6000
|
||||||
robby delay 500
|
robby delay 500
|
||||||
robby timeout 5000
|
robby timeout 50000
|
||||||
drive sx 0 sy 0 som 0
|
drive sx 0 sy 0 som 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,8 +165,8 @@ proc ::histogram_memory::isc_initialize {} {
|
|||||||
::histogram_memory::init_CAT_TABLE
|
::histogram_memory::init_CAT_TABLE
|
||||||
::histogram_memory::upload_config Filler_defaults
|
::histogram_memory::upload_config Filler_defaults
|
||||||
|
|
||||||
::nexus::data alias ::histogram_memory::vertical_axis ::histogram_memory::y_pixel_offset
|
set ::histogram_memory::histmem_axes(HOR) /instrument/detector/x_pixel_angular_offset
|
||||||
::nexus::data alias ::histogram_memory::horizontal_axis ::histogram_memory::x_pixel_angular_offset
|
set ::histogram_memory::histmem_axes(VER) /instrument/detector/y_pixel_offset
|
||||||
} message ] {
|
} message ] {
|
||||||
if {$::errorCode=="NONE"} {return $message}
|
if {$::errorCode=="NONE"} {return $message}
|
||||||
return -code error $message
|
return -code error $message
|
||||||
|
|||||||
@@ -539,8 +539,8 @@ ss1r softlowerlim $ss1r_LoRange
|
|||||||
ss1r softupperlim $ss1r_HiRange
|
ss1r softupperlim $ss1r_HiRange
|
||||||
ss1r home 0
|
ss1r home 0
|
||||||
ss1r movecount $move_count
|
ss1r movecount $move_count
|
||||||
ss1r part slits.first
|
ss1r part slits
|
||||||
ss1r long_name right
|
ss1r long_name first_right
|
||||||
|
|
||||||
# Slit 1, left
|
# Slit 1, left
|
||||||
Motor ss1l $motor_driver_type [params \
|
Motor ss1l $motor_driver_type [params \
|
||||||
@@ -558,8 +558,8 @@ ss1l softlowerlim $ss1l_LoRange
|
|||||||
ss1l softupperlim $ss1l_HiRange
|
ss1l softupperlim $ss1l_HiRange
|
||||||
ss1l home 0
|
ss1l home 0
|
||||||
ss1l movecount $move_count
|
ss1l movecount $move_count
|
||||||
ss1l part slits.first
|
ss1l part slits
|
||||||
ss1l long_name left
|
ss1l long_name first_left
|
||||||
|
|
||||||
# Slit 1, up
|
# Slit 1, up
|
||||||
Motor ss1u $motor_driver_type [params \
|
Motor ss1u $motor_driver_type [params \
|
||||||
@@ -577,8 +577,8 @@ ss1u softlowerlim $ss1u_LoRange
|
|||||||
ss1u softupperlim $ss1u_HiRange
|
ss1u softupperlim $ss1u_HiRange
|
||||||
ss1u home 0
|
ss1u home 0
|
||||||
ss1u movecount $move_count
|
ss1u movecount $move_count
|
||||||
ss1u part slits.first
|
ss1u part slits
|
||||||
ss1u long_name top
|
ss1u long_name first_top
|
||||||
|
|
||||||
# Slit 1, down
|
# Slit 1, down
|
||||||
Motor ss1d $motor_driver_type [params \
|
Motor ss1d $motor_driver_type [params \
|
||||||
@@ -596,8 +596,8 @@ ss1d softlowerlim $ss1d_LoRange
|
|||||||
ss1d softupperlim $ss1d_HiRange
|
ss1d softupperlim $ss1d_HiRange
|
||||||
ss1d home 0
|
ss1d home 0
|
||||||
ss1d movecount $move_count
|
ss1d movecount $move_count
|
||||||
ss1d part slits.first
|
ss1d part slits
|
||||||
ss1d long_name bottom
|
ss1d long_name first_bottom
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# Motor Controller 4
|
# Motor Controller 4
|
||||||
@@ -650,8 +650,8 @@ ss2r softlowerlim $ss2r_LoRange
|
|||||||
ss2r softupperlim $ss2r_HiRange
|
ss2r softupperlim $ss2r_HiRange
|
||||||
ss2r home 0
|
ss2r home 0
|
||||||
ss2r movecount $move_count
|
ss2r movecount $move_count
|
||||||
ss2r part slits.second
|
ss2r part slits
|
||||||
ss2r long_name right
|
ss2r long_name second_right
|
||||||
|
|
||||||
# Slit 2, left
|
# Slit 2, left
|
||||||
Motor ss2l $motor_driver_type [params \
|
Motor ss2l $motor_driver_type [params \
|
||||||
@@ -669,8 +669,8 @@ ss2l softlowerlim $ss2l_LoRange
|
|||||||
ss2l softupperlim $ss2l_HiRange
|
ss2l softupperlim $ss2l_HiRange
|
||||||
ss2l home 0
|
ss2l home 0
|
||||||
ss2l movecount $move_count
|
ss2l movecount $move_count
|
||||||
ss2l part slits.second
|
ss2l part slits
|
||||||
ss2l long_name left
|
ss2l long_name second_left
|
||||||
|
|
||||||
# Slit 2, up
|
# Slit 2, up
|
||||||
Motor ss2u $motor_driver_type [params \
|
Motor ss2u $motor_driver_type [params \
|
||||||
@@ -688,8 +688,8 @@ ss2u softlowerlim $ss2u_LoRange
|
|||||||
ss2u softupperlim $ss2u_HiRange
|
ss2u softupperlim $ss2u_HiRange
|
||||||
ss2u home 0
|
ss2u home 0
|
||||||
ss2u movecount $move_count
|
ss2u movecount $move_count
|
||||||
ss2u part slits.second
|
ss2u part slits
|
||||||
ss2u long_name top
|
ss2u long_name second_top
|
||||||
|
|
||||||
# Slit 2, down
|
# Slit 2, down
|
||||||
Motor ss2d $motor_driver_type [params \
|
Motor ss2d $motor_driver_type [params \
|
||||||
@@ -707,8 +707,8 @@ ss2d softlowerlim $ss2d_LoRange
|
|||||||
ss2d softupperlim $ss2d_HiRange
|
ss2d softupperlim $ss2d_HiRange
|
||||||
ss2d home 0
|
ss2d home 0
|
||||||
ss2d movecount $move_count
|
ss2d movecount $move_count
|
||||||
ss2d part slits.second
|
ss2d part slits
|
||||||
ss2d long_name bottom
|
ss2d long_name second_bottom
|
||||||
|
|
||||||
# Virtual and Simulated Motors
|
# Virtual and Simulated Motors
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
|
|
||||||
# Required by server_config.tcl
|
# Required by server_config.tcl
|
||||||
@@ -35,16 +36,29 @@ fileeval $cfPath(anticollider)/anticollider.tcl
|
|||||||
fileeval $cfPath(environment)/robby_configuration.tcl
|
fileeval $cfPath(environment)/robby_configuration.tcl
|
||||||
source gumxml.tcl
|
source gumxml.tcl
|
||||||
|
|
||||||
# Old Lakeshore340 driver (c-code)
|
|
||||||
# ::environment::temperature::add_ls340 tc1 1
|
# ::environment::temperature::add_ls340 tc1 1
|
||||||
# ::environment::temperature::add_ls340 tc2 2
|
###::environment::temperature::add_ls340 tc2 1
|
||||||
#
|
|
||||||
# New sct Lakeshore340 driver (in tcl)
|
|
||||||
# ::environment::temperature::add_ls340t tc1 1
|
|
||||||
# ::environment::temperature::add_ls340t tc2 2
|
|
||||||
|
|
||||||
# ::environment::temperature::add_west400 137.157.201.14
|
##
|
||||||
::robot::add_robby
|
# New lakeshore driver. BETA status. Data saving not tested
|
||||||
|
#add_ls340t tc1 ca5-[instname] 4001
|
||||||
|
#add_ls340t tc2 ca5-[instname] 4002
|
||||||
|
|
||||||
|
# New Lakeshore series driver for models 340 and 336
|
||||||
|
# driverName shortName IP-address portOnMoxa temperatureTolerance1 Tolerance2 LakeshoreModel
|
||||||
|
# ffr 2009-11-11: NOTE I've added a line terminator argument to the ls3xx setup.
|
||||||
|
# You need to set the line termintator to either "\r\n" for CRLF or "\r" for CR
|
||||||
|
# axm 2010-02-10: NOTE the ls3xx driver versions 2010-01-25 and newer expect 2 tolerance values,
|
||||||
|
# one for each control loop.
|
||||||
|
# name IP-address port term tol1 tol2 LakeshoreModel
|
||||||
|
# add_ls3xx tc1 137.157.201.23 7777 "\r\n" 2.0 10.0 336
|
||||||
|
|
||||||
|
###add_ls3xx tc1 137.157.201.23 7777 "\r\n" 5.0 336
|
||||||
|
#add_ls3xx tc1 ca5-[instname] 4001 "\r\n" 0.5 340
|
||||||
|
#add_ls3xx tc2 ca5-[instname] 4001 "\r" 0.5 340
|
||||||
|
|
||||||
|
::environment::temperature::add_west400 137.157.201.14
|
||||||
|
###::robot::add_robby
|
||||||
server_init
|
server_init
|
||||||
###########################################
|
###########################################
|
||||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace eval exp_mode {
|
|||||||
#4=Single
|
#4=Single
|
||||||
variable c1ht_pos
|
variable c1ht_pos
|
||||||
set valid_modes [list SB DB FOC MT POL]
|
set valid_modes [list SB DB FOC MT POL]
|
||||||
set c1ht_pos [list 1057 806.7 557.1 200 0.1]
|
set c1ht_pos [list 1057 806.7 557.1 320 68.9]
|
||||||
|
|
||||||
command set_mode "text=[join $valid_modes ,] arg " { ;#need to change all softzero's
|
command set_mode "text=[join $valid_modes ,] arg " { ;#need to change all softzero's
|
||||||
global ::exp_mode::valid_modes
|
global ::exp_mode::valid_modes
|
||||||
@@ -64,8 +64,21 @@ namespace eval exp_mode {
|
|||||||
# the following line does the job. However, it is duplicated when the mode is set in
|
# the following line does the job. However, it is duplicated when the mode is set in
|
||||||
# set_omega, so it is commented out for now.
|
# set_omega, so it is commented out for now.
|
||||||
# drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
|
# drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
|
||||||
if {[catch {::exp_mode::set_omega $arg1} errMsg]} {return -code error $errMsg}
|
# if {[catch {::exp_mode::set_omega $arg1} errMsg]} {return -code error $errMsg}
|
||||||
if {[catch {::exp_mode::set_two_theta $arg2} errMsg]} {return -code error $errMsg}
|
# if {[catch {::exp_mode::set_two_theta $arg2} errMsg]} {return -code error $errMsg}
|
||||||
|
|
||||||
|
omega $arg1
|
||||||
|
twotheta $arg2
|
||||||
|
|
||||||
|
if {[catch {
|
||||||
|
::exp_mode::set_omega $arg1
|
||||||
|
::exp_mode::set_two_theta $arg2
|
||||||
|
} errMsg ] } {
|
||||||
|
omega -1
|
||||||
|
twotheta -1
|
||||||
|
return -code error $errMsg
|
||||||
|
}
|
||||||
|
|
||||||
return -code ok
|
return -code ok
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +127,7 @@ proc ::exp_mode::set_omega { arg } {
|
|||||||
|
|
||||||
switch $expmode {
|
switch $expmode {
|
||||||
SB { ;#checked ARJN on 081231
|
SB { ;#checked ARJN on 081231
|
||||||
|
drive st4vt 0
|
||||||
if {[catch {::exp_mode::checkMotionAndDrive m1ro [expr -1.*$arg/2.]} errMsg]} {return -code error $errMsg}
|
if {[catch {::exp_mode::checkMotionAndDrive m1ro [expr -1.*$arg/2.]} errMsg]} {return -code error $errMsg}
|
||||||
|
|
||||||
set d1 [expr [SplitReply [slit3_distance]] - [SplitReply [guide1_distance]]]
|
set d1 [expr [SplitReply [slit3_distance]] - [SplitReply [guide1_distance]]]
|
||||||
@@ -148,23 +162,37 @@ proc ::exp_mode::set_omega { arg } {
|
|||||||
if { [catch {checkMotionAndDrive sz $h2} errMsg]} {return -code error $errMsg}
|
if { [catch {checkMotionAndDrive sz $h2} errMsg]} {return -code error $errMsg}
|
||||||
}
|
}
|
||||||
FOC {
|
FOC {
|
||||||
if { [catch {checkMotionAndDrive sth $arg} errMsg]} {return -code error $errMsg}
|
if { [catch {
|
||||||
if {[catch {checkMotionAndDrive st3vt 0} errMsg]} {return -code error $errMsg}
|
checkMotion sth $arg
|
||||||
|
checkMotion st3vt 0
|
||||||
|
} errMsg ] } {
|
||||||
|
return -code error $errMsg
|
||||||
|
}
|
||||||
|
run sth $arg st3vt 0
|
||||||
}
|
}
|
||||||
MT {
|
MT {
|
||||||
if {[catch {checkMotionAndDrive st3vt 0} errMsg]} {return -code error $errMsg}
|
if { [catch {
|
||||||
if { [catch {checkMotionAndDrive sth $arg} errMsg]} {return -code error $errMsg}
|
checkMotion sth $arg
|
||||||
|
checkMotion st3vt 0
|
||||||
|
} errMsg ] } {
|
||||||
|
return -code error $errMsg
|
||||||
|
}
|
||||||
|
run sth $arg st3vt 0
|
||||||
}
|
}
|
||||||
POL {
|
POL {
|
||||||
if {[catch {checkMotionAndDrive st3vt 0} errMsg]} {return -code error $errMsg}
|
if { [catch {
|
||||||
if { [catch {checkMotionAndDrive sth $arg} errMsg]} {return -code error $errMsg}
|
checkMotion sth $arg
|
||||||
|
checkMotion st3vt 0
|
||||||
|
} errMsg ] } {
|
||||||
|
return -code error $errMsg
|
||||||
|
}
|
||||||
|
run sth $arg st3vt 0
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
return -code error "omega driving not specified for that mode"
|
return -code error "omega driving not specified for that mode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
omega $arg
|
|
||||||
return -code ok
|
return -code ok
|
||||||
}
|
}
|
||||||
publish ::exp_mode::set_omega user
|
publish ::exp_mode::set_omega user
|
||||||
@@ -236,8 +264,13 @@ proc ::exp_mode::set_two_theta { arg } {
|
|||||||
set h1 [expr $d1 * tan($argrad)]
|
set h1 [expr $d1 * tan($argrad)]
|
||||||
set h2 [expr $d2 * tan($argrad)]
|
set h2 [expr $d2 * tan($argrad)]
|
||||||
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
|
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
|
||||||
if { [catch {checkMotionAndDrive st4vt $h2} errMsg]} {return -code error $errMsg}
|
if { [catch {
|
||||||
if { [catch {checkMotionAndDrive dz $h1} errMsg]} {return -code error $errMsg}
|
checkMotion st4vt $h2
|
||||||
|
checkMotion dz $h1
|
||||||
|
} errMsg]} {
|
||||||
|
return -code error $errMsg
|
||||||
|
}
|
||||||
|
run st4vt $h2 dz $h1
|
||||||
}
|
}
|
||||||
MT {
|
MT {
|
||||||
set d1 [SplitReply [dy]]
|
set d1 [SplitReply [dy]]
|
||||||
@@ -245,8 +278,13 @@ proc ::exp_mode::set_two_theta { arg } {
|
|||||||
set h1 [expr $d1 * tan($argrad)]
|
set h1 [expr $d1 * tan($argrad)]
|
||||||
set h2 [expr $d2 * tan($argrad)]
|
set h2 [expr $d2 * tan($argrad)]
|
||||||
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
|
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
|
||||||
if { [catch {checkMotionAndDrive st4vt $h2} errMsg]} {return -code error $errMsg}
|
if { [catch {
|
||||||
if { [catch {checkMotionAndDrive dz $h1} errMsg]} {return -code error $errMsg}
|
checkMotion st4vt $h2
|
||||||
|
checkMotion dz $h1
|
||||||
|
} errMsg ] } {
|
||||||
|
return -code error $errMsg
|
||||||
|
}
|
||||||
|
run st4vt $h2 dz $h1
|
||||||
}
|
}
|
||||||
POL {
|
POL {
|
||||||
set d1 [SplitReply [dy]]
|
set d1 [SplitReply [dy]]
|
||||||
@@ -257,17 +295,20 @@ proc ::exp_mode::set_two_theta { arg } {
|
|||||||
set h3 [expr $d3 * tan($argrad)]
|
set h3 [expr $d3 * tan($argrad)]
|
||||||
set ang1 [expr $arg + 0.8]
|
set ang1 [expr $arg + 0.8]
|
||||||
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
|
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
|
||||||
if { [catch {checkMotionAndDrive st4vt $h2} errMsg]} {return -code error $errMsg}
|
if { [catch {
|
||||||
if { [catch {checkMotionAndDrive dz $h1} errMsg]} {return -code error $errMsg}
|
checkMotion st4vt $h2
|
||||||
if { [catch {checkMotionAndDrive analz $h3} errMsg]} {return -code error $errMsg}
|
checkMotion dz $h1
|
||||||
if { [catch {checkMotionAndDrive analtilt $ang1} errMsg]} {return -code error $errMsg}
|
checkMotion analz $h3
|
||||||
|
checkMotion analtilit $ang1
|
||||||
|
} errMsg ] } {
|
||||||
|
return -code error $errMsg
|
||||||
|
}
|
||||||
|
run st4vt $h2 dz $h1 analz $h3 analtilit $ang1
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
return -code error "two_theta not defined for that mode: $expmode"
|
return -code error "two_theta not defined for that mode: $expmode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
twotheta $arg
|
|
||||||
return -code ok
|
return -code ok
|
||||||
}
|
}
|
||||||
publish ::exp_mode::set_two_theta user
|
publish ::exp_mode::set_two_theta user
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ if {$sim_mode == "true"} {
|
|||||||
#Measured absolute encoder reading at home position
|
#Measured absolute encoder reading at home position
|
||||||
|
|
||||||
set bz_home 8142000
|
set bz_home 8142000
|
||||||
set c1ht_home 8152065
|
#set c1ht_home 8152065 - this is wrong, it should be 8265000
|
||||||
|
set c1ht_home 8265000
|
||||||
set m1ro_home 134658
|
set m1ro_home 134658
|
||||||
set bat_home 8308518
|
set bat_home 8308518
|
||||||
set st3vt_home 5250496
|
set st3vt_home 5250496
|
||||||
|
|||||||
@@ -52,27 +52,31 @@ detector_distance 10000
|
|||||||
detector_base 300
|
detector_base 300
|
||||||
anal_distance 1808
|
anal_distance 1808
|
||||||
anal_base 20
|
anal_base 20
|
||||||
slit4_distance 5527
|
slit4_distance 5331.15
|
||||||
slit4_base 20
|
slit4_base 20
|
||||||
sample_distance 5129
|
sample_distance 5045.4
|
||||||
sample_base 50
|
sample_base 50
|
||||||
slit3_distance 4808
|
slit3_distance 4744.4
|
||||||
slit3_base 20
|
slit3_base 20
|
||||||
guide1_distance 2900.4 ;# distance measured to axis of rotation
|
guide1_distance 2900.4 ;# distance measured to axis of rotation
|
||||||
guide1_base
|
guide1_base
|
||||||
guide2_distance 3200 ;# distance measured to midpoint of the 2nd compound mirror (i.e. closest to the sample)
|
guide2_distance 3200 ;# distance measured to midpoint of the 2nd compound mirror (i.e. closest to the sample)
|
||||||
guide2_base
|
guide2_base
|
||||||
slit2_distance 1895
|
slit2_distance 1909.9
|
||||||
slit2_base 20
|
slit2_base 20
|
||||||
chopper4_distance 823
|
chopper4_distance 808
|
||||||
chopper4_base 20
|
chopper4_base 20
|
||||||
chopper3_distance 370
|
chopper4_phase_offset 0.3246
|
||||||
|
chopper3_distance 359
|
||||||
chopper3_base 20
|
chopper3_base 20
|
||||||
chopper2_distance 102
|
chopper3_phase_offset 0.38500
|
||||||
|
chopper2_distance 103
|
||||||
chopper2_base 20
|
chopper2_base 20
|
||||||
|
chopper2_phase_offset -0.02
|
||||||
chopper1_distance 0
|
chopper1_distance 0
|
||||||
chopper1_base 20
|
chopper1_base 20
|
||||||
slit1_distance -244
|
chopper1_phase_offset -1.857
|
||||||
|
slit1_distance -256.1
|
||||||
slit1_base 20
|
slit1_base 20
|
||||||
mode NONE
|
mode NONE
|
||||||
omega -1
|
omega -1
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ source gumxml.tcl
|
|||||||
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
|
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
|
||||||
::anticollider::protect_detector "true"
|
::anticollider::protect_detector "true"
|
||||||
|
|
||||||
# Driver for Bruker BEC1 power supply (1-Tesla Magnet) - beta
|
# Driver for Bruker BEC1 power supply (1-Tesla Magnet)
|
||||||
# driver short-name IP-address MoxaPort Tolerance(Amps)
|
# driver short-name IP-address MoxaPort Tolerance(Amps)
|
||||||
#add_bruker_BEC1 ma1 137.157.202.145 4003 0.1
|
#add_bruker_BEC1 ma1 137.157.202.152 4444 0.1
|
||||||
|
|
||||||
server_init
|
server_init
|
||||||
###########################################
|
###########################################
|
||||||
|
|||||||
@@ -4,33 +4,91 @@
|
|||||||
# Home value for Eulerian cradle
|
# Home value for Eulerian cradle
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
# this is the Huber Eulerian cradle
|
||||||
|
#
|
||||||
set eom_Home 23165406
|
set eom_Home 23165406
|
||||||
set ephi_Home 6647676
|
set ephi_Home 6647676
|
||||||
set echi_Home 8919336
|
set echi_Home 8919336
|
||||||
|
|
||||||
|
set eom_stepsPerX [expr -25000.0]
|
||||||
|
set eom_cntsPerX [expr 8192.0]
|
||||||
|
|
||||||
|
set ephi_stepsPerX [expr -25000.0/2.0]
|
||||||
|
set ephi_cntsPerX [expr -8192.0/2.0]
|
||||||
|
|
||||||
|
set echi_stepsPerX [expr -25000.0/1.0]
|
||||||
|
set echi_cntsPerX [expr 8192.0/1.0]
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# this is our own tiny black cradle
|
||||||
|
#
|
||||||
|
#set eom_Home 23165406
|
||||||
|
#set ephi_Home 20947518
|
||||||
|
#set echi_Home 24735790
|
||||||
|
#
|
||||||
|
#set eom_stepsPerX [expr -25000.0]
|
||||||
|
#set eom_cntsPerX [expr 8192.0]
|
||||||
|
#
|
||||||
|
#set ephi_stepsPerX [expr -25000.0]
|
||||||
|
#set ephi_cntsPerX [expr 8192.0]
|
||||||
|
#
|
||||||
|
#set echi_stepsPerX [expr -25000.0]
|
||||||
|
#set echi_cntsPerX [expr 8192.0]
|
||||||
|
|
||||||
|
|
||||||
# Sample Tilt 1, euler omega stage -> exchange with ssw further down
|
# Sample Tilt 1, euler omega stage -> exchange with ssw further down
|
||||||
|
#Motor eom $motor_driver_type [params \
|
||||||
|
# asyncqueue mc4\
|
||||||
|
# axis F\
|
||||||
|
# units degrees\
|
||||||
|
# hardlowerlim -390\
|
||||||
|
# hardupperlim 390\
|
||||||
|
# maxSpeed 1\
|
||||||
|
# maxAccel 1\
|
||||||
|
# maxDecel 1\
|
||||||
|
# stepsPerX $eom_stepsPerX\
|
||||||
|
# absEnc 1\
|
||||||
|
# absEncHome $eom_Home\
|
||||||
|
# cntsPerX $eom_cntsPer]
|
||||||
|
#setHomeandRange -motor eom -home 0 -lowrange -390 -uprange 390
|
||||||
|
#eom speed 1
|
||||||
|
#eom softlowerlim -390
|
||||||
|
#eom softupperlim 390
|
||||||
|
#eom movecount $move_count
|
||||||
|
#eom precision 0.01
|
||||||
|
#eom part sample
|
||||||
|
#eom long_name eom
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# use sample omega until euler omega gets its own cables
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Sample Omega, rotate
|
||||||
Motor eom $motor_driver_type [params \
|
Motor eom $motor_driver_type [params \
|
||||||
asyncqueue mc4\
|
asyncqueue mc2\
|
||||||
axis F\
|
axis E\
|
||||||
units degrees\
|
units degrees\
|
||||||
hardlowerlim -390\
|
hardlowerlim -180\
|
||||||
hardupperlim 390\
|
hardupperlim 180\
|
||||||
maxSpeed 1\
|
maxSpeed 3\
|
||||||
maxAccel 1\
|
maxAccel 5\
|
||||||
maxDecel 1\
|
maxDecel 5\
|
||||||
stepsPerX -25000\
|
stepsPerX [expr -25000.0*(383.0/360.0)]\
|
||||||
absEnc 1\
|
absEnc 1\
|
||||||
absEncHome $eom_Home\
|
absEncHome 26472736\
|
||||||
cntsPerX 8192]
|
cntsPerX [expr 8192.0*(383.0/360.0)]]
|
||||||
eom speed 1
|
setHomeandRange -motor som -home 0 -lowrange 178 -uprange 178
|
||||||
eom softlowerlim -390
|
eom Backlash_offset -0.5
|
||||||
eom softupperlim 390
|
eom speed 2
|
||||||
eom home 0
|
eom accel 0.1
|
||||||
eom movecount $move_count
|
eom decel 0.1
|
||||||
eom precision 0.01
|
eom precision 0.01
|
||||||
eom part sample
|
eom part sample
|
||||||
eom long_name eom
|
eom long_name eom
|
||||||
|
|
||||||
|
|
||||||
# Sample Tilt 2, euler chi stage -> EC1
|
# Sample Tilt 2, euler chi stage -> EC1
|
||||||
Motor echi $motor_driver_type [params \
|
Motor echi $motor_driver_type [params \
|
||||||
asyncqueue mc2\
|
asyncqueue mc2\
|
||||||
@@ -38,13 +96,14 @@ Motor echi $motor_driver_type [params \
|
|||||||
units degrees\
|
units degrees\
|
||||||
hardlowerlim -390\
|
hardlowerlim -390\
|
||||||
hardupperlim 390\
|
hardupperlim 390\
|
||||||
maxSpeed 5\
|
maxSpeed 10\
|
||||||
maxAccel 3\
|
maxAccel 3\
|
||||||
maxDecel 3\
|
maxDecel 3\
|
||||||
stepsPerX [expr -25000 ]\
|
stepsPerX $echi_stepsPerX\
|
||||||
absEnc 1\
|
absEnc 1\
|
||||||
absEncHome $echi_Home\
|
absEncHome $echi_Home\
|
||||||
cntsPerX [expr 8192 ] ]
|
cntsPerX $echi_cntsPerX ]
|
||||||
|
setHomeandRange -motor echi -home 0 -lowrange -390 -uprange 390
|
||||||
echi softlowerlim -10
|
echi softlowerlim -10
|
||||||
echi softupperlim 90
|
echi softupperlim 90
|
||||||
echi home 0
|
echi home 0
|
||||||
@@ -61,13 +120,13 @@ Motor ephi $motor_driver_type [params \
|
|||||||
units degrees\
|
units degrees\
|
||||||
hardlowerlim -400\
|
hardlowerlim -400\
|
||||||
hardupperlim 400\
|
hardupperlim 400\
|
||||||
maxSpeed 3\
|
maxSpeed 10\
|
||||||
maxAccel 1\
|
maxAccel 1\
|
||||||
maxDecel 1\
|
maxDecel 1\
|
||||||
stepsPerX [expr -25000.0/2.0]\
|
stepsPerX $ephi_stepsPerX\
|
||||||
absEnc 1\
|
absEnc 1\
|
||||||
absEncHome $ephi_Home\
|
absEncHome $ephi_Home\
|
||||||
cntsPerX [expr -8192.0/2.0]]
|
cntsPerX $ephi_cntsPerX]
|
||||||
setHomeandRange -motor ephi -home 0 -lowrange 400 -uprange 400
|
setHomeandRange -motor ephi -home 0 -lowrange 400 -uprange 400
|
||||||
ephi softlowerlim -400
|
ephi softlowerlim -400
|
||||||
ephi softupperlim 400
|
ephi softupperlim 400
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ set sz_home 2147456656
|
|||||||
#set sx_Home 9041997
|
#set sx_Home 9041997
|
||||||
# value after dismanteling the table
|
# value after dismanteling the table
|
||||||
# parameter sz=419.01 - mtth=79
|
# parameter sz=419.01 - mtth=79
|
||||||
set sx_Home 9050918
|
set sx_Home 9050281
|
||||||
|
|
||||||
|
|
||||||
#set sy_Home 7230717
|
#set sy_Home 7230717
|
||||||
@@ -84,7 +84,7 @@ set sx_Home 9050918
|
|||||||
# value after dismanteling the table
|
# value after dismanteling the table
|
||||||
# parameter sz=419.01 - mtth=79
|
# parameter sz=419.01 - mtth=79
|
||||||
#set sy_Home 18814870
|
#set sy_Home 18814870
|
||||||
set sy_Home 18815280
|
set sy_Home 18815689
|
||||||
|
|
||||||
# swapped sx with sy after rotation of vertical stage
|
# swapped sx with sy after rotation of vertical stage
|
||||||
set sx_pitch 4.9995324
|
set sx_pitch 4.9995324
|
||||||
@@ -116,19 +116,20 @@ set psho_home 7576691
|
|||||||
set psp_home 3977689
|
set psp_home 3977689
|
||||||
# set home value to be equal to front limit switch 28.01.2009, corr. to 50 mm distance to the stits front edge
|
# set home value to be equal to front limit switch 28.01.2009, corr. to 50 mm distance to the stits front edge
|
||||||
set psp_home 4084134
|
set psp_home 4084134
|
||||||
|
set psp_home 4813236
|
||||||
|
|
||||||
#set psw_home 2040518
|
#set psw_home 2040518
|
||||||
|
|
||||||
#set psw_home 7784698
|
#set psw_home 7784698
|
||||||
set psw_home 7789698
|
#set psw_home 7789698
|
||||||
|
set psw_home 7785599
|
||||||
|
|
||||||
#set ssho_home 500000
|
#set ssho_home 500000
|
||||||
#set ssho_home 7193394
|
#set ssho_home 7193394
|
||||||
set ssho_home 6877100
|
set ssho_home 6877100
|
||||||
#set ssp_home 2043085
|
#set ssp_home 2043085
|
||||||
#set ssp_home 8701689
|
#set ssp_home 8701689
|
||||||
set ssp_home 8701400
|
#set ssp_home 8701400
|
||||||
|
set ssp_home 9192956
|
||||||
|
|
||||||
set move_count 10
|
set move_count 10
|
||||||
|
|
||||||
@@ -325,7 +326,7 @@ Motor sz $motor_driver_type [params \
|
|||||||
axis A\
|
axis A\
|
||||||
units mm\
|
units mm\
|
||||||
hardlowerlim 0\
|
hardlowerlim 0\
|
||||||
hardupperlim 460\
|
hardupperlim 500\
|
||||||
maxSpeed 2\
|
maxSpeed 2\
|
||||||
maxAccel 1\
|
maxAccel 1\
|
||||||
maxDecel 1\
|
maxDecel 1\
|
||||||
@@ -334,8 +335,8 @@ Motor sz $motor_driver_type [params \
|
|||||||
absenchome $sz_home\
|
absenchome $sz_home\
|
||||||
cntsPerX -[expr (1<<15)/260.165]]
|
cntsPerX -[expr (1<<15)/260.165]]
|
||||||
setHomeandRange -motor sz -home 0 -lowrange 0 -uprange 350
|
setHomeandRange -motor sz -home 0 -lowrange 0 -uprange 350
|
||||||
sz speed 1
|
sz speed 0.6
|
||||||
sz softupperlim 460
|
sz softupperlim 500
|
||||||
sz softlowerlim 0
|
sz softlowerlim 0
|
||||||
sz part sample
|
sz part sample
|
||||||
sz backlash_offset -1
|
sz backlash_offset -1
|
||||||
@@ -471,7 +472,7 @@ Motor som $motor_driver_type [params \
|
|||||||
axis E\
|
axis E\
|
||||||
units degrees\
|
units degrees\
|
||||||
hardlowerlim -180\
|
hardlowerlim -180\
|
||||||
hardupperlim 185\
|
hardupperlim 180\
|
||||||
maxSpeed 3\
|
maxSpeed 3\
|
||||||
maxAccel 5\
|
maxAccel 5\
|
||||||
maxDecel 5\
|
maxDecel 5\
|
||||||
@@ -479,7 +480,7 @@ Motor som $motor_driver_type [params \
|
|||||||
absEnc 1\
|
absEnc 1\
|
||||||
absEncHome $som_Home\
|
absEncHome $som_Home\
|
||||||
cntsPerX [expr -8192.0*(383.0/360.0)]]
|
cntsPerX [expr -8192.0*(383.0/360.0)]]
|
||||||
setHomeandRange -motor som -home 0 -lowrange 180 -uprange 180
|
setHomeandRange -motor som -home 0 -lowrange 178 -uprange 178
|
||||||
som Backlash_offset -0.5
|
som Backlash_offset -0.5
|
||||||
som speed 2
|
som speed 2
|
||||||
som accel 0.1
|
som accel 0.1
|
||||||
@@ -493,7 +494,7 @@ Motor stth $motor_driver_type [params \
|
|||||||
asyncqueue mc2\
|
asyncqueue mc2\
|
||||||
axis F\
|
axis F\
|
||||||
units degrees\
|
units degrees\
|
||||||
hardlowerlim 40\
|
hardlowerlim 30\
|
||||||
hardupperlim 119.6\
|
hardupperlim 119.6\
|
||||||
maxSpeed 0.5\
|
maxSpeed 0.5\
|
||||||
maxAccel 0.1\
|
maxAccel 0.1\
|
||||||
@@ -502,7 +503,7 @@ Motor stth $motor_driver_type [params \
|
|||||||
absEnc 1\
|
absEnc 1\
|
||||||
absEncHome $stth_Home\
|
absEncHome $stth_Home\
|
||||||
cntsPerX [expr -8192.0/$stth_pitch]]
|
cntsPerX [expr -8192.0/$stth_pitch]]
|
||||||
stth softlowerlim 40
|
stth softlowerlim 30
|
||||||
stth softupperlim 119.6
|
stth softupperlim 119.6
|
||||||
stth home 0
|
stth home 0
|
||||||
stth speed 0.2
|
stth speed 0.2
|
||||||
@@ -607,7 +608,7 @@ Motor psp $motor_driver_type [params \
|
|||||||
axis B\
|
axis B\
|
||||||
units mm\
|
units mm\
|
||||||
hardlowerlim 0\
|
hardlowerlim 0\
|
||||||
hardupperlim 150\
|
hardupperlim 280\
|
||||||
maxSpeed 4\
|
maxSpeed 4\
|
||||||
maxAccel 1\
|
maxAccel 1\
|
||||||
maxDecel 1\
|
maxDecel 1\
|
||||||
@@ -619,7 +620,7 @@ psp speed 4
|
|||||||
psp Backlash_offset -0.3
|
psp Backlash_offset -0.3
|
||||||
psp part slits
|
psp part slits
|
||||||
psp long_name primary_psp
|
psp long_name primary_psp
|
||||||
setHomeandRange -motor psp -home 0 -lowrange 0 -uprange 150
|
setHomeandRange -motor psp -home 0 -lowrange 0 -uprange 280
|
||||||
|
|
||||||
# Primary Slit, width, 0-30mm
|
# Primary Slit, width, 0-30mm
|
||||||
Motor psw $motor_driver_type [params \
|
Motor psw $motor_driver_type [params \
|
||||||
@@ -670,7 +671,7 @@ Motor ssp $motor_driver_type [params \
|
|||||||
axis E\
|
axis E\
|
||||||
units mm\
|
units mm\
|
||||||
hardlowerlim 0\
|
hardlowerlim 0\
|
||||||
hardupperlim 150\
|
hardupperlim 220\
|
||||||
maxSpeed 4\
|
maxSpeed 4\
|
||||||
maxAccel 1\
|
maxAccel 1\
|
||||||
maxDecel 1\
|
maxDecel 1\
|
||||||
@@ -682,7 +683,7 @@ ssp speed 4
|
|||||||
ssp Backlash_offset -0.3
|
ssp Backlash_offset -0.3
|
||||||
ssp part slits
|
ssp part slits
|
||||||
ssp long_name secondary_ssp
|
ssp long_name secondary_ssp
|
||||||
setHomeandRange -motor ssp -home 0 -lowrange 0 -uprange 150
|
setHomeandRange -motor ssp -home 0 -lowrange 0 -uprange 220
|
||||||
|
|
||||||
# Primary Slit, height, 0-30mm
|
# Primary Slit, height, 0-30mm
|
||||||
#Motor psh $motor_driver_type [params \
|
#Motor psh $motor_driver_type [params \
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
set ssw_home 8220625
|
set ssw_home 8216527
|
||||||
|
|
||||||
# Secondary Slit, width
|
# Secondary Slit, width
|
||||||
Motor ssw $motor_driver_type [params \
|
Motor ssw $motor_driver_type [params \
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
# START MOTOR CONFIGURATION
|
# START MOTOR CONFIGURATION
|
||||||
::utility::mkVar FastShutter text manager FastShutter false instrument true false
|
::utility::mkVar FastShutter text manager FastShutter false instrument true false
|
||||||
|
|
||||||
|
# SET TO 1 TO USE THE TILT STAGE ie sample phi and chi
|
||||||
|
set use_tiltstage 0
|
||||||
|
|
||||||
set animal quokka
|
set animal quokka
|
||||||
set sim_mode [SplitReply [motor_simulation]]
|
set sim_mode [SplitReply [motor_simulation]]
|
||||||
|
|
||||||
@@ -174,7 +177,7 @@ dummy_motor softlowerlim -500
|
|||||||
dummy_motor softupperlim 500
|
dummy_motor softupperlim 500
|
||||||
dummy_motor home 0
|
dummy_motor home 0
|
||||||
|
|
||||||
|
if $use_tiltstage {
|
||||||
# Sample tilt along beam [-20,+20] degrees
|
# Sample tilt along beam [-20,+20] degrees
|
||||||
Motor samchi $motor_driver_type [params \
|
Motor samchi $motor_driver_type [params \
|
||||||
asyncqueue mc1\
|
asyncqueue mc1\
|
||||||
@@ -218,7 +221,7 @@ samphi long_name sample_phi
|
|||||||
samphi softlowerlim -20
|
samphi softlowerlim -20
|
||||||
samphi softupperlim 20
|
samphi softupperlim 20
|
||||||
samphi home 0
|
samphi home 0
|
||||||
|
}
|
||||||
# Sample translation across beam [0,1000] mm
|
# Sample translation across beam [0,1000] mm
|
||||||
Motor samx $motor_driver_type [params \
|
Motor samx $motor_driver_type [params \
|
||||||
asyncqueue mc1\
|
asyncqueue mc1\
|
||||||
@@ -724,25 +727,25 @@ apx softupperlim 5
|
|||||||
apx speed 5
|
apx speed 5
|
||||||
|
|
||||||
# Sample aperture y
|
# Sample aperture y
|
||||||
Motor apz $motor_driver_type [params \
|
#Motor apz $motor_driver_type [params \
|
||||||
asyncqueue mc3\
|
# asyncqueue mc3\
|
||||||
host mc3-quokka\
|
# host mc3-quokka\
|
||||||
port pmc3-quokka\
|
# port pmc3-quokka\
|
||||||
axis F\
|
# axis F\
|
||||||
units mm\
|
# units mm\
|
||||||
hardlowerlim -10\
|
# hardlowerlim -10\
|
||||||
hardupperlim 10\
|
# hardupperlim 10\
|
||||||
maxSpeed 1\
|
# maxSpeed 1\
|
||||||
maxAccel 1\
|
# maxAccel 1\
|
||||||
maxDecel 1\
|
# maxDecel 1\
|
||||||
stepsPerX 25000\
|
# stepsPerX 25000\
|
||||||
absEnc 1\
|
# absEnc 1\
|
||||||
absEncHome $apz_Home\
|
# absEncHome $apz_Home\
|
||||||
cntsPerX -8192]
|
# cntsPerX -8192]
|
||||||
apz part collimator
|
#apz part collimator
|
||||||
apz long_name apz
|
#apz long_name apz
|
||||||
setHomeandRange -motor apz -home 0 -lowrange 0 -uprange 5
|
#setHomeandRange -motor apz -home 0 -lowrange 0 -uprange 5
|
||||||
apz speed 1
|
#apz speed 1
|
||||||
|
|
||||||
# Rotary attenuator
|
# Rotary attenuator
|
||||||
set att_factor [expr ((1.0 - (1.0)/360.0)*(3000.0/61.0))/360.0]
|
set att_factor [expr ((1.0 - (1.0)/360.0)*(3000.0/61.0))/360.0]
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
##
|
##
|
||||||
# Note EndFacePosY and RotApPosY are surveyed positions
|
# Note EndFacePosY and RotApPosY are surveyed positions
|
||||||
foreach {var lname type priv units klass} {
|
foreach {var lname type priv units klass} {
|
||||||
BeamCenterX BeamCenterX float user mm parameter
|
BeamCenterX BeamCenterX float user mm reduce
|
||||||
BeamCenterZ BeamCenterZ float user mm parameter
|
BeamCenterZ BeamCenterZ float user mm reduce
|
||||||
BeamStop BeamStop int user none parameter
|
BeamStop BeamStop int user none parameter
|
||||||
BSdiam BSdiam float user mm parameter
|
BSdiam BSdiam float user mm parameter
|
||||||
EApPosY EApPosY float user mm parameter
|
EApPosY EApPosY float user mm parameter
|
||||||
|
|||||||
Reference in New Issue
Block a user