增加重测NG流程

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

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

@ -1,6 +1,7 @@
using Rs.AutoDischarge.V3.Flow;
using Rs.Controls;
using Rs.Framework;
using Rs.Motion;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow.Space;
using System;
@ -101,6 +102,8 @@ namespace Rs.MotionPlat.Flow
switch (step)
{
case ETakeTrayFlowStep.:
if(DischargeFlow.Instance.XYCanMove())
{
//double centerX = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterX");
//double centerY = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterY");
double cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX");
@ -110,14 +113,14 @@ namespace Rs.MotionPlat.Flow
Motion.ErrorCode errCode = AxisControl.LoadX.MovePos(targetX + cameraCenterX, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
errCode = AxisControl.LoadY.MovePos(targetY+ cameraCenterY, GlobalVar.TakeTraySpeed);
errCode = AxisControl.LoadY.MovePos(targetY + cameraCenterY, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
}
logInfo =GetClassName()+ $"准备运动到{m_fromTray}料仓取料盘位上方";
logInfo = GetClassName() + $"准备运动到{m_fromTray}料仓取料盘位上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
@ -130,14 +133,22 @@ namespace Rs.MotionPlat.Flow
{
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
}
}
else
{
Msg.ShowError("周转Y轴不在安全位请移动到安全后点击确定");
}
break;
case ETakeTrayFlowStep.:
if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{
if(Ops.IsArrived(AxisControl.LoadX,AxisControl.LoadY))
{
logInfo = GetClassName() + $"已运动到{m_fromTray}料仓取料盘位上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
}
break;
case ETakeTrayFlowStep.:
if (StockManager.Instance.GetStock(m_fromTray).Status == EStockTrayStatus.Loaded)
@ -254,6 +265,8 @@ namespace Rs.MotionPlat.Flow
}
break;
case ETakeTrayFlowStep.:
if (DischargeFlow.Instance.XYCanMove())
{
//if(GlobalVar.RunSpace)
//{
// Thread.Sleep(2000);
@ -261,22 +274,22 @@ namespace Rs.MotionPlat.Flow
//centerX = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterX");
//centerY = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterY");
takeTrayFinishedEvent?.Invoke();
cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX");
cameraCenterY = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterY");
double cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX");
double cameraCenterY = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterY");
targetX = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayX");
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)
{
errCode = AxisControl.LoadY.MovePos(targetY+ cameraCenterY - 2, GlobalVar.TakeTraySpeed);
errCode = AxisControl.LoadY.MovePos(targetY + cameraCenterY - 2, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
}
logInfo = GetClassName()+$"到{toTray}料仓放料盘上方";
logInfo = GetClassName() + $"到{toTray}料仓放料盘上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
@ -290,15 +303,23 @@ namespace Rs.MotionPlat.Flow
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
}
}
else
{
Msg.ShowError("周转Y轴不在安全位请移动到安全后点击确定");
}
break;
case ETakeTrayFlowStep.:
if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{
if (Ops.IsArrived(AxisControl.LoadX, AxisControl.LoadY))
{
logInfo = GetClassName() + $"已运动到{toTray}料仓放料盘上方";
MessageQueue.Instance.Insert(logInfo);
arrivedDumpPosEvent?.Invoke();
step = ETakeTrayFlowStep.;
}
}
break;
case ETakeTrayFlowStep.:
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)
{
if(Ops.IsOff("4号料仓料盘到位光电检测"))//如果ng料仓处没有料盘
@ -68,13 +66,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
}
logInfo = "start take ng tray to input stock";
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(() => {
StockManager.Instance.GetStock(ETrayType.Input).Unload(EStockTrayUnLoadMode.Whole, null);
});
});
}
Ops.Stop();
}
}
}

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

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

Loading…
Cancel
Save