AbortCommand

Cancels a command.

Syntax

KsCommandStatus AbortCommand(
     KsCommandStatus Status
);

Parameters

Status: the command you want to abort.

Return value

Returns the KsCommandStatus structure.

Remarks

The value given as Status to AbortCommand should not be empty, but be the return value of another command such as Start.

Usable EtherCAT states

ecatOffline, ecatInit, ecatBoot, ecatPreOP, ecatSafeOP, ecatOP

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 ksapi.h ksapi.h
Library KsApi_Rtss.lib KsApi.lib

See also

WaitForCommand