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 |
參見