优化排料放周转盘先检测真空,如果真空有效则不再检测粘料

master
lhiven 1 year ago
parent 8adb42119f
commit 46252f3642

@ -58,8 +58,8 @@ namespace Rs.MotionPlat.Flow
,
,
,
,
,
,
,
,
,
@ -1371,7 +1371,149 @@ namespace Rs.MotionPlat.Flow
{
logInfo = GetClassName()+$"排料吸嘴{curNozzle.NozzleIndex}号{WitchTrayWitchSlot(curNozzle.ToType, curNozzle.ToIndex)}放料完成已起位";
MessageQueue.Instance.Insert(logInfo);
flowStep = EDischargeFlowStep.;
if(curNozzle.ToType== TurnoverType.Turnover)
{
flowStep = EDischargeFlowStep.;
}
else
{
flowStep = EDischargeFlowStep.;
}
}
break;
case EDischargeFlowStep.:
if (curNozzle.ToType == TurnoverType.Turnover)
{
if (Ops.IsOn($"周转盘{curNozzle.ToIndex + 1}号穴位真空吸检测") || GlobalVar.RunSpace)
{
logInfo = GetClassName() + $"周转盘{curNozzle.ToIndex + 1}号穴位真空吸检测OK";
MessageQueue.Instance.Insert(logInfo);
flowStep = EDischargeFlowStep.;
}
else
{
//打开真空吸
curNozzle.VacSuction(EIoOperate.Open);
//如果粘料
if (curNozzle.HasProduct())
{
bool skip = false;
while (!skip)
{
//粘料报警,提示用户粘料,移动到安全位,或者点击跳过
//alarmInfo = $"排料{curNozzle.NozzleIndex}号吸嘴可能粘料,请查看吸嘴状态后处理";
alarmInfo = string.Format(AlarmCollection.GetAlarm(AlarmConstID.), curNozzle.NozzleIndex);
MessageQueue.Instance.Warn(GetClassName() + alarmInfo);
//TestCenterMessageBox.Show(AlarmConstID.NozzleTackinessAlarm, alarmInfo, MessageButtonManager.GetSkip_MoveToSafe_Button(), MessageButtonManager.GetSkip_MoveToSafe_ButtonText());
msgBox = MsgBox.ShowDialog(AlarmConstID., alarmInfo, MessageButtonManager.GetSkip_MoveToSafe_Button(), MessageButtonManager.GetSkip_MoveToSafe_ButtonText());// TestCenterMessageBox.WaitResult(AlarmConstID.NozzleTackinessAlarm);
switch (msgBox.Button)
{
case ETipButton.Skip:
logInfo = GetClassName() + "选择了跳过按钮";
MessageQueue.Instance.Insert(logInfo);
if (!curNozzle.HasProduct())
{
curNozzle.VacSuction(EIoOperate.Close);
curNozzle.Reset();
skip = true;
flowStep = EDischargeFlowStep.;
}
break;
case ETipButton.Yes:
logInfo = GetClassName() + "选择了移动到安全位按钮";
MessageQueue.Instance.Insert(logInfo);
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
break;
}
}
}
else
{
//如果没有粘料,说明产品放下去了,这个时候用相机检测产品是否在穴位种
UpCameraScanBarCodeFlow.Instance.ScanSingle(curNozzle.ToIndex + 1, true);
VisionResult vr = UpCameraScanBarCodeFlow.Instance.WaitSingle();
if (UpCameraScanBarCodeFlow.Instance.CheckResult(vr))
{
logInfo = GetClassName() + $"排料吸嘴{curNozzle.NozzleIndex}号SN={curNozzle.SN}放{WitchTrayWitchSlot(curNozzle.ToType, curNozzle.ToIndex)}";
MessageQueue.Instance.Insert(logInfo);
curNozzle.VacSuction(EIoOperate.Close);
flowStep = EDischargeFlowStep.;
}
else
{
//异常处理
bool exit = false;
Dictionary<ETipButton, string> buttons = new Dictionary<ETipButton, string>()
{
{ ETipButton.Retry,"重拍|Regrab" },
{ETipButton.Skip,"跳过|Skip" },
{ETipButton.Yes,"移动到安全位|MoveToSafePos" }
};
while (!exit)
{
//alarmInfo = $"周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常";
alarmInfo = string.Format(AlarmCollection.GetAlarm(AlarmConstID.), curNozzle.NozzleIndex, curNozzle.ToIndex + 1);
MessageQueue.Instance.Warn(GetClassName() + alarmInfo);
//TestCenterMessageBox.Show(AlarmConstID.TurnoverDumpFailAlarm, alarmInfo, ETipButton.Retry | ETipButton.Skip | ETipButton.Yes, buttons);
msgBox = MsgBox.ShowDialog(AlarmConstID., alarmInfo, ETipButton.Retry | ETipButton.Skip | ETipButton.Yes, buttons);// TestCenterMessageBox.WaitResult(AlarmConstID.TurnoverDumpFailAlarm);
if (msgBox != null)
{
switch (msgBox.Button)
{
case ETipButton.Retry://重拍
logInfo = GetClassName() + $"选择了重拍";
MessageQueue.Instance.Insert(logInfo);
UpCameraScanBarCodeFlow.Instance.ScanSingle(curNozzle.ToIndex + 1, true);
vr = UpCameraScanBarCodeFlow.Instance.WaitSingle();
if (UpCameraScanBarCodeFlow.Instance.CheckResult(vr))
{
logInfo = GetClassName() + $"排料吸嘴{curNozzle.NozzleIndex}号SN={curNozzle.SN}放{WitchTrayWitchSlot(curNozzle.ToType, curNozzle.ToIndex)}";
MessageQueue.Instance.Insert(logInfo);
curNozzle.VacSuction(EIoOperate.Close);
exit = true;
flowStep = EDischargeFlowStep.;
}
break;
case ETipButton.Skip://跳过
logInfo = GetClassName() + $"选择了跳过";
MessageQueue.Instance.Insert(logInfo);
if (GlobalVar.EnableExceptionHandlingNozzle)
{
//排料轴先回到安全位,等待异常处理吸嘴过来处理这颗异常料
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
WarningSuckerNgFlow.Instance.DealNgProduct(ETrayType.Turnover, curNozzle.ToIndex + 1);
VacManager.TurnoverTrayVacSuction(EVacOperator.Close, true, curNozzle.ToIndex + 1);
curNozzle.Reset();
flowStep = EDischargeFlowStep.;
exit = true;
}
else
{
if (!UpCameraCheckFlow.Instance.CheckTurnoverTrayHasProduct(null, curNozzle.ToIndex + 1))
{
VacManager.TurnoverTrayVacSuction(EVacOperator.Close, true, curNozzle.ToIndex + 1);
curNozzle.Reset();
flowStep = EDischargeFlowStep.;
exit = true;
}
}
break;
case ETipButton.Yes://移动到安全位
logInfo = GetClassName() + $"选择了移动到安全位";
MessageQueue.Instance.Insert(logInfo);
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
DischargeModuleGoSafePosFlow.Instance.Wait();
break;
default:
break;
}
}
}
}
}
}
}
break;
case EDischargeFlowStep.:
@ -1408,108 +1550,16 @@ namespace Rs.MotionPlat.Flow
break;
}
}
}
else
{
logInfo = GetClassName() + $"排料吸嘴{curNozzle.NozzleIndex}号SN={curNozzle.SN}放{WitchTrayWitchSlot(curNozzle.ToType, curNozzle.ToIndex)}";
MessageQueue.Instance.Insert(logInfo);
curNozzle.VacSuction(EIoOperate.Close);
flowStep = EDischargeFlowStep.;
}
break;
case EDischargeFlowStep.:
if (curNozzle.ToType == TurnoverType.Turnover)
{
if (Ops.IsOn($"周转盘{curNozzle.ToIndex + 1}号穴位真空吸检测") || GlobalVar.RunSpace)
{
logInfo = GetClassName()+$"周转盘{curNozzle.ToIndex + 1}号穴位真空吸检测OK";
MessageQueue.Instance.Insert(logInfo);
flowStep = EDischargeFlowStep.;
}
else
{
UpCameraScanBarCodeFlow.Instance.ScanSingle(curNozzle.ToIndex + 1, true);
VisionResult vr = UpCameraScanBarCodeFlow.Instance.WaitSingle();
if (UpCameraScanBarCodeFlow.Instance.CheckResult(vr))
{
flowStep = EDischargeFlowStep.;
}
else
{
//异常处理
bool exit = false;
Dictionary<ETipButton, string> buttons = new Dictionary<ETipButton, string>()
{
{ ETipButton.Retry,"重拍|Regrab" },
{ETipButton.Skip,"跳过|Skip" },
{ETipButton.Yes,"移动到安全位|MoveToSafePos" }
};
while (!exit)
{
//alarmInfo = $"周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常";
alarmInfo = string.Format(AlarmCollection.GetAlarm(AlarmConstID.), curNozzle.NozzleIndex, curNozzle.ToIndex + 1);
MessageQueue.Instance.Warn(GetClassName() + alarmInfo);
//TestCenterMessageBox.Show(AlarmConstID.TurnoverDumpFailAlarm, alarmInfo, ETipButton.Retry | ETipButton.Skip | ETipButton.Yes, buttons);
msgBox = MsgBox.ShowDialog(AlarmConstID., alarmInfo, ETipButton.Retry | ETipButton.Skip | ETipButton.Yes, buttons);// TestCenterMessageBox.WaitResult(AlarmConstID.TurnoverDumpFailAlarm);
if (msgBox != null)
{
switch (msgBox.Button)
{
case ETipButton.Retry://重拍
logInfo = GetClassName() + $"选择了重拍";
MessageQueue.Instance.Insert(logInfo);
UpCameraScanBarCodeFlow.Instance.ScanSingle(curNozzle.ToIndex + 1, true);
vr = UpCameraScanBarCodeFlow.Instance.WaitSingle();
if (UpCameraScanBarCodeFlow.Instance.CheckResult(vr))
{
exit = true;
flowStep = EDischargeFlowStep.;
}
break;
case ETipButton.Skip://跳过
logInfo = GetClassName() + $"选择了跳过";
MessageQueue.Instance.Insert(logInfo);
if (GlobalVar.EnableExceptionHandlingNozzle)
{
//排料轴先回到安全位,等待异常处理吸嘴过来处理这颗异常料
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
WarningSuckerNgFlow.Instance.DealNgProduct(ETrayType.Turnover, curNozzle.ToIndex + 1);
VacManager.TurnoverTrayVacSuction(EVacOperator.Close, true, curNozzle.ToIndex + 1);
curNozzle.Reset();
flowStep = EDischargeFlowStep.;
exit = true;
}
else
{
if (!UpCameraCheckFlow.Instance.CheckTurnoverTrayHasProduct(null, curNozzle.ToIndex + 1))
{
VacManager.TurnoverTrayVacSuction(EVacOperator.Close, true, curNozzle.ToIndex + 1);
curNozzle.Reset();
flowStep = EDischargeFlowStep.;
exit = true;
}
}
break;
case ETipButton.Yes://移动到安全位
logInfo = GetClassName() + $"选择了移动到安全位";
MessageQueue.Instance.Insert(logInfo);
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
DischargeModuleGoSafePosFlow.Instance.Wait();
break;
default:
break;
}
}
}
}
}
}
else
{
flowStep = EDischargeFlowStep.;
}
break;
case EDischargeFlowStep.:
//AxisControl.GetAxis($"NozzleZ{curNozzle.NozzleIndex}").Home();

@ -79,6 +79,8 @@ namespace Rs.MotionPlat.Flow
,
,
,
,
,
,

Loading…
Cancel
Save