HwinRobot执行Pick Place指令之前,直接读取控制器错误。

This commit is contained in:
DESKTOP-GPE37UV\THINKAPD 2023-01-29 14:59:12 +08:00
parent 2b8d78f301
commit e90fce5334
2 changed files with 21 additions and 22 deletions

View File

@ -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;

View File

@ -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
{