HaltAxis

命令控制的運動站。直到速度為零前,軸將維持在離散運動狀態,KsCommandStatusDone 欄位設為 TRUE ,則狀態變更為靜止 (Standstill)。

語法

KsCommandStatus HaltAxis(
     int Index,
     double Deceleration,
     double Jerk,
     McBufferMode BufferMode
);

參數

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

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

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

BufferMode [in]:定義如何融合兩功能的速度,請見 McBufferMode 類型。

回傳值

返回 KsCommandStatus 結構。

備註

範例

VOID MoveVelocity(INT Index, DOUBLE Velocity, INT Duration) {
   McDirection direction = mcPositiveDirection;
   if (Velocity < 0)
      direction = mcNegativeDirection;

   //Start the velocity motion
   KsCommandStatus status = WaitForCommand(5, FALSE, JogAxis(Index, Velocity, 
	36000, 36000, 3600000, direction));

   double velocity = 0;
   KsError nRet = GetAxisVelocity(Index, mcActualValue, &velocity);

   RtPrintf("Current Velocity: %d degree/s\n", (int)velocity);
   //Let it spin a bit
   Sleep(3000);
   //Stop the axis
   status = WaitForCommand(5, FALSE, HaltAxis(Index, 36000, 3600000, mcAborting));
}

使用需求

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

參見

HomeAxis

JogAxis

MoveAxisVelocity

StopAxis