\input manualMacros.tex
\manBegin
\manPageInfo{RCCL Reference Manual}{}{}
\manTitle{stopCurrentMotion}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{stopCurrentMotion}},
{\tt \manName{flushMotionQueue}}
-- cancel current RCCL motions.

}
\manSection{USAGE}
\cverbatim
stopCurrentMotion(mnp, stopCode)
  MANIP *mnp;
  int stopCode;

flushMotionQueue(mnp);
  MANIP *mnp;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt mnp} --}
Manipulator reference structure.
\manItem{{\tt stopCode} --}
Termination code. This can be used to indicate
why the motion was terminated. The value is considered
to be undefined if negative.
\manSection{DESCRIPTION}
These routines allow cancellation of any currently executing RCCL motions.

{\tt stopCurrentMotion()} cancels any RCCL motion presently being
executed (unless the current motion has been paused). The stop
status associated with the motion is set to either {\tt stopCode}, if that
value is non-negative, or {\tt ON_ABORT} otherwise.

{\tt flushMotionQueue()} flushes all the pending motion requests on the
motion queue for the indicated manipulator, and sets their stop statuses
to {\tt ON_ABORT}. It does {\bf not} cancel the current motion request. 

Typically, one wishes to both stop the current motion and
flush the motion queue. When doing this, the motion queue should
be flushed first, as in
\cverbatim
        flushMotionQueue(mnp);
        stopCurrentMotion(mnp, 0);
@endcverbatim
\noindent
Otherwise, the trajectory generator may remove another motion from the
queue and start executing it
after the current motion has been terminated
but before the queue has been flushed.
\manSection{DIAGNOSTICS}
No errors are currently implemented.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt stopMotion(3)}, {\tt pauseCurrentMotion(3)}, {\tt rcclSetOptions(3)},
{\tt errorStack(3)}. 
\manEnd
\end
