From d6f484f6dcf8255beda54c4ff5dd0f3f0d346a19 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Tue, 6 Nov 2007 14:49:11 +1100 Subject: [PATCH] We can now STop motors when SICS gets and INT1712 1 r2236 | ffr | 2007-11-06 14:49:11 +1100 (Tue, 06 Nov 2007) | 2 lines --- site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl | 6 +++--- site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl index 4f1da048..2d77f6e9 100755 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl @@ -1,7 +1,7 @@ #!/usr/bin/tclsh -# $Revision: 1.6 $ -# $Date: 2007-10-31 06:10:30 $ +# $Revision: 1.7 $ +# $Date: 2007-11-06 03:49:11 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ @@ -70,7 +70,7 @@ proc mkSimAxes {instrument} { set enPos 0; set enCnts 0; } - puts $simFile($IPtoContName($motor(asyncqueue)-$instrument)) "array set $nm \[\list TD 0 TP $enPos BG 0 SP $speed AC $acc DC $dec cntsperx $enCnts stepsperx $motor(stepsperx) PA 0 TS 44 \]"; + puts $simFile($IPtoContName($motor(asyncqueue)-$instrument)) "array set $nm \[\list TD 0 TP $enPos BG 0 ST 0 SP $speed AC $acc DC $dec cntsperx $enCnts stepsperx $motor(stepsperx) PA 0 TS 44 \]"; # eval "lappend $IPtoContName($motor(host))_motors $m"; } diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl index 5ce22e5c..ce6dd1b2 100644 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl @@ -1,5 +1,5 @@ -# $Revision: 1.4 $ -# $Date: 2007-10-31 06:10:30 $ +# $Revision: 1.5 $ +# $Date: 2007-11-06 03:49:11 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ @@ -51,6 +51,9 @@ proc DP {axis val} { proc TS {axis} { uplevel #0 eval set ${axis}(TS) } +proc ST {axis} { + uplevel #0 eval set ${axis}(ST) 1 +} proc SH {args} {} proc MO {args} {} @@ -110,13 +113,15 @@ proc nextstep {paxis step target} { if {[expr abs($TD_POS - double($target))] < 0.5} { set axis(TS) 44; # Stopped, limit switches open set axis(BG) 0; # motor has stopped + set axis(ST) 0; # make sure stop flag is unset return 0; - } elseif {[expr abs($target - $axis(TD)) < abs($step)]} { + } elseif {$axis(ST) == 1 || [expr abs($target - $axis(TD)) < abs($step)]} { set diff [expr $target - $axis(TD)]; set axis(TP) [expr int(round($diff*$mult + $axis(TP)))]; set axis(TD) [expr int($target)]; set axis(TS) 44; # Stopped, limit switches open set axis(BG) 0; # motor has stopped + set axis(ST) 0; # make sure stop flag is unset return 0; } else { return 1;