Catch the fermi chopper setspeed error and pass it up to motor.c
This commit is contained in:
@@ -116,20 +116,6 @@ namespace eval ::chopper {
|
||||
incr i
|
||||
}
|
||||
|
||||
##
|
||||
# Echeck_SpeedMult: Checks that speed is an allowed multiple of the reference signal
|
||||
# refFreq: Reference signal frequency (Hz)
|
||||
# speed: Requested chopper speed (RPM)
|
||||
proc Echeck_SpeedMult {refFreq speed} {
|
||||
variable speedMult
|
||||
set refRPM [expr 60 * $refFreq]
|
||||
foreach mult $speedMult {
|
||||
if { [expr $mult * $refRPM] == $speed} {return}
|
||||
}
|
||||
return -code error "Speed ($speed) is not an allowed multiple of the reference signal"
|
||||
}
|
||||
|
||||
|
||||
proc Echeck_ChSpeed {ch speed} {
|
||||
set minSpeed 3000
|
||||
array set vetoRange {min 9000 max 11000}
|
||||
@@ -412,7 +398,10 @@ namespace eval ::chopper {
|
||||
# imot_status clears the abort flag, but this only happens if imot_status
|
||||
# is being checked because of a "run" or "drive" when a stop is sent.
|
||||
hsetprop $hpath/$node abort 0
|
||||
setSpeed $hpath $node $addr $name $target
|
||||
set ret [setSpeed $hpath $node $addr $name $target]
|
||||
if {$ret != $SCode(OKOK)} {
|
||||
return $ret
|
||||
}
|
||||
hset $hpath/$node/control/start 1
|
||||
hsetprop $hpath/$node/control timecheck -1
|
||||
set readtime [hgetpropval $hpath read_time]
|
||||
@@ -604,6 +593,7 @@ proc mkFSpeedMot {fmot hdbroot chnode addr lowlim uplim} {
|
||||
$fmot softupperlim $uplim
|
||||
$fmot settle 30
|
||||
$fmot precision 1
|
||||
$fmot maxretry 0
|
||||
sicslist setatt $fmot units rpm
|
||||
sicslist setatt $fmot klass fermi_chopper
|
||||
sicslist setatt $fmot long_name $fmot
|
||||
@@ -639,6 +629,7 @@ proc mkFPhaseMot {fmot hdbroot chnode addr lowlim uplim} {
|
||||
$fmot softupperlim $uplim
|
||||
$fmot settle 30
|
||||
$fmot precision 1
|
||||
$fmot maxretry 0
|
||||
sicslist setatt $fmot units ns
|
||||
sicslist setatt $fmot klass fermi_chopper
|
||||
sicslist setatt $fmot long_name $fmot
|
||||
|
||||
Reference in New Issue
Block a user