1 优化重测NG流程

2 修复当只有8个产品时,结束上料不再周转盘不扫码的问题
master
lhiven 1 year ago
parent b9ea59e857
commit 46ceacce74

@ -632,6 +632,7 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
ScanBarCode();
flowStep = EDischargeFlowStep.; flowStep = EDischargeFlowStep.;
} }
} }
@ -1542,15 +1543,98 @@ namespace Rs.MotionPlat.Flow
{ {
if(curNozzle.ToType== TurnoverType.Turnover) if(curNozzle.ToType== TurnoverType.Turnover)
{ {
ScanBarCode();
}
if (LoadAndUnloadTask.Instance.GetUnDealedTask().Count > 0)
{
StockTrayToTurnoverTray = !StockTrayToTurnoverTray;
flowStep = EDischargeFlowStep.;
}
else
{
flowStep = EDischargeFlowStep.;
}
}
break;
case EDischargeFlowStep.:
errCode = AxisControl.LoadX.MovePos(SysConfigParam.GetValue<double>("LoadXStartPos"), GlobalVar.WholeSpeed);
if(errCode== ErrorCode.Ok || GlobalVar.VirtualAxis)
{
//AxisControl.NozzleZ1.Home();
//AxisControl.NozzleZ2.Home();
//AxisControl.NozzleZ3.Home();
//AxisControl.NozzleZ4.Home();
//AxisControl.NozzleZ5.Home();
//AxisControl.NozzleZ6.Home();
//AxisControl.NozzleZ7.Home();
//AxisControl.NozzleZ8.Home();
//AxisControl.NozzleR1.Home();
//AxisControl.NozzleR2.Home();
//AxisControl.NozzleR3.Home();
//AxisControl.NozzleR4.Home();
//AxisControl.NozzleR5.Home();
//AxisControl.NozzleR6.Home();
//AxisControl.NozzleR7.Home();
//AxisControl.NozzleR8.Home();
errCode = AxisControl.LoadY.MovePos(SysConfigParam.GetValue<double>("LoadYStartPos"), GlobalVar.WholeSpeed);
if(errCode== ErrorCode.Ok || GlobalVar.VirtualAxis)
{
ZRHomeFlow.Instance.GoHome();
if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
}
logInfo =GetClassName()+ $"排料任务结束到安全位";
MessageQueue.Instance.Insert(logInfo);
flowStep = EDischargeFlowStep.;
}
else
{
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadY, errCode);
}
}
else
{
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
}
break;
case EDischargeFlowStep.:
if(Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{
logInfo = GetClassName()+ $"任务结束已回到安全位";
MessageQueue.Instance.Insert(logInfo);
if (TestCenter.Instance.LoadResult())
{
logInfo = GetClassName()+ $"通知中控任务完成";
MessageQueue.Instance.Insert(logInfo);
LoadAndUnloadTask.Instance.Clear();
logInfo = GetClassName()+$"任务完成,清除任务";
MessageQueue.Instance.Insert(logInfo);
}
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting);
flowStep = EDischargeFlowStep.;
}
break;
default:
break;
}
}
private void ScanBarCode()
{
SchedulingMessageBox box = new SchedulingMessageBox();
if (LoadAndUnloadTask.Instance.GetUndealedLoadToTurnoverTask().Count == 0 && !GlobalVar.VirtualAxis) if (LoadAndUnloadTask.Instance.GetUndealedLoadToTurnoverTask().Count == 0 && !GlobalVar.VirtualAxis)
{ {
if(GlobalVar.GRR) if (GlobalVar.GRR)
{ {
scanNum++; scanNum++;
} }
if(scanNum==1 || !GlobalVar.GRR) if (scanNum == 1 || !GlobalVar.GRR)
{ {
if(GlobalVar.EnableVirtuleBarCode) if (GlobalVar.EnableVirtuleBarCode)
{ {
List<TurnoverTraySlot> slots = TurnoverTrayManager.Instance.GetSlots(ETurnoverTraySlotType.WaitTest, ETurnoverTraySlotStatus.Have); List<TurnoverTraySlot> slots = TurnoverTrayManager.Instance.GetSlots(ETurnoverTraySlotType.WaitTest, ETurnoverTraySlotStatus.Have);
foreach (var slot in slots) foreach (var slot in slots)
@ -1740,83 +1824,6 @@ namespace Rs.MotionPlat.Flow
} }
} }
if (LoadAndUnloadTask.Instance.GetUnDealedTask().Count > 0)
{
StockTrayToTurnoverTray = !StockTrayToTurnoverTray;
flowStep = EDischargeFlowStep.;
}
else
{
flowStep = EDischargeFlowStep.;
}
}
break;
case EDischargeFlowStep.:
errCode = AxisControl.LoadX.MovePos(SysConfigParam.GetValue<double>("LoadXStartPos"), GlobalVar.WholeSpeed);
if(errCode== ErrorCode.Ok || GlobalVar.VirtualAxis)
{
//AxisControl.NozzleZ1.Home();
//AxisControl.NozzleZ2.Home();
//AxisControl.NozzleZ3.Home();
//AxisControl.NozzleZ4.Home();
//AxisControl.NozzleZ5.Home();
//AxisControl.NozzleZ6.Home();
//AxisControl.NozzleZ7.Home();
//AxisControl.NozzleZ8.Home();
//AxisControl.NozzleR1.Home();
//AxisControl.NozzleR2.Home();
//AxisControl.NozzleR3.Home();
//AxisControl.NozzleR4.Home();
//AxisControl.NozzleR5.Home();
//AxisControl.NozzleR6.Home();
//AxisControl.NozzleR7.Home();
//AxisControl.NozzleR8.Home();
errCode = AxisControl.LoadY.MovePos(SysConfigParam.GetValue<double>("LoadYStartPos"), GlobalVar.WholeSpeed);
if(errCode== ErrorCode.Ok || GlobalVar.VirtualAxis)
{
ZRHomeFlow.Instance.GoHome();
if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
}
logInfo =GetClassName()+ $"排料任务结束到安全位";
MessageQueue.Instance.Insert(logInfo);
flowStep = EDischargeFlowStep.;
}
else
{
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadY, errCode);
}
}
else
{
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
}
break;
case EDischargeFlowStep.:
if(Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{
logInfo = GetClassName()+ $"任务结束已回到安全位";
MessageQueue.Instance.Insert(logInfo);
if (TestCenter.Instance.LoadResult())
{
logInfo = GetClassName()+ $"通知中控任务完成";
MessageQueue.Instance.Insert(logInfo);
LoadAndUnloadTask.Instance.Clear();
logInfo = GetClassName()+$"任务完成,清除任务";
MessageQueue.Instance.Insert(logInfo);
}
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting);
flowStep = EDischargeFlowStep.;
}
break;
default:
break;
}
}
/// <summary> /// <summary>
/// 取料完成后更新吸嘴状态 /// 取料完成后更新吸嘴状态
/// </summary> /// </summary>
@ -1910,4 +1917,5 @@ namespace Rs.MotionPlat.Flow
return $"{trayType}盘{slotIndex+1}穴位"; return $"{trayType}盘{slotIndex+1}穴位";
} }
} }
} }

@ -465,6 +465,7 @@ namespace Rs.AutoDischarge.V3.Flow
{ {
finished = false; finished = false;
} }
actionFinishedEvent.Reset();
IAxis StockFlow = AxisControl.GetAxis($"StockFlow{(int)m_stockType}"); IAxis StockFlow = AxisControl.GetAxis($"StockFlow{(int)m_stockType}");
logInfo = GetClassName() + $"{GetTrayName()} 料仓收到下料任务"; logInfo = GetClassName() + $"{GetTrayName()} 料仓收到下料任务";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
@ -679,6 +680,7 @@ namespace Rs.AutoDischarge.V3.Flow
} }
Thread.Sleep(10); Thread.Sleep(10);
} }
actionFinishedEvent.Set();
return true; return true;
} }

@ -69,9 +69,30 @@ namespace Rs.MotionPlat.Flow.SubFlow
TakeTrayFlow.Instance.Take(ETrayType.Ng, ETrayType.Input, () => { TakeTrayFlow.Instance.Take(ETrayType.Ng, ETrayType.Input, () => {
StockManager.Instance.GetStock(ETrayType.Ng).ChangeStatus(EStockTrayStatus.Empty); StockManager.Instance.GetStock(ETrayType.Ng).ChangeStatus(EStockTrayStatus.Empty);
}, null, () =>{ }, null, () =>{
Task.Run(() => { Task.Run(() => {
if (Ops.IsOn("4号料仓缺盘光电检测"))//如果还有需要搬运的料盘
StockManager.Instance.GetStock(ETrayType.Input).Unload(EStockTrayUnLoadMode.Whole, null); StockManager.Instance.GetStock(ETrayType.Input).Unload(EStockTrayUnLoadMode.Whole, null);
else
StockManager.Instance.GetStock(ETrayType.Input).Load(EStockTrayLoadMode.AfterTakeTray, () =>
{
StockManager.Instance.GetStock(ETrayType.Input).ChangeStatus(EStockTrayStatus.Loaded, true);
});
});
bool needTake = false;
Task.Run(() =>
{
if (Ops.IsOn("4号料仓缺盘光电检测"))//如果还有需要搬运的料盘
{
needTake = true;
StockManager.Instance.GetStock(ETrayType.Ng).Load(EStockTrayLoadMode.Whole, null);
}
}); });
Thread.Sleep(1000);
StockManager.Instance.GetStock(ETrayType.Input).WaitFinished();
if(needTake) {
StockManager.Instance.GetStock(ETrayType.Ng).WaitFinished();
}
}); });
} }
} }

@ -130,6 +130,7 @@ namespace Rs.MotionPlat.Flow
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Busying); MachineManage.Instance.SetLoadUnloadStatus(ERunState.Busying);
NgTrayToInputTrayFlow.Instance.MoveToInput(); NgTrayToInputTrayFlow.Instance.MoveToInput();
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting); MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting);
Ops.Stop();
break; break;
case EInstruction.TestFinished: case EInstruction.TestFinished:
MessageQueue.Instance.Insert("测试完成:"+JsonConvert.SerializeObject(schedule, new StringEnumConverter())); MessageQueue.Instance.Insert("测试完成:"+JsonConvert.SerializeObject(schedule, new StringEnumConverter()));

Loading…
Cancel
Save