软件打开后第一次收到排料任务后增加排料吸嘴、周转吸嘴、周转盘、治具中是否有产品的检测

master
lhiven 1 year ago
parent 1f13c9546f
commit d976a67daf

@ -1651,5 +1651,10 @@ namespace Rs.Framework
return SysConfigParam.GetValue<bool>(nameof(SocketHasProductCheck));
}
}
/// <summary>
/// 是否需要检测环境
/// </summary>
public static bool NeedCheckEnvironment { get; set; } = true;
}
}

@ -30,6 +30,7 @@ namespace Rs.MotionPlat.Commom
public static bool Pause { get; set; } = false;
public static void Init()
{
GlobalVar.NeedCheckEnvironment = true;
InitDb();
SysConfigParam.Init();
int errNum = 0;

@ -395,6 +395,10 @@ namespace Rs.MotionPlat.Flow
/// </summary>
public const int = 1091;
/// <summary>
/// 工作环境检测
/// </summary>
public const int = 1092;
/// <summary>

@ -149,6 +149,7 @@ namespace Rs.MotionPlat.Flow
|| LoadAndUnloadTask.Instance.GetTaskNum(ETaskType.Unload) > 0
|| LoadAndUnloadTask.Instance.GetTaskNum(ETaskType.Change) > 0)
{
StockTrayToTurnoverTray = true;
logInfo = GetClassName() + $"接收到排料任务";
MessageQueue.Instance.Insert(logInfo);
@ -167,17 +168,12 @@ namespace Rs.MotionPlat.Flow
}
else
{
if (GlobalVar.FirstDischarge)
{
GlobalVar.FirstDischarge = false;
//设备遗留产品检测
//吸嘴全部用真空吸检测周转盘用上相机检测SOCKET用镭射头检测
flowStep = EDischargeFlowStep.;
}
else
if (GlobalVar.NeedCheckEnvironment)
{
flowStep = EDischargeFlowStep.;
WorkEnvironment.Instance.Check();
GlobalVar.NeedCheckEnvironment = false;
}
flowStep = EDischargeFlowStep.;
}
}

@ -1,4 +1,5 @@
using Rs.AutoDischarge.V3.Flow;
using NPOI.SS.Formula.Functions;
using Rs.AutoDischarge.V3.Flow;
using Rs.Framework;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow.Camera;
@ -7,6 +8,7 @@ using Rs.MotionPlat.Flow.SubFlow;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@ -280,46 +282,120 @@ namespace Rs.MotionPlat.Flow
/// </summary>
public void Check()
{
List<int> dischargeNozzles = new List<int>();
List<int> turnoverNozzles = new List<int>();
List<int> turnoverTraySlots = new List<int>();
List<int> socketSlots = new List<int>();
//1 吸嘴检测
for(int i=1;i<9;i++)
while(true)
{
VacManager.DischargeVacSuction(EVacOperator.Open,true, i);
if(Ops.IsOn(""))
List<int> dischargeNozzles = new List<int>();
List<int> turnoverNozzles = new List<int>();
List<int> turnoverTraySlots = new List<int>();
List<int> socketSlots = new List<int>();
MessageQueue.Instance.Insert("discharge nozzle have or not product check");
//1 吸嘴检测
for (int i = 1; i < 9; i++)
{
dischargeNozzles.Add(i);
Ops.On($"{i}号吸嘴真空吸电磁阀");
MessageQueue.Instance.Insert($"打开{i}号吸嘴真空吸电磁阀");
Thread.Sleep(100);
if (Ops.IsOn($"{i}号吸嘴真空吸检测"))
{
MessageQueue.Instance.Insert($"{i}号吸嘴有料");
dischargeNozzles.Add(i);
}
else
{
MessageQueue.Instance.Insert($"{i}号吸嘴无料");
Ops.Off($"{i}号吸嘴真空吸电磁阀");
MessageQueue.Instance.Insert($"关闭{i}号吸嘴真空吸电磁阀");
}
}
}
//2 周转吸头检测
for (int i=1;i<17;i++)
{
VacManager.TransitNozzleVacSuction(ETurnoverNozzlePosition.TurnoverTray, EVacOperator.Open, true, i);
if (Ops.IsOn(""))
//2 周转吸头检测
for (int i = 1; i < 17; i++)
{
turnoverNozzles.Add(i);
Ops.On($"周转{i}号吸嘴真空吸");
MessageQueue.Instance.Insert($"打开周转{i}号吸嘴真空吸");
Thread.Sleep(100);
if (Ops.IsOn($"周转{i}号吸嘴真空吸检测"))
{
MessageQueue.Instance.Insert($"周转{i}号吸嘴有料");
turnoverNozzles.Add(i);
}
else
{
MessageQueue.Instance.Insert($"周转{i}号吸嘴无料");
Ops.Off($"周转{i}号吸嘴真空吸");
MessageQueue.Instance.Insert($"关闭周转{i}号吸嘴真空吸");
}
}
}
// 3周转盘穴位检测
for(int i=1;i<33;i++)
{
SlotProductHasOrNotResult result = UpCameraCheckFlow.Instance.CheckTurnoverTrayHasProduct(null, i, true);
if(result.HasProduct)
// 3周转盘穴位检测
for (int i = 1; i < 33; i++)
{
turnoverTraySlots.Add(i);
Ops.On($"周转盘{i}号穴位真空吸");
MessageQueue.Instance.Insert($"打开周转盘{i}号穴位真空吸");
Thread.Sleep(100);
if (Ops.IsOn($"周转盘{i}号穴位真空吸检测"))
{
Ops.Off($"周转盘{i}号穴位真空吸");
MessageQueue.Instance.Insert($"周转盘{i}号穴位有料");
turnoverTraySlots.Add(i);
}
else
{
MessageQueue.Instance.Insert($"周转盘{i}号穴位无料");
Ops.Off($"周转盘{i}号穴位真空吸");
MessageQueue.Instance.Insert($"关闭周转盘{i}号穴位真空吸");
}
//SlotProductHasOrNotResult result = UpCameraCheckFlow.Instance.CheckTurnoverTrayHasProduct(null, i, true);
//if(result.HasProduct)
//{
// turnoverTraySlots.Add(i);
//}
}
}
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
//4 SOCKET穴位检测
for (int i = 1; i < 17; i++)
{
VacManager.TransitNozzleVacSuction( ETurnoverNozzlePosition.Socket, EVacOperator.Open, true, i);
if (Ops.IsOn(""))
//DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
//4 SOCKET穴位检测
for (int i = 1; i < 17; i++)
{
Ops.On($"测试{i}号穴位真空吸");
MessageQueue.Instance.Insert($"打开测试{i}号穴位真空吸");
Thread.Sleep(100);
if (Ops.IsOn($"测试{i}号穴位真空吸检测"))
{
Ops.Off($"测试{i}号穴位真空吸");
MessageQueue.Instance.Insert($"测试{i}号穴位有料");
socketSlots.Add(i);
}
else
{
MessageQueue.Instance.Insert($"测试{i}号穴位无料");
Ops.Off($"测试{i}号穴位真空吸");
LogHelper.Debug($"关闭测试{i}号穴位真空吸");
}
}
if (dischargeNozzles.Count>0 || turnoverNozzles.Count>0 || turnoverTraySlots.Count>0 || socketSlots.Count>0)
{
StringBuilder msg = new StringBuilder();
if(dischargeNozzles.Count>0)
{
msg.AppendLine($"discharge nozzle {dischargeNozzles.ToJoinString()} has product");
}
if (turnoverNozzles.Count > 0)
{
msg.AppendLine($"turnover nozzle {turnoverNozzles.ToJoinString()} has product");
}
if (turnoverTraySlots.Count > 0)
{
msg.AppendLine($"turnover tray {turnoverTraySlots.ToJoinString()} has product");
}
if (socketSlots.Count > 0)
{
msg.AppendLine($"socket {socketSlots.ToJoinString()} has product");
}
PromptMessageBox.ShowDialog(AlarmConstID., msg.ToString(), SchedulingMessageBox.ETipButton.Retry);
}
else
{
turnoverNozzles.Add(i);
break;
}
}
}

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

Loading…
Cancel
Save