Commit 814e2081 张东亮

左侧口检测到掉料时暂停并报警

1 个父辈 e2efb7d5
......@@ -599,3 +599,4 @@ Res0221 未检测到打印标签 No printed labels detected
Res0222 贴标时未检测到打印标签 Labels Not Detected During Relabeling
Res0223 未知数 Unknow
Res0224 上一个标签尚未移走 Previous Label Not Removed
Res0225 放料失败请手动处理,请将料盘放入: 左侧料串,按左侧按钮继续 UnLoading Failed, Please Handle It Manually: Place Reel In UP Stacker And Press Left Button
......@@ -536,3 +536,4 @@ Res0221 未检测到打印标签 未检测到打印标签
Res0222 贴标时未检测到打印标签 贴标时未检测到打印标签
Res0223 未知数 未知数
Res0224 上一个标签尚未移走 上一个标签尚未移走
Res0225 放料失败请手动处理,请将料盘放入: 左侧料串,按左侧按钮继续 UnLoading Failed, Please Handle It Manually: Place Reel In UP Stacker And Press Left Button
\ No newline at end of file
......@@ -40,7 +40,7 @@
<HintPath>..\dll\Basler.Pylon.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper">
<HintPath>..\..\..\..\..\类库\ConfigHelper.dll</HintPath>
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\dll\halcondotnet.dll</HintPath>
......@@ -55,7 +55,7 @@
</Reference>
<Reference Include="MvCameraControl.Net, Version=2.4.1.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\类库\MvCameraControl.Net.dll</HintPath>
<HintPath>..\dll\MvCameraControl.Net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......
......@@ -39,6 +39,49 @@ namespace DeviceLibrary
// return hight;
// }
//}
int _leftBatchAxisPositionWhileTrayCheck = 0;
/// <summary>
/// 出库上一次料盘定位信号亮时批量轴的位置
/// </summary>
int LeftBatchAxisPositionWhileTrayCheck
{
get => _leftBatchAxisPositionWhileTrayCheck;
set
{
if (_leftBatchAxisPositionWhileTrayCheck != value)
{
_leftBatchAxisPositionWhileTrayCheck = value;
LeftMoveInfo.log($"左侧批量轴定位信号亮时位置:{_leftBatchAxisPositionWhileTrayCheck}");
}
}
}
bool checkReelIsPutOk(int curPos)
{
bool enableCheck = ConfigHelper.Config.Get("左侧料盘放料串检查是否启用", true);
if (enableCheck)
{
var aixH = 1f * Math.Abs(_leftBatchAxisPositionWhileTrayCheck - curPos) / Config.Left_Batch_ChangeValue;
int plateH = PlwHight / Config.Right_Batch_ChangeValue * Config.Left_Batch_ChangeValue;
var canErrorMM = ConfigHelper.Config.Get("左侧料盘放料串检查厚度最大偏差值", 5);
if (Math.Abs(aixH - plateH) <= canErrorMM)
{
LeftMoveInfo.log($"料盘定位信号{IOValue(IO_Type.LeftTop_Check)},批量轴当前位置:{curPos}," +
$"上次位置{_leftBatchAxisPositionWhileTrayCheck},批量轴厚度{aixH},料盘厚度{plateH},允许的最大差值{canErrorMM}," + $"{Math.Abs(aixH - plateH)}<={canErrorMM},认为放料串成功");
return true;
}
else
{
LeftMoveInfo.log($"料盘定位信号{IOValue(IO_Type.LeftTop_Check)},批量轴当前位置:{curPos}," +
$"上次位置{_leftBatchAxisPositionWhileTrayCheck},批量轴厚度{aixH},料盘厚度{plateH},允许的最大差值{canErrorMM}." + $"{Math.Abs(aixH - plateH)}>{canErrorMM},认为放料串失败");
return false;
}
}
else
{
return true;
}
}
void LeftProcess()
{
if (CheckWait(LeftMoveInfo))
......@@ -50,11 +93,15 @@ namespace DeviceLibrary
case MoveStep.L01:
LeftCount = 0;
LeftShelfNoTray = false;
LeftMoveInfo.NextMoveStep(MoveStep.L03);
LeftMoveInfo.NextMoveStep(MoveStep.L02);
CylinderMove(null, IO_Type.LeftStopDown, IO_Type.LeftStopUP);
LeftBatchAxisToP2(Config.Left_Batch_P2, Config.Left_Batch_P1_speed, IO_VALUE.HIGH);
LeftMoveInfo.log($"批量轴上升到P2位置,第一次提升,LeftStartMovePosition={LeftStartMovePosition}");
break;
case MoveStep.L02:
LeftMoveInfo.NextMoveStep(MoveStep.L03);
LeftBatchAxisPositionWhileTrayCheck = Left_Batch_Axis.GetAclPosition();
break;
//轴下降一点
case MoveStep.L03:
LeftMoveInfo.NextMoveStep(MoveStep.L04);
......@@ -74,6 +121,7 @@ namespace DeviceLibrary
LeftMoveInfo.NextMoveStep(MoveStep.L40_ShelfFull);
LeftMoveInfo.log($"批量轴已下降到底,料串已满,Left_Batch_P1={Config.Left_Batch_P1}");
}
LeftMoveInfo.log($"出料提升机构,下降固定值为{targetP1}脉冲!");
Left_Batch_Axis.AbsMove(LeftMoveInfo, targetP1, targetSpeed);
LeftMoveInfo.log($"批量轴下降固定值");
......@@ -81,7 +129,7 @@ namespace DeviceLibrary
//根据轴位置判断去料串满步骤还是不满步骤
case MoveStep.L04:
var currpos = Left_Batch_Axis.GetAclPosition();
if (currpos <= Config.Left_Batch_P1+2000)
if (currpos <= Config.Left_Batch_P1 + 2000)
{
LeftMoveInfo.NextMoveStep(MoveStep.L40_ShelfFull);
LeftMoveInfo.log($"批量轴已下降到底,料串已满,Left_Batch_P1={Config.Left_Batch_P1},needpos={currpos}");
......@@ -119,8 +167,40 @@ namespace DeviceLibrary
LeftMoveInfo.log($"批量轴上升到P2位置,LeftStartMovePosition={LeftStartMovePosition}");
break;
case MoveStep.L13:
LeftMoveInfo.NextMoveStep(MoveStep.L20_WaitLabel);
var curPos = Left_Batch_Axis.GetAclPosition();
//判断当前料盘是否放到料串上
if (checkReelIsPutOk(curPos))
{
LeftMoveInfo.NextMoveStep(MoveStep.L16);
LeftMoveInfo.log("放置料盘检查正常");
}
else
{
//LeftMoveInfo.log("检查到放置料盘检查异常");
Msg.add(crc.GetString("Res0225", "放料失败请手动处理,请将料盘放入: 左侧料串,按左侧按钮继续"), MsgLevel.alarm);
if (IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH))
{
LeftMoveInfo.NextMoveStep(MoveStep.L14);
LeftMoveInfo.log("放置料盘检查异常,复位继续");
}
return;
}
break;
case MoveStep.L14:
LeftMoveInfo.NextMoveStep(MoveStep.L15);
LeftBatchAxisToP2(Config.Left_Batch_P1, Config.Left_Batch_P1_speed, IO_VALUE.LOW);
LeftMoveInfo.log($"左侧料盘已手动放入,批量轴下降固定值");
break;
case MoveStep.L15:
LeftMoveInfo.NextMoveStep(MoveStep.L16);
LeftAxisRiseMax();
LeftMoveInfo.log($"批量轴重新上升到P2位置,LeftStartMovePosition={LeftStartMovePosition}");
break;
case MoveStep.L16:
LeftBatchAxisPositionWhileTrayCheck = Left_Batch_Axis.GetAclPosition();
LeftMoveInfo.NextMoveStep(MoveStep.L20_WaitLabel);
break;
//等贴标,由贴标流程跳出
case MoveStep.L20_WaitLabel:
......@@ -136,11 +216,11 @@ namespace DeviceLibrary
}
else
{
if (PlwHight >0)
if (PlwHight > 0)
{
LeftMoveInfo.NextMoveStep(MoveStep.L03);
LeftBatchAxisToP2(Config.Left_Batch_P1, Config.Left_Batch_P1_speed, IO_VALUE.LOW);
LeftMoveInfo.log($"贴标完成,批量轴下降固定值");
}
else
......
......@@ -66,6 +66,9 @@ namespace DeviceLibrary
L11_ReelPutted,
L12,
L13,
L14,
L15,
L16,
L20_WaitLabel,
L21,
L30_LabelFinish,
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!