private string ReadError() { CAN_ERR_INFO errInfo = new CAN_ERR_INFO(); if (ECANDLL.ReadErrInfo(Setting.DeviceType, Setting.DeviceID, Setting.Channel, out errInfo) == ECANStatus.STATUS_OK) { string strErrMessage = string.Empty; strErrMessage = string.Format("Error Code[0x{0:X4}]. Error Text: {0:X4} and {0:X4}", errInfo.ErrCode, errInfo.Passive_ErrData[0], errInfo.Passive_ErrData[1]); return(strErrMessage); } else { throw new Exception("Failed at get error message? Is can device connected?"); } }
public static extern ECANStatus ReadErrInfo( UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd, out CAN_ERR_INFO ReadErrInfo);