增加重测NG流程

搬运料盘增加周转轴防呆
master
lhiven 1 year ago
parent 2224794e85
commit b9ea59e857

@ -1887,7 +1887,7 @@ namespace Rs.MotionPlat.Flow
return false; return false;
return true; return true;
} }
private bool XYCanMove() public bool XYCanMove()
{ {
if (!CanGoTurnoverTray()) if (!CanGoTurnoverTray())
return false; return false;

@ -1,6 +1,7 @@
using Rs.AutoDischarge.V3.Flow; using Rs.AutoDischarge.V3.Flow;
using Rs.Controls; using Rs.Controls;
using Rs.Framework; using Rs.Framework;
using Rs.Motion;
using Rs.MotionPlat.Commom; using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow.Space; using Rs.MotionPlat.Flow.Space;
using System; using System;
@ -101,6 +102,8 @@ namespace Rs.MotionPlat.Flow
switch (step) switch (step)
{ {
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if(DischargeFlow.Instance.XYCanMove())
{
//double centerX = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterX"); //double centerX = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterX");
//double centerY = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterY"); //double centerY = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterY");
double cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX"); double cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX");
@ -130,14 +133,22 @@ namespace Rs.MotionPlat.Flow
{ {
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode); MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
} }
}
else
{
Msg.ShowError("周转Y轴不在安全位请移动到安全后点击确定");
}
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis) if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{
if(Ops.IsArrived(AxisControl.LoadX,AxisControl.LoadY))
{ {
logInfo = GetClassName() + $"已运动到{m_fromTray}料仓取料盘位上方"; logInfo = GetClassName() + $"已运动到{m_fromTray}料仓取料盘位上方";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.; step = ETakeTrayFlowStep.;
} }
}
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if (StockManager.Instance.GetStock(m_fromTray).Status == EStockTrayStatus.Loaded) if (StockManager.Instance.GetStock(m_fromTray).Status == EStockTrayStatus.Loaded)
@ -254,6 +265,8 @@ namespace Rs.MotionPlat.Flow
} }
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if (DischargeFlow.Instance.XYCanMove())
{
//if(GlobalVar.RunSpace) //if(GlobalVar.RunSpace)
//{ //{
// Thread.Sleep(2000); // Thread.Sleep(2000);
@ -261,12 +274,12 @@ namespace Rs.MotionPlat.Flow
//centerX = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterX"); //centerX = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterX");
//centerY = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterY"); //centerY = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterY");
takeTrayFinishedEvent?.Invoke(); takeTrayFinishedEvent?.Invoke();
cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX"); double cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX");
cameraCenterY = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterY"); double cameraCenterY = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterY");
targetX = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayX"); targetX = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayX");
targetY = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayY"); targetY = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayY");
errCode = AxisControl.LoadX.MovePos(targetX+ cameraCenterX, GlobalVar.TakeTraySpeed); ErrorCode errCode = AxisControl.LoadX.MovePos(targetX + cameraCenterX, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis) if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{ {
errCode = AxisControl.LoadY.MovePos(targetY + cameraCenterY - 2, GlobalVar.TakeTraySpeed); errCode = AxisControl.LoadY.MovePos(targetY + cameraCenterY - 2, GlobalVar.TakeTraySpeed);
@ -290,15 +303,23 @@ namespace Rs.MotionPlat.Flow
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode); MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
} }
}
else
{
Msg.ShowError("周转Y轴不在安全位请移动到安全后点击确定");
}
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis) if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{
if (Ops.IsArrived(AxisControl.LoadX, AxisControl.LoadY))
{ {
logInfo = GetClassName() + $"已运动到{toTray}料仓放料盘上方"; logInfo = GetClassName() + $"已运动到{toTray}料仓放料盘上方";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
arrivedDumpPosEvent?.Invoke(); arrivedDumpPosEvent?.Invoke();
step = ETakeTrayFlowStep.; step = ETakeTrayFlowStep.;
} }
}
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if ((StockManager.Instance.GetStock(m_toTray).Status == EStockTrayStatus.Unloaded|| StockManager.Instance.GetStock(m_toTray).Status == EStockTrayStatus.Empty) || GlobalVar.VirtualAxis) if ((StockManager.Instance.GetStock(m_toTray).Status == EStockTrayStatus.Unloaded|| StockManager.Instance.GetStock(m_toTray).Status == EStockTrayStatus.Empty) || GlobalVar.VirtualAxis)

@ -48,8 +48,6 @@ namespace Rs.MotionPlat.Flow.SubFlow
}); });
}); });
} }
Thread.Sleep(5000);
while (true) while (true)
{ {
if(Ops.IsOff("4号料仓料盘到位光电检测"))//如果ng料仓处没有料盘 if(Ops.IsOff("4号料仓料盘到位光电检测"))//如果ng料仓处没有料盘
@ -68,13 +66,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
logInfo = "start take ng tray to input stock"; logInfo = "start take ng tray to input stock";
MessageQueue.Instance.Insert(logInfo ); MessageQueue.Instance.Insert(logInfo );
TakeTrayFlow.Instance.Take(ETrayType.Ng, ETrayType.Input, null, null, () =>{ TakeTrayFlow.Instance.Take(ETrayType.Ng, ETrayType.Input, () => {
StockManager.Instance.GetStock(ETrayType.Ng).ChangeStatus(EStockTrayStatus.Empty);
}, null, () =>{
Task.Run(() => { Task.Run(() => {
StockManager.Instance.GetStock(ETrayType.Input).Unload(EStockTrayUnLoadMode.Whole, null); StockManager.Instance.GetStock(ETrayType.Input).Unload(EStockTrayUnLoadMode.Whole, null);
}); });
}); });
} }
Ops.Stop();
} }
} }
} }

@ -126,9 +126,10 @@ namespace Rs.MotionPlat.Flow
switch (eInstructioneInstruction) switch (eInstructioneInstruction)
{ {
case EInstruction.TransferSiloTray: case EInstruction.TransferSiloTray:
//ReportToTestCenter(schedule); ReportToTestCenter(schedule);
//MachineManage.Instance.SetLoadUnloadStatus(ERunState.Busying); MachineManage.Instance.SetLoadUnloadStatus(ERunState.Busying);
//NgTrayToInputTrayFlow.Instance.MoveToInput(); NgTrayToInputTrayFlow.Instance.MoveToInput();
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting);
break; break;
case EInstruction.TestFinished: case EInstruction.TestFinished:
MessageQueue.Instance.Insert("测试完成:"+JsonConvert.SerializeObject(schedule, new StringEnumConverter())); MessageQueue.Instance.Insert("测试完成:"+JsonConvert.SerializeObject(schedule, new StringEnumConverter()));

@ -212,6 +212,8 @@ namespace Rs.MotionPlat.SysConfig
tostock = ETrayType.Multi; tostock = ETrayType.Multi;
if (btnToEmpty2.Checked) if (btnToEmpty2.Checked)
tostock = ETrayType.Empty2; tostock = ETrayType.Empty2;
Task.Run(() => {
StockManager.Instance.GetStock(fromstock).Load(EStockTrayLoadMode.Whole, null); StockManager.Instance.GetStock(fromstock).Load(EStockTrayLoadMode.Whole, null);
TakeTrayFlow.Instance.Take(fromstock, tostock, TakeTrayFlow.Instance.Take(fromstock, tostock,
null, null,
@ -221,6 +223,7 @@ namespace Rs.MotionPlat.SysConfig
() => { () => {
StockManager.Instance.GetStock(tostock).Unload(EStockTrayUnLoadMode.Whole, null); StockManager.Instance.GetStock(tostock).Unload(EStockTrayUnLoadMode.Whole, null);
}); });
});
} }
} }
} }

Loading…
Cancel
Save