HwinRobot执行Pick Place指令之前,直接读取控制器错误。
This commit is contained in:
parent
2b8d78f301
commit
e90fce5334
|
@ -223,21 +223,31 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.HwinRobot
|
|||
private void CheckStateThenDo(Action onCheckSucceed, Action onCheckFailed = null)
|
||||
{
|
||||
// 检查Robot状态
|
||||
_lstHandler.AddLast(new HwinRobotSTATHandler(this, onHandlerEndTask: () =>
|
||||
_lstHandler.AddLast(new HwinRobotERRHandler(this, onHandlerEndTask: () =>
|
||||
{
|
||||
if (Status.IsServoOff)
|
||||
if (Errors.AggregateErrorMessages != null && Errors.AggregateErrorMessages.Count > 0)
|
||||
{
|
||||
EV.PostAlarmLog(Module, "Servo Off");
|
||||
onCheckFailed?.Invoke();
|
||||
}
|
||||
else if (Status.IsMotorError || Status.IsControllerError)
|
||||
{
|
||||
// 读取错误信息,并PostAlarm
|
||||
_lstHandler.AddLast(new HwinRobotERRHandler(this, onHandlerEndTask:onCheckFailed));
|
||||
try
|
||||
{
|
||||
onCheckFailed?.Invoke();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
EV.PostWarningLog(Module, "onCheckFailed action error");
|
||||
LOG.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onCheckSucceed?.Invoke();
|
||||
try
|
||||
{
|
||||
onCheckSucceed?.Invoke();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
EV.PostWarningLog(Module, "onCheckSucceed action error");
|
||||
LOG.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -414,7 +424,6 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.HwinRobot
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
Errors = null;
|
||||
Errors = new HiwinRobotAggregatedErrors(response);
|
||||
if (Errors.AggregateErrorMessages.Count > 0)
|
||||
|
@ -424,10 +433,6 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.HwinRobot
|
|||
EV.PostAlarmLog(Module, errMsg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EV.PostAlarmLog(Module, "Unknown Error");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
using Aitex.Sorter.Common;
|
||||
using MECF.Framework.Common.CommonData;
|
||||
using MECF.Framework.Common.CommonData;
|
||||
using MECF.Framework.Common.Communications;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Aitex.Core.RT.Event;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.HwinRobort.Errors;
|
||||
|
||||
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.HwinRobot
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue