From 46252f364232e72645ef1d0fcad6413aa9caada8 Mon Sep 17 00:00:00 2001 From: lhiven <2366881222@qq.com> Date: Thu, 11 Jan 2024 23:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=92=E6=96=99=E6=94=BE?= =?UTF-8?q?=E5=91=A8=E8=BD=AC=E7=9B=98=E5=85=88=E6=A3=80=E6=B5=8B=E7=9C=9F?= =?UTF-8?q?=E7=A9=BA=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=9C=9F=E7=A9=BA=E6=9C=89?= =?UTF-8?q?=E6=95=88=E5=88=99=E4=B8=8D=E5=86=8D=E6=A3=80=E6=B5=8B=E7=B2=98?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs | 240 ++++++++++++-------- Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs | 2 + 2 files changed, 147 insertions(+), 95 deletions(-) diff --git a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs index 4674b82..9e12c71 100644 --- a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs @@ -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 buttons = new Dictionary() + { + { 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 buttons = new Dictionary() - { - { 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(); diff --git a/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs b/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs index 82335b0..58e1e8a 100644 --- a/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs +++ b/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs @@ -79,6 +79,8 @@ namespace Rs.MotionPlat.Flow 等待到测试关破真空位, 测试位取料完成抬起, 等待测试位取料完成抬起, + + 测试位取料完成后真空检测, 到周转盘放料位上方, 等待到周转盘放料位上方,