优化装机

master
lhiven 10 months ago
parent 96b171d016
commit d3053e5fde

@ -30,19 +30,19 @@ namespace Rs.MotionPlat.Commom
} }
else else
{ {
alarmEntity = AlarmCollection.Get(AlarmConstID.LoadY2); alarmEntity = AlarmCollection.Get(AlarmConstID.LoadY2).Transform(errCode.ToString());
Msgbox.ShowDialog(alarmEntity, EButtonType.Retry); Msgbox.ShowDialog(alarmEntity, EButtonType.Retry);
} }
} }
else else
{ {
alarmEntity = AlarmCollection.Get(AlarmConstID.LoadY1); alarmEntity = AlarmCollection.Get(AlarmConstID.LoadY1).Transform(errCode.ToString());
Msgbox.ShowDialog(alarmEntity, EButtonType.Retry); Msgbox.ShowDialog(alarmEntity, EButtonType.Retry);
} }
} }
else else
{ {
alarmEntity = AlarmCollection.Get(AlarmConstID.LoadX); alarmEntity = AlarmCollection.Get(AlarmConstID.LoadX).Transform(errCode.ToString());
Msgbox.ShowDialog(alarmEntity, EButtonType.Retry); Msgbox.ShowDialog(alarmEntity, EButtonType.Retry);
} }
return false; return false;

@ -552,9 +552,9 @@ namespace Rs.MotionPlat.Flow
// || (num==0) // || (num==0)
// ||(NozzleManager.GetToTestNozzle() == null))) // ||(NozzleManager.GetToTestNozzle() == null)))
if(tounloadNum == 3 if(tounloadNum == 3
|| num == 0 || (num == 0 && NozzleManager.GetToTestNozzle() == null)
//|| NozzleManager.GetToTestNozzle() == null //|| NozzleManager.GetToTestNozzle() == null
) )//吸嘴上有3个待下的料开始下料治具中没有料同时吸嘴上没有待测的料开始下料
{ {
logInfo =GetClassName()+ $"clear:{GlobalVar.Clear},tounloadnum:{tounloadNum},num:{num}"; logInfo =GetClassName()+ $"clear:{GlobalVar.Clear},tounloadnum:{tounloadNum},num:{num}";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
@ -692,6 +692,11 @@ namespace Rs.MotionPlat.Flow
else else
{ {
//料盘放满了,更换料盘 //料盘放满了,更换料盘
double curLoadX = Ops.GetCurPosition(AxisControl.LoadX);
if (curLoadX - GlobalVar.FixtureSafePosX > 50)
{
DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToStock);
}
DischargeModuleGoSafePosFlow.Instance.GoSafePostion(); DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok, true, true); TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok, true, true);
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave); GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
@ -755,7 +760,13 @@ namespace Rs.MotionPlat.Flow
{ {
if(TestFixtureManager.Instance.GetHaveProductFixtureList().Count()==0) if(TestFixtureManager.Instance.GetHaveProductFixtureList().Count()==0)
{ {
flowStep = EDischargeFlowStep.; double curLoadX = Ops.GetCurPosition(AxisControl.LoadX);
if (curLoadX - GlobalVar.FixtureSafePosX > 50)
{
DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToStock);
}
DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.Stock);
flowStep = EDischargeFlowStep.;
} }
else else
{ {
@ -773,25 +784,26 @@ namespace Rs.MotionPlat.Flow
#endregion #endregion
case EDischargeFlowStep.: //case EDischargeFlowStep.工作完成到安全位:
targetPosition.X = GlobalVar.DischargeSafePostionX; // targetPosition.X = GlobalVar.DischargeSafePostionX;
targetPosition.Y1 = GlobalVar.StockSideY1; // targetPosition.Y1 = GlobalVar.StockSideY1;
targetPosition.Y2 = GlobalVar.DischargeSafePostionY2; // targetPosition.Y2 = GlobalVar.DischargeSafePostionY2;
if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed))
{ // if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed))
flowStep = EDischargeFlowStep.; // {
} // flowStep = EDischargeFlowStep.等待工作完成到安全位;
break; // }
case EDischargeFlowStep.: // break;
if(Ops.IsStop("LoadX", "LoadY1", "LoadY2")) //case EDischargeFlowStep.等待工作完成到安全位:
{ // if(Ops.IsStop("LoadX", "LoadY1", "LoadY2"))
AxisPosPrint.PrintXY1Y2CurrentPos("运动已停止,",GetClassName()); // {
if(AxisArrived.LoadXY1Y2IsArrived(targetPosition.X,targetPosition.Y1,targetPosition.Y2)) // AxisPosPrint.PrintXY1Y2CurrentPos("运动已停止,",GetClassName());
{ // if(AxisArrived.LoadXY1Y2IsArrived(targetPosition.X,targetPosition.Y1,targetPosition.Y2))
flowStep = EDischargeFlowStep.; // {
} // flowStep = EDischargeFlowStep.工作完成收料;
} // }
break; // }
// break;
case EDischargeFlowStep.: case EDischargeFlowStep.:
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok,true,true); TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok,true,true);
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Input); TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Input);

@ -234,18 +234,37 @@ namespace Rs.MotionPlat.Flow.SubFlow
else else
{ {
alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform(curNozzle.NozzleIndex, curFixture.Index); alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform(curNozzle.NozzleIndex, curFixture.Index);
EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Recheck | EButtonType.Skip, true); if(alarmEntity!=null)
if(buttonSelect== EButtonType.Skip)
{ {
curNozzle.VacSuction(EIoOperate.Close, GetClassName()); logInfo = alarmEntity.CN;
curNozzle.Product = null; MessageQueue.Instance.Warn(logInfo);
curNozzle.Status = ENozzleStatus.IDLE; EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Recheck | EButtonType.Skip | EButtonType.Retry, true);
curFixture.Clear(); if (buttonSelect == EButtonType.Skip)
GlobalTray.NozzleTray.ChangeStatus(curNozzle.NozzleIndex, ESlotStatus.NotHave); {
finished = true; MessageQueue.Instance.Insert($"{GetClassName()}选择了跳过");
flowStep = EFixtureTakeFlowStep.; curNozzle.VacSuction(EIoOperate.Close, GetClassName());
curNozzle.Product = null;
curNozzle.Status = ENozzleStatus.IDLE;
curFixture.Clear();
GlobalTray.NozzleTray.ChangeStatus(curNozzle.NozzleIndex, ESlotStatus.NotHave);
finished = true;
flowStep = EFixtureTakeFlowStep.;
}
else if (buttonSelect == EButtonType.Retry)
{
MessageQueue.Instance.Insert($"{GetClassName()}选择了重试");
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
flowStep = EFixtureTakeFlowStep.1;
}
else if (buttonSelect == EButtonType.Retry)
{
MessageQueue.Instance.Insert($"{GetClassName()}选择了重新检测真空");
}
}
else
{
Msg.ShowError("Translated document cann't find item 治具取料失败真空报警");
} }
//Msgbox.ShowTipDialog(EButtonType.Recheck, $"吸嘴{curNozzle.NozzleIndex}从治具{curFixture.Index}取料时真空检测异常,请处理","vac error",true);
} }
break; break;

@ -31,6 +31,8 @@ namespace Rs.MotionPlat.Flow.SubFlow
public class StockTakeFlow public class StockTakeFlow
{ {
bool finished = true; bool finished = true;
Nozzle curNozzle = null;
TraySlot waitTakeProductSlot = null;
EStockTakeFlowStep flowStep = EStockTakeFlowStep.; EStockTakeFlowStep flowStep = EStockTakeFlowStep.;
private StockTakeFlow() private StockTakeFlow()
{ {
@ -67,8 +69,6 @@ namespace Rs.MotionPlat.Flow.SubFlow
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
string logInfo = string.Empty; string logInfo = string.Empty;
TargetPosition targetPosition = new TargetPosition(); TargetPosition targetPosition = new TargetPosition();
Nozzle curNozzle = null;
TraySlot waitTakeProductSlot = null;
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop) if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop)
@ -118,7 +118,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
if (GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed)) if (GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed))
{ {
AxisPosPrint.PrintXY1Y2TargetPos($"到料仓{waitTakeProductSlot.Index}号穴位取料位上方,", targetPosition, GetClassName()); AxisPosPrint.PrintXY1Y2TargetPos($"{WhatNozzleIndex()}到料仓{WhatTraySlot()}取料位上方,", targetPosition, GetClassName());
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
} }
} }
@ -130,7 +130,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
AxisPosPrint.PrintXY1Y2CurrentPos("轴XY1Y2已停止运动,", GetClassName()); AxisPosPrint.PrintXY1Y2CurrentPos("轴XY1Y2已停止运动,", GetClassName());
if (AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2)) if (AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2))
{ {
AxisPosPrint.PrintXY1Y2CurrentPos("已运动到料仓取料位上方,", GetClassName()); AxisPosPrint.PrintXY1Y2CurrentPos($"{WhatNozzleIndex()}已运动到料仓{WhatTraySlot()}取料位上方,", GetClassName());
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
} }
else else
@ -143,7 +143,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
targetPosition.StockZ = NozzleManager.GetNozzleToTrayTakeProductPos(ETrayType.Input, curNozzle.NozzleIndex); targetPosition.StockZ = NozzleManager.GetNozzleToTrayTakeProductPos(ETrayType.Input, curNozzle.NozzleIndex);
if (NozzleManager.Go(curNozzle, targetPosition.StockZ, GlobalVar.WholeSpeed)) if (NozzleManager.Go(curNozzle, targetPosition.StockZ, GlobalVar.WholeSpeed))
{ {
logInfo = $"{GetClassName()}到料仓取料位下方,tz:{targetPosition.StockZ}"; logInfo = $"{GetClassName()}{WhatNozzleIndex()}到料仓{WhatTraySlot()}取料位下方,tz:{targetPosition.StockZ}";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
} }
@ -151,8 +151,8 @@ namespace Rs.MotionPlat.Flow.SubFlow
case EStockTakeFlowStep.: case EStockTakeFlowStep.:
if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}")) if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}"))
{ {
Thread.Sleep(200); Thread.Sleep(100);
logInfo = $"{GetClassName()} 已运动到料仓取料位下方"; logInfo = $"{GetClassName()}{WhatNozzleIndex()}已运动到料仓{WhatTraySlot()}取料位下方:{curNozzle.GetCurrentPos()}";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
if (!GlobalVar.RunSpace) if (!GlobalVar.RunSpace)
{ {
@ -173,7 +173,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
case EStockTakeFlowStep.: case EStockTakeFlowStep.:
if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}")) if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}"))
{ {
logInfo =$"{GetClassName()} 料仓取料完成已抬起"; logInfo =$"{GetClassName()} 料仓取料完成已抬起:{curNozzle.GetCurrentPos()}";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
} }
@ -195,11 +195,11 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
curNozzle.Status = ENozzleStatus.ToTest; curNozzle.Status = ENozzleStatus.ToTest;
//curNozzle.Status = ENozzleStatus.ToUnload; //curNozzle.Status = ENozzleStatus.ToUnload;
GlobalTray.NozzleTray.ChangeStatus(curNozzle.NozzleIndex, ESlotStatus.Have); curNozzle.ChangeStatus(ESlotStatus.Have);
GlobalTray.InputTray.ChangeStatus(waitTakeProductSlot.Index, ESlotStatus.NotHave); GlobalTray.InputTray.ChangeStatus(waitTakeProductSlot.Index, ESlotStatus.NotHave);
if(curNozzle.Product!=null) if(curNozzle.Product!=null)
{ {
logInfo = $"{GetClassName()} from r{waitTakeProductSlot.Row + 1}c{waitTakeProductSlot.Column + 1} 穴位索引:{waitTakeProductSlot.Index} 产品:{curNozzle.Product.SN}被吸嘴{curNozzle.NozzleIndex}取料完成,"; logInfo = $"{GetClassName()} from r{waitTakeProductSlot.Row + 1}c{waitTakeProductSlot.Column + 1} 穴位索引:{WhatTraySlot()} 产品:{curNozzle.Product.SN}被{WhatNozzleIndex()}取料完成,";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
} }
@ -252,5 +252,23 @@ namespace Rs.MotionPlat.Flow.SubFlow
{ {
return $"{nameof(StockTakeFlow)}-"; return $"{nameof(StockTakeFlow)}-";
} }
/// <summary>
/// 获取几号吸嘴
/// </summary>
/// <returns></returns>
private string WhatNozzleIndex()
{
return $"{curNozzle.NozzleIndex}号吸嘴";
}
/// <summary>
/// 获取料仓的几号穴位
/// </summary>
/// <returns></returns>
private string WhatTraySlot()
{
return $"{waitTakeProductSlot.Index}号穴位";
}
} }
} }

@ -129,6 +129,24 @@ namespace Rs.MotionPlat.Commom
{ {
return Ops.IsOn($"吸料真空{NozzleIndex}检测"); return Ops.IsOn($"吸料真空{NozzleIndex}检测");
} }
/// <summary>
/// 获取当前吸嘴的位置
/// </summary>
/// <returns></returns>
public double GetCurrentPos()
{
return Ops.GetCurPosition(NozzleName);
}
/// <summary>
/// 切换吸嘴的状态
/// </summary>
/// <param name="status"></param>
public void ChangeStatus(ESlotStatus status)
{
GlobalTray.NozzleTray.ChangeStatus(NozzleIndex, status);
}
} }
public static class NozzleManager public static class NozzleManager

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
// //
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
[assembly: AssemblyVersion("1.20.24.03")] [assembly: AssemblyVersion("1.20.24.06")]
//[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]

Loading…
Cancel
Save