sct_flipper.tcl
Fixed simulated driver mode. ascon.c Added host and port to ascon error messages. r2937 | ffr | 2010-05-24 14:24:04 +1000 (Mon, 24 May 2010) | 6 lines
This commit is contained in:
committed by
Douglas Clowes
parent
b1bfbb08b5
commit
a0923650d9
@@ -17,8 +17,21 @@
|
||||
# }
|
||||
#
|
||||
# NOTE:
|
||||
# If tuning=1 this will generate flipper/set_current and flipper/set_frequency nodes for the instrument scientists.
|
||||
# The tuining parameter should be set to 0 for the users.
|
||||
# If tuning=1 this will generate flipper/set_current and flipper/set_frequency
|
||||
# nodes for the instrument scientists.
|
||||
# The tuning parameter should be set to 0 for the users.
|
||||
#
|
||||
# The operation_manual_Platypus_polarization_system.doc:Sec 3.1 states the following
|
||||
# Attention
|
||||
# a) Do not switch on the RF output with non-zero current setting (the current
|
||||
# control becomes unstable)! If unsure, rotate the current setting
|
||||
# potentiometer 10 turns counter-clockwise.
|
||||
# b) In case of RF vacuum discharge (harmful for the system)
|
||||
# " the main symptom is that the RF power source turns into CV mode, the
|
||||
# voltage increases to 34 Vem and the current decreases;
|
||||
# " switch off the RF output;
|
||||
# " decrease current setting by rotating the potentiometer 10 turns counter-clockwise;
|
||||
# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar.
|
||||
|
||||
namespace eval ::scobj::rfgen {
|
||||
# Control states
|
||||
@@ -127,6 +140,8 @@ proc ::scobj::rfgen::rdStatFunc {} {
|
||||
variable RAMPTOZERO
|
||||
variable RAMPIDLE
|
||||
|
||||
set MAXVOLTAGE 34
|
||||
|
||||
set basePath [sct]
|
||||
|
||||
set currSuperState [sct ramping]
|
||||
@@ -140,6 +155,16 @@ proc ::scobj::rfgen::rdStatFunc {} {
|
||||
set statList [split $statStr "|="]
|
||||
mkStatArr stateArr $statList
|
||||
|
||||
if {$stateArr(CV)} {
|
||||
broadcast "WARNING: spin flipper has switched to voltage control"
|
||||
if {$stateArr(voltage) >= $MAXVOLTAGE} {
|
||||
set errMsg "ERROR: Spin flipper switched off voltage exceeds $MAXVOLTAGE in voltage control state, check vacuum"
|
||||
sct geterror $errMsg
|
||||
broadcast $errMsg
|
||||
sct ramping $RAMPSTOP
|
||||
return stateChange
|
||||
}
|
||||
}
|
||||
|
||||
if {$statList != [sct oldStateRep]} {
|
||||
hset $basePath/flip_current [expr {$stateArr(curr) / 10.0}]
|
||||
@@ -302,14 +327,6 @@ proc ::scobj::rfgen::mkFlipper {argList} {
|
||||
hsetprop /sics/$pa(NAME) origTargetCurr 0
|
||||
hsetprop /sics/$pa(NAME) oldStateRep ""
|
||||
|
||||
makesctcontroller sct_rfgen rfamp $pa(IP):$pa(PORT)
|
||||
mkStatArr stateArr [split [sct_rfgen transact "L:$pa(ADDRESS)"] "|="]
|
||||
hset /sics/$pa(NAME)/flip_current [expr {$stateArr(curr) / 10.0}]
|
||||
hset /sics/$pa(NAME)/flip_frequency $stateArr(freq)
|
||||
hset /sics/$pa(NAME)/flip_voltage $stateArr(voltage)
|
||||
hset /sics/$pa(NAME)/flip_on $stateArr(O)
|
||||
hsetprop /sics/$pa(NAME) targetFreq $stateArr(freq)
|
||||
hsetprop /sics/$pa(NAME) targetCurr [expr {$stateArr(curr) / 10.0}]
|
||||
hsetprop /sics/$pa(NAME) currTol $pa(CURRTOL)
|
||||
|
||||
hfactory /sics/$pa(NAME)/comp_current plain internal float
|
||||
@@ -325,16 +342,6 @@ proc ::scobj::rfgen::mkFlipper {argList} {
|
||||
hfactory /sics/$pa(NAME)/set_flip_on plain user int
|
||||
hsetprop /sics/$pa(NAME)/set_flip_on write ::scobj::rfgen::set_flip_on /sics/$pa(NAME)
|
||||
# Only create the set current and frequency nodes when commissioning
|
||||
if {$pa(TUNING)} {
|
||||
hfactory /sics/$pa(NAME)/set_current plain user float
|
||||
hfactory /sics/$pa(NAME)/set_frequency plain user int
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_current write ::scobj::rfgen::set_current /sics/$pa(NAME)
|
||||
hsetprop /sics/$pa(NAME)/set_frequency write ::scobj::rfgen::set_frequency /sics/$pa(NAME)
|
||||
|
||||
sct_rfgen write /sics/$pa(NAME)/set_current
|
||||
sct_rfgen write /sics/$pa(NAME)/set_frequency
|
||||
}
|
||||
|
||||
# Initialise properties required for generating the API for GumTree and to save data
|
||||
::scobj::hinitprops $pa(NAME) flip_current flip_frequency flip_voltage flip_on comp_current guide_current thickness
|
||||
@@ -343,7 +350,30 @@ proc ::scobj::rfgen::mkFlipper {argList} {
|
||||
hsetprop /sics/$pa(NAME)/thickness mutable false
|
||||
|
||||
if {[SplitReply [rfgen_simulation]] == "false"} {
|
||||
sct_rfgen poll /sics/$pa(NAME) $pa(INTERVAL)
|
||||
sct_rfgen write /sics/$pa(NAME)/set_flip_on
|
||||
makesctcontroller sct_rfgen rfamp $pa(IP):$pa(PORT)
|
||||
mkStatArr stateArr [split [sct_rfgen transact "L:$pa(ADDRESS)"] "|="]
|
||||
|
||||
hset /sics/$pa(NAME)/flip_current [expr {$stateArr(curr) / 10.0}]
|
||||
hset /sics/$pa(NAME)/flip_frequency $stateArr(freq)
|
||||
hset /sics/$pa(NAME)/flip_voltage $stateArr(voltage)
|
||||
hset /sics/$pa(NAME)/flip_on $stateArr(O)
|
||||
hsetprop /sics/$pa(NAME) targetFreq $stateArr(freq)
|
||||
hsetprop /sics/$pa(NAME) targetCurr [expr {$stateArr(curr) / 10.0}]
|
||||
|
||||
sct_rfgen poll /sics/$pa(NAME) $pa(INTERVAL)
|
||||
sct_rfgen write /sics/$pa(NAME)/set_flip_on
|
||||
}
|
||||
|
||||
if {$pa(TUNING)} {
|
||||
hfactory /sics/$pa(NAME)/set_current plain user float
|
||||
hfactory /sics/$pa(NAME)/set_frequency plain user int
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_current write ::scobj::rfgen::set_current /sics/$pa(NAME)
|
||||
hsetprop /sics/$pa(NAME)/set_frequency write ::scobj::rfgen::set_frequency /sics/$pa(NAME)
|
||||
|
||||
if {[SplitReply [rfgen_simulation]] == "false"} {
|
||||
sct_rfgen write /sics/$pa(NAME)/set_current
|
||||
sct_rfgen write /sics/$pa(NAME)/set_frequency
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user