Commit 5b33ecee 张东亮

放料完成检测工单情况

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