StopAxis

Commands a controlled motion stop and sets a axis to the Stopping state. It aborts any ongoing function execution. While an axis is in the Stopping state, other functions can't move the axis. After the axis has reached velocity zero, the Done field of KsCommandStatus is set to TRUE immediately. To leave the Stopping state and go to Standstill, use ReleaseAxis.

Syntax

KsCommandStatus StopAxis(
     int Index,
     double Deceleration,
     double Jerk
);

Parameters

Index [in]: the index of an axis. Indexes are zero based. Aliases affect this parameter.

Deceleration [in]: a value of the deceleration. The unit is determined by the McProfileType type. [unit/second2] or [second]

Jerk [in]: a value of the jerk. The unit is determined by the McProfileType type. [unit/second3] or [second]

Return value

Returns the KsCommandStatus structure.

Remarks

Example

VOID Lock(INT Index) {
   //StopAxis will halt and lock the axis preventing any other move to run
   KsCommandStatus status = WaitForCommand(5, FALSE, StopAxis(Index, 36000, 3600000));

   //The axis is now locked. The state is axisLocked.
   AxisState state = axisOffline;
   KsError nRet = GetAxisState(Index, &state);

   RtPrintf("Current State: %d\n", state);
   //Unlock the axis
   status = AbortCommand(status);
}

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header ksmotion.h ksmotion.h
Library KsApi_Rtss.lib KsApi.lib

See also

HaltAxis

HomeAxis

JogAxis

MoveAxisVelocity

PowerAxis

ReleaseAxis