Commit 2a3343e8 张东亮

入库空抓料盘时取消入库任务

1 个父辈 9e9d9777
......@@ -108,6 +108,7 @@ namespace OnlineStore.DeviceLibrary
{
LogInfo("复位前,清理出库高度:" + OutStoreHeight);
}
lastcode = "";
//复位时设置状态为none
AgvClient.SetStatus(Config.AgvInName);
AgvClient.SetStatus(Config.AgvOutName);
......
......@@ -347,7 +347,7 @@ namespace OnlineStore.DeviceLibrary
{
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
bool isfull = tray.IsFull;
if (tray!=null&& tray.InoutPar.Corrected)
if (tray != null && tray.InoutPar.Corrected)
{
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】托盘已纠正,不再验证料盘检测信号");
}
......@@ -365,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.ReelCheck));
}
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2,DeviceID);
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2, DeviceID);
TrayMoveOk();
return;
}
......@@ -559,7 +559,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
InLog("料盘移栽" + MoveInfo.SLog + ","+SecondMoveInfo.SLog+":托盘开始放行");
InLog("料盘移栽" + MoveInfo.SLog + "," + SecondMoveInfo.SLog + ":托盘开始放行");
if (Config.SidesWayNum > 0)
{
if (CylinderIsOk(IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down))
......@@ -680,7 +680,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
InLog("检测到料架, " + MoveInfo.MoveStep + " :升降盘定位气缸下降");
TrayLCylinderAfter(MoveInfo);
}else
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_00_BatchAxisToP2);
OutLog("检测到料架,升降盘不在后退端 " + MoveInfo.SLog + " :提升伺服先回到P2");
......@@ -724,7 +725,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Location_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Line_Run, IO_VALUE.HIGH));
} else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
}
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart);
InLog("入料检测: " + MoveInfo.SLog + " 进料口有新料架,进料阻挡上升,缓冲阻挡前进1000,流水线转动 1000");
......@@ -793,10 +795,10 @@ namespace OnlineStore.DeviceLibrary
string ip = RFIDManager.GetRFIP(DeviceID, 1);
InLog("料架号【" + CurrShelfId + "】无效,ResetRFID[" + ip + "], 等待30秒后重新读取");
string msg = "";
bool result=RFIDManager.ResetRFID(ip, out msg);
bool result = RFIDManager.ResetRFID(ip, out msg);
if (!result)
{
LogUtil.error(Name+ "料架号【" + CurrShelfId + "】无效,ResetRFID[" + ip + "], 失败:"+msg);
LogUtil.error(Name + "料架号【" + CurrShelfId + "】无效,ResetRFID[" + ip + "], 失败:" + msg);
}
//MoveInfo.NextMoveStep(LineMoveStep.FI_53_BatchAxisToP1);
......@@ -1342,7 +1344,7 @@ namespace OnlineStore.DeviceLibrary
private void FI_25_WaitTray()
{
if ((getPosTask==null|| getPosTask.IsCompleted) && LastPosParam != null)
if ((getPosTask == null || getPosTask.IsCompleted) && LastPosParam != null)
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_WaitTray);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
......@@ -1381,6 +1383,46 @@ namespace OnlineStore.DeviceLibrary
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
LastPosParam = null;
string code = CodeManager.ProcessCode(LastCodeList);
if (!string.IsNullOrEmpty(lastcode) && !string.IsNullOrEmpty(code))
{
if (lastcode.Equals(code))
{
InLog($"【{code}】与上一盘的条码相同【{lastcode}】,认为空抓,取消该入库任务,直接NG不需要获取库位号");
getPosTask = null;
LastPosParam = new InOutParam(0, lastcode, "", LastHeight, LastWidth, true);
LastPosParam.NgMsg = $"入库:与上一盘的条码相同,认为空抓";
LastPosParam.InStoreNg = true;
LastPosParam.rfid = CurrShelfId;
LastPosParam.WareCode = lastcode;
LastPosParam.ManualJudgeNG = true;
//如果没有宽度,默认最宽料盘
if (LastWidth <= 0)
{
LastWidth = 15;
LastHeight = 56;
LastPosParam.PlateH = LastHeight;
LastPosParam.PlateW = LastWidth;
InLog($"【{code}】宽度为0,默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true");
}
else
{
if (LastWidth.Equals(7))
{
LastHeight = 16;
}
else
{
LastHeight = 56;
}
LastPosParam.PlateH = LastHeight;
InLog($"【{code}】宽度为{LastWidth},默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true");
}
SServerManager.cancelPutInTask(Name, LastPosParam.WareCode, false);
return;
}
}
lastcode = code;
//如果尺寸或者高度为0,不需要获取库位号
if (LastWidth <= 0 || LastHeight <= 0)
......@@ -1388,8 +1430,8 @@ namespace OnlineStore.DeviceLibrary
InLog($"【" + code + "】清空LastPosResult,料盘尺寸 {LastWidth}X{LastHeight} 尺寸不完整,直接NG不需要获取库位号");
getPosTask = null;
LastPosParam = new InOutParam(0,lastcode,"",LastHeight,LastWidth,true) ;
LastPosParam.NgMsg =$"入库:{LastWidth}X{LastHeight} 尺寸不完整";
LastPosParam = new InOutParam(0, lastcode, "", LastHeight, LastWidth, true);
LastPosParam.NgMsg = $"入库:{LastWidth}X{LastHeight} 尺寸不完整";
LastPosParam.InStoreNg = true;
LastPosParam.rfid = CurrShelfId;
LastPosParam.WareCode = lastcode;
......@@ -1401,7 +1443,7 @@ namespace OnlineStore.DeviceLibrary
LastHeight = 56;
LastPosParam.PlateH = LastHeight;
LastPosParam.PlateW = LastWidth;
InLog($"【{ code }】宽度为0,默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true");
InLog($"【{code}】宽度为0,默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true");
}
else
{
......@@ -1414,7 +1456,7 @@ namespace OnlineStore.DeviceLibrary
LastHeight = 56;
}
LastPosParam.PlateH = LastHeight;
InLog($"【{ code }】宽度为{LastWidth},默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true");
InLog($"【{code}】宽度为{LastWidth},默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true");
}
return;
}
......@@ -1526,7 +1568,7 @@ namespace OnlineStore.DeviceLibrary
{
targetPosition = maxtPosition;
}
InLog("料盘移栽" + MoveInfo.SLog + ":提升轴下降到料盘不溢出(" + (currPositon - Config.Height_ChangeValue * 30) + "):" + targetPosition+",速度:"+Config.BatchAxis_P4Speed);
InLog("料盘移栽" + MoveInfo.SLog + ":提升轴下降到料盘不溢出(" + (currPositon - Config.Height_ChangeValue * 30) + "):" + targetPosition + ",速度:" + Config.BatchAxis_P4Speed);
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P4Speed);
}
......@@ -1547,7 +1589,7 @@ namespace OnlineStore.DeviceLibrary
YuScanTask = Task.Factory.StartNew(delegate
{
Thread.Sleep(100);
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name.Trim()+"预扫码");
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name.Trim() + "预扫码");
bool isCanUse = true;
//判断是否可用
foreach (string nC in NextCodeList)
......@@ -1708,7 +1750,7 @@ namespace OnlineStore.DeviceLibrary
if (LoopCount < 10)
{
MoveInfo.NextMoveStep(LineMoveStep.FI_10_AxisUpMove);
InLog("料架入库" + MoveInfo.SLog + ":CheckHasTray:上料轴开始慢速上升到P3点,等待检测到料盘,LoopCount="+LoopCount);
InLog("料架入库" + MoveInfo.SLog + ":CheckHasTray:上料轴开始慢速上升到P3点,等待检测到料盘,LoopCount=" + LoopCount);
MoveInfo.ShelfNoTray = false;
BatchAxisToP3(false);
}
......@@ -1772,7 +1814,7 @@ namespace OnlineStore.DeviceLibrary
private List<string> LastCodeList = new List<string>();
private List<string> NextCodeList = new List<string>();
private int TrayLCylinderMoveCount=0;//升降盘气缸已运动次数
private int TrayLCylinderMoveCount = 0;//升降盘气缸已运动次数
private int GetHeight()
{
LastHeight = 0;
......@@ -1821,7 +1863,7 @@ namespace OnlineStore.DeviceLibrary
}
if (LastHeight <= 8) { LastHeight = 8; }
string code = CodeManager.ProcessCode(LastCodeList);
string msg = Name + " 计算盘高:上升前 [" + StartMovePosition + "]实时[ " + EndMovePosition + "]差值[" + (EndMovePosition - StartMovePosition) + "]系数[" + AxisChangeValue + "] 计算后"+buchongStr+"[" + height + "]" + ",归类为【" + LastHeight + "mm】条码【"+code+"】";
string msg = Name + " 计算盘高:上升前 [" + StartMovePosition + "]实时[ " + EndMovePosition + "]差值[" + (EndMovePosition - StartMovePosition) + "]系数[" + AxisChangeValue + "] 计算后" + buchongStr + "[" + height + "]" + ",归类为【" + LastHeight + "mm】条码【" + code + "】";
LogUtil.info(msg);
return LastHeight;
}
......@@ -1843,7 +1885,8 @@ namespace OnlineStore.DeviceLibrary
else if (IOValue(IO_Type.SL_TrayCheck1).Equals(IO_VALUE.HIGH))
{
width = 7;
}else
}
else
{
LogUtil.error(Name + "GetWidth :1234都未检测到,默认为7寸盘");
width = 7;
......@@ -1958,7 +2001,7 @@ namespace OnlineStore.DeviceLibrary
{
//入料执行中, 且需要空托盘
if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_WaitTray) ||
MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_BatchAxisDown)||
MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_BatchAxisDown) ||
MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_CylinderGive))
//if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_WaitTray) && MoveInfo.IsInWait.Equals(false))
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!