Commit 3c31060e 张东亮

出库同一个工单两料串都有料情况

1 个父辈 338752ba
 
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
...@@ -64,18 +64,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -64,18 +64,18 @@ namespace OnlineStore.DeviceLibrary
cames = ConfigHelper.Config.Get<string[]>($"{Name}_HeightCams"); cames = ConfigHelper.Config.Get<string[]>($"{Name}_HeightCams");
} }
public void TimerProcess() public void TimerProcess()
{ {
//如果急停,不再处理 //如果急停,不再处理
if (Robot.alarmType.Equals(AlarmType.SuddenStop)|| Robot.alarmType.Equals(AlarmType.NoAirpressure_Check)) if (Robot.alarmType.Equals(AlarmType.SuddenStop) || Robot.alarmType.Equals(AlarmType.NoAirpressure_Check))
{ {
return; return;
} }
if (!MoveStop) if (!MoveStop)
{ {
if (MoveInfo.MoveType.Equals(MoveType.None)) if (MoveInfo.MoveType.Equals(MoveType.None))
{ {
WarnMsg = ""; WarnMsg = "";
if (Robot.MoveInfo.MoveType.Equals(MoveType.Reset) || Robot.MoveInfo.MoveType.Equals(MoveType.RHome)) if (Robot.MoveInfo.MoveType.Equals(MoveType.Reset) || Robot.MoveInfo.MoveType.Equals(MoveType.RHome))
{ {
} }
...@@ -85,7 +85,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -85,7 +85,8 @@ namespace OnlineStore.DeviceLibrary
if (Robot.IOValue(Config.IO_AGV_RequestIn).Equals(IO_VALUE.HIGH)) if (Robot.IOValue(Config.IO_AGV_RequestIn).Equals(IO_VALUE.HIGH))
{ {
ShelfEnterProcess("", ""); ShelfEnterProcess("", "");
}else if (Robot.AutoInput && Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH)) }
else if (Robot.AutoInput && Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
{ {
LogUtil.debug($"{Name} 处理2"); LogUtil.debug($"{Name} 处理2");
StartInstore(new InOutParam()); StartInstore(new InOutParam());
...@@ -122,7 +123,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -122,7 +123,7 @@ namespace OnlineStore.DeviceLibrary
if (StoreManager.checkWatch(shelfWatch, 10000, true)) if (StoreManager.checkWatch(shelfWatch, 10000, true))
{ {
//doorInfo.hSerial = MoveInfo.MoveParam.hSerial; //doorInfo.hSerial = MoveInfo.MoveParam.hSerial;
doorInfo.status = doorStatusE.free; doorInfo.status = doorStatusE.free;
doorInfo.hasContainer = false; doorInfo.hasContainer = false;
WorkLog($"无料串,:通知agv来送料串 ShelfType:{ShelfType},{doorInfo.doorIndex},hasContainer:{doorInfo.hasContainer}"); WorkLog($"无料串,:通知agv来送料串 ShelfType:{ShelfType},{doorInfo.doorIndex},hasContainer:{doorInfo.hasContainer}");
...@@ -151,20 +152,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -151,20 +152,20 @@ namespace OnlineStore.DeviceLibrary
if (Robot.CanStartRun()) if (Robot.CanStartRun())
{ {
if (Robot.runStatus >= RunStatus.HomeMoving) if (Robot.runStatus >= RunStatus.HomeMoving)
{ {
if (needStop) if (needStop)
{ {
StopMove(); StopMove();
} }
string msg = ""; string msg = "";
bool axisOpen = BatchAxis.Open(true, out msg); bool axisOpen = BatchAxis.Open(true, out msg);
// WorkLog("批量轴打开结果:" + axisOpen); // WorkLog("批量轴打开结果:" + axisOpen);
if (!axisOpen) if (!axisOpen)
{ {
BatchAxis.SuddenStop(); BatchAxis.SuddenStop();
BatchAxis.ServoOff(); BatchAxis.ServoOff();
WarnMsg = Name + "复位失败:批量轴打开失败:"+msg; WarnMsg = Name + "复位失败:批量轴打开失败:" + msg;
return false; return false;
} }
if (resetShelf) if (resetShelf)
...@@ -175,10 +176,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -175,10 +176,10 @@ namespace OnlineStore.DeviceLibrary
preCodeList = new List<string>(); preCodeList = new List<string>();
WarnMsg = ""; WarnMsg = "";
alarmType = AlarmType.None; alarmType = AlarmType.None;
MoveInfo.NewMove(MoveType.Reset,new InOutParam()); MoveInfo.NewMove(MoveType.Reset, new InOutParam());
MoveInfo.NextMoveStep(StepEnum.IBR01_StopDown); MoveInfo.NextMoveStep(StepEnum.IBR01_StopDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
WorkLog("开始复位,定位气缸下降"); WorkLog("开始复位,定位气缸下降");
StopDown(MoveInfo); StopDown(MoveInfo);
return true; return true;
} }
...@@ -207,11 +208,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -207,11 +208,11 @@ namespace OnlineStore.DeviceLibrary
} }
if (MoveInfo.IsStep(StepEnum.IBR01_StopDown)) if (MoveInfo.IsStep(StepEnum.IBR01_StopDown))
{ {
MoveInfo.NextMoveStep(StepEnum.IBR02_LineRun); MoveInfo.NextMoveStep(StepEnum.IBR02_LineRun);
WorkLog("复位:链条正转3秒"); WorkLog("复位:链条正转3秒");
LineRun(MoveInfo); LineRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
} }
else if (MoveInfo.IsStep(StepEnum.IBR02_LineRun)) else if (MoveInfo.IsStep(StepEnum.IBR02_LineRun))
{ {
...@@ -253,7 +254,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -253,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
BatchAxis.AxisStopCheckMove(); BatchAxis.AxisStopCheckMove();
BatchAxis.SuddenStop(); BatchAxis.SuddenStop();
} }
public DateTime LastAlarmTime = DateTime.Now; public DateTime LastAlarmTime = DateTime.Now;
public AlarmType alarmType = AlarmType.None; public AlarmType alarmType = AlarmType.None;
internal void Alarm(AlarmType alarmType) internal void Alarm(AlarmType alarmType)
...@@ -271,7 +272,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -271,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
{ {
StopMove(); StopMove();
} }
} }
#region 气缸操作 #region 气缸操作
public void LineRun(DeviceMoveInfo moveInfo = null) public void LineRun(DeviceMoveInfo moveInfo = null)
...@@ -347,7 +348,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -347,7 +348,8 @@ namespace OnlineStore.DeviceLibrary
} }
targetSpeed = Robot.Config.BatchAxis_P3Speed; targetSpeed = Robot.Config.BatchAxis_P3Speed;
} }
else { else
{
targetSpeed = Robot.Config.BatchAxis_P1Speed; targetSpeed = Robot.Config.BatchAxis_P1Speed;
} }
// 需要增加定时器,获取验证信号并停止伺服 // 需要增加定时器,获取验证信号并停止伺服
...@@ -562,7 +564,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -562,7 +564,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
internal bool ShelfReadyOut(InOutPosInfo posInfo = null, bool SendShelfOut = false) internal bool ShelfReadyOut(InOutPosInfo posInfo = null, bool SendShelfOut = false, ShelfInfo otherBatchShelf = null)
{ {
if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.IsStep(StepEnum.IS11_ShelfReady)) if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.IsStep(StepEnum.IS11_ShelfReady))
{ {
...@@ -570,6 +572,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -570,6 +572,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return true; return true;
} }
//TODO 验证料串是否同一个,不是同一个直接送出料串 //TODO 验证料串是否同一个,不是同一个直接送出料串
if (String.IsNullOrEmpty(CurrShelf.XuniRfid)) if (String.IsNullOrEmpty(CurrShelf.XuniRfid))
{ {
...@@ -654,7 +657,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -654,7 +657,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (WarnMsg.Contains(msg)) if (WarnMsg.Contains(msg))
{ {
WarnMsg=""; WarnMsg = "";
} }
} }
} }
...@@ -672,7 +675,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -672,7 +675,7 @@ namespace OnlineStore.DeviceLibrary
internal string RfidIP = ""; internal string RfidIP = "";
#region 左右入料口共有IO #region 左右入料口共有IO
//伺服料盘检测 //伺服料盘检测
internal string IO_ReelCheck = "ReelCheck"; internal string IO_ReelCheck = "ReelCheck";
//料串前端检测 //料串前端检测
internal string IO_LineIn_Check = "LineIn_Check"; internal string IO_LineIn_Check = "LineIn_Check";
//料串到位检测 //料串到位检测
......
...@@ -400,7 +400,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -400,7 +400,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("复位完成"); LogInfo("复位完成");
runStatus = RunStatus.Runing; runStatus = RunStatus.Runing;
MoveInfo.EndMove(); MoveInfo.EndMove();
if(clampHasReelWhen) if (clampHasReelWhen)
{ {
runStatus = RunStatus.Busy; runStatus = RunStatus.Busy;
MoveInfo.NewMove(MoveType.OutStore, new InOutParam()); MoveInfo.NewMove(MoveType.OutStore, new InOutParam());
...@@ -633,6 +633,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -633,6 +633,13 @@ namespace OnlineStore.DeviceLibrary
{ {
if (moveBean.MoveInfo.MoveType.Equals(MoveType.Reset) || moveBean.MoveInfo.MoveType.Equals(MoveType.RHome)) if (moveBean.MoveInfo.MoveType.Equals(MoveType.Reset) || moveBean.MoveInfo.MoveType.Equals(MoveType.RHome))
continue; continue;
var otherModeBean = BatchMoveList.Find(s => !s.Name.Equals(moveBean.Name));
var othSerial = otherModeBean?.MoveInfo.MoveParam?.PosInfo?.hSerial ?? "";
var othHasTheHserial = false;
if (!string.IsNullOrEmpty(othSerial) && othSerial.Equals(posInfo.hSerial))
{
othHasTheHserial = true;
}
//LogUtil.debug($"{moveBean.Name} CheckStartOutPos 处理"); //LogUtil.debug($"{moveBean.Name} CheckStartOutPos 处理");
var curhSerial = moveBean.MoveInfo.MoveParam?.PosInfo?.hSerial ?? ""; var curhSerial = moveBean.MoveInfo.MoveParam?.PosInfo?.hSerial ?? "";
if (!string.IsNullOrEmpty(curhSerial) && curhSerial != posInfo.hSerial) if (!string.IsNullOrEmpty(curhSerial) && curhSerial != posInfo.hSerial)
...@@ -646,7 +653,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -646,7 +653,7 @@ namespace OnlineStore.DeviceLibrary
moveBean.StartOutstore(); moveBean.StartOutstore();
return true; return true;
} }
else if (moveBean.ShelfReadyOut(posInfo, shelfAutoLeave)) else if (!othHasTheHserial && moveBean.ShelfReadyOut(posInfo, shelfAutoLeave))
{ {
InOutParam param = new InOutParam(posInfo.ToCopy()); InOutParam param = new InOutParam(posInfo.ToCopy());
param.ShelfType = moveBean.ShelfType; param.ShelfType = moveBean.ShelfType;
...@@ -713,6 +720,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -713,6 +720,13 @@ namespace OnlineStore.DeviceLibrary
// LogUtil.debug($"{moveBean.Name} CheckStartOutPos {moveBean.MoveInfo.MoveType}"); // LogUtil.debug($"{moveBean.Name} CheckStartOutPos {moveBean.MoveInfo.MoveType}");
if (moveBean.MoveInfo.MoveType.Equals(MoveType.Reset) || moveBean.MoveInfo.MoveType.Equals(MoveType.RHome)) if (moveBean.MoveInfo.MoveType.Equals(MoveType.Reset) || moveBean.MoveInfo.MoveType.Equals(MoveType.RHome))
continue; continue;
var otherModeBean = BatchMoveList.Find(s => !s.Name.Equals(moveBean.Name));
var othSerial = otherModeBean?.MoveInfo.MoveParam?.PosInfo?.hSerial ?? "";
var othHasTheHserial = false;
if (!string.IsNullOrEmpty(othSerial) && othSerial.Equals(posInfo.hSerial))
{
othHasTheHserial = true;
}
// LogUtil.debug($"{moveBean.Name} CheckStartOutPos 处理"); // LogUtil.debug($"{moveBean.Name} CheckStartOutPos 处理");
var curhSerial = moveBean.MoveInfo.MoveParam?.PosInfo?.hSerial ?? ""; var curhSerial = moveBean.MoveInfo.MoveParam?.PosInfo?.hSerial ?? "";
if (!string.IsNullOrEmpty(curhSerial) && curhSerial != posInfo.hSerial) if (!string.IsNullOrEmpty(curhSerial) && curhSerial != posInfo.hSerial)
...@@ -726,7 +740,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -726,7 +740,7 @@ namespace OnlineStore.DeviceLibrary
moveBean.StartOutstore(); moveBean.StartOutstore();
return true; return true;
} }
else if (moveBean.ShelfReadyOut(posInfo, shelfAutoLeave)) else if (!othHasTheHserial && moveBean.ShelfReadyOut(posInfo, shelfAutoLeave))
{ {
InOutParam param = new InOutParam(posInfo.ToCopy()); InOutParam param = new InOutParam(posInfo.ToCopy());
param.ShelfType = moveBean.ShelfType; param.ShelfType = moveBean.ShelfType;
......
...@@ -999,6 +999,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -999,6 +999,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
MoveInfo.NextMoveStep(StepEnum.IO03_InoutToP2); MoveInfo.NextMoveStep(StepEnum.IO03_InoutToP2);
ClampRelax(MoveInfo);
clampTryCount++; clampTryCount++;
MoveLog($"出库A->{shelf}料串 {MoveInfo.SLog}: 未检测到料,重新抓取"); MoveLog($"出库A->{shelf}料串 {MoveInfo.SLog}: 未检测到料,重新抓取");
} }
...@@ -1108,6 +1109,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1108,6 +1109,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
MoveInfo.NextMoveStep(StepEnum.IO13_InoutToP3); MoveInfo.NextMoveStep(StepEnum.IO13_InoutToP3);
ClampRelax(MoveInfo);
clampTryCount++; clampTryCount++;
MoveLog($"出库B->{shelf}料串 {MoveInfo.SLog}: 未检测到料,重新抓取"); MoveLog($"出库B->{shelf}料串 {MoveInfo.SLog}: 未检测到料,重新抓取");
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!