Commit 5b33ecee 张东亮

放料完成检测工单情况

1 个父辈 7390aa08
...@@ -786,7 +786,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -786,7 +786,7 @@ namespace OnlineStore.DeviceLibrary
public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "0", string robotIndex = "1") public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "0", string robotIndex = "1")
{ {
UpdateLocInfo(barcode, "END", rfid); //UpdateLocInfo(barcode, "END", rfid);
LogUtil.info($"ShelfFinish rifd【{rfid}】barcode【{barcode}】rfidLoc【{rfidLoc}】robotIndex【{robotIndex}】"); LogUtil.info($"ShelfFinish rifd【{rfid}】barcode【{barcode}】rfidLoc【{rfidLoc}】robotIndex【{robotIndex}】");
return null; return null;
} }
......
...@@ -40,7 +40,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -40,7 +40,7 @@ namespace OnlineStore.DeviceLibrary
if (AgvClient.GetAction(Config.AgvName) == ClientAction.NeedLeave || AgvClient.GetAction(Config.AgvName) == ClientAction.MayLeave) if (AgvClient.GetAction(Config.AgvName) == ClientAction.NeedLeave || AgvClient.GetAction(Config.AgvName) == ClientAction.MayLeave)
{ {
//WorkLog("料串入料 :等待AGV来取空料串1"); //WorkLog("料串入料 :等待AGV来取空料串1");
return false; return false;
} }
UpdateShelf(1); UpdateShelf(1);
if (CurrShelf.ShelfState.Equals(3)) if (CurrShelf.ShelfState.Equals(3))
...@@ -49,12 +49,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -49,12 +49,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "StartInstore 失败,料串" + CurrShelf.ToStr() + "需要离开,NeedLeave:" + Config.AgvName + "," + CurrShelf.ShelfRfid + ",agvcallresult:" + agvcallresult.ToString()); LogUtil.info(Name + "StartInstore 失败,料串" + CurrShelf.ToStr() + "需要离开,NeedLeave:" + Config.AgvName + "," + CurrShelf.ShelfRfid + ",agvcallresult:" + agvcallresult.ToString());
return false; return false;
} }
else if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH) ) else if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.NewMove(MoveType.InStore,new InOutParam()); MoveInfo.NewMove(MoveType.InStore, new InOutParam());
IB03_LineStart(); IB03_LineStart();
} }
else if(Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH)) else if (Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.NewMove(MoveType.InStore, new InOutParam()); MoveInfo.NewMove(MoveType.InStore, new InOutParam());
IB04_LineWait(); IB04_LineWait();
...@@ -86,7 +86,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,7 +86,7 @@ namespace OnlineStore.DeviceLibrary
WorkLog("定位工位检测到料串: 链条停止,阻挡气缸上升"); WorkLog("定位工位检测到料串: 链条停止,阻挡气缸上升");
LineStop(); LineStop();
StopUp(MoveInfo); StopUp(MoveInfo);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
} }
private void IB02_BatchAxisToP1() private void IB02_BatchAxisToP1()
{ {
...@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
{ {
WorkLog("料串入料 :入口有料串,转动料串到位"); WorkLog("料串入料 :入口有料串,转动料串到位");
MoveInfo.NextMoveStep(StepEnum.IB03_LineStart); MoveInfo.NextMoveStep(StepEnum.IB03_LineStart);
LineRun(MoveInfo); LineRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(Config.IO_LineIn_Check, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(Config.IO_LineIn_Check, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(Config.IO_LineEnd_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(Config.IO_LineEnd_Check, IO_VALUE.HIGH));
} }
...@@ -211,7 +211,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -211,7 +211,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.IB07_AxisUpMove)) else if (MoveInfo.IsStep(StepEnum.IB07_AxisUpMove))
{ {
CheckHasTray(); CheckHasTray();
}else if (MoveInfo.IsStep(StepEnum.IB08_BatchAxisToP4)) }
else if (MoveInfo.IsStep(StepEnum.IB08_BatchAxisToP4))
{ {
if (Robot.AxisIsInShelfUp(ShelfType)) if (Robot.AxisIsInShelfUp(ShelfType))
{ {
...@@ -269,7 +270,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -269,7 +270,7 @@ namespace OnlineStore.DeviceLibrary
WorkLog("料串入料 :扫码结束【" + code + "】,等待取料机构来取料," + MoveInfo.MoveParam.PosInfo.ToStr()); WorkLog("料串入料 :扫码结束【" + code + "】,等待取料机构来取料," + MoveInfo.MoveParam.PosInfo.ToStr());
} }
} }
else else
{ {
WarnMsg = Name + "[" + MoveInfo.MoveStep + "] 扫码超时 [" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]"; WarnMsg = Name + "[" + MoveInfo.MoveStep + "] 扫码超时 [" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, 999); LogUtil.error(WarnMsg, 999);
...@@ -369,40 +370,40 @@ namespace OnlineStore.DeviceLibrary ...@@ -369,40 +370,40 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
//Task<List<string>> scanTask = Task.Factory.StartNew(delegate //Task<List<string>> scanTask = Task.Factory.StartNew(delegate
scanTask = Task.Factory.StartNew(delegate scanTask = Task.Factory.StartNew(delegate
{ {
Robot.IOMove(IO_Type.CameraLed, IO_VALUE.HIGH); Robot.IOMove(IO_Type.CameraLed, IO_VALUE.HIGH);
LastCodeList = CodeManager.CameraScan(Config.CameraName, Name); LastCodeList = CodeManager.CameraScan(Config.CameraName, Name);
if (LastCodeList.Count <= 0) if (LastCodeList.Count <= 0)
{ {
LastCodeList = CodeManager.CameraScan(Config.CameraName, Name); LastCodeList = CodeManager.CameraScan(Config.CameraName, Name);
} }
Robot.IOMove(IO_Type.CameraLed, IO_VALUE.LOW); Robot.IOMove(IO_Type.CameraLed, IO_VALUE.LOW);
//TODO 需要判断是否和上次的条码重复,重复的条码不可用 //TODO 需要判断是否和上次的条码重复,重复的条码不可用
bool isCanUse = true; bool isCanUse = true;
//判断是否可用 //判断是否可用
foreach (string nC in LastCodeList) foreach (string nC in LastCodeList)
{ {
foreach (string n in preCodeList) foreach (string n in preCodeList)
{ {
//if(CodeManager.HasRightCode(nC)) //if(CodeManager.HasRightCode(nC))
if (nC.Length > 15 && nC.Equals(n)) if (nC.Length > 15 && nC.Equals(n))
{ {
LogUtil.error(Name + "扫码结果【" + nC + "】与上个条码【" + n + "】重复,扫码结果不可用"); LogUtil.error(Name + "扫码结果【" + nC + "】与上个条码【" + n + "】重复,扫码结果不可用");
isCanUse = false; isCanUse = false;
break; break;
} }
} }
} }
if (!isCanUse) if (!isCanUse)
{ {
LastCodeList = new List<string>(); LastCodeList = new List<string>();
} }
return LastCodeList; return LastCodeList;
}); });
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -424,22 +425,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -424,22 +425,22 @@ namespace OnlineStore.DeviceLibrary
{ {
toBatchP4 = false; toBatchP4 = false;
//判断扫码点是否可用,可用,运动到扫码点 //判断扫码点是否可用,可用,运动到扫码点
int currP = BatchAxis.GetAclPosition(); int currP = BatchAxis.GetAclPosition();
int targetPosition = currP + Config.BatchAxisP4; int targetPosition = currP + Config.BatchAxisP4;
if (Config.BatchAxisP4 > 0 &&(targetPosition<Config.BatchAxisP2 )) if (Config.BatchAxisP4 > 0 && (targetPosition < Config.BatchAxisP2))
{ {
batchAxisReelPosition = currP; batchAxisReelPosition = currP;
toBatchP4 = true; toBatchP4 = true;
MoveInfo.NextMoveStep(StepEnum.IB08_BatchAxisToP4); MoveInfo.NextMoveStep(StepEnum.IB08_BatchAxisToP4);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
BatchAxis.AbsMove(MoveInfo, targetPosition, Robot.Config.BatchAxis_P4Speed); BatchAxis.AbsMove(MoveInfo, targetPosition, Robot.Config.BatchAxis_P4Speed);
WorkLog("料盘已到位,批量轴当前位置【"+currP+ "】,扫码上升高度P4【" + Config.BatchAxisP4+"】可用,批量轴走到扫码点【"+ targetPosition + "】"); WorkLog("料盘已到位,批量轴当前位置【" + currP + "】,扫码上升高度P4【" + Config.BatchAxisP4 + "】可用,批量轴走到扫码点【" + targetPosition + "】");
} }
else else
{ {
LogUtil.info(Name + "料盘已到位,批量轴当前位置【" + currP + "】扫码上升高度P4【" + Config.BatchAxisP4 + "】扫码点【" + targetPosition + "】P2【"+ Config.BatchAxisP2 + "】,可直接扫码"); LogUtil.info(Name + "料盘已到位,批量轴当前位置【" + currP + "】扫码上升高度P4【" + Config.BatchAxisP4 + "】扫码点【" + targetPosition + "】P2【" + Config.BatchAxisP2 + "】,可直接扫码");
if (Robot.AxisIsInShelfUp(ShelfType)) if (Robot.AxisIsInShelfUp(ShelfType))
{ {
MoveInfo.NextMoveStep(StepEnum.IB09_WaitCanScan); MoveInfo.NextMoveStep(StepEnum.IB09_WaitCanScan);
...@@ -450,7 +451,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -450,7 +451,7 @@ namespace OnlineStore.DeviceLibrary
{ {
IB11_ScanCode(); IB11_ScanCode();
} }
} }
} }
else else
{ {
...@@ -475,7 +476,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -475,7 +476,7 @@ namespace OnlineStore.DeviceLibrary
} }
private void SendInShelfLeave(string msg = "") private void SendInShelfLeave(string msg = "")
{ {
WorkLog(" SendInShelfLeave :" + msg+",清空条码"); WorkLog(" SendInShelfLeave :" + msg + ",清空条码");
LastCodeList = new List<string>(); LastCodeList = new List<string>();
preCodeList = new List<string>(); preCodeList = new List<string>();
bool needLeave = true; bool needLeave = true;
...@@ -484,7 +485,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -484,7 +485,7 @@ namespace OnlineStore.DeviceLibrary
{ {
needLeave = false; needLeave = false;
} }
else if (ShelfType.Equals(1) && Robot.BatchMove_B.ShelfIsOut()) else if (ShelfType.Equals(1) && Robot.BatchMove_B.ShelfIsOut())
{ {
needLeave = true; needLeave = true;
} }
...@@ -617,8 +618,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -617,8 +618,15 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
MoveInfo.NextMoveStep(StepEnum.IS11_ShelfReady); if (SServerManager.GetOutTaskCount(MoveInfo.MoveParam.PosInfo.hSerial) == 0)
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); {
SendOutShelfLeave("检测到工单已结束:" + MoveInfo.MoveParam.PosInfo.hSerial);
}
else
{
MoveInfo.NextMoveStep(StepEnum.IS11_ShelfReady);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
} }
} }
else if (MoveInfo.IsStep(StepEnum.IS12_AxisDown)) else if (MoveInfo.IsStep(StepEnum.IS12_AxisDown))
...@@ -702,9 +710,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -702,9 +710,9 @@ namespace OnlineStore.DeviceLibrary
} }
internal void ReelPutOk() internal void ReelPutOk()
{ {
if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.IsStep(StepEnum.IS13_WaitReel)) if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.IsStep(StepEnum.IS13_WaitReel))
{ {
MoveInfo.NextMoveStep(StepEnum.IS14_ReelOK); MoveInfo.NextMoveStep(StepEnum.IS14_ReelOK);
WorkLog($"出库{MoveInfo.SLog} 放料完成"); WorkLog($"出库{MoveInfo.SLog} 放料完成");
if (SServerManager.GetOutTaskCount(MoveInfo.MoveParam.PosInfo.hSerial) == 0) if (SServerManager.GetOutTaskCount(MoveInfo.MoveParam.PosInfo.hSerial) == 0)
...@@ -722,7 +730,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -722,7 +730,7 @@ namespace OnlineStore.DeviceLibrary
} }
private void CheckShelfIsFull() private void CheckShelfIsFull()
{ {
int currPositon = BatchAxis.GetAclPosition(); int currPositon = BatchAxis.GetAclPosition();
int nextP = currPositon - Robot.Config.Height_ChangeValue * (8 + 20); int nextP = currPositon - Robot.Config.Height_ChangeValue * (8 + 20);
if (nextP <= Config.BatchAxisP1) if (nextP <= Config.BatchAxisP1)
...@@ -739,7 +747,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -739,7 +747,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
SendOutShelfLeave("料串出满需离开(信号到位)"); SendOutShelfLeave("料串出满需离开(信号到位)");
} }
} }
else if (MoveInfo.IsStep(StepEnum.IB07_AxisUpMove)) else if (MoveInfo.IsStep(StepEnum.IB07_AxisUpMove))
...@@ -812,11 +820,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -812,11 +820,11 @@ namespace OnlineStore.DeviceLibrary
if (!result) if (!result)
{ {
LogUtil.error(logName + $" 等待{ Config.IO_LineIn_Check}=High 超时, 等待 {Config.IO_LineEnd_Check } 信号"); LogUtil.error(logName + $" 等待{Config.IO_LineIn_Check}=High 超时, 等待 {Config.IO_LineEnd_Check} 信号");
} }
else else
{ {
LogUtil.info(logName + $"已收到 {Config.IO_LineIn_Check}=High , 等待 { Config.IO_LineEnd_Check} 信号"); LogUtil.info(logName + $"已收到 {Config.IO_LineIn_Check}=High , 等待 {Config.IO_LineEnd_Check} 信号");
} }
result = Robot.WaitIo(Config.IO_LineEnd_Check, IO_VALUE.HIGH, 60000); result = Robot.WaitIo(Config.IO_LineEnd_Check, IO_VALUE.HIGH, 60000);
...@@ -886,7 +894,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -886,7 +894,7 @@ namespace OnlineStore.DeviceLibrary
bool result = Robot.WaitIo(Config.IO_LineIn_Check, IO_VALUE.LOW, 60000); bool result = Robot.WaitIo(Config.IO_LineIn_Check, IO_VALUE.LOW, 60000);
if (!result) if (!result)
{ {
LogUtil.error(logName + $" 等待 { Config.IO_LineIn_Check}=LOW超时,等待8000后停止转动,发送FinishLeave"); LogUtil.error(logName + $" 等待 {Config.IO_LineIn_Check}=LOW超时,等待8000后停止转动,发送FinishLeave");
} }
else else
{ {
...@@ -953,7 +961,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -953,7 +961,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveType.Equals(MoveType.InStore)) if (MoveInfo.MoveType.Equals(MoveType.InStore))
{ {
if (MoveInfo.IsStep(StepEnum.IB16_SaveHight)) if (MoveInfo.IsStep(StepEnum.IB16_SaveHight))
{ {
MoveInfo.NextMoveStep(StepEnum.IB17_WaitReelLeave); MoveInfo.NextMoveStep(StepEnum.IB17_WaitReelLeave);
WorkLog("当前料盘已离开,开始判断是否有下一盘,开始扫码"); WorkLog("当前料盘已离开,开始判断是否有下一盘,开始扫码");
LastHeight = 0; LastHeight = 0;
...@@ -963,7 +971,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -963,7 +971,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(Name + "当前状态:" + MoveInfo.MoveType + ",GetTrayLeave暂不处理"); LogUtil.error(Name + "当前状态:" + MoveInfo.MoveType + ",GetTrayLeave暂不处理");
} }
} }
private bool isFastLoad = true; private bool isFastLoad = true;
public bool UpdateShelf(int state = 0, string xnRfid = "") public bool UpdateShelf(int state = 0, string xnRfid = "")
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!