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