GetAxesStatus

獲取選定軸線的狀態。

語法

KsError GetAxesStatus(
     int Length,
     int* Indexes,
     AxisStatus* States
);

參數

Length [in]:軸的數量。

Indexes [in]:軸索引之陣列,索引以零為起點;別名將影響此參數。

States [out]:將接收軸狀態的 AxisStatus 陣列類型。

回傳值

如果此函式執行成功,會回傳 errNoError,否則會傳回錯誤碼。如需更多有關錯誤碼的資訊,請參閱 KsError 清單。

備註

模數軸啟用時,模數值會套用至 McSource 中的 Commend、Set 及 Actual 位置。

範例

複製
AxisStatus axesStatus[4] = { {0} };
int axesIdx[4] = { 0, 2, 4, 6 };
KsError nRet = GetAxesStatus(4, axesIdx, axesStatus);

for (int i = 0; i < 4; i++)
{
    RtPrintf("Axis %d State: %d MotionError: 0X%x\n", i, axesStatus[i].State, axesStatus[i].MotionError);
}

使用需求

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

參見

GetAxisInfo

GetAxisState