Commit 3c31060e 张东亮

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

1 个父辈 338752ba


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