增加重测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,42 +102,52 @@ namespace Rs.MotionPlat.Flow
switch (step) switch (step)
{ {
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
//double centerX = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterX"); if(DischargeFlow.Instance.XYCanMove())
//double centerY = SysConfigParam.GetValue<double>($"Tray{m_fromTray.ToString()}CenterY");
double cameraCenterX = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterX");
double cameraCenterY = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterY");
targetX = SysConfigParam.GetValue<double>($"{m_fromTray.ToString()}TakeTrayX");
targetY = SysConfigParam.GetValue<double>($"{m_fromTray.ToString()}TakeTrayY");
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); //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");
double cameraCenterY = SysConfigParam.GetValue<double>("ClampCenter2UpCameraCenterY");
targetX = SysConfigParam.GetValue<double>($"{m_fromTray.ToString()}TakeTrayX");
targetY = SysConfigParam.GetValue<double>($"{m_fromTray.ToString()}TakeTrayY");
Motion.ErrorCode errCode = AxisControl.LoadX.MovePos(targetX + cameraCenterX, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis) if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{ {
if (GlobalVar.VirtualAxis) errCode = AxisControl.LoadY.MovePos(targetY + cameraCenterY, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{ {
Thread.Sleep(GlobalVar.VirtualAxisMoveTime); if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
}
logInfo = GetClassName() + $"准备运动到{m_fromTray}料仓取料盘位上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
else
{
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadY, errCode);
} }
logInfo =GetClassName()+ $"准备运动到{m_fromTray}料仓取料盘位上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
} }
else else
{ {
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadY, errCode); MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
} }
} }
else else
{ {
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode); Msg.ShowError("周转Y轴不在安全位请移动到安全后点击确定");
} }
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis) if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{ {
logInfo = GetClassName() + $"已运动到{m_fromTray}料仓取料盘位上方"; if(Ops.IsArrived(AxisControl.LoadX,AxisControl.LoadY))
MessageQueue.Instance.Insert(logInfo); {
step = ETakeTrayFlowStep.; logInfo = GetClassName() + $"已运动到{m_fromTray}料仓取料盘位上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
} }
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
@ -254,50 +265,60 @@ namespace Rs.MotionPlat.Flow
} }
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
//if(GlobalVar.RunSpace) if (DischargeFlow.Instance.XYCanMove())
//{
// Thread.Sleep(2000);
//}
//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");
targetX = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayX");
targetY = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayY");
errCode = AxisControl.LoadX.MovePos(targetX+ cameraCenterX, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{ {
errCode = AxisControl.LoadY.MovePos(targetY+ cameraCenterY - 2, GlobalVar.TakeTraySpeed); //if(GlobalVar.RunSpace)
//{
// Thread.Sleep(2000);
//}
//centerX = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterX");
//centerY = SysConfigParam.GetValue<double>($"Tray{m_toTray.ToString()}CenterY");
takeTrayFinishedEvent?.Invoke();
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");
ErrorCode errCode = AxisControl.LoadX.MovePos(targetX + cameraCenterX, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis) if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{ {
if (GlobalVar.VirtualAxis) errCode = AxisControl.LoadY.MovePos(targetY + cameraCenterY - 2, GlobalVar.TakeTraySpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{ {
Thread.Sleep(GlobalVar.VirtualAxisMoveTime); if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
}
logInfo = GetClassName() + $"到{toTray}料仓放料盘上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
else
{
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadY, errCode);
} }
logInfo = GetClassName()+$"到{toTray}料仓放料盘上方";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
} }
else else
{ {
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadY, errCode); MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode);
} }
} }
else else
{ {
MsgBox.ShowAxisAlarmDialog(AxisControl.LoadX, errCode); Msg.ShowError("周转Y轴不在安全位请移动到安全后点击确定");
} }
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:
if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis) if (Ops.IsStop("LoadX", "LoadY") || GlobalVar.VirtualAxis)
{ {
logInfo = GetClassName() + $"已运动到{toTray}料仓放料盘上方"; if (Ops.IsArrived(AxisControl.LoadX, AxisControl.LoadY))
MessageQueue.Instance.Insert(logInfo); {
arrivedDumpPosEvent?.Invoke(); logInfo = GetClassName() + $"已运动到{toTray}料仓放料盘上方";
step = ETakeTrayFlowStep.; MessageQueue.Instance.Insert(logInfo);
arrivedDumpPosEvent?.Invoke();
step = ETakeTrayFlowStep.;
}
} }
break; break;
case ETakeTrayFlowStep.: case ETakeTrayFlowStep.:

@ -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,15 +212,18 @@ namespace Rs.MotionPlat.SysConfig
tostock = ETrayType.Multi; tostock = ETrayType.Multi;
if (btnToEmpty2.Checked) if (btnToEmpty2.Checked)
tostock = ETrayType.Empty2; tostock = ETrayType.Empty2;
StockManager.Instance.GetStock(fromstock).Load(EStockTrayLoadMode.Whole, null); Task.Run(() => {
TakeTrayFlow.Instance.Take(fromstock, tostock,
null, StockManager.Instance.GetStock(fromstock).Load(EStockTrayLoadMode.Whole, null);
() => { TakeTrayFlow.Instance.Take(fromstock, tostock,
StockManager.Instance.GetStock(fromstock).ChangeStatus(EStockTrayStatus.Unloaded); null,
}, () => {
() => { StockManager.Instance.GetStock(fromstock).ChangeStatus(EStockTrayStatus.Unloaded);
StockManager.Instance.GetStock(tostock).Unload(EStockTrayUnLoadMode.Whole, null); },
}); () => {
StockManager.Instance.GetStock(tostock).Unload(EStockTrayUnLoadMode.Whole, null);
});
});
} }
} }
} }

Loading…
Cancel
Save