\input manualMacros.tex
\manBegin
\manPageInfo{RCCL Reference Manual}{}{}
\manTitle{setCompletedSig}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{setCompletedSig}},
{\tt \manName{setStopSig}}
-- deliver UNIX signal when RCCL motions complete.

}
\manSection{USAGE}
\cverbatim
#include <rccl.h>

setCompletedSig (mnp, signum)
  MANIP *mnp;
  int signum;

setStopSig (mnp, signum, mid)
  MANIP *mnp;
  int signum;
  int mid;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt mnp} --}
Manipulator reference structure.
\manItem{{\tt signum} --}
UNIX signal number.
\manItem{{\tt mid} --}
Motion ID. This is the number returned by the move request.
\manSection{RESTRICTIONS}
These routines must be called from the planning level. Signals
{\tt SIGXCPU} and {\tt SIGHUP} are reserved for use by RCI and
cannot be used.
\manSection{DESCRIPTION}
These routines arrange for
a UNIX signal to be delivered when either the motion queue empties
or a particular motion finishes.

{\tt setCompletedSig()} arranges for a signal to be delivered the next
time the motion queue empties and the trajectory generator finds itself idle.
This is equivalent to having a signal
delivered at the point where {\tt waitForCompleted(mnp)} would return.

{\tt setStopSig()} arranges for a UNIX signal to be delivered when the
indicated motion terminates.

For both of the routines, specifying a signal number of less than 
1 cancels any pending signal request.
\manSection{DIAGNOSTICS}
These routines return {\tt -1} in the event of an error.
They will automatically abort the program if the option {\tt RCCL_ERROR_EXIT}
is set (see {\tt rcclSetOptions(3)}). 
Error codes and messages are placed on the {\it errorStack} (q.v.). 
The following error codes may be set:

\manItem{{\tt ERange} --}
Illegal UNIX signal value specified.

{\tt setStopSig} may also set the following:

\manItem{{\tt EDescriptor} --}
Bad or invalid motion ID number specified.

These routines will abort the program if called from the control level.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt move(3)}, {\tt setMotionFlag(3)},
{\tt rcclSetOptions(3)}, {\tt errorStack(3)}.
\manEnd
\end
