1、优化周转模组取放料时开关真空的时机

2、增加是否开启光纤检测
3、增加是否启用二段速
master
lhiven 1 year ago
parent 56b5b6630b
commit f7cdb0e1dc

@ -250,7 +250,7 @@ namespace Rs.MotionPlat.Commom
/// </summary>
/// <param name="eOperator"></param>
/// <param name="indexes"></param>
public static void TestTrayVacSuction(EVacOperator eOperator, params int[] indexes)
public static void TestTrayVacSuction(EVacOperator eOperator,bool bNeedSleep, params int[] indexes)
{
if(indexes.Length>0)
{
@ -268,12 +268,14 @@ namespace Rs.MotionPlat.Commom
if (eOperator== EVacOperator.Open)
{
Thread.Sleep(GlobalVar.PressOpenVacSuctionDelaytime);
if (bNeedSleep)
Thread.Sleep(GlobalVar.PressOpenVacSuctionDelaytime);
MessageQueue.Instance.Insert($"打开测试{string.Join(",", indexes)}号穴位真空吸");
}
else
{
Thread.Sleep(GlobalVar.PresseCloseVacSuctionDelaytime);
if (bNeedSleep)
Thread.Sleep(GlobalVar.PresseCloseVacSuctionDelaytime);
MessageQueue.Instance.Insert($"关闭测试{string.Join(",", indexes)}号穴位真空吸");
}
}
@ -284,7 +286,7 @@ namespace Rs.MotionPlat.Commom
/// </summary>
/// <param name="eOperator"></param>
/// <param name="indexes"></param>
public static void TestTrayVacBreak(EVacOperator eOperator, params int[] indexes)
public static void TestTrayVacBreak(EVacOperator eOperator,bool bNeedSleep, params int[] indexes)
{
if (indexes.Length > 0)
{
@ -302,11 +304,13 @@ namespace Rs.MotionPlat.Commom
if (eOperator == EVacOperator.Open)
{
Thread.Sleep(GlobalVar.PresseOpenVacBreakDelaytime);
if (bNeedSleep)
Thread.Sleep(GlobalVar.PresseOpenVacBreakDelaytime);
MessageQueue.Instance.Insert($"打开测试{string.Join(",", indexes)}号穴位真空破");
}
else
{
if (bNeedSleep)
Thread.Sleep(GlobalVar.PressCloseVacBreakDelaytime);
MessageQueue.Instance.Insert($"关闭测试{string.Join(",", indexes)}号穴位真空破");
}

@ -598,7 +598,7 @@ namespace Rs.MotionPlat.Flow
//获取需要放料的吸嘴
hasProductNozzles = TransitNozzleManager.Instance.GetHasProductNozzles();
/*打开测试穴位真空吸*/
VacManager.TestTrayVacSuction(EVacOperator.Open, hasProductNozzles.Select(n => n.NozzleIndex).ToArray());
VacManager.TestTrayVacSuction(EVacOperator.Open,false, hasProductNozzles.Select(n => n.NozzleIndex).ToArray());
if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
@ -767,7 +767,7 @@ namespace Rs.MotionPlat.Flow
switch (msgBox.Button)
{
case ETipButton.Retry:
VacManager.TestTrayVacSuction(EVacOperator.Open, nozzle.NozzleIndex);
VacManager.TestTrayVacSuction(EVacOperator.Open,true, nozzle.NozzleIndex);
if (Ops.IsOn($"测试{nozzle.NozzleIndex}号穴位光纤检测") || GlobalVar.RunSpace)
{
exit = true;
@ -778,13 +778,13 @@ namespace Rs.MotionPlat.Flow
TestHeightResult heightReulst = LaserFlow.Instance.HasProduct(ETrayType.Test, nozzle.NozzleIndex);
if (!heightReulst.HasProduct)
{
VacManager.TestTrayVacSuction(EVacOperator.Close, nozzle.NozzleIndex);
VacManager.TestTrayVacSuction(EVacOperator.Close,true, nozzle.NozzleIndex);
nozzle.Clear();
exit = true;
}
break;
case ETipButton.Yes://移动到安全位
VacManager.TestTrayVacSuction(EVacOperator.Close, nozzle.NozzleIndex);
VacManager.TestTrayVacSuction(EVacOperator.Close,true, nozzle.NozzleIndex);
TransitModuleSafePosFlow.Instance.GoSafePostion(EExceptionSafePos.Socket);
break;
}
@ -812,7 +812,7 @@ namespace Rs.MotionPlat.Flow
switch (msgBox.Button)
{
case ETipButton.Retry:
VacManager.TestTrayVacSuction(EVacOperator.Open, nozzle.NozzleIndex);
VacManager.TestTrayVacSuction(EVacOperator.Open,true, nozzle.NozzleIndex);
if (Ops.IsOn($"测试{nozzle.NozzleIndex}号穴位真空吸检测"))
{
GlobalTray.TestTray.ChangeStatus(nozzle.NozzleIndex, ESlotStatus.Have);
@ -831,7 +831,7 @@ namespace Rs.MotionPlat.Flow
}
break;
case ETipButton.Yes://移动到安全位
VacManager.TestTrayVacSuction(EVacOperator.Close, nozzle.NozzleIndex);
VacManager.TestTrayVacSuction(EVacOperator.Close,true, nozzle.NozzleIndex);
TransitModuleSafePosFlow.Instance.GoSafePostion(EExceptionSafePos.Socket);
break;
}
@ -896,7 +896,10 @@ namespace Rs.MotionPlat.Flow
break;
case ETurnoverFlowStep.1:
targetPos = SysConfigParam.GetValue<double>("PressZ");
targetPos = targetPos + SysConfigParam.GetValue<double>("PressLowSpeedOffset");
if (GlobalVar.EnableTwoSpeed)
{
targetPos = targetPos + SysConfigParam.GetValue<double>("PressLowSpeedOffset");
}
errCode = AxisControl.PressZ.MovePos(targetPos, GlobalVar.WholeSpeed);
if(errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis )
{
@ -947,7 +950,7 @@ namespace Rs.MotionPlat.Flow
MessageQueue.Instance.Insert(logInfo);
/*关闭测试穴位真空吸*/
List<TestTraySlot> willTestSlot = TestTrayManager.Instance.GetSlots(ETestTraySlotStatus.Have);
VacManager.TestTrayVacSuction(EVacOperator.Close, willTestSlot.Select(s => s.Index).ToArray());
VacManager.TestTrayVacSuction(EVacOperator.Close,false, willTestSlot.Select(s => s.Index).ToArray());
Step = ETurnoverFlowStep.;
}
break;
@ -965,14 +968,23 @@ namespace Rs.MotionPlat.Flow
//if(MachineManage.Instance.tes)
if(MachineManage.Instance.TestStatus== ETestStatus.Finished)
{
//测试完成后,重新打开真空吸
List<TestTraySlot> tested = TestTrayManager.Instance.GetSlots(ETestTraySlotStatus.Have);
VacManager.TestTrayVacSuction(EVacOperator.Open,true,tested.Select(s => s.Index).ToArray());
Step = ETurnoverFlowStep.;
}
break;
case ETurnoverFlowStep.:
targetPos = SysConfigParam.GetValue<double>("PressZ")+GlobalVar.PressLowSpeedOffset;
if(GlobalVar.EnableTwoSpeed)
{
targetPos = SysConfigParam.GetValue<double>("PressZ") + GlobalVar.PressLowSpeedOffset;
}
else
{
targetPos = SysConfigParam.GetValue<double>("PressSafeZ");
}
double curPos = Ops.GetCurPosition(AxisAlias.PressZ);
if(Math.Abs(curPos-targetPos)<0.1)
{
@ -1177,10 +1189,17 @@ namespace Rs.MotionPlat.Flow
}
break;
case ETurnoverFlowStep.1:
targetPos = SysConfigParam.GetValue<double>("PressTakeZ") + GlobalVar.PressLowSpeedOffset;
targetPos = SysConfigParam.GetValue<double>("PressTakeZ");
if (GlobalVar.EnableTwoSpeed)
{
targetPos = targetPos + GlobalVar.PressLowSpeedOffset;
}
errCode = AxisControl.TurnoverZ.MovePos(targetPos, GlobalVar.WholeSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
undealTasks = LoadAndUnloadTask.Instance.GetTestToTurnoverTasks(ETaskDealStatus.Undeal);
/*提前打开周转吸头真空吸*/
VacManager.TransitNozzleVacSuction(EVacOperator.Open, false, undealTasks.Select(t => t.FromIndex + 1).ToArray());
if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
@ -1228,19 +1247,24 @@ namespace Rs.MotionPlat.Flow
MessageQueue.Instance.Insert(logInfo);
//int[] indexes = TestTrayManager.Instance.GetSlots(ETestTraySlotStatus.Have).Select(s=>s.Index).ToArray();
undealTasks = LoadAndUnloadTask.Instance.GetTestToTurnoverTasks(ETaskDealStatus.Undeal);
int[] indexes = undealTasks.Select(t => t.FromIndex + 1).ToArray();
/*打开周转吸头真空吸*/
VacManager.TransitNozzleVacSuction(EVacOperator.Open, true, indexes);
//VacManager.TransitNozzleVacSuction(EVacOperator.Open, true, indexes);
/*关闭测试穴位真空吸*/
VacManager.TestTrayVacSuction(EVacOperator.Close, indexes);
VacManager.TestTrayVacSuction(EVacOperator.Close,false, undealTasks.Select(t => t.FromIndex + 1).ToArray());
/*打开测试穴位真空破*/
VacManager.TestTrayVacBreak(EVacOperator.Open, indexes);
VacManager.TestTrayVacBreak(EVacOperator.Open,true, undealTasks.Select(t => t.FromIndex + 1).ToArray());
Step = ETurnoverFlowStep.;
}
break;
case ETurnoverFlowStep.:
targetPos = SysConfigParam.GetValue<double>("PressTakeZ")+GlobalVar.PressLowSpeedOffset;
if(GlobalVar.EnableTwoSpeed)
{
targetPos = SysConfigParam.GetValue<double>("PressTakeZ") + GlobalVar.PressLowSpeedOffset;
}
else
{
targetPos = SysConfigParam.GetValue<double>("PressSafeZ");
}
errCode = AxisControl.TurnoverZ.MovePos(targetPos, GlobalVar.PressLowSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
@ -1264,7 +1288,7 @@ namespace Rs.MotionPlat.Flow
MessageQueue.Instance.Insert(logInfo);
undealTasks = LoadAndUnloadTask.Instance.GetTestToTurnoverTasks(ETaskDealStatus.Undeal);
/*关闭测试穴位真空破*/
VacManager.TestTrayVacBreak(EVacOperator.Close, undealTasks.Select(t => t.FromIndex + 1).ToArray());
VacManager.TestTrayVacBreak(EVacOperator.Close,false, undealTasks.Select(t => t.FromIndex + 1).ToArray());
Step = ETurnoverFlowStep.;
}
break;
@ -1311,6 +1335,11 @@ namespace Rs.MotionPlat.Flow
TransitNozzleManager.Instance.Nozzle(task.FromIndex + 1).AddProduct(task);
GlobalTray.TestTray.ChangeStatus(task.FromIndex + 1, ESlotStatus.NotHave);
}
else
{
logInfo = $"周转{task.FromIndex + 1}号吸嘴真空吸检测异常";
MessageQueue.Instance.Insert(logInfo);
}
}
}
if (TestTrayManager.Instance.GetSlots(ETestTraySlotStatus.Have).Count == 0)
@ -1461,10 +1490,20 @@ namespace Rs.MotionPlat.Flow
}
break;
case ETurnoverFlowStep.1:
targetPos = SysConfigParam.GetValue<double>("TurnoverTakeZ") + GlobalVar.PressLowSpeedOffset;
if(GlobalVar.EnableTwoSpeed)
{
targetPos = SysConfigParam.GetValue<double>("TurnoverTakeZ") + GlobalVar.PressLowSpeedOffset;
}
else
{
targetPos = SysConfigParam.GetValue<double>("TurnoverTakeZ");
}
errCode = AxisControl.TurnoverZ.MovePos(targetPos+1, GlobalVar.WholeSpeed);
if(errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
hasProductNozzles = TransitNozzleManager.Instance.GetHasProductNozzles();
/*提前打开周转盘真空吸*/
VacManager.TurnoverTrayVacSuction(EVacOperator.Open, false, hasProductNozzles.Select(n => n.ToIndex + 1).ToArray());
if (GlobalVar.VirtualAxis)
{
Thread.Sleep(GlobalVar.VirtualAxisMoveTime);
@ -1511,10 +1550,8 @@ namespace Rs.MotionPlat.Flow
logInfo = GetClassName() + $"已运动到周转盘放料位下方2";
MessageQueue.Instance.Insert(logInfo);
hasProductNozzles = TransitNozzleManager.Instance.GetHasProductNozzles();
/*打开周转盘真空吸*/
VacManager.TurnoverTrayVacSuction(EVacOperator.Open, true, hasProductNozzles.Select(n => n.ToIndex+1).ToArray());
/*关闭周转吸头真空吸*/
VacManager.TransitNozzleVacSuction( EVacOperator.Close,true,hasProductNozzles.Select(n=>n.FromIndex + 1).ToArray());
VacManager.TransitNozzleVacSuction( EVacOperator.Close,false,hasProductNozzles.Select(n=>n.FromIndex + 1).ToArray());
/*打开周转吸头真空破*/
VacManager.TransitNozzleVacBreak(EVacOperator.Open, true, hasProductNozzles.Select(n => n.FromIndex + 1).ToArray());
Step = ETurnoverFlowStep.1;
@ -1522,7 +1559,14 @@ namespace Rs.MotionPlat.Flow
break;
case ETurnoverFlowStep.1:
targetPos = SysConfigParam.GetValue<double>("TurnoverTakeZ") + GlobalVar.PressLowSpeedOffset;
if(GlobalVar.EnableTwoSpeed)
{
targetPos = SysConfigParam.GetValue<double>("TurnoverTakeZ") + GlobalVar.PressLowSpeedOffset;
}
else
{
targetPos = SysConfigParam.GetValue<double>("TurnoverSafeZ");
}
errCode = AxisControl.TurnoverZ.MovePos(targetPos, GlobalVar.PressLowSpeed);
if(errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{

@ -48,6 +48,8 @@
this.label7 = new System.Windows.Forms.Label();
this.cboxUpCameraName = new System.Windows.Forms.ComboBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtQifuValue = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.panel1 = new System.Windows.Forms.Panel();
this.radioButton4 = new System.Windows.Forms.RadioButton();
@ -56,6 +58,7 @@
this.label6 = new System.Windows.Forms.Label();
this.cboxVirtualAxis = new System.Windows.Forms.CheckBox();
this.cboxCheckSafeEnable = new System.Windows.Forms.CheckBox();
this.cboxEnableTwoSpeed = new System.Windows.Forms.CheckBox();
this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox();
this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox();
this.cboxRunSpace = new System.Windows.Forms.CheckBox();
@ -79,8 +82,7 @@
this.label27 = new System.Windows.Forms.Label();
this.txtControlCenterIP = new System.Windows.Forms.TextBox();
this.label26 = new System.Windows.Forms.Label();
this.txtQifuValue = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.cboxEnableTestFixtureFiberCheck = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox10.SuspendLayout();
@ -329,6 +331,8 @@
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.cboxVirtualAxis);
this.groupBox1.Controls.Add(this.cboxCheckSafeEnable);
this.groupBox1.Controls.Add(this.cboxEnableTestFixtureFiberCheck);
this.groupBox1.Controls.Add(this.cboxEnableTwoSpeed);
this.groupBox1.Controls.Add(this.cboxEnableScanBarCodeByDownCamera);
this.groupBox1.Controls.Add(this.cboxEnableExceptionHandlingNozzle);
this.groupBox1.Controls.Add(this.cboxRunSpace);
@ -360,6 +364,30 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "系统配置";
//
// txtQifuValue
//
this.txtQifuValue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16)))));
this.txtQifuValue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtQifuValue.Font = new System.Drawing.Font("宋体", 9F);
this.txtQifuValue.ForeColor = System.Drawing.Color.White;
this.txtQifuValue.Location = new System.Drawing.Point(370, 325);
this.txtQifuValue.Name = "txtQifuValue";
this.txtQifuValue.Size = new System.Drawing.Size(85, 21);
this.txtQifuValue.TabIndex = 51;
this.txtQifuValue.Tag = "PressZ";
this.txtQifuValue.Text = "0.01";
this.txtQifuValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtQifuValue.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtQifuValue_KeyUp);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(308, 329);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(47, 12);
this.label9.TabIndex = 50;
this.label9.Text = "气压值:";
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
@ -428,7 +456,7 @@
// cboxVirtualAxis
//
this.cboxVirtualAxis.AutoSize = true;
this.cboxVirtualAxis.Location = new System.Drawing.Point(256, 240);
this.cboxVirtualAxis.Location = new System.Drawing.Point(294, 240);
this.cboxVirtualAxis.Name = "cboxVirtualAxis";
this.cboxVirtualAxis.Size = new System.Drawing.Size(60, 16);
this.cboxVirtualAxis.TabIndex = 8;
@ -438,13 +466,23 @@
// cboxCheckSafeEnable
//
this.cboxCheckSafeEnable.AutoSize = true;
this.cboxCheckSafeEnable.Location = new System.Drawing.Point(172, 240);
this.cboxCheckSafeEnable.Location = new System.Drawing.Point(202, 240);
this.cboxCheckSafeEnable.Name = "cboxCheckSafeEnable";
this.cboxCheckSafeEnable.Size = new System.Drawing.Size(72, 16);
this.cboxCheckSafeEnable.TabIndex = 8;
this.cboxCheckSafeEnable.Text = "安全检查";
this.cboxCheckSafeEnable.UseVisualStyleBackColor = true;
//
// cboxEnableTwoSpeed
//
this.cboxEnableTwoSpeed.AutoSize = true;
this.cboxEnableTwoSpeed.Location = new System.Drawing.Point(202, 277);
this.cboxEnableTwoSpeed.Name = "cboxEnableTwoSpeed";
this.cboxEnableTwoSpeed.Size = new System.Drawing.Size(84, 16);
this.cboxEnableTwoSpeed.TabIndex = 8;
this.cboxEnableTwoSpeed.Text = "启用二段速";
this.cboxEnableTwoSpeed.UseVisualStyleBackColor = true;
//
// cboxEnableScanBarCodeByDownCamera
//
this.cboxEnableScanBarCodeByDownCamera.AutoSize = true;
@ -458,7 +496,7 @@
// cboxEnableExceptionHandlingNozzle
//
this.cboxEnableExceptionHandlingNozzle.AutoSize = true;
this.cboxEnableExceptionHandlingNozzle.Location = new System.Drawing.Point(332, 240);
this.cboxEnableExceptionHandlingNozzle.Location = new System.Drawing.Point(391, 240);
this.cboxEnableExceptionHandlingNozzle.Name = "cboxEnableExceptionHandlingNozzle";
this.cboxEnableExceptionHandlingNozzle.Size = new System.Drawing.Size(96, 16);
this.cboxEnableExceptionHandlingNozzle.TabIndex = 8;
@ -690,29 +728,15 @@
this.label26.TabIndex = 0;
this.label26.Text = "中控IP:";
//
// txtQifuValue
//
this.txtQifuValue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16)))));
this.txtQifuValue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtQifuValue.Font = new System.Drawing.Font("宋体", 9F);
this.txtQifuValue.ForeColor = System.Drawing.Color.White;
this.txtQifuValue.Location = new System.Drawing.Point(370, 325);
this.txtQifuValue.Name = "txtQifuValue";
this.txtQifuValue.Size = new System.Drawing.Size(85, 21);
this.txtQifuValue.TabIndex = 51;
this.txtQifuValue.Tag = "PressZ";
this.txtQifuValue.Text = "0.01";
this.txtQifuValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtQifuValue.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtQifuValue_KeyUp);
//
// label9
// cboxEnableTestFixtureFiberCheck
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(308, 329);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(47, 12);
this.label9.TabIndex = 50;
this.label9.Text = "气压值:";
this.cboxEnableTestFixtureFiberCheck.AutoSize = true;
this.cboxEnableTestFixtureFiberCheck.Location = new System.Drawing.Point(294, 277);
this.cboxEnableTestFixtureFiberCheck.Name = "cboxEnableTestFixtureFiberCheck";
this.cboxEnableTestFixtureFiberCheck.Size = new System.Drawing.Size(96, 16);
this.cboxEnableTestFixtureFiberCheck.TabIndex = 8;
this.cboxEnableTestFixtureFiberCheck.Text = "启用光纤检测";
this.cboxEnableTestFixtureFiberCheck.UseVisualStyleBackColor = true;
//
// CommonConfig
//
@ -798,5 +822,7 @@
private System.Windows.Forms.CheckBox cboxEnableScanBarCodeByDownCamera;
private System.Windows.Forms.TextBox txtQifuValue;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.CheckBox cboxEnableTwoSpeed;
private System.Windows.Forms.CheckBox cboxEnableTestFixtureFiberCheck;
}
}
Loading…
Cancel
Save