Commit 18314631 LN

未抓起料盘问题优化

1 个父辈 a8659099
......@@ -607,22 +607,32 @@ namespace OnlineStore.DeviceLibrary
}
else if (span.TotalSeconds > moveInfo.TimeOutSeconds)
{
string msg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + FormUtil.GetSpanStr(span)+"]";
int second = 10;
if (IsLowAlarm(moveInfo))
{
second = 30;
}
second = (int)( span.TotalSeconds / moveInfo.TimeOutSeconds) *10;
second = (int)(span.TotalSeconds / moveInfo.TimeOutSeconds) * 10;
if (second > 120)
{
second = 120;
}else if (second < 10)
}
else if (second < 10)
{
second = 10;
}
string msg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + FormUtil.GetSpanStr(span) + "]";
string type = moveInfo.GetStepDes() + "_" + "超时报警";
//判断是等待抓料直接返回
List<WaitResultInfo> noTrayAlarm = (from m in list where m.WaitType.Equals(WaitEnum.W1000_NoTrayAlarm) select m).ToList();
if (noTrayAlarm.Count > 0)
{
msg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]未抓起料盘,请取走料盘后复位[" + FormUtil.GetSpanStr(span) + "]";
type = MoveInfo.GetStepDes() + "_" + "未抓起料";
}
//LogUtil.error(WarnMsg, DeviceID * 1000 + 15, second);
SetWarnMsg(msg, type, moveInfo, second);
Alarm(LineAlarmType.IoSingleTimeOut);
......
......@@ -45,6 +45,13 @@ namespace OnlineStore.DeviceLibrary
{
return true;
}
}else if (wait.WaitType.Equals(WaitEnum.W103_GetShelfTray))
{
//入料机构拿走料串上的料,需要同时 SL_ClampCylinder_Check=HIGH,SL_AxisLocationCheck=LOW
if (IOValue(IO_Type.SL_ClampCylinder_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW))
{
return true;
}
}
return false;
}
......@@ -391,9 +398,13 @@ namespace OnlineStore.DeviceLibrary
if (UpdownIsInP1())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CheckTray);
InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_ClampCylinder_Check=HIGH,SL_AxisLocationCheck=LOW");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_ClampCylinder_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW));
InLog("料盘移栽" + MoveInfo.SLog + ":等待 拿走料串上的料, SL_ClampCylinder_Check=HIGH,SL_AxisLocationCheck=LOW,最多等待10秒");
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_ClampCylinder_Check, IO_VALUE.HIGH));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW));
MoveInfo.TimeOutSeconds = 15;
MoveInfo.WaitList.Add(WaitResultInfo.WaitGetShelfTray());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
MoveInfo.OneWaitCanEndStep = true;
}
else
{
......@@ -404,13 +415,28 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(LineMoveStep.FI_25_CheckTray))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_26_BatchAxisToP3);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//LastWidth = GetWidth();
//MoveInfo.MoveParam.PlateW = LastWidth;
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,横移气缸上升 ");
CylinderMove(null, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
BatchAxisToP3(false);
//判断是否拿起来料
if (IOValue(IO_Type.SL_ClampCylinder_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW))
{
InLog("料盘移栽" + MoveInfo.SLog + ":料盘已被拿走");
MoveInfo.NextMoveStep(LineMoveStep.FI_26_BatchAxisToP3);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//LastWidth = GetWidth();
//MoveInfo.MoveParam.PlateW = LastWidth;
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,横移气缸上升 ");
CylinderMove(null, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
BatchAxisToP3(false);
}
else
{
InLog("料盘移栽" + MoveInfo.SLog + ":料盘还未被拿走,直接报警:未抓起料盘,请取走料盘后复位");
//未抓起料盘,直接报警
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CheckTray);
MoveInfo.WaitList.Add(WaitResultInfo.WaitNoTrayAlarm());
SetWarnMsg("未抓起料盘,请取走料盘后复位", MoveInfo.GetStepDes() + "_" + "未抓起料", MoveInfo);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.IsStep(LineMoveStep.FI_26_BatchAxisToP3))
{
......
......@@ -357,22 +357,46 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.MI_06_CylinderUp))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_07_ClampCheck);
InLog("入库 " + MoveInfo.SLog + ": 等待夹爪料盘检测信号=HIGH");
InLog("入库 " + MoveInfo.SLog + ": 等待抓到料盘:夹爪料盘检测信号=HIGH,最多等待10秒");
MoveInfo.TimeOutSeconds = 15;
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampCylinder_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
MoveInfo.OneWaitCanEndStep = true;
}
else if (MoveInfo.IsStep(LineMoveStep.MI_07_ClampCheck))
{
int num = MoveInfo.MoveParam.TrayNumber;
MoveInfo.NextMoveStep(LineMoveStep.MI_10_WaitBox);
LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": 物品(高" + MoveInfo.MoveParam.PlateH+")已移走,更新托盘【" + num + "】为空盘,删除入库任务");
MoveInfo.WaitList.Add(WaitResultInfo.WaitBoxCanReviceTray());
TrayManager.UpdateTrayInfo(num);
RemoveInStore(MoveInfo.MoveParam);
if (MoveInfo.MoveParam.PlateH < 44)
//判断是否拿起来料
if (IOValue(IO_Type.ClampCylinder_Check).Equals(IO_VALUE.HIGH))
{
InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
InLog("入库 " + MoveInfo.SLog + ":成功抓取料盘");
int num = MoveInfo.MoveParam.TrayNumber;
MoveInfo.NextMoveStep(LineMoveStep.MI_10_WaitBox);
LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": 物品(高" + MoveInfo.MoveParam.PlateH + ")已移走,更新托盘【" + num + "】为空盘,删除入库任务");
MoveInfo.WaitList.Add(WaitResultInfo.WaitBoxCanReviceTray());
TrayManager.UpdateTrayInfo(num);
RemoveInStore(MoveInfo.MoveParam);
if (MoveInfo.MoveParam.PlateH < 44)
{
InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
}
}
else
{
int num = MoveInfo.MoveParam.TrayNumber;
InLog("入库 " + MoveInfo.SLog + ":抓取料盘失败,取消入库任务,清空托盘[" + num + "]信息。报警:未抓起料盘,请取走料盘后复位。");
//未抓起料盘,直接报警
MoveInfo.NextMoveStep(LineMoveStep.MI_07_ClampCheck);
MoveInfo.WaitList.Add(WaitResultInfo.WaitNoTrayAlarm());
SetWarnMsg("未抓起料盘,请取走料盘后复位", MoveInfo.GetStepDes() + "_" + "未抓起料", MoveInfo);
Alarm(LineAlarmType.IoSingleTimeOut);
TrayInfo tray = TrayManager.GetTrayInfo(num);
LogUtil.error(Name + " 抓料失败自动清空入库任务 :" + tray.InoutPar.ToStr());
TrayManager.ClearInstore(tray, "抓料失败自动清空入库任务");
TrayManager.UpdateTrayInfo(num);
}
}
else if (MoveInfo.IsStep(LineMoveStep.MI_10_WaitBox))
......
......@@ -212,7 +212,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public static void ClearInstore(TrayInfo tray)
public static void ClearInstore(TrayInfo tray,string opLog= "手动清空托盘")
{
if (tray == null)
{
......@@ -226,9 +226,9 @@ namespace OnlineStore.DeviceLibrary
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
{
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
moveEquip.RemoveInStore(tray.InoutPar, "手动清空托盘");
moveEquip.RemoveInStore(tray.InoutPar, opLog);
//手动清空托盘时直接取消入库任务
SServerManager.cancelPutInTask("手动清空托盘", tray.InoutPar.WareCode, false);
SServerManager.cancelPutInTask(opLog, tray.InoutPar.WareCode, false);
}
}
}
......
......@@ -366,37 +366,7 @@ namespace OnlineStore.DeviceLibrary
wait.WaitType = WaitEnum.W009_BoxCanInstore;
return wait;
}
//public static WaitResultInfo WaitSWCanTopUp(int swNum)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.WaitType = WaitEnum.W010_SWCanTopUp;
// wait.TargetPosition = swNum;
// return wait;
//}
//public static WaitResultInfo WaitSideWay()
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.WaitType = WaitEnum.W010_SW34NoTray;
// return wait;
//}
/// <summary>
/// 等待出料移栽可以开始移栽
/// </summary>
//public static WaitResultInfo WaitProvidingEquipCanOut()
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.WaitType = WaitEnum.W201_ProvidingCanOut;
// return wait;
//}
/// <summary>
/// 等待出料流水线可以接收料盘
/// </summary>
//public static WaitResultInfo WaitDLineCanReviceTray()
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.WaitType = WaitEnum.W202_DLineCanOut;
// return wait;
//}
public static WaitResultInfo WaitBatchAxis(ConfigMoveAxis axis, int targetPosition, int targetSpeed)
{
WaitResultInfo wait = new WaitResultInfo();
......@@ -415,7 +385,36 @@ namespace OnlineStore.DeviceLibrary
wait.WaitType = WaitEnum.W102_FeedScanCode;
return wait;
}
/// <summary>
/// 入料机构拿走料串上的料,需要同时 SL_ClampCylinder_Check=HIGH,SL_AxisLocationCheck=LOW
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitGetShelfTray()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W103_GetShelfTray;
return wait;
}
///// <summary>
///// 移栽入料时抓取料盘
///// </summary>
///// <returns></returns>
//public static WaitResultInfo WaitInStoreGetTray()
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.WaitType = WaitEnum.W010_InStoreGetTray;
// return wait;
//}
/// <summary>
/// 未抓起料报警
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitNoTrayAlarm()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W1000_NoTrayAlarm;
return wait;
}
public string ToStr()
{
if (WaitType.Equals(WaitEnum.W001_AxisMove))
......@@ -458,11 +457,10 @@ namespace OnlineStore.DeviceLibrary
else if (WaitType.Equals(WaitEnum.W009_BoxCanInstore))
{
return "BOX可以开始入库";
} else if (WaitType.Equals(WaitEnum.W010_InStoreGetTray))
{
return "抓起料盘";
}
//else if (WaitType.Equals(WaitEnum.W010_SWCanTopUp))
//{
// return "等待横移"+TargetPosition+"无托盘";
//}
else if (WaitType.Equals(WaitEnum.W101_BatchAxisMove))
{
return "上料轴缓慢上升";
......@@ -470,22 +468,14 @@ namespace OnlineStore.DeviceLibrary
else if (WaitType.Equals(WaitEnum.W102_FeedScanCode))
{
return "入料模块扫码";
} else if (WaitType.Equals(WaitEnum.W103_GetShelfTray))
{
return "抓起料盘";
}
else if (WaitType.Equals(WaitEnum.W1000_NoTrayAlarm))
{
return "未抓起料盘,请取走料盘后复位";
}
//else if (WaitType.Equals(WaitEnum.W103_FeedNoMove))
//{
// return "横移机构空闲";
//}
//else if (WaitType.Equals(WaitEnum.W201_ProvidingCanOut))
//{
// return "可移栽出料";
//}else if (WaitType.Equals(WaitEnum.W202_DLineCanOut))
//{
// return "皮带线可放料盘";
//}
//else if (WaitType.Equals(WaitEnum.W301_DLineScanCode))
//{
// return "出料皮带线扫码";
//}
else
{
return "Wait位置类型:WaitType=【" + WaitType + "】";
......@@ -581,6 +571,10 @@ namespace OnlineStore.DeviceLibrary
/// BOX可以开始入库
/// </summary>
internal static int W009_BoxCanInstore = 9;
/// <summary>
/// 入库时移栽拿走料盘上的料
/// </summary>
internal static int W010_InStoreGetTray = 10;
///// <summary>
///// 等待横移模块可以顶升,等待入料四和入料一处无托盘处理
///// </summary>
......@@ -593,7 +587,15 @@ namespace OnlineStore.DeviceLibrary
/// 入料模块扫码
/// </summary>
internal static int W102_FeedScanCode = 102;
/// <summary>
/// 入料机构拿走料串上的料,需要同时 SL_ClampCylinder_Check=HIGH,SL_AxisLocationCheck=LOW
/// </summary>
internal static int W103_GetShelfTray = 103;
/// <summary>
/// 未抓起料盘,请取走料盘后复位
/// </summary>
internal static int W1000_NoTrayAlarm = 1000;
}
public enum LineMoveType
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!