PowerAxis

Enables or disables the operation of an axis.

Syntax

KsCommandStatus PowerAxis(
     int Index,
     BOOL Enable,
     BOOL EnablePositiveDirection,
     BOOL EnableNegativeDirection
);

Parameters

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

Enable [in]: TRUE to enable the axis, FALSE to disable the axis.

EnablePositiveDirection [in]: TRUE to let the axis move into the positive direction.

EnableNegativeDirection [in]: TRUE to let the axis move into the negative direction.

Return value

Returns the KsCommandStatus structure.

Remarks

It starts or stops the servo motor and prevents overtravel of an axis.

Example

BOOL Enable(INT Index) {
   KsCommandStatus status = WaitForCommand(5, TRUE, ResetAxis(Index));
   status = WaitForCommand(5, TRUE, PowerAxis(Index, TRUE, TRUE, TRUE));
   return TRUE;
}

Requirements

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

See also

ResetAxis

SetAxisCamSwitch

SetAxisTouchProbe