Commit 8908ee2e LN

增加错误码解析

1 个父辈 cb3129a8
...@@ -45,6 +45,7 @@ namespace HuichuanLibrary ...@@ -45,6 +45,7 @@ namespace HuichuanLibrary
SystemConfigPath = systemConfigPath; SystemConfigPath = systemConfigPath;
} }
HCLogUtil.LOGGER = LogManager.GetLogger(logName); HCLogUtil.LOGGER = LogManager.GetLogger(logName);
HCErrorCode.LoadConfig();
} }
private static string BoardName() private static string BoardName()
...@@ -102,7 +103,7 @@ namespace HuichuanLibrary ...@@ -102,7 +103,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetCardsNum(ref nCardNum); UInt32 ret = ImcApi.IMC_GetCardsNum(ref nCardNum);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" GetCardsNum FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" GetCardsNum FAIL, ",ret);
return false; return false;
} }
else else
...@@ -122,7 +123,7 @@ namespace HuichuanLibrary ...@@ -122,7 +123,7 @@ namespace HuichuanLibrary
ret = ImcApi.IMC_OpenCardHandle(nCardNo, ref nCardHandle); ret = ImcApi.IMC_OpenCardHandle(nCardNo, ref nCardHandle);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" OpenCardHandle FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" OpenCardHandle FAIL, ",ret);
return false; return false;
} }
else else
...@@ -134,7 +135,7 @@ namespace HuichuanLibrary ...@@ -134,7 +135,7 @@ namespace HuichuanLibrary
ret = ImcApi.IMC_DownLoadDeviceConfig(nCardHandle, DeviceConfigPath); ret = ImcApi.IMC_DownLoadDeviceConfig(nCardHandle, DeviceConfigPath);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" DownLoadDeviceConfig FAIL, ErrorCode=0x" + ret.ToString("x8") + ",请检查是否有" + DeviceConfigPath + "文件"); ShowErrorLog(" DownLoadDeviceConfig FAIL, " + ",请检查是否有" + DeviceConfigPath + "文件", ret );
return false; return false;
} }
else else
...@@ -150,7 +151,7 @@ namespace HuichuanLibrary ...@@ -150,7 +151,7 @@ namespace HuichuanLibrary
ret = ImcApi.IMC_GetECATMasterSts(nCardHandle, ref masterStatus); ret = ImcApi.IMC_GetECATMasterSts(nCardHandle, ref masterStatus);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" GetECATMasterSts FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" GetECATMasterSts FAIL, ",ret);
return false; return false;
} }
else else
...@@ -168,7 +169,7 @@ namespace HuichuanLibrary ...@@ -168,7 +169,7 @@ namespace HuichuanLibrary
ret = ImcApi.IMC_ScanCardECAT(nCardHandle, blockFlag); ret = ImcApi.IMC_ScanCardECAT(nCardHandle, blockFlag);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" ScanCardECAT FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" ScanCardECAT FAIL, ",ret);
return false; return false;
} }
} }
...@@ -207,7 +208,7 @@ namespace HuichuanLibrary ...@@ -207,7 +208,7 @@ namespace HuichuanLibrary
uint ret = ImcApi.IMC_DownLoadSystemConfig(nCardHandle, SystemConfigPath); uint ret = ImcApi.IMC_DownLoadSystemConfig(nCardHandle, SystemConfigPath);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" DownLoadSystemConfig FAIL, ErrorCode=0x" + ret.ToString("x8") + ",请检查是否有" + SystemConfigPath + "文件"); ShowErrorLog(" DownLoadSystemConfig FAIL, " + ",请检查是否有" + SystemConfigPath + "文件,", ret );
return false; return false;
} }
else else
...@@ -225,7 +226,7 @@ namespace HuichuanLibrary ...@@ -225,7 +226,7 @@ namespace HuichuanLibrary
uint ret = ImcApi.IMC_GetCardResource(nCardHandle, ref tResource); uint ret = ImcApi.IMC_GetCardResource(nCardHandle, ref tResource);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" GetCardResource FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" GetCardResource FAIL, ",ret);
return false; return false;
} }
else else
...@@ -255,7 +256,7 @@ namespace HuichuanLibrary ...@@ -255,7 +256,7 @@ namespace HuichuanLibrary
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" GetECATMasterSts FAIL, ErrorCode=0x" + ret.ToString("x8") + " "); ShowErrorLog(" GetECATMasterSts FAIL, ",ret );
} }
else if (pStatus.Equals(6)) else if (pStatus.Equals(6))
{ {
...@@ -301,7 +302,7 @@ namespace HuichuanLibrary ...@@ -301,7 +302,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_CloseCard(nCardHandle); UInt32 ret = ImcApi.IMC_CloseCard(nCardHandle);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog("CloseCard FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog("CloseCard FAIL, ",ret);
return false; return false;
} }
else else
...@@ -313,7 +314,7 @@ namespace HuichuanLibrary ...@@ -313,7 +314,7 @@ namespace HuichuanLibrary
ret = ImcApi.IMC_CloseCardHandle(nCardHandle); ret = ImcApi.IMC_CloseCardHandle(nCardHandle);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog("CloseCardHandle FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog("CloseCardHandle FAIL, ",ret);
return false; return false;
} }
else else
...@@ -358,7 +359,7 @@ namespace HuichuanLibrary ...@@ -358,7 +359,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 0); UInt32 ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 0);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" EmgStop FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" EmgStop FAIL, ",ret);
return false; return false;
} }
else else
...@@ -381,7 +382,7 @@ namespace HuichuanLibrary ...@@ -381,7 +382,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 1); UInt32 ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" CancelEmg FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" CancelEmg FAIL, ",ret);
return false; return false;
} }
else else
...@@ -411,7 +412,7 @@ namespace HuichuanLibrary ...@@ -411,7 +412,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetEcatDoBit(nCardHandle, bitNo, bitValue); UInt32 ret = ImcApi.IMC_SetEcatDoBit(nCardHandle, bitNo, bitValue);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" bitNo["+bitNo+"]bitValue["+bitValue+ "] IMC_SetEcatDoBit FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" bitNo["+bitNo+"]bitValue["+bitValue+ "] IMC_SetEcatDoBit FAIL, ",ret);
return false; return false;
} }
return true; return true;
...@@ -431,7 +432,7 @@ namespace HuichuanLibrary ...@@ -431,7 +432,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatDoBit(nCardHandle, bitNo, ref bitValue); UInt32 ret = ImcApi.IMC_GetEcatDoBit(nCardHandle, bitNo, ref bitValue);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" bitNo[" + bitNo + "] IMC_GetEcatDoBit FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" bitNo[" + bitNo + "] IMC_GetEcatDoBit FAIL, ",ret);
return 0; return 0;
} }
...@@ -453,7 +454,7 @@ namespace HuichuanLibrary ...@@ -453,7 +454,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatDiBit(nCardHandle, bitNo, ref bitValue); UInt32 ret = ImcApi.IMC_GetEcatDiBit(nCardHandle, bitNo, ref bitValue);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" bitNo[" + bitNo + "] IMC_GetEcatDiBit, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" bitNo[" + bitNo + "] IMC_GetEcatDiBit, ",ret);
return 0; return 0;
} }
return bitValue; return bitValue;
...@@ -468,7 +469,7 @@ namespace HuichuanLibrary ...@@ -468,7 +469,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetEcatGrpDo(nCardHandle, groupNo, groupValue); UInt32 ret = ImcApi.IMC_SetEcatGrpDo(nCardHandle, groupNo, groupValue);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" groupNo[" + groupNo + "] IMC_SetEcatGrpDo FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" groupNo[" + groupNo + "] IMC_SetEcatGrpDo FAIL, ",ret);
return false; return false;
} }
return true; return true;
...@@ -484,7 +485,7 @@ namespace HuichuanLibrary ...@@ -484,7 +485,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatGrpDo(nCardHandle, groupNo, ref groupValue); UInt32 ret = ImcApi.IMC_GetEcatGrpDo(nCardHandle, groupNo, ref groupValue);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" groupNo[" + groupNo + "] IMC_GetEcatGrpDo FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" groupNo[" + groupNo + "] IMC_GetEcatGrpDo FAIL, ",ret);
return 0; return 0;
} }
return groupValue; return groupValue;
...@@ -500,7 +501,7 @@ namespace HuichuanLibrary ...@@ -500,7 +501,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatGrpDi(nCardHandle, groupNo, ref groupValue); UInt32 ret = ImcApi.IMC_GetEcatGrpDi(nCardHandle, groupNo, ref groupValue);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" groupNo[" + groupNo + "] IMC_GetEcatGrpDi FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" groupNo[" + groupNo + "] IMC_GetEcatGrpDi FAIL, ",ret);
return 0; return 0;
} }
return groupValue; return groupValue;
...@@ -561,7 +562,7 @@ namespace HuichuanLibrary ...@@ -561,7 +562,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatAdVal(nCardHandle, adNo, ref adVal); UInt32 ret = ImcApi.IMC_GetEcatAdVal(nCardHandle, adNo, ref adVal);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" adNo[" + adNo + "] IMC_GetEcatAdVal FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" adNo[" + adNo + "] IMC_GetEcatAdVal FAIL, ",ret);
return 0; return 0;
} }
return adVal; return adVal;
...@@ -581,7 +582,7 @@ namespace HuichuanLibrary ...@@ -581,7 +582,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatAdSts(nCardHandle, adNo, ref adSts); UInt32 ret = ImcApi.IMC_GetEcatAdSts(nCardHandle, adNo, ref adSts);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" adNo[" + adNo + "] IMC_GetEcatAdSts FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" adNo[" + adNo + "] IMC_GetEcatAdSts FAIL, ",ret);
return 0; return 0;
} }
return adSts; return adSts;
...@@ -603,11 +604,18 @@ namespace HuichuanLibrary ...@@ -603,11 +604,18 @@ namespace HuichuanLibrary
} }
#endregion #endregion
private static void ShowErrorLog(string msg) private static void ShowErrorLog(string msg,UInt32 ret=0)
{ {
CardMsg = BoardName() + msg; if (ret > 0)
Console.WriteLine(BoardName() + msg); {
HCLogUtil.error(BoardName() + msg); CardMsg = BoardName() +msg+ HCErrorCode.GetCodeMsg(ret);
}
else
{
CardMsg = BoardName() + msg;
}
Console.WriteLine(CardMsg);
HCLogUtil.error(CardMsg);
} }
private static void ShowLog(string msg) private static void ShowLog(string msg)
......
...@@ -25,7 +25,7 @@ namespace HuichuanLibrary ...@@ -25,7 +25,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_AxServoOn(nCardHandle, axisNo, 1); UInt32 ret = ImcApi.IMC_AxServoOn(nCardHandle, axisNo, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] ServoOn FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] ServoOn FAIL,",ret);
return false; return false;
} }
else else
...@@ -49,7 +49,7 @@ namespace HuichuanLibrary ...@@ -49,7 +49,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_AxServoOff(nCardHandle, axisNo, 1); UInt32 ret = ImcApi.IMC_AxServoOff(nCardHandle, axisNo, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] ServoOff FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] ServoOff FAIL, ",ret);
return false; return false;
} }
else else
...@@ -94,7 +94,7 @@ namespace HuichuanLibrary ...@@ -94,7 +94,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_StartHoming(nCardHandle, axisNo, ref tHomingPara); UInt32 ret = ImcApi.IMC_StartHoming(nCardHandle, axisNo, ref tHomingPara);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "]StartHoming FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "]StartHoming FAIL, ",ret);
return false; return false;
} }
else else
...@@ -118,7 +118,7 @@ namespace HuichuanLibrary ...@@ -118,7 +118,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_StopHoming(nCardHandle, axisNo, 0); //0:表示平滑停止 1:表示急停 UInt32 ret = ImcApi.IMC_StopHoming(nCardHandle, axisNo, 0); //0:表示平滑停止 1:表示急停
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] StopHoming FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] StopHoming FAIL, ",ret);
return false; ; return false; ;
} }
else else
...@@ -143,7 +143,7 @@ namespace HuichuanLibrary ...@@ -143,7 +143,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetHomingStatus(nCardHandle, axisNo, ref nHomingStatus); UInt32 ret = ImcApi.IMC_GetHomingStatus(nCardHandle, axisNo, ref nHomingStatus);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetHomingStatus FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetHomingStatus FAIL, ",ret);
return -1; return -1;
} }
else else
...@@ -164,12 +164,12 @@ namespace HuichuanLibrary ...@@ -164,12 +164,12 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_FinishHoming(nCardHandle, axisNo); UInt32 ret = ImcApi.IMC_FinishHoming(nCardHandle, axisNo);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] FinishHoming FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] FinishHoming FAIL, ",ret);
return false; return false;
} }
else else
{ {
DebugLog(" Axis[" + axisNo + "] FinishHoming OK!"); ShowLog(" Axis[" + axisNo + "] FinishHoming OK!");
return true; return true;
} }
} }
...@@ -288,7 +288,7 @@ namespace HuichuanLibrary ...@@ -288,7 +288,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_StartPtpMove(nCardHandle, axisNo, ptpPos, ptpType); UInt32 ret = ImcApi.IMC_StartPtpMove(nCardHandle, axisNo, ptpPos, ptpType);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] StartPtpMove " + ptpType + " FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] StartPtpMove " + ptpType + " FAIL, ",ret);
return false; return false;
} }
else else
...@@ -314,7 +314,7 @@ namespace HuichuanLibrary ...@@ -314,7 +314,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetSingleAxMvPara(nCardHandle, axisNo, ptpVel, ptpAcc, ptpDec); UInt32 ret = ImcApi.IMC_SetSingleAxMvPara(nCardHandle, axisNo, ptpVel, ptpAcc, ptpDec);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] SetSingleAxMvPara ptpVel [" + ptpVel + "] ptpAcc [" + ptpAcc + "] ptpDec [" + ptpDec + "] FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] SetSingleAxMvPara ptpVel [" + ptpVel + "] ptpAcc [" + ptpAcc + "] ptpDec [" + ptpDec + "] FAIL, ",ret);
return false; return false;
} }
else else
...@@ -340,7 +340,7 @@ namespace HuichuanLibrary ...@@ -340,7 +340,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_AxMoveStop(nCardHandle, axisNo, 1); //StopType=1,立即停止 UInt32 ret = ImcApi.IMC_AxMoveStop(nCardHandle, axisNo, 1); //StopType=1,立即停止
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] MoveStop FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] MoveStop FAIL, ",ret);
return false; return false;
} }
else else
...@@ -368,7 +368,7 @@ namespace HuichuanLibrary ...@@ -368,7 +368,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxEcatStation(nCardHandle, axisNo, ref nphyStationId, ref nphySlotId); UInt32 ret = ImcApi.IMC_GetAxEcatStation(nCardHandle, axisNo, ref nphyStationId, ref nphySlotId);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] IMC_GetAxEcatStation FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] IMC_GetAxEcatStation FAIL, ",ret);
return false; return false;
} }
...@@ -378,12 +378,12 @@ namespace HuichuanLibrary ...@@ -378,12 +378,12 @@ namespace HuichuanLibrary
{ {
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_1 FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_1 FAIL, ",ret);
return false; return false;
} }
else else
{ {
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_1 FAIL, ErrorCode=0x" + abort_code.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_1 FAIL, ErrorCode=0x" ,abort_code);
return false; return false;
} }
...@@ -395,12 +395,12 @@ namespace HuichuanLibrary ...@@ -395,12 +395,12 @@ namespace HuichuanLibrary
{ {
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_2 FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_2 FAIL, ",ret);
return false; return false;
} }
else else
{ {
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_2 FAIL, ErrorCode=0x" + abort_code.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_2 FAIL, ErrorCode=0x" , abort_code );
return false; return false;
} }
} }
...@@ -421,7 +421,7 @@ namespace HuichuanLibrary ...@@ -421,7 +421,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_StartJogMove(nCardHandle, axisNo, targetVel); UInt32 ret = ImcApi.IMC_StartJogMove(nCardHandle, axisNo, targetVel);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] speed [" + targetVel + "] StartJogMove FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] speed [" + targetVel + "] StartJogMove FAIL, ",ret);
return false; return false;
} }
else else
...@@ -448,7 +448,7 @@ namespace HuichuanLibrary ...@@ -448,7 +448,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxPrfMode(nCardHandle, axisNo, nTimerAxPrfMode, 1); //变量需要定义为数组,默认读取1个轴 UInt32 ret = ImcApi.IMC_GetAxPrfMode(nCardHandle, axisNo, nTimerAxPrfMode, 1); //变量需要定义为数组,默认读取1个轴
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfMode FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfMode FAIL, ",ret);
return -1; return -1;
} }
if (nTimerAxPrfMode.Length > 0) if (nTimerAxPrfMode.Length > 0)
...@@ -478,7 +478,7 @@ namespace HuichuanLibrary ...@@ -478,7 +478,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxSts(nCardHandle, axisNo, nTimerAxSts, 1); UInt32 ret = ImcApi.IMC_GetAxSts(nCardHandle, axisNo, nTimerAxSts, 1);
if (ret != 0 || nTimerAxSts.Length <= 0) if (ret != 0 || nTimerAxSts.Length <= 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxSts FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxSts FAIL, ",ret);
return sts; return sts;
} }
...@@ -498,7 +498,7 @@ namespace HuichuanLibrary ...@@ -498,7 +498,7 @@ namespace HuichuanLibrary
ret = ImcApi.IMC_GetAxEcatDigitalInput(nCardHandle, axisNo, ref nTimerAxInput); ret = ImcApi.IMC_GetAxEcatDigitalInput(nCardHandle, axisNo, ref nTimerAxInput);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "]GetAxEcatDigitalInput ,ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "]GetAxEcatDigitalInput ,",ret);
return sts; return sts;
} }
...@@ -526,7 +526,7 @@ namespace HuichuanLibrary ...@@ -526,7 +526,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxPrfPos(nCardHandle, axisNo, nTimerAxPrfPos, 1); UInt32 ret = ImcApi.IMC_GetAxPrfPos(nCardHandle, axisNo, nTimerAxPrfPos, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfPos FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfPos FAIL, ",ret);
return -1; return -1;
} }
return nTimerAxPrfPos[0]; return nTimerAxPrfPos[0];
...@@ -547,7 +547,7 @@ namespace HuichuanLibrary ...@@ -547,7 +547,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxPrfVel(nCardHandle, axisNo, nTimerAxPrfVel, 1); UInt32 ret = ImcApi.IMC_GetAxPrfVel(nCardHandle, axisNo, nTimerAxPrfVel, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfVel FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfVel FAIL, ",ret);
return -1; return -1;
} }
return nTimerAxPrfVel[0]; return nTimerAxPrfVel[0];
...@@ -567,7 +567,7 @@ namespace HuichuanLibrary ...@@ -567,7 +567,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxEncPos(nCardHandle, axisNo, nTimerAxEncPos, 1); UInt32 ret = ImcApi.IMC_GetAxEncPos(nCardHandle, axisNo, nTimerAxEncPos, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxEncPos FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxEncPos FAIL, ",ret);
return -1; return -1;
} }
return nTimerAxEncPos[0]; return nTimerAxEncPos[0];
...@@ -587,7 +587,7 @@ namespace HuichuanLibrary ...@@ -587,7 +587,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxEncVel(nCardHandle, axisNo, nTimerAxEncVel, 1); UInt32 ret = ImcApi.IMC_GetAxEncVel(nCardHandle, axisNo, nTimerAxEncVel, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxEncVel FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxEncVel FAIL, ",ret);
return -1; return -1;
} }
return nTimerAxEncVel[0]; return nTimerAxEncVel[0];
...@@ -607,7 +607,7 @@ namespace HuichuanLibrary ...@@ -607,7 +607,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxEncAcc(nCardHandle, axisNo, nTimerAxEncAcc, 1); UInt32 ret = ImcApi.IMC_GetAxEncAcc(nCardHandle, axisNo, nTimerAxEncAcc, 1);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxEncAcc FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxEncAcc FAIL, ",ret);
return -1; return -1;
} }
return nTimerAxEncAcc[0]; return nTimerAxEncAcc[0];
...@@ -626,7 +626,7 @@ namespace HuichuanLibrary ...@@ -626,7 +626,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_ClrAxSts(nCardHandle, axisNo); UInt32 ret = ImcApi.IMC_ClrAxSts(nCardHandle, axisNo);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] ClrAxSts FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] ClrAxSts FAIL, ",ret);
return false; return false;
} }
return true; return true;
...@@ -646,7 +646,7 @@ namespace HuichuanLibrary ...@@ -646,7 +646,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetAxErrCode(nCardHandle, axisNo, ref outV); UInt32 ret = ImcApi.IMC_GetAxErrCode(nCardHandle, axisNo, ref outV);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxEncAcc FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxEncAcc FAIL, ",ret);
return -1; return -1;
} }
return outV; return outV;
...@@ -669,7 +669,7 @@ namespace HuichuanLibrary ...@@ -669,7 +669,7 @@ namespace HuichuanLibrary
res = "轴类型[" + pAxType + "],物理通道[" + pOutChn + "]"; res = "轴类型[" + pAxType + "],物理通道[" + pOutChn + "]";
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxType FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxType FAIL, ",ret);
} }
return res; return res;
...@@ -690,7 +690,7 @@ namespace HuichuanLibrary ...@@ -690,7 +690,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatAxPosTorqLmt(nCardHandle, axisNo, ref outV); UInt32 ret = ImcApi.IMC_GetEcatAxPosTorqLmt(nCardHandle, axisNo, ref outV);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetEcatAxPosTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetEcatAxPosTorqLmt FAIL, ",ret);
return -1; return -1;
} }
return outV; return outV;
...@@ -710,7 +710,7 @@ namespace HuichuanLibrary ...@@ -710,7 +710,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetEcatAxPosTorqLmt(nCardHandle, axisNo, value); UInt32 ret = ImcApi.IMC_SetEcatAxPosTorqLmt(nCardHandle, axisNo, value);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "][" + value + "] SetEcatAxPosTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "][" + value + "] SetEcatAxPosTorqLmt FAIL, ",ret);
return false; return false;
} }
return true; return true;
...@@ -730,7 +730,7 @@ namespace HuichuanLibrary ...@@ -730,7 +730,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatAxNegTorqLmt(nCardHandle, axisNo, ref outV); UInt32 ret = ImcApi.IMC_GetEcatAxNegTorqLmt(nCardHandle, axisNo, ref outV);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetEcatAxNegTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetEcatAxNegTorqLmt FAIL, ",ret);
return -1; return -1;
} }
return outV; return outV;
...@@ -750,7 +750,7 @@ namespace HuichuanLibrary ...@@ -750,7 +750,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetEcatAxNegTorqLmt(nCardHandle, axisNo, value); UInt32 ret = ImcApi.IMC_SetEcatAxNegTorqLmt(nCardHandle, axisNo, value);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "][" + value + "] SetEcatAxNegTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "][" + value + "] SetEcatAxNegTorqLmt FAIL, ",ret);
return false; return false;
} }
return true; return true;
...@@ -770,7 +770,7 @@ namespace HuichuanLibrary ...@@ -770,7 +770,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_GetEcatAxMaxTorqLmt(nCardHandle, axisNo, ref outV); UInt32 ret = ImcApi.IMC_GetEcatAxMaxTorqLmt(nCardHandle, axisNo, ref outV);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetEcatAxMaxTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetEcatAxMaxTorqLmt FAIL, ",ret);
return -1; return -1;
} }
return outV; return outV;
...@@ -790,7 +790,7 @@ namespace HuichuanLibrary ...@@ -790,7 +790,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetEcatAxMaxTorqLmt(nCardHandle, axisNo, value); UInt32 ret = ImcApi.IMC_SetEcatAxMaxTorqLmt(nCardHandle, axisNo, value);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "][" + value + "] SetEcatAxMaxTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "][" + value + "] SetEcatAxMaxTorqLmt FAIL, ",ret);
return false; return false;
} }
return true; return true;
......
using log4net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HuichuanLibrary
{
public class HCErrorCode
{
private static Dictionary<string, string> CmdMap = new Dictionary<string, string>();
private static Dictionary<string, string> ErrorCodeMap = new Dictionary<string, string>();
public static void LoadConfig(string cmdConfigPath = "", string errCodeConfigPath = "" )
{
if (cmdConfigPath.Equals(""))
{
cmdConfigPath = Application.StartupPath+ @"\huichuan_config\commandDef.txt";
}
if (errCodeConfigPath.Equals(""))
{
errCodeConfigPath = Application.StartupPath + @"\huichuan_config\errorcode.h";
}
LoadCmdConfig(cmdConfigPath);
LoadErrConfig(errCodeConfigPath);
}
public static string GetCodeMsg(UInt32 ret)
{
string str = ret.ToString("x8").PadLeft(8,'0');
string cmdCode = "0x" + str.Substring(0, 4);
string errCode = "0x" + str.Substring(4, 4);
CmdMap.TryGetValue(cmdCode, out string cmdStr);
ErrorCodeMap.TryGetValue(errCode, out string errStr);
string result = " ErrorCode = 0x" + str + ",CMD=" + cmdStr + ",ErrorMsg=" + errStr;
return result;
}
private static void LoadCmdConfig (string cmdPath)
{
try
{
CmdMap = new Dictionary<string, string>();
if (!File.Exists(cmdPath))
{
return;
}
Encoding encoding = Encoding.UTF8;
if (!GetType(cmdPath).Equals(Encoding.UTF8))
{
encoding = Encoding.GetEncoding("gb2312");
}
string[] lines = File.ReadAllLines(cmdPath, encoding);
foreach (string line in lines)
{
if (line.Trim().StartsWith("#define"))
{
string newS = line.Trim().Replace("#define", "").Replace(")","");
string[] array = newS.Trim().Split('(');
if (array.Length >= 2)
{
//#define ID_IMC_GetCardsNum (0x8000)
string cmdName = array[0].Trim();
string cmdCode = array[1].Trim().ToLower();
if(!String.IsNullOrEmpty(cmdName) && (!String.IsNullOrEmpty(cmdCode))){
if (!CmdMap.ContainsKey(cmdCode))
{
CmdMap.Add(cmdCode, cmdName);
}
}
}
}
}
}
catch (Exception ex)
{
HCLogUtil.error("加载:" + cmdPath + "错误:" + ex.ToString());
}
}
private static void LoadErrConfig(string errPath)
{
try
{
ErrorCodeMap = new Dictionary<string, string>();
if (!File.Exists(errPath))
{
return;
}
Encoding encoding = Encoding.UTF8;
if (!GetType(errPath).Equals(Encoding.UTF8))
{
encoding = Encoding.GetEncoding("gb2312");
}
string[] lines = File.ReadAllLines(errPath, encoding);
foreach (string line in lines)
{
if (line.Trim().StartsWith("#define"))
{
string newS = line.Trim().Replace("#define", "").Replace(")", "").Replace("//","/");
string[] array = newS.Trim().Split('(');
if (array.Length >= 2)
{
string[] array2 = array[1].Split('/');
if (array2.Length >= 2)
{
//#define ERR_BGVEL_OUTRANG (0x0010) // 起始速度设置超出范围
string cmdName = array2[0].Trim();
string cmdCode = array2[1].Trim().ToLower();
if (!String.IsNullOrEmpty(cmdName) && (!String.IsNullOrEmpty(cmdCode))){
if (!ErrorCodeMap.ContainsKey(cmdName))
{
ErrorCodeMap.Add(cmdName, cmdCode);
}
}
}
}
}
}
}
catch (Exception ex)
{
HCLogUtil.error("加载:" + errPath + "错误:" + ex.ToString());
}
}
#region 判断编码格式
private static bool IsUTF8Bytes(byte[] data)
{
int charByteCounter = 1; //计算当前正分析的字符应还有的字节数
byte curByte; //当前分析的字节.
for (int i = 0; i < data.Length; i++)
{
curByte = data[i];
if (charByteCounter == 1)
{
if (curByte >= 0x80)
{
//判断当前
while (((curByte <<= 1) & 0x80) != 0)
{
charByteCounter++;
}
//标记位首位若为非0 则至少以2个1开始 如:110XXXXX...........1111110X
if (charByteCounter == 1 || charByteCounter > 6)
{
return false;
}
}
}
else
{
//若是UTF-8 此时第一位必须为1
if ((curByte & 0xC0) != 0x80)
{
return false;
}
charByteCounter--;
}
}
if (charByteCounter > 1)
{
throw new Exception("非预期的byte格式");
}
return true;
}
public static System.Text.Encoding GetType(FileStream fs)
{
byte[] Unicode = new byte[] { 0xFF, 0xFE, 0x41 };
byte[] UnicodeBIG = new byte[] { 0xFE, 0xFF, 0x00 };
byte[] UTF8 = new byte[] { 0xEF, 0xBB, 0xBF }; //带BOM
Encoding reVal = Encoding.Default;
BinaryReader r = new BinaryReader(fs, System.Text.Encoding.Default);
int i;
int.TryParse(fs.Length.ToString(), out i);
byte[] ss = r.ReadBytes(i);
if (IsUTF8Bytes(ss) || (ss[0] == 0xEF && ss[1] == 0xBB && ss[2] == 0xBF))
{
reVal = Encoding.UTF8;
}
else if (ss[0] == 0xFE && ss[1] == 0xFF && ss[2] == 0x00)
{
reVal = Encoding.BigEndianUnicode;
}
else if (ss[0] == 0xFF && ss[1] == 0xFE && ss[2] == 0x41)
{
reVal = Encoding.Unicode;
}
r.Close();
return reVal;
}
public static System.Text.Encoding GetType(string FILE_NAME)
{
FileStream fs = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read);
Encoding r = GetType(fs);
fs.Close();
return r;
}
#endregion
}
}
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
</Compile> </Compile>
<Compile Include="HCBoardManager.cs" /> <Compile Include="HCBoardManager.cs" />
<Compile Include="HCBoardManager_Axis.cs" /> <Compile Include="HCBoardManager_Axis.cs" />
<Compile Include="HCErrorCode.cs" />
<Compile Include="ImcApi.cs" /> <Compile Include="ImcApi.cs" />
<Compile Include="HCLogUtil.cs" /> <Compile Include="HCLogUtil.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
...@@ -65,6 +66,12 @@ ...@@ -65,6 +66,12 @@
<Content Include="device_config.xml"> <Content Include="device_config.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<EmbeddedResource Include="huichuan_config\commandDef.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="huichuan_config\errorcode.h">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<Content Include="huichuan_x64\IMC_API_x64.dll"> <Content Include="huichuan_x64\IMC_API_x64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
......
/*==========================================================================*/
/*---- COMMAND ID DEFINE ---*/
/*==========================================================================*/
/*==========================================================================*/
/*----1.1 板卡的操作以及资源的获取接口 ---*/
/*==========================================================================*/
#define ID_IMC_GetCardsNum (0x8000)
#define ID_IMC_OpenCard (0x8001)
#define ID_IMC_CloseCard (0x8002)
#define ID_IMC_OpenCardHandle (0x8004)
#define ID_IMC_ScanCardECAT (0x8006)
#define ID_IMC_GetECATMasterSts (0x8007)
#define ID_IMC_CloseCardHandle (0x8005)
#define ID_IMC_ScanCard (0x8008)
#define ID_IMC_GetCardSts (0x8009)
#define ID_IMC_GetCardResource (0x8003)
#define ID_IMC_UpLoadDeviceConfig (0x8010)
#define ID_IMC_DownLoadDeviceConfig (0x8011)
#define ID_IMC_DownLoadSystemConfig (0x8012)
#define ID_IMC_GetHwVer (0x8026)
/*==========================================================================*/
/*----1.2 板卡的操作以及资源的获取接口 ---*/
/*==========================================================================*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----1.2.1 ECAT资源设置接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetEcatGrpDiInverse (0x0010)
#define ID_IMC_GetEcatGrpDiInverse (0x0011)
#define ID_IMC_SetEcatGrpDoInverse (0x0012)
#define ID_IMC_GetEcatGrpDoInverse (0x0013)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----1.2.2 端子板资源设置接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_GetBoardWorkSts (0x0080)
#define ID_IMC_SetLocalDiFilterTime (0x0081)
#define ID_IMC_GetLocalDiFilterTime (0x0082)
#define ID_IMC_SetLocalHmLmtPrbFilterTime (0x008b)
#define ID_IMC_GetLocalHmLmtPrbFilterTime (0x008c)
#define ID_IMC_SetLocalSpecialIOInverse (0x008d)
#define ID_IMC_GetLocalSpecialIOInverse (0x008e)
#define ID_IMC_SetLocalDiInverse (0x0083)
#define ID_IMC_GetLocalDiInverse (0x0084)
#define ID_IMC_SetLocalDoInverse (0x0085)
#define ID_IMC_GetLocalDoInverse (0x0086)
#define ID_IMC_SetLocalEncDir (0x0087)
#define ID_IMC_GetLocalEncDir (0x0088)
#define ID_IMC_SetLocalPulseMode (0x0089)
#define ID_IMC_GetLocalPulseMode (0x008a)
#define ID_IMC_SetLocalGpoUseType (0x0092)
#define ID_IMC_GetLocalGpoUseType (0x0093)
#define ID_IMC_SetEncFilterPara (0x0094)
#define ID_IMC_GetEncFilterPara (0x0095)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----1.2.3 系统参数设置接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_GetHwSysPara (0x0202)
#define ID_IMC_ResetSysPara (0x0222)
#define ID_IMC_GetCalcLoadRatio (0x0203)
#define ID_IMC_GetVersion (0x0204)
#define ID_IMC_WriteUserCode (0x8015)
#define ID_IMC_CheckUserCode (0x8016)
#define ID_IMC_SetEmgStopMode (0x020f)
#define ID_IMC_GetEmgStopMode (0x0215)
#define ID_IMC_SetEmgFilter (0x0210)
#define ID_IMC_GetEmgFilter (0x0211)
#define ID_IMC_SetEmgTrigLevelInv (0x0212)
#define ID_IMC_GetEmgTrigLevelInv (0x0213)
#define ID_IMC_GetEmgDiLevel (0x0214)
#define ID_IMC_SetEmgDoResetFlag (0x0216)
#define ID_IMC_GetEmgDoResetFlag (0x0217)
#define ID_IMC_SetEmgSvOffVelThreshold (0x0218)
#define ID_IMC_GetEmgSvOffVelThreshold (0x0219)
#define ID_IMC_OpenWatchDog (0x0223)
#define ID_IMC_FeedWatchDog (0x0224)
#define ID_IMC_CloseWatchDog (0x0225)
#define ID_IMC_EnableCheckEcatErrCode (0x0226)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----1.2.4 轴参数设置接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetAxActive (0x0065)
#define ID_IMC_GetAxActive (0x0066)
#define ID_IMC_SetAxMaxMtPara (0x0031)
#define ID_IMC_GetAxMaxMtPara (0x0032)
#define ID_IMC_SetAxEquiv (0x0060)
#define ID_IMC_GetAxEquiv (0x0061)
#define ID_IMC_SetAxBondCfg (0x0041)
#define ID_IMC_GetAxBondCfg (0x0042)
#define ID_IMC_ResetAxBondCfg (0x004f)
#define ID_IMC_SetAxAttriPara (0x0043)
#define ID_IMC_GetAxAttriPara (0x0044)
#define ID_IMC_SetAxSoftLimit (0x0045)
#define ID_IMC_GetAxSoftLimit (0x0046)
#define ID_IMC_SetAxArrivalBand (0x0047)
#define ID_IMC_GetAxArrivalBand (0x0048)
#define ID_IMC_SetAxErrorPos (0x004b)
#define ID_IMC_GetAxErrorPos (0x004c)
#define ID_IMC_SetAxBacklash (0x004d)
#define ID_IMC_GetAxBacklash (0x004e)
#define ID_IMC_AxSafeCheckEnable (0x0050)
#define ID_IMC_AxSafeCheckSts (0x0051)
#define ID_IMC_AxAlarmEnable (0x0052)
#define ID_IMC_AxAlarmDisable (0x0053)
#define ID_IMC_AxSoftLmtsEnable (0x0054)
#define ID_IMC_AxSoftLmtsDisable (0x0055)
#define ID_IMC_AxHwLmtsEnable (0x0056)
#define ID_IMC_AxHwLmtsDisable (0x0057)
#define ID_IMC_AxErrPosEnable (0x0058)
#define ID_IMC_AxErrPosDisable (0x0059)
#define ID_IMC_SetEcatAxProbeMaskBit (0x0030)
#define ID_IMC_GetEcatAxProbeMaskBit (0x0033)
#define ID_IMC_SetupAxGantry (0x0062)
#define ID_IMC_AbortAxGantry (0x0063)
#define ID_IMC_GetAxGantrySts (0x0064)
#define ID_IMC_ClrAxGantrySts (0x0068)
#define ID_IMC_AxSetScrewCompTable (0x2100)
#define ID_IMC_AxGetScrewCompTable (0x2101)
#define ID_IMC_AxEnableScrewComp (0x2103)
#define ID_IMC_AxDisableScrewComp (0x2104)
#define ID_IMC_AxGetScrewCompStatus (0x2105)
#define ID_IMC_AxGetScrewCompValue (0x2106)
/*==========================================================================*/
/*----2.1 ECAT硬件操作接口 ---*/
/*==========================================================================*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----2.1.1ECAT总线 SDO操作以及状态查询 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_GetSlaveCurSts (0x8017)
#define ID_IMC_GetSlaveReqSts (0x8018)
#define ID_IMC_GetEcatErrCode (0x8019)
#define ID_IMC_GetAxEcatStation (0x801a)
#define ID_IMC_GetEcatSdo (0x801b)
#define ID_IMC_SetEcatSdo (0x801c)
#define ID_IMC_GetAxEcatPidVid (0x8032)
#define ID_IMC_GetEcatStationPidVid (0x8032)
#define ID_IMC_GetAxSdo (0x8034)
#define ID_IMC_SetAxSdo (0x8033)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----2.1.2 ECAT总线 DI/DO操作 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetEcatDoBit (0x0100)
#define ID_IMC_GetEcatDoBit (0x0102)
#define ID_IMC_SetEcatGrpDo (0x0103)
#define ID_IMC_GetEcatGrpDo (0x0104)
#define ID_IMC_GetEcatDiBit (0x0105)
#define ID_IMC_GetEcatGrpDi (0x0106)
#define ID_IMC_GetEcatAdVal (0x0107)
#define ID_IMC_SetEcatDaVal (0x0108)
#define ID_IMC_GetEcatDaVal (0x0109)
#define ID_IMC_GetEcatAdSts (0x001e)
#define ID_IMC_GetEcatDaSts (0x001f)
#define ID_IMC_GetEcatPtVal (0x0113)
/*==========================================================================*/
/*----2.2 端子板硬件操作接口 ---*/
/*==========================================================================*/
#define ID_IMC_GetBoardVersion (0x0152)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----2.2.1 端子板DIO操作接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetLocalDoBit (0x0140)
#define ID_IMC_GetLocalDoBit (0x0141)
#define ID_IMC_SetLocalDo (0x0142)
#define ID_IMC_GetLocalDo (0x0143)
#define ID_IMC_GetLocalDiBit (0x0144)
#define ID_IMC_GetLocalDi (0x0145)
#define ID_IMC_GetLocalADVal (0x0148)
#define ID_IMC_GetLocalSpecialDi (0x0149)
#define ID_IMC_GetLocalSpecialDiBit (0x014a)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----2.2.2 端子板编码器操作接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_GetLocalCntPos (0x0150)
#define ID_IMC_GetLocalCntVel (0x0151)
#define ID_IMC_GetLocalEncPos (0x0146)
#define ID_IMC_GetLocalEncVel (0x0147)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----2.2.4 端子板位置比较输出操作接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_CompareSrcConfig (0x0180)
#define ID_IMC_CompareOutputConfig (0x0186)
#define ID_IMC_GetCompareStatus (0x0184)
#define ID_IMC_StopCompareOut (0x0185)
#define ID_IMC_StartCompareOut (0x0187)
#define ID_IMC_CompareManualOutput (0x0181)
#define ID_IMC_LinearCompare (0x0182)
#define ID_IMC_SetCompareData (0x0183)
#define ID_IMC_SetCompareDataType (0x0188)
#define ID_IMC_GetCompareDataType (0x0189)
#define ID_IMC_SetComparePosType (0x018a)
#define ID_IMC_GetComparePosType (0x018b)
#define ID_IMC_SetMultiDimensComparePara (0x018c)
#define ID_IMC_GetMultiDimensComparePara (0x018d)
#define ID_IMC_SetMultiDimensCompareData (0x018e)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----2.2.5 端子板PWM输出控制 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetPwmPara (0x0160)
#define ID_IMC_GetPwmPara (0x0161)
#define ID_IMC_SetPwmFrq (0x0162)
#define ID_IMC_SetPwmDuty (0x0163)
#define ID_IMC_SetPwmOnOff (0x0164)
#define ID_IMC_SetPwmOnDelay (0x0165)
#define ID_IMC_SetPwmOffDelay (0x0166)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----2.2.6 PSO控制 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetPSOMode0Para (0x0179)
#define ID_IMC_GetPSOMode0Para (0x017a)
#define ID_IMC_StartPSO (0x017b)
#define ID_IMC_StopPSO (0x017c)
/*==========================================================================*/
/*----3 回零操作接口 ---*/
/*==========================================================================*/
#define ID_IMC_StartHomingInUnit (0x000a)
#define ID_IMC_StartHoming (0x000a)
#define ID_IMC_StopHoming (0x000d)
#define ID_IMC_GetHomingStatus (0x000c)
#define ID_IMC_FinishHoming (0x000b)
#define ID_IMC_StartEcatAxCSPHoming (0x0024)
#define ID_IMC_StopEcatAxCSPHoming (0x0025)
#define ID_IMC_GetEcatAxCSPHomingSts (0x0026)
#define ID_IMC_FinishEcatAxCSPHoming (0x0027)
#define ID_IMC_CloseAutoHomingFinish (0x000f)
/*==========================================================================*/
/*----4 状态管理接口 ---*/
/*==========================================================================*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----4.2 轴状态管理接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_GetAxPrfMode (0x0308)
#define ID_IMC_GetAxSts (0x0300)
#define ID_IMC_ClrAxSts (0x0301)
#define ID_IMC_GetAxPrfPos (0x0302)
#define ID_IMC_GetAxPrfVel (0x0303)
#define ID_IMC_GetAxPrfAcc (0x0304)
#define ID_IMC_GetAxEncPos (0x0305)
#define ID_IMC_GetAxcOrgEncPos (0x030f)
#define ID_IMC_GetAxEncVel (0x0306)
#define ID_IMC_GetAxEncAcc (0x0307)
#define ID_IMC_GetPrfPos (0x0309)
#define ID_IMC_GetAxType (0x030a)
#define ID_IMC_GetMultiAxArrivalSts (0x0310)
#define ID_IMC_AxServoOn (0x0320)
#define ID_IMC_AxServoOff (0x0323)
#define ID_IMC_AxMoveStop (0x0321)
#define ID_IMC_AxStopInBits (0x0322)
#define ID_IMC_SetAxCurPos (0x0330)
#define ID_IMC_SetAxCompenPos (0x0331)
#define ID_IMC_GetAxCompenPos (0x0332)
#define ID_IMC_SetAxCtrlMode (0x0360)
#define ID_IMC_GetAxCtrlMode (0x0361)
#define ID_IMC_PrfAxTorq (0x0362)
#define ID_IMC_GetAxActTorq (0x0363)
#define ID_IMC_SetAxTorqSlope (0x0364)
#define ID_IMC_GetAxTorqSlope (0x0366)
#define ID_IMC_SetAxTgtTorq (0x0367)
#define ID_IMC_GetAxTgtTorq (0x0368)
#define ID_IMC_GetAxErrCode (0x030d)
#define ID_IMC_GetAxEcatDigitalInput (0x0365)
#define ID_IMC_GetAxBacklashCmpVal (0x0369)
#define ID_IMC_SetEcatAxMaxVelLmt (0x0028)
#define ID_IMC_GetEcatAxMaxVelLmt (0x0029)
#define ID_IMC_SetEcatAxPosTorqLmt (0x002a)
#define ID_IMC_GetEcatAxPosTorqLmt (0x002b)
#define ID_IMC_SetEcatAxNegTorqLmt (0x002c)
#define ID_IMC_GetEcatAxNegTorqLmt (0x002d)
#define ID_IMC_SetEcatAxMaxTorqLmt (0x002e)
#define ID_IMC_GetEcatAxMaxTorqLmt (0x002f)
#define ID_IMC_SyncAxPos (0x030e)
#define ID_IMC_SetAxPressFitCtrlWord (0x0370)
#define ID_IMC_GetAxPressFitSts (0x0371)
#define ID_IMC_GetAxAIInputVal (0x0372)
#define ID_IMC_GetAxPressFeedback (0x0373)
#define ID_IMC_SetAxPressTgtVal (0x0374)
#define ID_IMC_StartAxTorqHoming (0x0380)
#define ID_IMC_StopAxTorqHoming (0x0381)
#define ID_IMC_GetAxTorqHomingSts (0x0382)
#define ID_IMC_FinishAxTorqHoming (0x0383)
#define ID_IMC_StartAxCsvPrf (0x0390)
#define ID_IMC_StopAxCsvPrf (0x0391)
#define ID_IMC_EstopAxCsvPrf (0x0392)
#define ID_IMC_UpdateAxCsvPrf (0x0393)
#define ID_IMC_GetAxCsvPrfStatus (0x0394)
/*==========================================================================*/
/*----5 数据采样接口 ---*/
/*==========================================================================*/
#define ID_IMC_ConfigSamplePara (0x0400)
#define ID_IMC_ConfigSampleData (0x0401)
#define ID_IMC_ConfigSampleEnable (0x0402)
#define ID_IMC_GetSampleStatus (0x0403)
#define ID_IMC_GetSampleData (0x0404)
/*==========================================================================*/
/*----6 轴位置捕获接口 ---*/
/*==========================================================================*/
#define ID_IMC_SetAxCaptMode (0x0340)
#define ID_IMC_GetAxCaptMode (0x0341)
#define ID_IMC_GetAxCaptStatus (0x0342)
/*==========================================================================*/
/*----7 运动模式接口 ---*/
/*==========================================================================*/
#define ID_IMC_SetSingleAxMvPara (0x1000)
#define ID_IMC_GetSingleAxMvPara (0x1001)
#define ID_IMC_SetSingleAxVelType (0x1002)
#define ID_IMC_GetSingleAxVelType (0x1003)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.1 PTP点位模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_StartPtpMove (0x1004)
#define ID_IMC_StartMultiPtpMove (0x1009)
#define ID_IMC_UpdatePtpTgtPos (0x1005)
#define ID_IMC_UpdatePtpMvPara (0x1006)
#define ID_IMC_UpdatePtpTgtVel (0x1008)
#define ID_IMC_PauseMove (0x1030)
#define ID_IMC_ResumeMove (0x1031)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.2 Jog运动模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_StartJogMove (0x1010)
#define ID_IMC_StartMultiJogMove (0x1013)
#define ID_IMC_UpdateJogMvPara (0x1011)
#define ID_IMC_UpdateJogTgtVel (0x1012)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.3 手轮跟随运动模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_EnterHandWheelMode (0x1200)
#define ID_IMC_ExitHandWheelMode (0x1201)
#define ID_IMC_SwitchHandWheelRatio (0x1202)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.4 电子齿轮 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_GearSetParam (0x1403)
#define ID_IMC_GearGetParam (0x1404)
#define ID_IMC_GearUpdateScale (0x1405)
#define ID_IMC_GearStart (0x1400)
#define ID_IMC_GearStop (0x1401)
#define ID_IMC_GearGetStatus (0x1402)
#define ID_IMC_GearDestroy (0x1408)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.5 直角坐标系插补运动模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_CrdSetMtSys (0x2500)
#define ID_IMC_CrdGetMtSysParam (0x2501)
#define ID_IMC_CrdDeleteMtSys (0x2502)
#define ID_IMC_CrdSetAdvParam (0x2503)
#define ID_IMC_CrdGetAdvParam (0x2504)
#define ID_IMC_CrdSetTrajVel (0x2528)
#define ID_IMC_CrdSetTrajAcc (0x2529)
#define ID_IMC_CrdSetTrajAccAndDec (0x2537)
#define ID_IMC_CrdSetZeroFlag (0x252a)
#define ID_IMC_CrdSetIncMode (0x252d)
#define ID_IMC_CrdUserVelPlan (0x252f)
#define ID_IMC_CrdSetTrajTol (0x2530)
#define ID_IMC_CrdSetTrajTurnCoef (0x2531)
#define ID_IMC_CrdSetFolVelMode (0x253a)
#define ID_IMC_CrdGetFolVelMode (0x2546)
#define ID_IMC_CrdGetTrajVel (0x2541)
#define ID_IMC_CrdGetTrajAccAndDec (0x2542)
#define ID_IMC_CrdGetZeroFlag (0x2543)
#define ID_IMC_CrdGetIncMode (0x2544)
#define ID_IMC_CrdGetUserVelPlan (0x2545)
#define ID_IMC_CrdLineXYZ (0x2505)
#define ID_IMC_CrdLineXY (0x2506)
#define ID_IMC_CrdLineZX (0x2508)
#define ID_IMC_CrdLineYZ (0x2507)
#define ID_IMC_CrdArcThreePoint (0x2509)
#define ID_IMC_Crd3DArcCenerNormal (0x250a)
#define ID_IMC_Crd3DArcRadiusNormal (0x250e)
#define ID_IMC_Crd3DArcAngleNormal (0x2527)
#define ID_IMC_CrdArcCenterXYPlane (0x250b)
#define ID_IMC_CrdArcCenterYZPlane (0x250c)
#define ID_IMC_CrdArcCenterZXPlane (0x250d)
#define ID_IMC_CrdArcRadiusXYPlane (0x250f)
#define ID_IMC_CrdArcRadiusYZPlane (0x2510)
#define ID_IMC_CrdArcRadiusZXPlane (0x2511)
#define ID_IMC_CrdArcAngleXYPlane (0x2524)
#define ID_IMC_CrdArcAngleYZPlane (0x2525)
#define ID_IMC_CrdArcAngleZXPlane (0x2526)
#define ID_IMC_CrdWaitTime (0x2512)
#define ID_IMC_CrdWaitDI (0x2513)
#define ID_IMC_CrdSetDO (0x2514)
#define ID_IMC_CrdPTPMove (0x2515)
#define ID_IMC_CrdSyncMove (0x2516)
#define ID_IMC_CrdEndData (0x2517)
#define ID_IMC_CrdWaitInPos (0x2538)
#define ID_IMC_CrdSetDistanceDO (0x254b)
#define ID_IMC_CrdSetTimeDO (0x254c)
#define ID_IMC_CrdStart (0x2518)
#define ID_IMC_CrdStop (0x2519)
#define ID_IMC_CrdGetStatus (0x251a)
#define ID_IMC_CrdSetRatio (0x251b)
#define ID_IMC_CrdGetRatio (0x251c)
#define ID_IMC_CrdGetPos (0x251d)
#define ID_IMC_CrdGetVel (0x251e)
#define ID_IMC_CrdGetUserID (0x251f)
#define ID_IMC_CrdGetSpace (0x2520)
#define ID_IMC_CrdClrData (0x2521)
#define ID_IMC_CrdClrError (0x2522)
#define ID_IMC_CrdGetTargetPos (0x2523)
#define ID_IMC_CrdGetPausePos (0x2533)
#define ID_IMC_CrdSetSmoothParam (0x252b)
#define ID_IMC_CrdGetSmoothParam (0x252c)
#define ID_IMC_CrdGetArrivalSts (0x2539)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.6 PTP连续运动模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_PTPCAddFixTData (0x1021)
#define ID_IMC_PTPCAddFixVmData (0x1022)
#define ID_IMC_PTPCInterruptData (0x1025)
#define ID_IMC_PTPCStart (0x1020)
#define ID_IMC_PTPCGetSpace (0x1023)
#define ID_IMC_PTPCClrData (0x1024)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.7 多轴同步运动模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetupMutiSyncSys (0x2000)
#define ID_IMC_GetMutiSyncSysInfo (0x2011)
#define ID_IMC_DeleteMutiSyncSys (0x2001)
#define ID_IMC_MutiSyncMotion (0x200c)
#define ID_IMC_MutiSyncMotionInRatio (0x200c)
#define ID_IMC_MutiSyncMotionLookaheadInRatio (0x2014)
#define ID_IMC_MutiSyncMotionInAxVelAcc (0x2012)
#define ID_IMC_MutiSyncMotionLookaheadInAxVelAcc (0x2015)
#define ID_IMC_MutiSyncMotionInSynVelAcc (0x2013)
#define ID_IMC_MutiSyncMotionLookaheadInSynVelAcc (0x2016)
#define ID_IMC_MutiSyncMotionInAccDecTime (0x2018)
#define ID_IMC_MutiSyncMotionInRunTime (0x2019)
#define ID_IMC_MutiSyncStart (0x2006)
#define ID_IMC_MutiSyncStop (0x2007)
#define ID_IMC_MutiSyncGetStatus (0x200b)
#define ID_IMC_MutiSyncSetRatio (0x2004)
#define ID_IMC_MutiSyncGetRatio (0x2005)
#define ID_IMC_MutiSyncGetUserID (0x2008)
#define ID_IMC_MutiSyncGetSpace (0x2009)
#define ID_IMC_MutiSyncClrData (0x200a)
#define ID_IMC_MutiSyncClrError (0x2010)
#define ID_IMC_MutiSyncSetType (0x200e)
#define ID_IMC_MutiSyncGetType (0x200f)
#define ID_IMC_MutiSyncGetTrajVel (0x2017)
#define ID_IMC_MutiSyncGetArrivalSts (0x201a)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.8 多轴插补立即运动模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_ImmediateLineMoveInSynVelAcc (0x2900)
#define ID_IMC_ImmediateLineMoveInAxisVelAcc (0x2901)
#define ID_IMC_ImmediateArcThreePointMove (0x2904)
#define ID_IMC_ImmediateArcCenterMove (0x2905)
#define ID_IMC_ImmediateArcRadiusMove (0x2906)
#define ID_IMC_ImmediateArcAngleMove (0x2907)
#define ID_IMC_ImmediateMoveGetVel (0x2908)
#define ID_IMC_ImmediateMoveStop (0x2902)
#define ID_IMC_ImmediateMoveEStop (0x2903)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.9 周期运动接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetCycleMovePara (0x1700)
#define ID_IMC_GetCycleMovePara (0x1701)
#define ID_IMC_StartCycleMove (0x1702)
#define ID_IMC_StopCycleMove (0x1703)
#define ID_IMC_GetCycleMovePrfPos (0x1704)
#define ID_IMC_GetCycleMoveEncPos (0x1705)
#define ID_IMC_SetCycleMoveCurPos (0x1706)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*----7.10 捆绑PT运动模式接口 ---*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define ID_IMC_SetupPtPackSys (0x1920)
#define ID_IMC_AddMotionPointPtPack (0x1921)
#define ID_IMC_AddDoPointPtPack (0x1929)
#define ID_IMC_StartPtPack (0x1922)
#define ID_IMC_StopPtPack (0x1923)
#define ID_IMC_GetPtPackRestSpace (0x1924)
#define ID_IMC_GetPtPackStatus (0x1925)
#define ID_IMC_DeletePtPackSys (0x1927)
#define ID_IMC_ClrPtPackData (0x1928)
#define ID_IMC_SetPtPackIncMode (0x192a)
#define ID_IMC_GetPtPackIncMode (0x192b)
#define ID_IMC_EnablePtPackNoDataProtect (0x192c)
#define ID_IMC_DisablePtPackNoDataProtect (0x192d)
#define ID_IMC_GetPtPackNoDataProtectStatus (0x192e)
#define ID_IMC_ClrPtPackError (0x192f)
#define ID_IMC_GetPtPackError (0x1930)
#define ID_IMC_PtPackGetArrivalSts (0x1932)
/*==========================================================================*/
/*----8 事件管理接口 ---*/
/*==========================================================================*/
#define ID_IMC_SetEventIO (0x1600)
#define ID_IMC_GetEventIO (0x1601)
#define ID_IMC_EnableEventIO (0x1602)
#define ID_IMC_DisableEventIO (0x1603)
#define ID_IMC_SetEventDiMotion (0x1610)
#define ID_IMC_GetEventDiMotion (0x1611)
#define ID_IMC_EnableEventDiMotion (0x1612)
#define ID_IMC_DisableEventDiMotion (0x1613)
#define ID_IMC_GetEventDiMotionSts (0x1614)
#define ID_IMC_ClearEventDiMotionSts (0x1615)
#define ID_IMC_SetEventCompareOut (0x1620)
#define ID_IMC_GetEventCompareOut (0x1621)
#define ID_IMC_EnableEventCompareOut (0x1622)
#define ID_IMC_DisableEventCompareOut (0x1623)
#define ID_IMC_SetEventVirtualIOVal (0x1630)
#define ID_IMC_GetEventVirtualIOVal (0x1631)
#define ID_IMC_GetEventVirtualIOUseSts (0x1632)
#define EXE_SUCCESS (0x0000) // 指令成功
#define ERR_TRANSMIT (0x0001) // 指令传输错误
#define ERR_UNKNOWN (0x0002) // 不支持的指令
#define ERR_PARSE (0x0003) // 指令解析错误
#define ERR_BGVEL_OUTRANG (0x0010) // 起始速度设置超出范围
#define ERR_MAXVEL_OUTRANG (0x0011) // 最大速度设置超出范围
#define ERR_MAXACC_OUTRANG (0x0012) // 最大加速度设置超出范围
#define ERR_MAXDEC_OUTRANG (0x0013) // 最大减速度设置超出范围
#define ERR_MAXJERK_OUTRANG (0x0014) // 最大加加速度设置超出范围
#define ERR_STOPDEC_OUTRANG (0x0015) // 平滑停止速度设置超出范围
#define ERR_ESTOPDEC_OUTRANG (0x0016) // 急停速度设置超出范围
#define ERR_VEL_OUTRANG (0x0017) // 运行速度设置超出范围
#define ERR_ACC_OUTRANG (0x0018) // 运行加速度设置超出范围
#define ERR_DEC_OUTRANG (0x0019) // 运行减速度设置超出范围
#define ERR_RATIO_OUTRANG (0x001a) // 倍率设置超出范围
#define ERR_TGTPOS_OUTRANG (0x001b) // 目标位置设置超出范围
#define ERR_INDEX_OUTRANG (0x001c) // 索引号设置超出范围
#define ERR_DIMDL_NUM_OUTRANG (0x001d) // 设置ECAT的DI超出DI模块数量范围
#define ERR_DOMDL_NUM_OUTRANG (0x001e) // 设置ECAT的DO超出DO模块数量范围
#define ERR_AIMDL_NUM_OUTRANG (0x001f) // 设置ECAT的AI超出AI模块数量范围
#define ERR_AOMDL_NUM_OUTRANG (0x0020) // 设置ECAT的AO超出AO模块数量范围
#define ERR_NO_ECAT_DO (0x0021) // ECAT未配置DO模块
#define ERR_NO_ECAT_DI (0x0022) // ECAT未配置DI模块
#define ERR_NO_ECAT_AO (0x0023) // ECAT未配置AO模块
#define ERR_NO_ECAT_AI (0x0024) // ECAT未配置AI模块
#define ERR_NO_ECAT_ENC (0x0025) // ECAT未配置ENC模块
#define ERR_TYPE_PARA (0x0026) // 指令中类型参数错误
#define ERR_OUTCHN_PARA (0x0027) // 输出通道参数错误
#define ERR_ALRM_ENABLE (0x0028) // 报警使能参数非0或1
#define ERR_SOFTLMT_ENABLE (0x0029) // 软限位使能参数非0或1
#define ERR_HWLMT_ENABLE (0x002a) // 硬限位使能参数非0或1
#define ERR_ERRLMT_ENABLE (0x002b) // 跟随误差报警使能参数非0或1
#define ERR_COUNT_OUTRANG (0x002c) // 数量的参数超出规定范围
#define ERR_HOME_FLTTIME (0x002e) // HOME滤波参数错误
#define ERR_LIMIT_FLTTIME (0x002f) // LIMIT滤波参数错误
#define ERR_PROBE_FLTTIME (0x0030) // PROBE滤波参数错误
#define ERR_INVERSE_PARA (0x0031) // 取反参数非0或1
#define ERR_MODE_PARA (0x0032) // 指令中模式参数错误
#define ERR_LEVEL_PARA (0x0033) // 指令电平参数非0或1
#define ERR_SRC_PARA (0x0034) // 指令源参数错误,不在规定范围
#define ERR_TRIG_SNS (0x0035) // 触发电平参数非0或1
#define ERR_CYCTIME (0x0036) // 设置规划周期参数不在规定范围
#define ERR_FLAG_PARA (0x0037) // 标志参数设置非0或1
#define ERR_ONOFF_PARA (0x0038) // 开关参数设置非0或1
#define ERR_SV_ALARM (0x0039) // 伺服报警
#define ERR_SV_OFF (0x003a) // 掉使能报警
#define ERR_TERMINAL_NOLINK (0x003b) // 端子板通讯失败
#define ERR_AX_BUSY (0x003c) // 轴正处于规划中
#define ERR_ST_HOMING (0x003d) // 启动回零错误,该轴配置成了虚轴
#define ERR_SAMPLE_COUNT (0x003e) // 采样数据的个数不对
#define ERR_SAMPLE_BUSY (0x003f) // 采样正忙,不能配置参数
#define ERR_SAMPLE_DATATYPE (0x0040) // 采样数据的类型不存在
#define ERR_SAMPLE_INDEX (0x0041) // 采样数据的下标越界
#define ERR_SAMPLE_DRAW_DATA (0x0042) // 读取采样数据失败
#define ERR_HOMING_AX_TYPE (0x0043) // 回零的轴类型不对,非端子板轴
#define ERR_HOMING_MODE (0x0044) // 回零的模式不对,不在回零范围内
#define ERR_HOMING_POS_SRC (0x0045) // 端子板轴回零的位置来源参数设置不在范围内
#define ERR_HOMING_MAXTIME (0x0046) // 判断回零等待超时最短时间不能小于1s
#define ERR_HOMING_NO_READY (0x0047) // 回零参数未设置好错误
#define ERR_HANDWHEEL_BUSY (0x0048) // 手轮处于忙状态
#define ERR_HANDWHEEL_M_INDEX (0x0049) // 手轮主跟随编码器的序号不在范围内
#define ERR_NO_HANDWHEEL_MODE (0x004a) // 非手轮模式
#define ERR_HANDWHEEL_M_MOVE (0x004b) // 手轮主跟随编码器的在进入手轮前就在运动
#define ERR_COMP_DIMENS (0x004c) // 位置比较的维数错误
#define ERR_COMP_SRC_NO (0x004d) // 位置比较的位置源端口号超出范围
#define ERR_COMP_SRC_TYPE (0x004e) // 位置比较的源类型错误
#define ERR_COMP_PULSE_WIDTH (0x004f) // 位置比较的脉冲输出宽度
#define ERR_COMP_OUTVAL (0x0050) // 位置比较的立即输出值不在范围内
#define ERR_COMP_CTRLMODE (0x0051) // 位置比较输出的控制模式参数设置错误
#define ERR_COMP_INTERVAL (0x0052) // 位置等距比较输出的间距值小于1个pulse
#define ERR_COMP_REPEATTIME (0x0053) // 位置等距比较输出的次数小于1次
#define ERR_COMP_BUSY (0x0054) // 位置比较输出忙
#define ERR_ECAT_CAPT_DISEN (0x0055) // ECAT捕获未使能
#define ERR_PARA_LESS_ZERO (0x0056) // 参数设置小于0
#define ERR_PWM_DUTY_OUTRANG (0x0057) // PWM设置的占空比超限
#define ERR_PWM_FRQ_LESS_ZERO (0x0058) // PWM设置的频率小于0
#define ERR_PWM_NO_RIGHT_MODE (0x0059) // PWM模式错误
#define ERR_BACKLASH_CMPVAL (0x005a) // 反向间隙总补偿量设置小于0
#define ERR_BACKLASH_CMPVEL (0x005b) // 反向间隙补偿量速度小于0
#define ERR_BACKLASH_CMPDIR (0x005c) // 反向间隙补偿方向错误
#define ERR_AX_NO_BOND (0x005d) // 轴未绑定物理输出端
#define ERR_AX_BOND_SAME_CHN (0x005e) // 轴绑定了相同的一个物理轴
#define ERR_LOCAL_DI_FLTTIME (0x005f) // DI滤波参数错误
#define ERR_COUNT_IS_BONDED (0x0060) // 清除的内部计数通道被绑定轴上了
#define ERR_ENC_IS_BONDED (0x0061) // 清除的编码器计数通道被绑定轴上了
#define ERR_AX_IS_MASKED_TO_CRD (0x0062) // 轴已映射至插补坐标系
#define ERR_PRF_IN_WRONG_MODE (0x0063) // 在错误模式下执行
#define ERR_CRD_NOT_EXIST (0x0064) // 坐标系不存在
#define ERR_TOL_OUTRANG (0x0065) // 坐标系精度参数设置错误
#define ERR_CRD_COPLAN_PARA (0x0066) // 坐标系异面过渡参数设置错误
#define ERR_CRD_TURN_PARA (0x0067) // 坐标系拐弯系数设置错误
#define ERR_CRD_TRANSMODE_PARA (0x0068) // 坐标系过渡模式设置错误
#define ERR_CRD_NODATA_PROTECT_PARA (0x0069) // 坐标系数据断流保护参数错误
#define ERR_CRD_ARC_ACC_PARA (0x006a) // 坐标系圆弧变加速参数设置错误
#define ERR_CRD_TRAJ_TYPE_PARA (0x006b) // 坐标系速度规划类型参数设置错误
#define ERR_CRD_FATAL_DATA_ERR (0x006c) // 坐标系压入数据致命错误
#define ERR_CRD_DO_TYPE (0x006d) // 坐标系压入的DO类型错误
#define ERR_CRD_LOOKAHEAD_LEN (0x006f) // 坐标系前瞻长度设置错误
#define ERR_CRD_SGL_FLT_DEPTH (0x0070) // 坐标系单轴滤波参数错误
#define ERR_CRD_SGL_CTRL_TOL (0x0071) // 坐标系单轴控制精度参数错误
#define ERR_CRD_MASK_SAME_AXNO (0x0073) // 坐标系输出轴映射到相同端口错误
#define ERR_CRD_MASK_AXNO_OUTRANG (0x0074) // 坐标系输出轴映射号超出范围
#define ERR_CRD_REPEATED_CREATED (0x0075) // 坐标系重复创建
#define ERR_CRD_CREATE_FAILED (0x0076) // 坐标系创建失败
#define ERR_CRD_BUSY (0x0077) // 坐标系正处于规划中
#define ERR_CRD_SMOOTH_COEF (0x0078) // 坐标系平滑系数设置错误
#define ERR_CRD_BUF_FULL (0x0079) // 坐标系数据缓冲区满
#define ERR_CRD_BUF_DATA_PARA (0x007a) // 坐标系缓冲区指令参数错误
#define ERR_CRD_BUF_DATA_GEOM (0x007b) // 坐标系缓冲区指令几何构造错误
#define ERR_CRD_DOWNLOAD_DATA (0x007c) // 坐标系缓冲区指令下发底层失败
#define ERR_CRD_PAUSE_POS_CHANGE (0x007d) // 坐标系暂停后,位置被改变
#define ERR_FORBID_SVON (0x007e) // 禁止使能报警
#define ERR_AX_CRD_CONFLICT (0x007f) // 单轴和插补运动冲突报警
#define ERR_DIS_ERR (0x0080) // 坐标系输入线段弧长过短
#define ERR_CRD_EXT_AX_CONFLICT (0x0081) // 缓存同步事件设置轴号运动冲突
#define ERR_CRD_RUN_ERR (0x0082) // 坐标系运行报警错误,需要清除才能再次启动或者压入数据
#define ERR_CRD_ARC_DIR_PARA (0x0083) // 坐标系中圆弧运动的方向参数错误
#define ERR_CRD_SYNC_ERROR (0x0084) // 坐标系中同步运动无法完成
#define ERR_CRD_BUF_NOT_EPMTY (0x0085) // 坐标系参数设置未满足缓冲区数据为空要求
#define ERR_CRD_MODE_UNMACHED (0x0086) // 坐标系不匹配的插补模式,如:非用户规划模式
#define ERR_CRD_ALL_BUSY (0x0087) // 坐标系所有均繁忙
#define ERR_AX_NOT_EXIST (0x0088) // 单轴未参与任何一个插补坐标系
#define ERR_CRDIN_GEOM_ERR (0x0089) // 立即插补几何错误
#define ERR_CRD_INLINE (0x008a) // 圆弧三点共线
#define ERR_CRD_NORMAL_TOO_SHORT (0x008b) // 圆弧输入的法向量太短
#define ERR_CRD_RADIUS_TOO_SHORT (0x008c) // 圆弧输入的半径太短
#define ERR_CRD_NORMAL_ANGLE (0x008d) // 圆弧输入的法向量角度错误
#define ERR_CRD_RADIUS_ERR (0x008e) // 特指圆弧半径输入模式下,半径小于首点到末点长度的一半
#define ERR_LENGTH_OUTRANG (0x0090) // 设置的长度单位不在范围
#define ERR_SOFTLMT_POS_LESS_NEG (0x0091) // 软正限位设置比软负限位小错误
#define ERR_SAMPLE_INTERVAL (0x0092) // 数据采样配置间隔参数错误
#define ERR_SAMPLE_TRIG_TYPE (0x0093) // 数据采样配置触发采样类型参数错误
#define ERR_SAMPLE_DELAY_PARA (0x0094) // 数据采样配置启动延时参数错误
#define ERR_SAMPLE_DI_NO (0x0095) // 数据采样配置DI触发端口错误
#define ERR_SAMPLE_DI_LEVEL (0x0096) // 数据采样配置DI触发电平错误
#define ERR_RESET_IS_PERMIT (0x0097) // 系统复位条件不足,检查是否还在使能
#define ERR_GANTRY_IS_USING (0x0098) // 龙门正在使用中
#define ERR_GANTRY_AXNO_CONFLICT (0x009f) // 配置龙门的轴号各组有冲突
#define ERR_GANTRY_ERRORLMT_LESS_ZERO (0x0099) // 龙门主从轴误差极限值小于0
#define ERR_GANTRY_ERROR_OUT_LIMIT (0x009a) // 龙门主从轴误差大于设定极限
#define ERR_GANTRY_SLAVE_FORBID_PRF (0x009b) // 龙门从轴禁止规划
#define ERR_GANTRY_AX_EQU_DIFF (0x009c) // 龙门主从轴的当量不一致
#define ERR_GANTRY_AX_SV_STS_DIFF (0x009d) // 龙门主从轴的伺服状态不一致
#define ERR_ECAT_DA_VAL (0x009e) // ECAT总线的DA值设置范围超限
#define ERR_SYNCMOVE_NOT_EXIST (0x00a0) // 多轴系统未建立
#define ERR_SYNCMOVE_HAVE_EXISTED (0x00a1) // 多轴系统重复创建
#define ERR_SYNCMOVE_COUNT (0x00a2) // 多轴系统轴映射总数量不在范围内
#define ERR_SYNCMOVE_MAP (0x00a3) // 多轴系统轴映射错误
#define ERR_SYNCMOVE_RATIO (0x00a4) // 多轴系统比率设定范围错误
#define ERR_SYNCMOVE_AXNO_REPEATED (0x00a5) // 多轴系统的映射轴有重复
#define ERR_SYNCMOVE_AXNO_OUTRANG (0x00a6) // 多轴系统的映射轴不在系统范围
#define ERR_AX_MULTI_SYNC_CONFLICT (0x00a7) // 多轴系统中的轴与单轴运动冲突
#define ERR_AX_IS_SET_MULTI_PRF (0x00a8) // 当前轴已设置为多轴或插补规划模式,不能再次设置
#define ERR_SYNCMOVE_PAUSE_POS_CHANGE (0x00a9) // 多轴系统暂停后,位置被改变
#define ERR_SYNCMOVE_ALARM (0x00aa) // 多轴系统有报警,不允许启动
#define ERR_HOMING_METHOD (0x00b0) // 回零方式错误
#define ERR_NO_ECAT_SV (0x00b1) // 非ECAT伺服轴
#define ERR_CST_GANTRY_FORBID (0x00b2) // 龙门控制,不允许伺服为转矩模式
#define ERR_CTRL_MODE (0x00b3) // 错误控制模式
#define ERR_TGTTRQ_OUTRANG (0x00b4) // 目标转矩设置超出范围
#define ERR_TRQ_CHANGE_TIME_LESS_ZERO (0x00b5) // 目标转矩的改变时间参数小于0
#define ERR_FORBID_POS_PRF_IN_CST (0x00b6) // 禁止在CST模式下进行位置规划
#define ERR_SV_MODE_PDO_NO_CFG (0x00b7) // ECAT伺服的模式PDO对象未配置
#define ERR_AX_IS_IN_HOMING (0x00b8) // 轴正处于回零状态
#define ERR_HW_ESTP_IS_TRIG (0x00b9) // 硬件急停信号触发
#define ERR_ACT_TORQ_PDO_NO_CFG (0x00ba) // ECAT伺服的实际转矩PDO对象未配置
#define ERR_TOUCH_PROBE_PDO_NO_CFG (0x00bb) // ECAT伺服的探针捕获相关PDO对象未配置
#define ERR_AX_MV_DIR_LIMT_TRIG (0x00bc) // 轴运动方向的限位触发
#define ERR_AX_FOLLOW_ERROR (0x00bd) // 轴跟随误差报警
#define ERR_AX_STATUS_ERROR (0x00be) // 轴状态错误,调用查询轴状态指令获取具体信息
#define ERR_SET_TIME (0x00c0) // 时间类参数设置错误
#define ERR_PVT_LIST (0x00c1) // PVT表参数设置错误
#define ERR_PVT_LOOP (0x00c2) // PVT循环次数参数设置错误
#define ERR_PVT_PARAM (0x00c3) // PVT数据参数输入错误
#define ERR_PVT_TABLE_BUSY (0x00c4) // PVT当前表被占用
#define ERR_PVT_TABLE_INVALID (0x00c5) // PVT当前表类型不匹配
#define ERR_PVT_TABLE_FULL (0x00c6) // PVT表FIFO数据满
#define ERR_PVT_TABLE_NULL (0x00c7) // PVT表数据为NULL
#define ERR_NOT_PVT_MODE (0x00c8) // 非PVT模式下,不能访问
#define ERR_FOL_SCALE (0x00d1) // FOL齿数输入有误
#define ERR_FOL_MASTER_NO (0x00d2) // FOL主轴轴号输入有误
#define ERR_FOL_LMT_POS (0x00d3) // FOL从轴跟随位置有误
#define ERR_PTPC_MOVE_PARAM (0x00d4) // PTP缓存模式运动参数有误
#define ERR_EDVEL_OUTRANG (0x00d5) // 结束速度有问题
#define ERR_FIFO_FULL (0x00d6) // 队列数据满
#define ERR_FIFO_EMPTY (0x00d7) // 队列数据空
#define ERR_FIFO_STPOS_DIFF_CURPOS (0x00d8) // 队列起始位置与当前位置不一致
#define ERR_NOT_HOMING_MODE (0x00d9) // 非回零规划模式
#define ERR_GEAR_UPDATE_SCALE (0x00da) // 电子齿轮更新比例失败
#define ERR_FOL_SLOPE_LEES_ZERO (0x00db) // FOL的主轴离合区值小于0
#define ERR_PROBE_BIT_OUTRANGE (0x00dc) // 设置轴ECAT探针对应bit不在0~31中
#define ERR_ENC_FILTER_DEPTH (0x00e0) // 编码器滤波深度参数错误
#define ERR_ENC_FILTER_COEF (0x00e1) // 编码器滤波系数参数错误
#define ERR_COMPARE_BUF_EMPTY (0x00e2) // 位置比较缓冲区数据为空
#define ERR_COMPARE_DATA_INVERSE (0x00e3) // 位置比较设置的比较数据出现反向
#define ERR_COMPARE_POS_TYPE (0x00e4) // 等距比较数据不允许在绝对位置比较类型下压入
#define ERR_COMPARE_DATA_TYPE (0x00e5) // 等距比较数据不允许在动态数据类型下压入
#define ERR_AX_HW_NOT_EXIST (0x00e6) // 设置的物理轴不存在
#define ERR_TGTPOS_OVER_SOFTLMT (0x00e7) // 目标位置超出了软限位范围
#define ERR_BACKLASH_VAL_NOT_ZERO (0x00e8) // 当前反向间隙补偿的值不为0,不能再次修改设置反向间隙值
#define ERR_WRONG_HOMING_MODE (0x00e9) // 调用错误回零完成指令
#define ERR_AX_COMPEN_BUSY (0x00ea) // 轴补偿进行中
#define ERR_MULTI_COMPARE_UNSUPPORTED (0x00eb) // 多维位置比较不支持错误
#define ERR_WAIT_TIME_PARA (0x00f2) // 等待事件类型参数错误
#define ERR_CYCMV_PARA_NOT_SET (0x00f3) // 周期运动的参数未设置,不能启动
#define ERR_NOT_CYCMV_MODE (0x00f4) // 非周期模式下操作
#define ERR_HOMING_DIR_PARA (0x00f5) // 回零方向参数错误
#define ERR_HOMING_LEVEL_PARA (0x00f6) // 回零触发沿参数错误
#define ERR_CSV_PRF_NOT_START (0x00f7) // CSV规划没有启动
#define ERR_CSV_IN_PRFING (0x00f8) // CSV在规划中,不允许切换到CSP下
#define ERR_NO_TERMINAL_CFG (0x00f9) // 端子板没有配置,不允许访问
#define ERR_OFFSET_PARA (0x00fa) // 偏置参数不在范围
#define ERR_PTP_NOT_PAUSE (0x00fb) // PTP无暂停动作
#define ERR_PTP_STOPPED (0x00fc) // PTP运动已停止,不能调用Pause指令
#define ERR_VERSION_TOO_LOW (0x0100) // dll库版本比控制器版本低
#define ERR_CST_HANDWHEEL_FORBID (0x0101) // 手轮控制,不允许伺服为转矩模式
#define ERR_GANTRY_NOT_SETUP (0x0102) // 龙门关系尚未建立
#define ERR_WATCHDOG_TIME_LESS_ZERO (0x0103) // 看门狗设置时间小于0
#define ERR_MULTI_PTP_AXNUM (0x0104) // 多轴同时启动PTP的个数小于1
#define ERR_MULTI_JOG_AXNUM (0x0105) // 多轴同时启动JOG的个数小于1
#define ERR_WATCHDOG_NOT_OPENED (0x0106) // 看门狗未开启
#define ERR_WRONG_MODE_OPERATIONG (0x0107) // 错误模式下操作
#define ERR_NO_SYS_INT_SIGNAL (0x0108) // 系统中断没有起来,请检查总线是否处于OP状态
#define ERR_GET_SYS_HW_RES (0x0109) // 获取系统硬件资源失败:如端子板资源或ECAT资源
#define ERR_TORQ_SLP_PDO_NO_CFG (0x0110) // ECAT伺服的转矩斜坡PDO对象未配置
#define ERR_TGT_TORQ_PDO_NO_CFG (0x0111) // ECAT伺服的目标转矩PDO对象未配置
#define ERR_PRESS_CTRL_PDO_NO_CFG (0x0112) // ECAT伺服中的压合控制对象未配置(SV510)
#define ERR_PRESS_STS_PDO_NO_CFG (0x0113) // ECAT伺服中的压合状态对象未配置(SV510)
#define ERR_PRESS_VAL_PDO_NO_CFG (0x0114) // ECAT伺服中的压力反馈对象未配置(SV510)
#define ERR_AI1_VOLT_PDO_NO_CFG (0x0115) // ECAT伺服中的电压1输入对象未配置(SV510)
#define ERR_AI2_VOLT_PDO_NO_CFG (0x0116) // ECAT伺服中的电压2输入对象未配置(SV510)
#define ERR_NO_ECAT_PT (0x0117) // ECAT未配置PT模块
#define ERR_PRESS_SETVAL_PDO_NO_CFG (0x0118) // ECAT伺服中的目标压合力设置对象未配置(SV510)
#define ERR_MAXVEL_PDO_NO_CFG (0x0119) // ECAT伺服中的最大速度限制设置对象未配置
#define ERR_POS_TORQ_LMT_PDO_NO_CFG (0x011a) // ECAT伺服中的正向转矩限制设置对象未配置
#define ERR_NEG_TORQ_LMT_PDO_NO_CFG (0x011b) // ECAT伺服中的负向转矩限制设置对象未配置
#define ERR_MAX_TORQ_LMT_PDO_NO_CFG (0x011c) // ECAT伺服中的最大转矩限制设置对象未配置
#define ERR_MPG_NOT_CFG (0x011d) // ECAT的手轮模块没有配置对象
#define ERR_MPG_NOT_ENABLE (0x011e) // ECAT的手轮模块没有使能
#define ERR_EVENT_IO_INTYPE (0x0120) // IO事件的输入类型错误
#define ERR_EVENT_IO_INPORT (0x0121) // IO事件的输入端口错误
#define ERR_EVENT_IO_IN_INVERT (0x0122) // IO事件的输入取反值错误
#define ERR_EVENT_IO_OPERTOR (0x0123) // IO事件的输入操作符错误
#define ERR_EVENT_IO_OUTTYPE (0x0124) // IO事件的输出类型错误
#define ERR_EVENT_IO_OUT_INVERT (0x0125) // IO事件的输出取反值错误
#define ERR_EVENT_IO_OUTPORT (0x0126) // IO事件的输出端口号错误
#define ERR_EVENT_IO_TRIG_TYPE (0x0127) // IO事件的触发类型错误
#define ERR_EVENT_IO_DELAY (0x0128) // IO事件的延时值小于0
#define ERR_EVENT_IO_ACTIVE_TYPE (0x0129) // IO事件的激活类型错误
#define ERR_EVENT_IO_PARA_NO_SET (0x012a) // IO事件的参数没有设置,不能使能
#define ERR_EVENT_DIMT_INTYPE (0x0130) // DI触发运动事件的输入类型错误
#define ERR_EVENT_DIMT_INPORT (0x0131) // DI触发运动事件的输入端口错误
#define ERR_EVENT_DIMT_AXNO (0x0132) // DI触发运动事件的触发轴号超出范围
#define ERR_EVENT_DIMT_DELAY (0x0133) // DI触发运动事件的延时值小于0
#define ERR_EVENT_DIMT_TGTVEL (0x0134) // DI触发运动事件设置的目标速度小于0
#define ERR_EVENT_DIMT_ACC (0x0135) // DI触发运动事件设置的加速度小于0
#define ERR_EVENT_DIMT_DEC (0x0136) // DI触发运动事件设置的减速度小于0
#define ERR_EVENT_DIMT_TGTPOS (0x0137) // DI触发运动事件设置的目标位置超限
#define ERR_EVENT_DIMT_INVERTBIT (0x0138) // DI触发运动事件设置的取反标志非0和1
#define ERR_EVENT_DIMT_MOTION_TYPE (0x0139) // DI触发运动事件设置的运动类型错误
#define ERR_EVENT_DIMT_TRIGGER_TYPE (0x013a) // DI触发运动事件设置的触发类型错误
#define ERR_EVENT_DIMT_PARA_NO_SET (0x013b) // DI触发运动事件的参数没有设置,不能使能
#define ERR_EVENT_CMPOUT_INTYPE (0x0140) // 比较位置输出事件的输入类型错误
#define ERR_EVENT_CMPOUT_PORT (0x0141) // 比较位置输出事件的输出源端口号超出范围
#define ERR_EVENT_CMPOUT_OUTPORT (0x0142) // 比较位置输出事件的输出DO端口超出范围
#define ERR_EVENT_CMPOUT_OUTTYPE (0x0143) // 比较位置输出事件的输出类型错误
#define ERR_EVENT_CMPOUT_OUTVAL (0x0144) // 比较位置输出事件的输出值错误
#define ERR_EVENT_CMPOUT_CMPTYPE (0x0145) // 比较位置输出事件的比较类型参数错误
#define ERR_EVENT_CMPOUT_PLSWIDTH (0x0146) // 比较位置输出事件的脉冲输出脉宽小于0
#define ERR_EVENT_CMPOUT_CMPPOS (0x0147) // 比较位置输出事件的比较位置超出范围
#define ERR_EVENT_VIRTUAL_IO_VAL (0x0148) // 事件虚拟IO的值设置错误
#define ERR_EVENT_VIRTUAL_IO_DISABLE (0x0149) // 事件虚拟被禁用,不能作为输出使用
#define ERR_EVENT_CMPOUT_PARA_NO_SET (0x014a) // 比较位置输出事件的参数没有设置,不能使能
#define ERR_PSO_DIMENS (0x0150) // PSO的维数参数错误
#define ERR_PSO_PULSE_WIDTH (0x0151) // PSO的脉冲输出宽度错误
#define ERR_PSO_SRC_NO (0x0152) // PSO的位置源序号错误
#define ERR_PSO_SRC_TYPE (0x0153) // PSO的位置源类型错误
#define ERR_PSO_SYN_POS (0x0154) // PSO的同步比较输出间距错误
#define ERR_SCREWCMP_DIR (0x0200) // 螺距补偿方向设置错误
#define ERR_SCREWCMP_INTERVAL (0x0201) // 螺距补偿间隔为负
#define ERR_SCREWCMP_TABLE_NUM (0x0202) // 螺距补偿的数据表数量超限
#define ERR_SCREWCMP_ST_BIGGER_END (0x0203) // 螺距补偿的正向补偿起始位置大于终止位置
#define ERR_SCREWCMP_CALC_INTERVAL (0x0204) // 螺距补偿设置的起始和终止位置以及点数计算的间隔距离非整数
#define ERR_BANDPT_COUNT (0x0210) // 绑定PT轴映射总数量不在范围内
#define ERR_BANDPT_AXNO_OUTRANG (0x0211) // 绑定PT轴超过范围
#define ERR_BANDPT_AXNO_REPEATED (0x0212) // 绑定PT轴重复
#define ERR_AX_IS_SET_BANDPT_PRF (0x0213) // 轴已经设成绑定PT模式
#define ERR_BANDPT_NOT_EXIST (0x0214) // 绑定PT系统轴没有建立
#define ERR_BANDPT_BEYOND_MAXCNT (0x0215) // 绑定PT输入数据量超过最大限制
#define ERR_BANDPT_ERR (0x0216) // 绑定PT处于错误状态
//电子凸轮错误
#define ERR_ECAM_TABLE_FULL (0x0250) // 电子凸轮数据表满
#define ERR_ECAM_POS (0x0251) // 凸轮位置错误
#define ERR_ECAM_TABLE_BUSY (0x0252) // 凸轮表被占用
#define ERR_ECAM_TABLE_NULL (0x0253) // 凸轮表无数据
#define ERR_ECAM_EVENT_MASTER_POS (0x0254) // 凸轮表事件输入主轴位置错误
#define ERR_ECAM_LIST_TABLE (0x0255) // 凸轮表list中的表号有误
#define ERR_ECAM_LIST_FULL (0x0256) // 凸轮表list表号已放满
#define ERR_ECAM_MASTER_SLAVE_PARAM (0x0257) // 凸轮表设置参数主从属性参数设置错误
#define ERR_ECAM_TABLE_PARAM (0x0258) // 凸轮表设置参数错误
#define ERR_ECAM_START_CONDITION (0x0259) // 凸轮启动条件参数设置错误
#define ERR_ECAM_NOT_START (0x025a) // 凸轮还未启动
#define ERR_ECAM_ALARM (0x025b) // 凸轮报警
#define ERR_ECAM_LIST_TABLE_NULL (0x025c) // 凸轮list无表
#define ERR_ECAM_LIST_BUSY (0x025d) // 凸轮list被占用
#define ERR_ECAM_LIST_TABLE_DATA_FORMAT (0x025e) // 凸轮list模式中表格式错误
//非标错误
#define ERR_READGCODE_DU (0x7000) // 重复检测
#define ERR_READGCODE_REACH_MAXLINE (0x7001) // 文件行数过多
#define ERR_READGCODE_NO_FILE (0x7002) // 文件不存在
#define ERR_ESTIMATE_INACTIVE (0x7003) // 时间估算未激活
#define ERR_DEVICE (0x8000) // 错误参数输入
#define ERR_INPUT (0x8001) // 错误指针参数输入
#define ERR_CARDNO (0x8002) // 错误卡号
#define ERR_MEM1ALLOC (0x8003) // 分配全局内存1错误
#define ERR_MEM2ALLOC (0x8004) // 分配全局内存2错误
#define ERR_MEM3ALLOC (0x8005) // 分配全局内存3错误
#define ERR_OPENDEV (0x8006) // 打开PCI设备错误
#define ERR_GETDEVATTR (0x8007) // 获取PCI设备属性错误
#define ERR_READ_LEN (0x8008) // 读取数据长度错误
#define ERR_READ_CHECKSUM (0x8009) // 读取校验和错误
#define ERR_WRITE_BLOCK (0x800A) // 写块数据失败
#define ERR_READ_BLOCK (0x800B) // 读块数据失败
#define ERR_BLOCK_FIFO_FULL (0x800C) // 块数据FIFO已经满
#define ERR_OPEN_CHANNEL (0x800D) // 打开数据通道失败
#define ERR_CLOSE_CHANNEL (0x800E) // 关闭数据通道错误
#define ERR_DSP_BUSY (0x800F) // DSP一直处于忙状态
#define ERR_LOCK_ERROR (0x8010) // 获取锁资源失败
#define ERR_WAIT_TIMEOUT (0x8011) // 等待数据超时
#define ERR_EXECUTE (0x8012) // 执行命令错误
#define ERR_PARAMETER (0x8013) // 传入参数错误
#define ERR_OPEN_XML (0x8014) // 打开XML文件失败
#define ERR_CREATE_XML (0x8015) // 创建XML文件失败
#define ERR_MALLOC_MEM (0x8016) // 分配文件内存失败
#define ERR_UNKOWN_AXTYPE (0x8017) // 不能识别的轴类型
#define ERR_CARD_HANDLE (0x8018) // card handle 错误
#define ERR_PARSER_XML (0x8019) // 解析系统参数配置错误
#define ERR_CHECK_USER_CODE (0x801A) // 用户密码校验错误
#define ERR_NOT_ECAT_AX (0x801B) // 非ECAT轴
#define ERR_CARD_NUM_OUTRANG (0x801C) // 扫描板卡数量超限
#define ERR_PCI2ARMWRDATA (0x801D) // PCI向ARM侧写数据异常
#define ERR_PCI2ARMRDDATA (0x801E) // PCI向ARM侧读数据异常
#define ERR_CARD_BUSY (0x801F) // 板卡正上次初始化尚未结束,请稍等
#define ERR_OPEN_CARD_ERR (0x8020) // 开卡创建线程错误
#define ERR_ARM_ECAT_SHM (0x9000) // 共享内存错误
#define ERR_ARM_ECAT_LINK (0x9001) // EtherCat连接错误
#define ERR_ARM_ECAT_INIT_STEP0 (0x9002) // EtherCat初始化阶段STEP0错误
#define ERR_ARM_SCAN_MODULE (0x9003) // EtherCat初始化阶段扫描MODULE错误
#define ERR_ARM_ECAT_INIT_STEP2 (0x9004) // EtherCat初始化阶段STEP2错误
#define ERR_ARM_ECAT_INIT_STEP3 (0x9005) // EtherCat初始化阶段STEP3错误
#define ERR_ARM_INIT_SYNC_DSP (0x9006) // EtherCat配置信息同步到DSP错误
#define ERR_ARM_DEL_MASTER (0x9007) // 删除EtherCat主站状态机错误
#define ERR_ARM_SCAN_SLAVES (0x9008) // 扫描从站设备状态发生错误
#define ERR_ARM_ECAT_SHM_ADDR (0x9009) // 共享内存地址非法
#define ERR_ARM_INUPUT_PARA (0x900A) // 输入参数错误
#define ERR_ARM_ECAT_ENTER_HOME_MODE (0x900B) // EtherCat轴进入回零模式错误
#define ERR_ARM_ECAT_SET_HOME_PAR (0x900C) // 设置EtherCat轴回零参数错误
#define ERR_ARM_ECAT_START_HOME (0x900D) // 设置EtherCat轴开始回零错误
#define ERR_ARM_ECAT_STOP_HOME (0x900E) // 停止EtherCat轴回零错误
#define ERR_ARM_ECAT_GET_HOME_STATUS (0x900F) // 获取EtherCat轴回零状态错误
#define ERR_ARM_ECAT_SET_HOME_FINISH (0x9010) // 设置完成EtherCat轴回零错误
#define ERR_ARM_ECAT_EXIT_HOME_MODE (0x9011) // 退出EtherCat轴回零模式错误
#define ERR_ARM_FILE_BEYOND_MAX (0x9012) // 文件太大,超出buffer长度
#define ERR_ARM_FILE_OPEN (0x9013) // 打开文件失败
#define ERR_ARM_FILE_MMAP (0x9014) // 文件映射失败
#define ERR_ARM_FILE_MUNMMAP (0x9015) // 文件反映射失败
#define ERR_ARM_GET_ECAT_RESOUCE (0x9016) // 获取EtherCat资源失败
#define ERR_ARM_SDO_UPLOAD (0x9017) // 上传EtherCat SDO失败
#define ERR_ARM_SDO_DOWNLOAD (0x9018) // 下载EtherCat SDO失败
#define ERR_ARM_SEND_MSG (0x9019) // 发送消息失败
#define ERR_ARM_EXE_FUN (0x901a) // 执行调用函数异常
#define ERR_ARM_CK_DEV_XML (0x901b) //校验设备配置XML异常
#define ERR_ARM_NOT_EXIST_STATION (0x901c) // 不存在该站点
#define ERR_ARM_SUBBOARD_LINK (0x901d) // 端子板连接错误
#define ERR_ARM_CMP_ENCRY_CHIP (0x901e) // 板卡权限验证不通过
#define NO_ENCRY_CHIP (0x901f) // 板卡没有加密芯片
#define ERR_EEPROM_INFO (0x9020) // 板卡上板载信息有误
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!