Commit 20c16f74 LN

1.有料托盘需要入库时,若检测信号不亮,直接禁用托盘。

2.禁用托盘界面增加选项:开始处理托盘。勾选后,禁用的托盘到达出料4后,会等待托盘启用后再放行。退出界面自动退出托盘处理。
3.启用托盘会清理托盘信息,需拿走托盘上的物料。
4.有托盘被禁用时,发送报警信息到服务器。
1 个父辈 1a94036c
...@@ -183,6 +183,7 @@ ...@@ -183,6 +183,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmDisableTray.resx"> <EmbeddedResource Include="FrmDisableTray.resx">
<DependentUpon>FrmDisableTray.cs</DependentUpon> <DependentUpon>FrmDisableTray.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmIOMsg.resx"> <EmbeddedResource Include="FrmIOMsg.resx">
<DependentUpon>FrmIOMsg.cs</DependentUpon> <DependentUpon>FrmIOMsg.cs</DependentUpon>
......
...@@ -21,12 +21,15 @@ namespace OnlineStore.AssemblyLine ...@@ -21,12 +21,15 @@ namespace OnlineStore.AssemblyLine
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
timer1.Stop();
this.Close(); this.Close();
} }
private void FrmDisableTray_Load(object sender, EventArgs e) private void FrmDisableTray_Load(object sender, EventArgs e)
{ {
LoadList(); LoadList();
timer1.Start();
lblMsg.Text = "勾选开始处理托盘,禁用的托盘到达出料4后,会等待托盘启用后再放行\r\n关闭当前界面后,自动退出托盘处理";
} }
private void LoadList() private void LoadList()
...@@ -78,14 +81,21 @@ namespace OnlineStore.AssemblyLine ...@@ -78,14 +81,21 @@ namespace OnlineStore.AssemblyLine
if (e.RowIndex != -1 && e.ColumnIndex >= 0) if (e.RowIndex != -1 && e.ColumnIndex >= 0)
{ {
string name = this.dataGridView1.Columns[e.ColumnIndex].Name; string name = this.dataGridView1.Columns[e.ColumnIndex].Name;
int num = Convert.ToInt32( this.dataGridView1.Rows[e.RowIndex].Cells[Column_trayNum.Index].Value); int num = Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells[Column_trayNum.Index].Value);
int rowIndex = e.RowIndex; int rowIndex = e.RowIndex;
if (name.Equals(this.Column_Del.Name)) if (name.Equals(this.Column_Del.Name))
{ {
DialogResult dialogResult = MessageBox.Show("确定启用托盘【"+num+"】?", "提示?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); TrayInfo tray = TrayManager.GetTrayInfo(num);
string msg = "启用托盘将清空托盘信息,确定启用托盘【" + num + "】?";
DialogResult dialogResult = MessageBox.Show(msg, "提示?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dialogResult.Equals(DialogResult.OK)) if (dialogResult.Equals(DialogResult.OK))
{ {
LogUtil.info("用户手动启用托盘【" + num + "】"); LogUtil.info("用户手动启用托盘【" + num + "】" + tray.ToStr());
if (tray.IsFull && tray.InOrOutStore.Equals(1))
{
TrayManager.ClearInstore(tray,"清理禁用托盘");
}
TrayDisableManager.RemoveDisable(num); TrayDisableManager.RemoveDisable(num);
this.dataGridView1.Rows.RemoveAt(rowIndex); this.dataGridView1.Rows.RemoveAt(rowIndex);
...@@ -106,5 +116,44 @@ namespace OnlineStore.AssemblyLine ...@@ -106,5 +116,44 @@ namespace OnlineStore.AssemblyLine
lblTrayInfo.Text = tray.ToStr(); lblTrayInfo.Text = tray.ToStr();
} }
} }
private void chbProTray_CheckedChanged(object sender, EventArgs e)
{
TrayDisableManager.ProcessTray = chbProTray.Checked;
LogUtil.info("用户更改" + chbProTray.Text + "=" + chbProTray.Checked);
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Visible)
{
try
{
ProvidingEquip pro4 = LineManager.Line.ProvidingEquipMap[204];
if(pro4.WarnMsg.Contains( TrayDisableManager.ProWarnMsg))
{
lblPro4Warnmsg.Text = pro4.WarnMsg;
}else
{
lblPro4Warnmsg.Text = "";
}
}catch (Exception ex)
{
LogUtil.error("FrmDisableTray timer1_Tick error:" + ex.ToString());
}
}
}
private void group3_Enter(object sender, EventArgs e)
{
}
private void FrmDisableTray_FormClosed(object sender, FormClosedEventArgs e)
{
TrayDisableManager.ProcessTray = false;
LogUtil.info("退出禁用托盘处理界面," + chbProTray.Text + "=false" );
}
} }
} }
...@@ -135,4 +135,25 @@ ...@@ -135,4 +135,25 @@
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column_trayNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_DeviceName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_datetime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_describle.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_TrayInfo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>
\ No newline at end of file \ No newline at end of file
20200225 20200226
环形线更新文件 20210226-AssemblyLine-更新,能重启时帮忙更新下。
修改内容:
1.有料托盘需要入库时,若检测信号不亮,直接禁用托盘。
2.禁用托盘界面增加选项:开始处理托盘。勾选后,禁用的托盘到达出料4后,会等待托盘启用后再放行。退出界面自动退出托盘处理。
3.启用托盘会清理托盘信息,需拿走托盘上的物料。
4.有托盘被禁用时,发送报警信息到服务器。
20200225
1.托盘增加禁用功能,禁用的托盘可在(设备调试->查看禁用托盘)界面手动启用。 1.托盘增加禁用功能,禁用的托盘可在(设备调试->查看禁用托盘)界面手动启用。
2.进仓界面增加启用托盘检测的勾选配置。 2.进仓界面增加启用托盘检测的勾选配置。
3.进仓启用托盘检测功能后,若拦截到入库托盘,需要等待托盘检测信号亮。拦截空托盘出库时,如果托盘检测信号亮,直接禁用托盘。 3.进仓启用托盘检测功能后,若拦截到入库托盘,需要等待托盘检测信号亮。拦截空托盘出库时,如果托盘检测信号亮,直接禁用托盘。
......
...@@ -1089,9 +1089,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -1089,9 +1089,13 @@ namespace OnlineStore.DeviceLibrary
alarmList.Add(new AlarmMsg(Name, "line_" + alarmType, WarnMsg)); alarmList.Add(new AlarmMsg(Name, "line_" + alarmType, WarnMsg));
} }
int num = TrayDisableManager.GetDisableList().Count; int num = TrayDisableManager.GetDisableList().Count;
if (num > 5) if (num >= 5)
{ {
alarmList.Add(new AlarmMsg(Name, "line_Tray" , "已有["+num+"]个托盘被禁用,请尽快处理")); alarmList.Add(new AlarmMsg(Name, "line_Tray", "已有[" + num + "]个托盘被禁用,请尽快处理"));
}
else if (num >= 1)
{
alarmList.Add(new AlarmMsg(Name, "line_Tray", "已有[" + num + "]个托盘被禁用,请尽快处理"));
} }
foreach (EquipBase equip in AllEquipMap.Values) foreach (EquipBase equip in AllEquipMap.Values)
{ {
......
...@@ -498,8 +498,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -498,8 +498,14 @@ namespace OnlineStore.DeviceLibrary
{ {
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals(""))) if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")))
{ {
if (LineManager.useTrayCheck.Contains(DeviceID) && IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.LOW))
{
LogInfo(" 入库需拦截有料托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,禁用托盘");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮");
return false;
}
//判断是否验证成功,如果验证失败,不入库 //判断是否验证成功,如果验证失败,不入库
if (LineServer.RightInPosId(DeviceID, cc.PosId)) else if (LineServer.RightInPosId(DeviceID, cc.PosId))
{ {
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg); SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg);
return true; return true;
...@@ -648,7 +654,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -648,7 +654,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
private bool RemoveInStore(InOutParam param) internal bool RemoveInStore(InOutParam param, string logName = "料盘已移走")
{ {
if (waitInStoreList.Count > 0) if (waitInStoreList.Count > 0)
{ {
...@@ -669,7 +675,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -669,7 +675,7 @@ namespace OnlineStore.DeviceLibrary
if (reIndex >= 0) if (reIndex >= 0)
{ {
waitInStoreList.RemoveAt(reIndex); waitInStoreList.RemoveAt(reIndex);
LogInfo("*******料盘已移走,清理入库任务:【" + param.ToStr() + "】"); LogInfo("*******"+ logName + ",清理入库任务:【" + param.ToStr() + "】");
return true; return true;
} }
} }
...@@ -833,16 +839,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -833,16 +839,17 @@ namespace OnlineStore.DeviceLibrary
if (isNeed) if (isNeed)
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
if (isFull && LineManager.useTrayCheck.Contains(DeviceID))
{
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200,等待料盘检测信号");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck, IO_VALUE.HIGH));
}
else
{
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200");
} SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
//if (isFull && LineManager.useTrayCheck.Contains(DeviceID))
//{
// CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200,等待料盘检测信号");
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck, IO_VALUE.HIGH));
//}
//else
//{
// CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200");
//}
} }
else else
{ {
......
...@@ -308,18 +308,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -308,18 +308,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug(Name + "托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸上升,下降耗时(" + FormUtil.GetSpanStr(span) + "),等待 阻挡2托盘检测=1)"); LogUtil.debug(Name + "托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸上升,下降耗时(" + FormUtil.GetSpanStr(span) + "),等待 阻挡2托盘检测=1)");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
} }
// else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_FixtureCheck))
// {
// SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_Stop2Down);
// CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 再次检测料盘信号");
// //CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待" + TrayManager.SwTrayWaitTime + ",再次检测料盘信号");
//// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
// if (Config.SidesWayNum.Equals(4))
// {
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(400));
// }
// }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_Stop2Down)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_Stop2Down))
{ {
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " ,等待编码信号稳定StopCylinder_Check2=1"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " ,等待编码信号稳定StopCylinder_Check2=1");
...@@ -365,24 +353,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -365,24 +353,16 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
// SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown); if (this.Config.SidesWayNum.Equals(4) && TrayDisableManager.ProcessTray && TrayDisableManager.DisableTray(currTrayNum))
CheckLog("放托盘(放开阻挡)" + MoveInfo.SLog + " 托盘 【" + currTrayNum + "】直接放行,判断顶升需要下降或上升");
if (Config.SidesWayNum <= 0)
{ {
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_10_WaitProDisableTray);
LogInfo(Name + "拦截禁用托盘【"+currTrayNum+"】,等待托盘启用后再放行");
} }
else if (Config.SidesWayNum.Equals(4))
{ else
CylinderMove(null, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
if (LineManager.Line.SwCanUpMove(1))
{ {
LineManager.Line.CylinderMove(null, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up); MO_14_TopDown();
}
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
} }
} }
} }
...@@ -425,6 +405,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -425,6 +405,24 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 不需要出出料,直接放行 #region 不需要出出料,直接放行
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_10_WaitProDisableTray))
{
bool isOk = (!TrayDisableManager.ProcessTray) || (!TrayDisableManager.DisableTray(currTrayNum));
if (isOk)
{
ClearTimeoutAlarm(TrayDisableManager.ProWarnMsg);
MO_14_TopDown();
}
else if(SecondMoveInfo.IsTimeOut(30))
{
WarnMsg = Name + TrayDisableManager.ProWarnMsg+ "[" + currTrayNum + "], 请处理并启用托盘,已超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
}
else
{
WarnMsg = Name + TrayDisableManager.ProWarnMsg + "[" + currTrayNum + "], 请处理并启用托盘";
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_TopDown)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_TopDown))
{ {
if (Config.SidesWayNum > 0) if (Config.SidesWayNum > 0)
...@@ -485,7 +483,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -485,7 +483,27 @@ namespace OnlineStore.DeviceLibrary
} }
#endregion #endregion
} }
private void MO_14_TopDown()
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown);
CheckLog("放托盘(放开阻挡)" + MoveInfo.SLog + " 托盘 【" + currTrayNum + "】直接放行,判断顶升需要下降或上升");
if (Config.SidesWayNum <= 0)
{
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
else if (Config.SidesWayNum.Equals(4))
{
CylinderMove(null, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
if (LineManager.Line.SwCanUpMove(1))
{
LineManager.Line.CylinderMove(null, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up);
}
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
}
#endregion #endregion
#region 料盘移栽处理 #region 料盘移栽处理
......
...@@ -10,7 +10,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -10,7 +10,8 @@ namespace OnlineStore.DeviceLibrary
{ {
public class TrayDisableManager public class TrayDisableManager
{ {
public static bool ProcessTray = false;
public static string ProWarnMsg = "拦截到禁用托盘";
/// <summary> /// <summary>
/// 托盘集合,key=托盘编号,value=托盘详细信息 /// 托盘集合,key=托盘编号,value=托盘详细信息
/// </summary> /// </summary>
...@@ -51,6 +52,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -51,6 +52,8 @@ namespace OnlineStore.DeviceLibrary
public static void RemoveDisable(int trayNum) public static void RemoveDisable(int trayNum)
{ {
TrayManager.UpdateTrayInfo(trayNum);
bool result = TrayDisableMap.TryRemove(trayNum, out TrayDisableInfo removeInfo); bool result = TrayDisableMap.TryRemove(trayNum, out TrayDisableInfo removeInfo);
if (result && removeInfo != null) if (result && removeInfo != null)
{ {
......
...@@ -176,6 +176,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -176,6 +176,24 @@ namespace OnlineStore.DeviceLibrary
{ {
TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>(); TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>();
} }
public static void ClearInstore(TrayInfo tray,string msg = "手动清空托盘")
{
if (tray == null)
{
return;
}
//如果是入库托盘,需要清理入库消息
if (tray.InOrOutStore.Equals(1) && tray.InoutPar.InStoreNg.Equals(false) && (!tray.InoutPar.PosId.Equals("")))
{
int storeId = tray.InoutPar.GetStoreId();
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
{
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
moveEquip.RemoveInStore(tray.InoutPar, msg);
}
}
}
#region 横移状态缓存 #region 横移状态缓存
internal static bool LineCanMoveSW(int swNum) internal static bool LineCanMoveSW(int swNum)
{ {
......
...@@ -305,6 +305,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -305,6 +305,11 @@ namespace OnlineStore.DeviceLibrary
/// 等待StoreMove移走料盘开始放托盘通过 /// 等待StoreMove移走料盘开始放托盘通过
/// </summary> /// </summary>
MIO_09_WaitLetFixtureGo=3089, MIO_09_WaitLetFixtureGo=3089,
/// <summary>
/// 等待禁用托盘被启用
/// </summary>
MIO_10_WaitProDisableTray=3090,
#endregion #endregion
#region 移栽装置出库处理 3100-3200 #region 移栽装置出库处理 3100-3200
...@@ -391,7 +396,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -391,7 +396,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 移载(流水线)装置出库处理,上下气缸1上升 /// 移载(流水线)装置出库处理,上下气缸1上升
/// </summary> /// </summary>
MO_60_CylinderUp , MO_60_CylinderUp,
#region 入料模块,紧急出料移栽处理 #region 入料模块,紧急出料移栽处理
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!