PowerAxis

启用或停用轴的运作。

语法

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

参数

Index [in]:轴索引。索引以零为起点;别名将影响此参数。

Enable [in]:设置 TRUE 以启用轴;FALSE 以停用轴。

EnablePositiveDirection [in]:TRUE 使轴移动到正方向。

EnableNegativeDirection [in]: TRUE 使轴移动到负方向。

回传值

返回 KsCommandStatus 结构。

备注

此函式将启动或停止伺服马达并防止轴超程。

范例

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

使用需求

  RT Win32
最低支援版本 4.0 4.0
标头档 ksmotion.h ksmotion.h
程式库 KsApi_Rtss.lib KsApi.lib

参见

ResetAxis

SetAxisCamSwitch

SetAxisTouchProbe

StopAxis