Common SICS configuration and some utility functions
r1080 | ffr | 2006-08-25 12:44:09 +1000 (Fri, 25 Aug 2006) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
e1dc2842d0
commit
d10c726ccf
51
site_ansto/instrument/server_config.tcl
Normal file
51
site_ansto/instrument/server_config.tcl
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# SICS common configuration
|
||||||
|
|
||||||
|
# $Revision: 1.1 $
|
||||||
|
# $Date: 2006-08-25 02:44:09 $
|
||||||
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
|
# Last revision by $Author: ffr $
|
||||||
|
|
||||||
|
|
||||||
|
installprotocolhandler
|
||||||
|
|
||||||
|
source utility.tcl
|
||||||
|
|
||||||
|
set sicshome "/usr/local/sics"
|
||||||
|
ServerOption statusfile $sicshome/log/status.tcl
|
||||||
|
ServerOption RedirectFile $sicshome/log/stdout
|
||||||
|
ServerOption LogFileBaseName $sicshome/log/serverlog
|
||||||
|
ServerOption LogFileDir $sicshome/log
|
||||||
|
ServerOption QuieckPort 60004
|
||||||
|
ServerOption ServerPort 60003
|
||||||
|
ServerOption InterruptPort 60002
|
||||||
|
ServerOption TelWord sicslogin
|
||||||
|
ServerOption TelnetPort 60001
|
||||||
|
ServerOption ReadUserPasswdTimeout 600000
|
||||||
|
ServerOption AcceptTimeOut 10
|
||||||
|
ServerOption ReadTimeOut 10
|
||||||
|
SicsUser manager ansto 1
|
||||||
|
SicsUser user sydney 2
|
||||||
|
SicsUser spy 007 3
|
||||||
|
MakeDataNumber SicsDataNumber $sicshome/data/DataNumber
|
||||||
|
VarMake SicsDataPath Text Internal
|
||||||
|
SicsDataPath $sicshome/data/
|
||||||
|
SicsDataPath lock
|
||||||
|
VarMake SicsDataPrefix Text Internal
|
||||||
|
SicsDataPrefix ansto
|
||||||
|
SicsDataPrefix lock
|
||||||
|
VarMake SicsDataPostFix Text Internal
|
||||||
|
SicsDataPostFix .hdf
|
||||||
|
SicsDataPostFix lock
|
||||||
|
VarMake Title Text User
|
||||||
|
VarMake Sample Text User
|
||||||
|
VarMake User Text User
|
||||||
|
VarMake starttime Text User
|
||||||
|
VarMake currentfile Text User
|
||||||
|
VarMake batchroot Text User
|
||||||
|
VarMake Instrument Text Internal
|
||||||
|
Instrument HRPD
|
||||||
|
Instrument lock
|
||||||
|
MakeDrive
|
||||||
|
|
||||||
|
# Useful for making configurable batch files.
|
||||||
|
publish set user
|
||||||
53
site_ansto/instrument/utility.tcl
Normal file
53
site_ansto/instrument/utility.tcl
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Some useful functions for SICS configuration.
|
||||||
|
|
||||||
|
# $Revision: 1.1 $
|
||||||
|
# $Date: 2006-08-25 02:44:09 $
|
||||||
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
|
# Last revision by $Author: ffr $
|
||||||
|
|
||||||
|
# Utility fucntion for setting the home and upper and lower
|
||||||
|
# limits for a motor
|
||||||
|
proc setHomeandRange {args} {
|
||||||
|
set usage "
|
||||||
|
Usage: setHomeandRange -motor motName -home homeVal -lowrange low -uprange high
|
||||||
|
eg
|
||||||
|
setHomeandRange -motor mchi -home 90 -lowrange 5 -uprange 7
|
||||||
|
this sets the home position to 90 degreess for motor mchi
|
||||||
|
with the lower limit at 85 and the upper limit at 97
|
||||||
|
"
|
||||||
|
if {$args == ""} {clientput $usage; return}
|
||||||
|
array set params $args
|
||||||
|
set motor $params(-motor)
|
||||||
|
set home $params(-home)
|
||||||
|
set lowlim [expr $home - $params(-lowrange)]
|
||||||
|
set uplim [expr $home + $params(-uprange)]
|
||||||
|
|
||||||
|
uplevel 1 "$motor home $home"
|
||||||
|
uplevel 1 "$motor hardlowerlim $lowlim"
|
||||||
|
uplevel 1 "$motor hardupperlim $uplim"
|
||||||
|
uplevel 1 "$motor softlowerlim $lowlim"
|
||||||
|
uplevel 1 "$motor softupperlim $uplim"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use this to create an array of named parameters to initialise motors.
|
||||||
|
proc params {args} {
|
||||||
|
upvar 1 "" x;
|
||||||
|
if [info exists x] {unset x}
|
||||||
|
eval "array set x [list $args]"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse motor readings for virtual motor scripts.
|
||||||
|
proc SplitReply { text } {
|
||||||
|
set l [split $text =]
|
||||||
|
return [lindex $l 1]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Sets motor position reading to pos by adjusting the softzero
|
||||||
|
proc setpos {motor pos} {
|
||||||
|
set currPos [SplitReply [$motor]]
|
||||||
|
set oldZero [SplitReply [$motor softzero]]
|
||||||
|
set newZero [expr $currPos - $pos + $oldZero]
|
||||||
|
uplevel #0 "$motor softzero $newZero"
|
||||||
|
}
|
||||||
|
publish setpos user
|
||||||
|
publish SplitReply user
|
||||||
Reference in New Issue
Block a user