StopAxis

命令控制的運動站和將軸設置至停止 (Stopping) 狀態,其中斷所有正在執行中的函式,當軸在停止狀態時,其他函式將無法移動軸,當軸到達速度零時,DoneKsCommandStatus 欄位將立即設為 TRUE。欲離開停止狀態並前往靜止 (Standstill) 狀態,請使用 ReleaseAxis

語法

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

參數

Index [in]:軸索引。索引以零為起點;別名將影響此參數。

Deceleration [in]:減速度值,單位由 McProfileType 類型決定,為 [單位/秒2] 或 [秒]。

Jerk [in]:加加速度值,單位由 McProfileType 類型決定,為 [單位/秒3] 或 [秒]。

回傳值

返回 KsCommandStatus 結構。

備註

範例

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);
}

使用需求

  RT Win32
最低支援版本 4.0 4.0
標頭檔 ksmotion.h ksmotion.h
程式庫 KsApi_Rtss.lib KsApi.lib

參見

HaltAxis

HomeAxis

JogAxis

MoveAxisVelocity

PowerAxis

ReleaseAxis