stopMotion(3)

NAME
stopMotion, startMotion -- cancel an RCCL motion or control its start time.

USAGE
stopMotion (mid, stopCode)
  int mid;
  int stopCode;

startMotion (mid, startCode)
  int mid;
  int startCode;

ARGUMENTS

mid --
    Motion ID. This is a number returned by the motion request primitive. Its value is either assigned automatically, or specified explicitly by the program with setMotionFlag() before the request is issued.

stopCode --
    Code value indicating why the motion was cancelled. Considered to be undefined if less than 0.

startCode --
    Code value indicating conditions under which the motion was started. Considered to be undefined if less than 0.

DESCRIPTION
These routines provide the ability to cancel RCCL motions, or control when they start. A motion is referenced using the ID value returned by the primitive that originally requested the motion.

stopMotion() cancels a motion. The motion's stop code is set to stopCode, unless stopCode is undefined (less than 0), in which case the stop code is set to ON_ABORT. The stop code can later be referenced with the primitive motionStopCode(). If the cancelled motion is still on the motion queue, it will simply be removed from the queue. If it is currently executing, it will be aborted. If the motion has already completed, the old stop code is overwritten with the new stop code.

startMotion() gives permission for a motion to start. This is necessary only for motions whose requests have been preceded by the primitive setMotionHold(); otherwise, the motion request will automatically give start permission to the motion and assign it the start code ON_NORMAL. startMotion() assigns the motion a start code given by the value in startCode. If startCode is undefined (less than 0), then the start code is set to ON_NORMAL. The start code can later be referenced with the primitive motionStartCode(). startMotion() can be called any time after a motion request has been issued. If startMotion() is called for a motion that has already been given start permission, the old start code is overwritten with the new start code.

DIAGNOSTICS
These routines return -1 in the event of an error. They will automatically abort the program if the option RCCL_ERROR_EXIT is set (see rcclSetOptions(3)). Error codes and messages are placed on the errorStack (q.v.). The following error codes may be set:

EDescriptor --
    A motion ID was specified that was either illegal or no longer valid.

SEE ALSO
move(3), motionStatus(3), setMotionHold(3), setMotionFlag(3), rcclSetOptions(3), errorStack(3).