取料失败自动回原

develop
lhiven 3 months ago
parent 6bfe88107c
commit 2d7f1dcfb0

@ -452,7 +452,8 @@ namespace Rs.MotionPlat.Flow
else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail) else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)
{ {
Nozzle idleNozzle = NozzleManager.GetIdelNozzle(); Nozzle idleNozzle = NozzleManager.GetIdelNozzle();
if (!GlobalVar.ScanFailToTest) //if (!GlobalVar.ScanFailToTest)
if(false)
{ {
StockTakeFlow.Instance.Take(ETrayType.Input, ret.SlotIndex, idleNozzle.NozzleIndex); StockTakeFlow.Instance.Take(ETrayType.Input, ret.SlotIndex, idleNozzle.NozzleIndex);
//放料 //放料

@ -1,5 +1,6 @@
using Rs.Controls; using Rs.Controls;
using Rs.Framework; using Rs.Framework;
using Rs.Motion.Base;
using Rs.MotionPlat.Commom; using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys; using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Flow.Common; using Rs.MotionPlat.Flow.Common;
@ -32,6 +33,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
public class FixtureTakeFlow public class FixtureTakeFlow
{ {
int takeNum = 1;
bool finished = true; bool finished = true;
EFixtureTakeFlowStep flowStep = EFixtureTakeFlowStep.; EFixtureTakeFlowStep flowStep = EFixtureTakeFlowStep.;
public FixtureTakeFlow() public FixtureTakeFlow()
@ -58,6 +60,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
AlarmEntity alarmEntity = new AlarmEntity(); AlarmEntity alarmEntity = new AlarmEntity();
public void Take(int fixtureIndex,int nozzleIndex=-1,bool btest=false, bool needStop = true) public void Take(int fixtureIndex,int nozzleIndex=-1,bool btest=false, bool needStop = true)
{ {
takeNum = 1;
if (finished) if (finished)
finished = false; finished = false;
else else
@ -246,38 +249,60 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform(curNozzle.NozzleIndex, curFixture.Index); if (takeNum < 2)
if(alarmEntity!=null)
{ {
logInfo = alarmEntity.CN; takeNum++;
MessageQueue.Instance.Warn(logInfo); IAxis homeAxis = AxisControl.GetAxis($"NozzleZ{curNozzle.NozzleIndex}");
EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Recheck | EButtonType.Skip | EButtonType.Retry, true); if (homeAxis != null)
if (buttonSelect == EButtonType.Skip)
{ {
MessageQueue.Instance.Insert($"{GetClassName()}选择了跳过"); homeAxis.Home();
curNozzle.VacSuction(EIoOperate.Close, GetClassName()); Thread.Sleep(500);
curNozzle.Product = null; while (true)
curNozzle.Status = ENozzleStatus.IDLE; {
curFixture.Clear(); if (homeAxis.HomeStatus == Motion.EHomeStatus.Finished)
GlobalTray.NozzleTray.ChangeStatus(curNozzle.NozzleIndex, ESlotStatus.NotHave); {
finished = true; break;
flowStep = EFixtureTakeFlowStep.; }
Thread.Sleep(100);
}
} }
else if (buttonSelect == EButtonType.Retry) flowStep = EFixtureTakeFlowStep.;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform(curNozzle.NozzleIndex, curFixture.Index);
if (alarmEntity != null)
{ {
MessageQueue.Instance.Insert($"{GetClassName()}选择了重试"); logInfo = alarmEntity.CN;
curNozzle.VacSuction(EIoOperate.Close, GetClassName()); MessageQueue.Instance.Warn(logInfo);
flowStep = EFixtureTakeFlowStep.1; EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Recheck | EButtonType.Skip | EButtonType.Retry, true);
if (buttonSelect == EButtonType.Skip)
{
MessageQueue.Instance.Insert($"{GetClassName()}选择了跳过");
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 if (buttonSelect == EButtonType.Retry) else
{ {
MessageQueue.Instance.Insert($"{GetClassName()}选择了重新检测真空"); Msg.ShowError("Translated document cann't find item 治具取料失败真空报警");
} }
} }
else
{
Msg.ShowError("Translated document cann't find item 治具取料失败真空报警");
}
} }
break; break;

@ -1,5 +1,6 @@
using Rs.Controls; using Rs.Controls;
using Rs.Framework; using Rs.Framework;
using Rs.Motion.Base;
using Rs.MotionPlat.Commom; using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys; using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Flow.Common; using Rs.MotionPlat.Flow.Common;
@ -36,6 +37,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
/// </summary> /// </summary>
public class StockTakeFlow public class StockTakeFlow
{ {
int takeNum = 1;
bool finished = true; bool finished = true;
Nozzle curNozzle = null; Nozzle curNozzle = null;
TraySlot waitTakeProductSlot = null; TraySlot waitTakeProductSlot = null;
@ -68,7 +70,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
/// <param name="className"></param> /// <param name="className"></param>
public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, EStockScanBarcodeMode scanBarCodeMode= EStockScanBarcodeMode.Multi, ProductLocationResult locaResult=null,bool needStop=true) public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, EStockScanBarcodeMode scanBarCodeMode= EStockScanBarcodeMode.Multi, ProductLocationResult locaResult=null,bool needStop=true)
{ {
takeNum = 1;
if (finished) if (finished)
finished = false; finished = false;
else else
@ -252,56 +254,80 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
if(GlobalVar.BinTakeFailSkip && trayType== ETrayType.Input) if(takeNum<2)
{ {
logInfo = GetClassName() + $"{trayType} bin {waitTakeProductSlot.Index} take fail auto skip"; takeNum++;
MessageQueue.Instance.Insert(logInfo); IAxis homeAxis = AxisControl.GetAxis($"NozzleZ{curNozzle.NozzleIndex}");
curNozzle.VacBreak(EIoOperate.Close, GetClassName()); if (homeAxis != null)
curNozzle.VacSuction(EIoOperate.Close, GetClassName()); {
finished = true; homeAxis.Home();
flowStep = EStockTakeFlowStep.; Thread.Sleep(500);
while (true)
{
if (homeAxis.HomeStatus == Motion.EHomeStatus.Finished)
{
break;
}
Thread.Sleep(100);
}
}
flowStep = EStockTakeFlowStep.;
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform($"{curNozzle.NozzleIndex}", $"{waitTakeProductSlot.Row}", $"{waitTakeProductSlot.Column}", $"{waitTakeProductSlot.Index}");
EButtonType btnSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.EndInput | EButtonType.Retry | EButtonType.Skip | EButtonType.Recheck, true); if (GlobalVar.BinTakeFailSkip && trayType == ETrayType.Input)
switch (btnSelect)
{ {
case EButtonType.EndInput: logInfo = GetClassName() + $"{trayType} bin {waitTakeProductSlot.Index} take fail auto skip";
logInfo = GetClassName() + $"选择了结束上料"; MessageQueue.Instance.Insert(logInfo);
MessageQueue.Instance.Insert(logInfo); curNozzle.VacBreak(EIoOperate.Close, GetClassName());
GlobalVar.Clear = true; curNozzle.VacSuction(EIoOperate.Close, GetClassName());
finished = true; finished = true;
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
break; }
case EButtonType.Retry: else
logInfo = GetClassName() + $"选择了重试"; {
MessageQueue.Instance.Insert(logInfo); AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform($"{curNozzle.NozzleIndex}", $"{waitTakeProductSlot.Row}", $"{waitTakeProductSlot.Column}", $"{waitTakeProductSlot.Index}");
curNozzle.VacBreak(EIoOperate.Close, GetClassName()); EButtonType btnSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.EndInput | EButtonType.Retry | EButtonType.Skip | EButtonType.Recheck, true);
curNozzle.VacSuction(EIoOperate.Close, GetClassName()); switch (btnSelect)
//先把产品放下 {
//StockPlaceFlow.Instance.Place(ETrayType.Input, waitTakeProductSlot.Index, curNozzle.NozzleIndex); case EButtonType.EndInput:
flowStep = EStockTakeFlowStep.; logInfo = GetClassName() + $"选择了结束上料";
break; MessageQueue.Instance.Insert(logInfo);
case EButtonType.Recheck: GlobalVar.Clear = true;
logInfo = GetClassName() + $"选择了重新检查真空"; finished = true;
MessageQueue.Instance.Insert(logInfo); flowStep = EStockTakeFlowStep.;
flowStep = EStockTakeFlowStep.; break;
break; case EButtonType.Retry:
case EButtonType.Skip: logInfo = GetClassName() + $"选择了重试";
logInfo = GetClassName() + $"选择了跳过"; MessageQueue.Instance.Insert(logInfo);
curNozzle.VacBreak(EIoOperate.Close, GetClassName()); curNozzle.VacBreak(EIoOperate.Close, GetClassName());
curNozzle.VacSuction(EIoOperate.Close, GetClassName()); curNozzle.VacSuction(EIoOperate.Close, GetClassName());
MessageQueue.Instance.Insert(logInfo); //先把产品放下
finished = true; //StockPlaceFlow.Instance.Place(ETrayType.Input, waitTakeProductSlot.Index, curNozzle.NozzleIndex);
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
break; break;
case EButtonType.Recheck:
logInfo = GetClassName() + $"选择了重新检查真空";
MessageQueue.Instance.Insert(logInfo);
flowStep = EStockTakeFlowStep.;
break;
case EButtonType.Skip:
logInfo = GetClassName() + $"选择了跳过";
curNozzle.VacBreak(EIoOperate.Close, GetClassName());
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
MessageQueue.Instance.Insert(logInfo);
finished = true;
flowStep = EStockTakeFlowStep.;
break;
default: default:
break; break;
}
} }
} }
} }
break; break;
} }

Loading…
Cancel
Save