Commit eed214ee LN

托盘横移条件修改。T4托盘放行修改。

1 个父辈 724c41a9
...@@ -5,6 +5,7 @@ using System; ...@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
...@@ -86,8 +87,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,8 +87,17 @@ namespace OnlineStore.DeviceLibrary
} }
private static void AgvClient_CloseDoor(string id, string rfid) private static void AgvClient_CloseDoor(string id, string rfid)
{ {
// RFIDData data = new RFIDData(content); LogUtil.info("收到 AgvClient_CloseDoor [" + id + "] [" + rfid + "] 更新状态 ");
LogUtil.info("收到 AgvClient_CloseDoor [" + id + "] [" + rfid + "] "); UpdateAction(id, ClientAction.CloseDoor);
Task.Factory.StartNew(delegate
{
Thread.Sleep(5000);
if (GetAction(id).Equals(ClientAction.CloseDoor))
{
SetStatus(id);
LogUtil.error("收到 AgvClient_CloseDoor [" + id + "] [" + rfid + "] 5秒后,更新状态为None ");
}
});
} }
private static void AgvClient_Ready(string id, string rfid) private static void AgvClient_Ready(string id, string rfid)
{ {
......
...@@ -990,7 +990,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -990,7 +990,7 @@ namespace OnlineStore.DeviceLibrary
}); });
} }
internal void ShelfEnterProcess() internal void ShelfEnterProcess()
{ {
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
string logName = Name + "AGV料架进入 [" + Config.AgvInName + "] "; string logName = Name + "AGV料架进入 [" + Config.AgvInName + "] ";
...@@ -998,55 +998,55 @@ namespace OnlineStore.DeviceLibrary ...@@ -998,55 +998,55 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.LOW))
{ {
LogUtil.info(logName + " 开始"); LogUtil.info(logName + " 开始,设置状态=MayEnter");
//AgvClient.SetStatus(Config.AgvInName,"",ClientAction.MayEnter,ClientLevel.High); AgvClient.SetStatus(Config.AgvInName, "", ClientAction.MayEnter, ClientLevel.High, true);
ProcessShelfEnter = true; ProcessShelfEnter = true;
////进料阻挡上升
//IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);
//转动线体 //转动线体
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH); IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待进料检测信号 //等待进料检测信号
bool result = WaitIo(IO_Type.SL_Entry_Check, IO_VALUE.HIGH, 60000); bool result = WaitIo(IO_Type.SL_Entry_Check, IO_VALUE.HIGH, 600000);
if (!result) LogUtil.info(logName + " 等待 SL_Entry_Check=High " + result + ", 等待 SL_Stop_Check 信号");
{ result = WaitIo(IO_Type.SL_Stop_Check, IO_VALUE.HIGH, 600000);
LogUtil.info(logName + " 等待 SL_Entry_Check=High 超时, 等待 SL_Stop_Check 信号");
}
else
{
LogUtil.info(logName + "已收到 SL_Entry_Check=High , 等待 SL_Stop_Check 信号");
}
result = WaitIo(IO_Type.SL_Stop_Check, IO_VALUE.HIGH, 60000);
if (!result) LogUtil.info(logName + " 等待 SL_Stop_Check=High " + result + ",开始等待CloseDoor 超时10分钟");
try
{ {
LogUtil.info(logName + " 等待 SL_Stop_Check=High 超时,等待3000后停止转动,发送 FinishEnter"); result = WaitUtil.Wait(600000, delegate ()
{
return AgvClient.GetAction(Config.AgvInName).Equals(ClientAction.CloseDoor);
}, logName + "等待CloseDoor超时");
} }
else catch (TimeoutException te)
{ {
LogUtil.info(logName + "已收到 SL_Stop_Check=High ,等待5000后停止转动,发送 FinishEnter"); LogUtil.error(logName + " 超时:" + te);
} }
//等待200毫秒后停止转动 ////等待 15000 毫秒后停止转动
Thread.Sleep(5000); //Thread.Sleep(15000);
if (MoveInfo.IsStep(LineMoveStep.FI_05_LineStart)) if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_05_LineStart))
{ {
LogUtil.info(logName + " 等待5000后, MoveInfo.MoveType= FI_03_LineStart 不需要停止链条转动"); LogUtil.info(logName + " 完成, MoveInfo.MoveType= FI_03_LineStart 不需要停止链条转动");
} }
else else
{ {
LogUtil.info(logName + "等待5000后,停止链条转动"); LogUtil.info(logName + "完成,停止链条转动");
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW); IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
} }
//料架可离开 //料架可离开
AgvClient.SetStatus(Config.AgvInName, "", ClientAction.FinishEnter, ClientLevel.High, true); //AgvClient.SetStatus(Config.AgvInName, "", ClientAction.FinishEnter, ClientLevel.High, true);
Thread.Sleep(1000); Thread.Sleep(1000);
AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None, ClientLevel.High, true); AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None, ClientLevel.High, true);
ProcessShelfEnter = false; ProcessShelfEnter = false;
LogUtil.info(logName + " 结束"); LogUtil.info(logName + " 结束");
} }
else
{
LogUtil.info(logName + "开始,未检测到料架信号,不处理,设置=None");
AgvClient.SetStatus(Config.AgvInName, LastOutShelfId, ClientAction.None, ClientLevel.High, true);
}
} }
catch (TimeoutException te) catch (TimeoutException te)
{ {
...@@ -1063,7 +1063,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1063,7 +1063,6 @@ namespace OnlineStore.DeviceLibrary
} }
}); });
} }
private bool ReadShelfId() private bool ReadShelfId()
{ {
try try
...@@ -1109,6 +1108,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -1109,6 +1108,17 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#endregion #endregion
internal bool NeedEmptyTray()
{
if (MoveInfo.MoveType.Equals(LineMoveType.InStore) &&
MoveInfo.MoveStep > LineMoveStep.FI_14_TrayLocation_Before &&
MoveInfo.MoveStep < LineMoveStep.FI_51_BatchAxisToP2)
{
return true;
}
return false;
}
private string lastcode = ""; private string lastcode = "";
public override string GetMoveStr() public override string GetMoveStr()
{ {
......
...@@ -518,7 +518,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -518,7 +518,6 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, LastPosParam.Clone(), LastPosParam.NgMsg); TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, LastPosParam.Clone(), LastPosParam.NgMsg);
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum); TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
InLog("料盘移栽" + MoveInfo.SLog + ":升降轴到P2: [" + targetPositon + "] 更新托盘信息【" + tray.ToStr() + "】"); InLog("料盘移栽" + MoveInfo.SLog + ":升降轴到P2: [" + targetPositon + "] 更新托盘信息【" + tray.ToStr() + "】");
...@@ -560,14 +559,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -560,14 +559,23 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_36_TrayMoveOk); if (IOValue(IO_Type.SL_ClampCylinder_Check).Equals(IO_VALUE.LOW))
MoveInfo.MoveParam = new InOutParam(); {
InLog("料盘移栽" + MoveInfo.SLog + ":升降轴已到P1,托盘放行"); FI_37_TrayMoveOk();
TrayMoveOk(); }
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_36_ClampCheck);
InLog("料盘移栽" + MoveInfo.SLog + ":等待夹爪无料");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_ClampCylinder_Check, IO_VALUE.LOW));
}
} }
} }
else if (MoveInfo.IsStep(LineMoveStep.FI_36_ClampCheck))
else if (MoveInfo.IsStep(LineMoveStep.FI_36_TrayMoveOk)) {
FI_37_TrayMoveOk();
}
else if (MoveInfo.IsStep(LineMoveStep.FI_37_TrayMoveOk))
{ {
if (axisCheckTimer != null && axisCheckTimer.Enabled) if (axisCheckTimer != null && axisCheckTimer.Enabled)
{ {
...@@ -719,6 +727,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -719,6 +727,14 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
} }
private void FI_37_TrayMoveOk()
{
MoveInfo.NextMoveStep(LineMoveStep.FI_37_TrayMoveOk);
MoveInfo.MoveParam = new InOutParam();
InLog("料盘移栽" + MoveInfo.SLog + ":,托盘放行");
TrayMoveOk();
}
private Task getPosTask = null; private Task getPosTask = null;
private InOutParam LastPosParam = null; private InOutParam LastPosParam = null;
private int LastResult = 0; private int LastResult = 0;
......
...@@ -593,8 +593,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -593,8 +593,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (CylinderIsOk(IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take)) if (CylinderIsOk(IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take))
{ {
int targetP = Config.GetUpdownP2Detial(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW); int targetP = Config.GetUpdownP2Detial(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
if (UpdownAxis.IsInPosition(targetP)) if (UpdownAxis.IsInPosition(targetP))
...@@ -613,13 +612,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -613,13 +612,14 @@ namespace OnlineStore.DeviceLibrary
if (UpdownIsInP1()) if (UpdownIsInP1())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_22_CylinderTake); MoveInfo.NextMoveStep(LineMoveStep.FO_22_CylinderTake);
OutLog(outType + MoveInfo.SLog + ":上料横移机构取料端"); OutLog(outType + MoveInfo.SLog + ":上料横移机构取料端,等待夹爪无料");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_ClampCylinder_Check, IO_VALUE.LOW));
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_21_AxisDownMove); MoveInfo.NextMoveStep(LineMoveStep.FO_21_AxisDownMove);
OutLog(outType + MoveInfo.SLog + ":上料横移机构取料端 前升降轴先到P1 ["+ Config.UpDownAxisP1 + "]"); OutLog(outType + MoveInfo.SLog + ":上料横移机构取料端 前升降轴先到P1 [" + Config.UpDownAxisP1 + "]");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
} }
} }
...@@ -660,38 +660,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -660,38 +660,37 @@ namespace OnlineStore.DeviceLibrary
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
} }
int trayNum = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.TrayNumber : currTrayNum;
//更新此托盘为空托盘
TrayManager.UpdateTrayInfo(trayNum, false);
//SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
TrayMoveOk();
} }
else if (MoveInfo.IsStep(LineMoveStep.FO_26_UpdownAxisToP1)) else if (MoveInfo.IsStep(LineMoveStep.FO_26_UpdownAxisToP1))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_27_ClampCheck);
OutLog(outType + MoveInfo.SLog + ":检测夹爪料盘检测=HIGH");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_ClampCylinder_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.IsStep(LineMoveStep.FO_27_ClampCheck))
{
if (UpdownIsInP1()) if (UpdownIsInP1())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_28_CylinderGive); if (IOValue(IO_Type.SL_ClampCylinder_Check).Equals(IO_VALUE.LOW))
OutLog(outType + MoveInfo.SLog + ":上料横移机构到放料端"); {
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give); MoveInfo.NextMoveStep(LineMoveStep.FO_27_ClampCheck);
OutLog(outType + MoveInfo.SLog + ":检测夹爪料盘检测=HIGH");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_ClampCylinder_Check, IO_VALUE.HIGH));
}
else
{
FO_28_CylinderGive(outType);
}
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_26_UpdownAxisToP1); MoveInfo.NextMoveStep(LineMoveStep.FO_26_UpdownAxisToP1);
OutLog(outType + MoveInfo.SLog + ":上料横移机构到放料端前,先升降轴先到P1 ["+ Config.UpDownAxisP1 + "]"); OutLog(outType + MoveInfo.SLog + ":上料横移机构到放料端前,先升降轴先到P1 [" + Config.UpDownAxisP1 + "]");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
} }
}
else if (MoveInfo.IsStep(LineMoveStep.FO_27_ClampCheck))
{
FO_28_CylinderGive(outType);
} }
else if (MoveInfo.IsStep(LineMoveStep.FO_28_CylinderGive)) else if (MoveInfo.IsStep(LineMoveStep.FO_28_CylinderGive))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_29_UpdownAxisToP3); MoveInfo.NextMoveStep(LineMoveStep.FO_29_UpdownAxisToP3);
OutLog(outType + MoveInfo.SLog + ":移栽伺服到P3 ["+ Config.UpDownAxisP3 + "]"); OutLog(outType + MoveInfo.SLog + ":移栽伺服到P3 [" + Config.UpDownAxisP3 + "]");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP3, Config.UpdownAxis_P3Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP3, Config.UpdownAxis_P3Speed);
} }
else if (MoveInfo.IsStep(LineMoveStep.FO_29_UpdownAxisToP3)) else if (MoveInfo.IsStep(LineMoveStep.FO_29_UpdownAxisToP3))
...@@ -795,6 +794,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -795,6 +794,17 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
private void FO_28_CylinderGive(string outType)
{
int trayNum = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.TrayNumber : currTrayNum;
TrayManager.UpdateTrayInfo(trayNum, false);
TrayMoveOk();
MoveInfo.NextMoveStep(LineMoveStep.FO_28_CylinderGive);
OutLog(outType + MoveInfo.SLog + ":更新托盘【"+ trayNum + "】为空,托盘可离开,上料横移机构到放料端 ");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
private bool afterPutOk = false; private bool afterPutOk = false;
private void FO_25_CylinderTighten(string outType) private void FO_25_CylinderTighten(string outType)
{ {
......
...@@ -851,7 +851,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -851,7 +851,7 @@ namespace OnlineStore.DeviceLibrary
FeedingEquip feed1 = LineManager.Line.FeedingEquipMap[101]; FeedingEquip feed1 = LineManager.Line.FeedingEquipMap[101];
FeedingEquip feed2 = LineManager.Line.FeedingEquipMap[102]; FeedingEquip feed2 = LineManager.Line.FeedingEquipMap[102];
if ((!feed1.MoveInfo.MoveType.Equals(LineMoveType.InStore)) && (!feed2.MoveInfo.MoveType.Equals(LineMoveType.InStore))) if ((!feed1.NeedEmptyTray()) && (!feed2.NeedEmptyTray()))
{ {
return true; return true;
} }
...@@ -864,15 +864,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -864,15 +864,14 @@ namespace OnlineStore.DeviceLibrary
{ {
if (tray.InOrOutStore.Equals(1)) if (tray.InOrOutStore.Equals(1))
{ {
int storeId = tray.InoutPar.GetStoreId(); //NG料需要横移
List<int> instoreId = new List<int> { 1, 2, 3, 4, 5, 13, 14, 15, 16 }; if (tray.InoutPar.InStoreNg)
if (!instoreId.Contains(storeId))
{ {
return true; return true;
} }
int storeId = tray.InoutPar.GetStoreId();
//NG料需要横移 List<int> instoreId = new List<int> { 1, 2, 3, 4, 5, 13, 14, 15, 16 };
if (tray.InoutPar.InStoreNg) if (!instoreId.Contains(storeId))
{ {
return true; return true;
} }
...@@ -893,16 +892,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -893,16 +892,17 @@ namespace OnlineStore.DeviceLibrary
} }
else if (tray.InOrOutStore.Equals(1)) else if (tray.InOrOutStore.Equals(1))
{ {
int storeId = tray.InoutPar.GetStoreId(); if (tray.InoutPar.InStoreNg)
List<int> instoreId = new List<int> { 11, 12, 23, 24 };
if (!instoreId.Contains(storeId))
{ {
return true; return true;
} }
if (tray.InoutPar.InStoreNg) int storeId = tray.InoutPar.GetStoreId();
List<int> instoreId = new List<int> { 11, 12, 23, 24 };
if (!instoreId.Contains(storeId))
{ {
return true; return true;
} }
} }
} }
} }
...@@ -928,7 +928,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -928,7 +928,7 @@ namespace OnlineStore.DeviceLibrary
} }
FeedingEquip feed5 = LineManager.Line.FeedingEquipMap[105]; FeedingEquip feed5 = LineManager.Line.FeedingEquipMap[105];
if (!feed5.MoveInfo.MoveType.Equals(LineMoveType.InStore)) if (!feed5.NeedEmptyTray())
{ {
return true; return true;
} }
......
...@@ -591,10 +591,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -591,10 +591,6 @@ namespace OnlineStore.DeviceLibrary
if (Config.WorkDeviceId > 0) if (Config.WorkDeviceId > 0)
{ {
TrayInfo trayInfo = TrayManager.GetTrayInfo(trayNum); TrayInfo trayInfo = TrayManager.GetTrayInfo(trayNum);
//if (trayInfo.IsFull)
//{
// return false;
//}
//如果是HY02,且T1在等待托盘,先放行一个托盘 //如果是HY02,且T1在等待托盘,先放行一个托盘
if (DeviceID.Equals(202)) if (DeviceID.Equals(202))
......
...@@ -608,9 +608,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -608,9 +608,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
FI_35_AxisToP1, FI_35_AxisToP1,
/// <summary> /// <summary>
/// 料盘移栽:检测夹爪无料
/// </summary>
FI_36_ClampCheck,
/// <summary>
/// 料盘移栽: 放托盘离开 /// 料盘移栽: 放托盘离开
/// </summary> /// </summary>
FI_36_TrayMoveOk, FI_37_TrayMoveOk,
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!