Make sure spin flipper code in rfamp.c is initialised

Fixed drive bugs in lakeshore drivers.
r3071 | ffr | 2011-02-25 18:27:31 +1100 (Fri, 25 Feb 2011) | 2 lines
This commit is contained in:
Ferdi Franceschini
2011-02-25 18:27:31 +11:00
committed by Douglas Clowes
parent 009fdbfc29
commit 7371a561d9
30 changed files with 10384 additions and 75 deletions

View File

@@ -446,19 +446,14 @@ proc setDesiredField {tc_root nextState cmd} {
set ns ::scobj::lh45
set par [sct target]
#hset $tc_root/status "busy"
set wrStatus [sct writestatus]
if {$wrStatus == "start"} {
# Called by drive adapter
# puts "setDesiredField(): driving set to 1"
set nodename $tc_root/sensor/setpoint
hsetprop $nodename driving 1
}
#puts "setDesiredField(wrStatus=$wrStatus): sct send $cmd$par"
after $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS
sct send "$cmd$par"
return $nextState
} message ]
if {$catch_status == 1} {
# TCL_ERROR
sct driving 0
}
handle_exception $catch_status $message "in setDesiredField(). Last write command: $::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd"
}
@@ -475,19 +470,14 @@ proc setDesiredCurrent {tc_root nextState cmd} {
set ns ::scobj::lh45
set par [sct target]
#hset $tc_root/status "busy"
set wrStatus [sct writestatus]
if {$wrStatus == "start"} {
# Called by drive adapter
# puts "setDesiredCurrent(): driving set to 1"
set nodename $tc_root/sensor/nominal_outp_current
hsetprop $nodename driving 1
}
#puts "setDesiredCurrent(wrStatus=$wrStatus): sct send $cmd$par"
after $::scobj::bruker_BEC1::bruker_BEC1_MIN_TIME_BETWEEN_COMMANDS
sct send "$cmd$par"
return $nextState
} message ]
if {$catch_status == 1} {
# TCL_ERROR
sct driving 0
}
handle_exception $catch_status $message "in setDesiredCurrent(). Last write command: $::scobj::bruker_BEC1::bruker_BEC1_lastWriteCmd"
}

View File

@@ -71,9 +71,9 @@ debug_log "setPoint new data for $tc_root [sct] result=$par"
hset $tc_root/status "busy"
sct print "status: busy"
hset $tc_root/drive_state "START"
hsetprop $tc_root/setpoint driving 1
} catch_message ]
if {$catch_status != 0} {
hsetprop $tc_root/setpoint driving 0
return -code error $catch_message
}
sct print "setPoint: [hget $tc_root/drive_state]"

View File

@@ -94,9 +94,9 @@ debug_log "setPoint new data for $tc_root [sct] result=$par"
hset $tc_root/status "busy"
sct print "status: busy"
hset $tc_root/drive_state "START"
hsetprop $tc_root/setpoint driving 1
} catch_message ]
if {$catch_status != 0} {
hsetprop $tc_root/setpoint driving 0
return -code error $catch_message
}
sct print "setPoint: [hget $tc_root/drive_state]"
@@ -456,6 +456,7 @@ debug_log "rdState $tc_root error scan status = $rslt on $my_status"
set lolimit [hval $tc_root/lowerlimit]
set hilimit [hval $tc_root/upperlimit]
if {$setpoint < $lolimit || $setpoint > $hilimit} {
sct driving 0
error "setpoint violates limits"
}
return OK

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,7 @@ namespace eval ::scobj::lh45 {
proc setPoint {tc_root nextState cmd} {
if {[hval $tc_root/remote_ctrl] == "False"} {
sct driving 0
return idle
}
set par [sct target]
@@ -33,12 +34,8 @@ namespace eval ::scobj::lh45 {
# }
hset $tc_root/power 1
hset $tc_root/status "busy"
if {[sct writestatus] == "start"} {
# Called by drive adapter
hsetprop $tc_root/setpoint driving 1
}
sct send "$cmd $par"
sct updated 0
sct setpoint_pending 0
return $nextState
}
@@ -53,7 +50,6 @@ namespace eval ::scobj::lh45 {
sct oldval $data
sct update $data
sct utime readtime
sct updated 1
}
}
}
@@ -88,8 +84,8 @@ namespace eval ::scobj::lh45 {
sct update $power
}
if {$power==1} {
set setpoint_updated [hgetpropval $tc_root/setpoint updated]
if {$setpoint_updated != 1} {
if [hgetpropval $tc_root/setpoint setpoint_pending] {
# Don't update status while we're waiting for the new setpoint to be sent
return idle
}
set currtime [sct readtime]
@@ -196,8 +192,10 @@ namespace eval ::scobj::lh45 {
set lolimit [hval $tc_root/lowerlimit]
set hilimit [hval $tc_root/upperlimit]
if {$setpoint < $lolimit || $setpoint > $hilimit} {
sct driving 0
error "setpoint violates limits"
}
sct setpoint_pending 1
return OK
}
@@ -239,7 +237,7 @@ namespace eval ::scobj::lh45 {
hsetprop $scobj_hpath/setpoint driving 0
hsetprop $scobj_hpath/setpoint writestatus UNKNOWN
hsetprop $scobj_hpath/setpoint type drivable
hsetprop $scobj_hpath/setpoint updated 0
hsetprop $scobj_hpath/setpoint setpoint_pending 0
# Drive adapter interface
hsetprop $scobj_hpath/setpoint checklimits ${ns}::check $scobj_hpath
hsetprop $scobj_hpath/setpoint checkstatus ${ns}::drivestatus $scobj_hpath

View File

@@ -710,6 +710,9 @@ proc inTolerance {CtrlLoopIdx} {
set cmpIdString [string compare -length 13 $data "LSCI,MODEL336"]
}
if {$cmpIdString == 0 } {
if [ hgetpropval $tc_root/sensor/setpoint$CtrlLoopIdx setpoint_pending ] {
continue
}
# set nodename $tc_root/control/config_Loop_$CtrlLoopIdx
# set iSensor [hval $nodename]
# set iSensor [string range $iSensor 0 0]
@@ -900,11 +903,12 @@ proc setPoint {tc_root nextState cmd whichCtrlLoop} {
# Called by drive adapter
# puts "setPoint(): driving set to 1"
set nodename $tc_root/sensor/setpoint$whichCtrlLoop
hsetprop $nodename driving 1
}
#puts "setPoint(wrStatus=$wrStatus): sct send $cmd$par"
sct send "$cmd$par"
sct setpoint_pending 0
} message ]} {
hsetprop $nodename driving 0
return -code error "in setPoint: $message. Last write command: $::scobj::ls336::ls336_lastWriteCmd"
}
return $nextState
@@ -1175,8 +1179,10 @@ proc check {tc_root whichCtrlLoop} {
}
}
} message ]} {
sct driving 0
return -code error "in check(): $message. Last write command: $::scobj::ls336::ls336_lastWriteCmd"
}
sct setpoint_pending 1
return OK
}
@@ -1728,6 +1734,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hsetprop $nodeName checklimits ${ns}::check $scobj_hpath $idx
hsetprop $nodeName checkstatus ${ns}::drivestatus $scobj_hpath
hsetprop $nodeName halt ${ns}::halt $scobj_hpath $idx
hsetprop $nodeName setpoint_pending 0
}
} message ]} {
return -code error "in createNode $message"

View File

@@ -710,6 +710,9 @@ proc inTolerance {CtrlLoopIdx} {
set cmpIdString [string compare -length 13 $data "LSCI,MODEL336"]
}
if {$cmpIdString == 0 } {
if [ hgetpropval $tc_root/sensor/setpoint$CtrlLoopIdx setpoint_pending ] {
continue
}
# set nodename $tc_root/control/config_Loop_$CtrlLoopIdx
# set iSensor [hval $nodename]
# set iSensor [string range $iSensor 0 0]
@@ -900,11 +903,12 @@ proc setPoint {tc_root nextState cmd whichCtrlLoop} {
# Called by drive adapter
# puts "setPoint(): driving set to 1"
set nodename $tc_root/sensor/setpoint$whichCtrlLoop
hsetprop $nodename driving 1
}
#puts "setPoint(wrStatus=$wrStatus): sct send $cmd$par"
sct send "$cmd$par"
sct setpoint_pending 0
} message ]} {
hsetprop $nodename driving 0
return -code error "in setPoint: $message. Last write command: $::scobj::ls340::ls340_lastWriteCmd"
}
return $nextState
@@ -1175,8 +1179,10 @@ proc check {tc_root whichCtrlLoop} {
}
}
} message ]} {
sct driving 0
return -code error "in check(): $message. Last write command: $::scobj::ls340::ls340_lastWriteCmd"
}
sct setpoint_pending 1
return OK
}
@@ -1728,6 +1734,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hsetprop $nodeName checklimits ${ns}::check $scobj_hpath $idx
hsetprop $nodeName checkstatus ${ns}::drivestatus $scobj_hpath
hsetprop $nodeName halt ${ns}::halt $scobj_hpath $idx
hsetprop $nodeName setpoint_pending 0
}
} message ]} {
return -code error "in createNode $message"

View File

@@ -40,11 +40,8 @@ debug_log "setPoint $tc_root $nextState $cmd sct=[sct]"
set par "[sct target]"
}
hset $tc_root/status "busy"
if {[sct writestatus] == "start"} {
# Called by drive adapter
hsetprop $tc_root/setpoint driving 1
}
sct send "@1$cmd$par"
sct setpoint_pending 0
debug_log "setPoint $cmd$par"
return $nextState
}
@@ -259,7 +256,7 @@ debug_log "rdState $tc_root: target=$tgt"
set tgt [SplitReply [hgetprop $tc_root/setpoint target]]
debug_log "rdState $tc_root: initialised target to: target=$tgt"
}
if {$my_driving > 0} {
if {$my_driving > 0 && [sct setpoint_pending] == 0} {
if {[hval $tc_root/control_sensor] == "3"} {
set temp [hval $tc_root/sensor3/value]
} elseif {[hval $tc_root/control_sensor] == "2"} {
@@ -299,8 +296,10 @@ debug_log "rdState returns: $nextState"
set lolimit [hval $tc_root/lowerlimit]
set hilimit [hval $tc_root/upperlimit]
if {$setpoint < $lolimit || $setpoint > $hilimit} {
sct driving 0
error "setpoint violates limits"
}
sct setpoint_pending 1
return OK
}
@@ -341,6 +340,7 @@ debug_log "halt $tc_root"
hsetprop $scobj_hpath/setpoint noResponse ${ns}::noResponse
hsetprop $scobj_hpath/setpoint oldval UNKNOWN
hsetprop $scobj_hpath/setpoint driving 0
hsetprop $scobj_hpath/setpoint setpoint_pending 0
hsetprop $scobj_hpath/setpoint writestatus UNKNOWN
# Drive adapter interface
hsetprop $scobj_hpath/setpoint checklimits ${ns}::check $scobj_hpath

View File

@@ -374,7 +374,6 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/device_control/target [sct target]
hset $tc_root/device_control/previous_error [expr [sct target] - [hval $tc_root/samplesensor]]
hset $tc_root/status "busy"
hsetprop $tc_root/setpoint driving 1
return idle
}
@@ -442,6 +441,7 @@ debug_log "setPoint $dev:1016:$cmd $par"
set lolimit [hval $tc_root/lowerlimit]
set hilimit [hval $tc_root/upperlimit]
if {$setpoint < $lolimit || $setpoint > $hilimit} {
sct driving 0
error "setpoint violates limits"
}
return OK