Commit 9fea21ae LN

托盘横移修改:托盘检测信号需要持续500。阻挡气缸单独下降。

1 个父辈 e095c294
...@@ -34,7 +34,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -34,7 +34,8 @@ namespace OnlineStore.DeviceLibrary
/// 升降轴 /// 升降轴
/// </summary> /// </summary>
public AxisBean UpdownAxis = null; public AxisBean UpdownAxis = null;
public delegate void TrayProcessEnd(int swNum, int trayNum);
protected virtual void StopMoveProcess() protected virtual void StopMoveProcess()
{ {
} }
......
...@@ -43,6 +43,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -43,6 +43,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
public event TrayProcessEnd TrayPEndEvent;
#region 托盘检测 #region 托盘检测
private InOutParam CheckParam = new InOutParam(); private InOutParam CheckParam = new InOutParam();
private void StartCheckFixture() private void StartCheckFixture()
...@@ -53,11 +54,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -53,11 +54,9 @@ namespace OnlineStore.DeviceLibrary
} }
if (Config.SidesWayNum > 0) if (Config.SidesWayNum > 0)
{ {
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
bool isTestNeed = (LineManager.Line.runStatus <= LineRunStatus.Wait); if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && canProcess)
bool isNeedTray = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && (isTestNeed || isNeedTray))
{ {
UpdateTrayNum(); UpdateTrayNum();
// preTrayNum = currTrayNum; // preTrayNum = currTrayNum;
...@@ -78,14 +77,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -78,14 +77,13 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateSWState(Config.SidesWayNum, 1); TrayManager.UpdateSWState(Config.SidesWayNum, 1);
} }
} }
else if (Config.SidesWayNum.Equals(2) && IOValue(IO_Type.SW_StopCheck).Equals(IO_VALUE.HIGH) && (isTestNeed || isNeedTray)) else if (Config.SidesWayNum.Equals(2) && IOValue(IO_Type.SW_StopCheck).Equals(IO_VALUE.HIGH) && canProcess)
{ {
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam); SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
TrayManager.UpdateSWState(Config.SidesWayNum, 2); TrayManager.UpdateSWState(Config.SidesWayNum, 2);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_StopCylinder1Down);
CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,等待"+TrayManager.StopDownWaitTime); CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,等待"+TrayManager.StopDownWaitTime);
IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
} }
...@@ -107,7 +105,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,7 +105,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_StopCylinder1Down);
CheckLog(" 检测到FL_StopCheck:" + SecondMoveInfo.SLog + " FL阻挡1下降 ,最多等待1秒)"); CheckLog(" 检测到FL_StopCheck:" + SecondMoveInfo.SLog + " FL阻挡1下降 ,最多等待1秒)");
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH));
...@@ -133,11 +131,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -133,11 +131,11 @@ namespace OnlineStore.DeviceLibrary
} }
#region 托盘检测 #region 托盘检测
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_StopCylinder1Down)) if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_00_StopCylinder1Down))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
if (Config.SidesWayNum <= 0) if (Config.SidesWayNum <= 0)
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡1上升,等待FL_TrayCheck=1)"); CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡1上升,等待FL_TrayCheck=1)");
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW));
...@@ -145,11 +143,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -145,11 +143,38 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_FixtureCheck);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸上升,等待SW_TrayCheck=1)");
IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH));
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_FixtureCheck))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_02_WaitFixture);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "再次等待SW_TrayCheck=1并需要持续:" + TrayManager.SwTrayWaitTime);
IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_02_WaitFixture))
{
if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸上升,等待SW_TrayCheck=1)"); CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸上升,等待SW_TrayCheck=1)");
IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW); IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH));
} }
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_02_WaitFixture);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "再次等待SW_TrayCheck=1并需要持续:" + TrayManager.SwTrayWaitTime);
IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
}
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_StopCylinder2Down)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_StopCylinder2Down))
{ {
...@@ -191,8 +216,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -191,8 +216,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
CheckLog("托盘检测:不需要次托盘,结束处理 )"); CheckLog("托盘检测:不需要次托盘,结束处理 )");
TrayManager.UpdateSWState(Config.SidesWayNum, 1); SMoveEnd();
SecondMoveInfo.EndMove();
} }
} }
} }
...@@ -249,11 +273,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -249,11 +273,10 @@ namespace OnlineStore.DeviceLibrary
{ {
if (Config.SidesWayNum.Equals(2)) if (Config.SidesWayNum.Equals(2))
{ {
//更新横移托盘已处理完成
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
//preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
CheckLog("托盘放行: 此处为环形线横移2,顶升气缸不需要下降, (托盘放行结束) "); CheckLog("托盘放行: 此处为环形线横移2,顶升气缸不需要下降, (托盘放行结束) ");
SecondMoveInfo.EndMove();
SMoveEnd();
} }
else else
{ {
...@@ -275,11 +298,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -275,11 +298,8 @@ namespace OnlineStore.DeviceLibrary
{ {
if (Config.SidesWayNum > 0) if (Config.SidesWayNum > 0)
{ {
//更新横移托盘已处理完成
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
//preTrayNum = currTrayNum;
CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) "); CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) ");
SecondMoveInfo.EndMove(); SMoveEnd();
} }
else else
{ {
...@@ -308,8 +328,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -308,8 +328,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) "); CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) ");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); SMoveEnd();
SecondMoveInfo.EndMove();
} }
#endregion #endregion
...@@ -318,7 +337,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -318,7 +337,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (MoveInfo.MoveType.Equals(LineMoveType.None) && StartTrayOut(SecondMoveInfo.MoveParam)) if (MoveInfo.MoveType.Equals(LineMoveType.None) && StartTrayOut(SecondMoveInfo.MoveParam))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_WaitOutEnd); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_WaitOutEnd);
} }
else else
{ {
...@@ -333,6 +352,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -333,6 +352,13 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private void SMoveEnd()
{
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
SecondMoveInfo.EndMove();
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
#endregion #endregion
#region 入料流程 #region 入料流程
......
...@@ -12,9 +12,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -12,9 +12,10 @@ namespace OnlineStore.DeviceLibrary
{ {
#region 出料流程 #region 出料流程
private int OutStoreHeight = -1; private int OutStoreHeight = -1;
internal bool CanStartCheckOut() internal bool CanStartCheckOut(int trayNum)
{ {
UpdateTrayNum(); preTrayNum = currTrayNum;
currTrayNum = trayNum;
if (CurrTrayIsNeed(currTrayNum, true)) if (CurrTrayIsNeed(currTrayNum, true))
{ {
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam); SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
......
...@@ -88,6 +88,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,6 +88,7 @@ namespace OnlineStore.DeviceLibrary
AddDeviceName(ioList, config.IOIPList); AddDeviceName(ioList, config.IOIPList);
FeedingEquipMap.Add(config.Id, equip); FeedingEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip); AllEquipMap.Add(config.Id, equip);
equip.TrayPEndEvent += Equip_TrayPEndEvent;
} }
foreach (MoveEquip_Config config in configList.Values) foreach (MoveEquip_Config config in configList.Values)
{ {
...@@ -104,6 +105,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -104,6 +105,7 @@ namespace OnlineStore.DeviceLibrary
AddDeviceName(ioList, config.IOIPList); AddDeviceName(ioList, config.IOIPList);
ProvidingEquipMap.Add(config.Id, equip); ProvidingEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip); AllEquipMap.Add(config.Id, equip);
equip.TrayPEndEvent += Equip_TrayPEndEvent;
} }
foreach (DischargeLine_Config config in disLineMap.Values) foreach (DischargeLine_Config config in disLineMap.Values)
{ {
...@@ -203,7 +205,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -203,7 +205,7 @@ namespace OnlineStore.DeviceLibrary
}); });
} }
private void AddDeviceName(List<string> targetList, List<string> list) private void AddDeviceName(List<string> targetList, List<string> list)
{ {
foreach (string str in list) foreach (string str in list)
...@@ -316,7 +318,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -316,7 +318,7 @@ namespace OnlineStore.DeviceLibrary
private void RHomeOp() private void RHomeOp()
{ {
TrayManager.SidesWayStateMap = new System.Collections.Concurrent.ConcurrentDictionary<int, int>() ; // TrayManager.SidesWayStateMap = new System.Collections.Concurrent.ConcurrentDictionary<int, int>() ;
alarmType = LineAlarmType.None; alarmType = LineAlarmType.None;
mainTimer.Enabled = false; mainTimer.Enabled = false;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
......
...@@ -353,32 +353,76 @@ namespace OnlineStore.DeviceLibrary ...@@ -353,32 +353,76 @@ namespace OnlineStore.DeviceLibrary
#region 横移处理- #region 横移处理-
/// <summary> internal int Sw41TrayNum = 0;
/// 横移无处理 internal int Sw23TrayNum = 0;
/// </summary> private void Equip_TrayPEndEvent(int swNum, int trayNum)
/// <param name="sidesWayNum"></param>
/// <returns></returns>
internal bool SwNoProcess(int sidesWayNum)
{ {
if (sidesWayNum.Equals(2) && TrayManager.GetSwStatus(sidesWayNum).Equals(1)) if (swNum <= 0 || this.runStatus <= (LineRunStatus.Wait))
{ {
return false; return;
} }
if (sidesWayNum.Equals(1) || sidesWayNum.Equals(4)) if (swNum.Equals(2))
{ {
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None)) if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None))
{ {
return true; Sw23TrayNum = trayNum;
SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
SWLog("横移轨道23:检测到SW2_TrayCheck,定位气缸下降,等待横移2托盘检测信号,托盘号 [" + Sw23TrayNum + "] ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
CylinderMove(SW23_MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
CylinderMove(SW23_MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
}
else
{
LogInfo("Equip_TrayPEndEvent【" + swNum + "】【" + trayNum + "】失败,SW23_MoveInfo 忙碌中");
} }
} }
else if (sidesWayNum.Equals(2) || sidesWayNum.Equals(3)) else if (swNum.Equals(4))
{ {
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None)) if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None))
{ {
return true; Sw41TrayNum = trayNum;
SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
SWLog("横移轨道41:检测到SW4_TrayCheck,定位气缸下降, 等待横移4托盘检测信号,更新托盘号 [" + Sw41TrayNum + "] ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
}
else
{
LogInfo("Equip_TrayPEndEvent【" + swNum + "】【" + trayNum + "】失败,SW41_MoveInfo 忙碌中");
} }
} }
else }
/// <summary>
/// 横移无处理
/// </summary>
internal bool SwNoProcess(int sidesWayNum)
{
if (LineManager.Line.runStatus <= LineRunStatus.Wait)
{
return true;
}
if (sidesWayNum.Equals(2))
{
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None) && FeedingEquipMap[104].SecondMoveInfo.MoveType.Equals(LineMoveType.None))
{ return true; }
}
else if (sidesWayNum.Equals(3) && runStatus <= LineRunStatus.Wait)
{
return true;
}
if (sidesWayNum.Equals(4))
{
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && FeedingEquipMap[101].SecondMoveInfo.MoveType.Equals(LineMoveType.None))
{ return true; }
}
else if (sidesWayNum.Equals(3) && runStatus <= LineRunStatus.Wait)
{ {
return true; return true;
} }
...@@ -408,14 +452,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -408,14 +452,13 @@ namespace OnlineStore.DeviceLibrary
private DateTime SideWay41Ntime = DateTime.Now; private DateTime SideWay41Ntime = DateTime.Now;
private bool SideWay41IsWait = false; private bool SideWay41IsWait = false;
private DateTime SideWay23Ntime = DateTime.Now; private DateTime SideWay23Ntime = DateTime.Now;
private bool SideWay23IsWait = false; private bool SideWay23IsWait = false;
internal int Sw41TrayNum = 0;
internal int Sw23TrayNum = 0;
private bool sdIsInprocess = false; private bool sdIsInprocess = false;
private DateTime sdlastProTime = DateTime.Now; private DateTime sdlastProTime = DateTime.Now;
private int TraySingleWaitTime = 500;
private DateTime lastSw2StopDownTime = DateTime.Now;
private DateTime lastSw4StopDownTime = DateTime.Now;
private void SideWayTimerProcess() private void SideWayTimerProcess()
{ {
TimeSpan span = DateTime.Now - sdlastProTime; TimeSpan span = DateTime.Now - sdlastProTime;
...@@ -434,18 +477,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -434,18 +477,19 @@ namespace OnlineStore.DeviceLibrary
sdIsInprocess = false; sdIsInprocess = false;
return; return;
} }
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None)) if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && ProvidingEquipMap[204].runStatus <= LineRunStatus.Wait)
{ {
if (IOValue(IO_Type.SW4_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW1_TrayCheck).Equals(IO_VALUE.LOW) && if (IOValue(IO_Type.SW4_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW1_TrayCheck).Equals(IO_VALUE.LOW) &&
TrayManager.CanMoveSidesWay(4) && TrayManager.CanMoveSidesWay(1)) TrayManager.LineCanMoveSW(4) && TrayManager.LineCanMoveSW(1))
{ {
TimeSpan span41 = DateTime.Now - SideWay41Ntime; TimeSpan span41 = DateTime.Now - SideWay41Ntime;
if (SideWay41IsWait && span41.TotalMilliseconds > TraySingleWaitTime) if (SideWay41IsWait && span41.TotalMilliseconds > TrayManager.SwTrayWaitTime)
{ {
SW41_MoveInfo.NewMove(LineMoveType.InStore); SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
UpateSw41TrayNum(); UpateSw41TrayNum();
SWLog("横移轨道41:检测到SW4_TrayCheck,定位气缸下降, 等待横移4托盘检测信号,更新托盘号 [" + Sw41TrayNum+"] "); SWLog("横移轨道41:检测到SW4_TrayCheck,定位气缸下降, 等待横移4托盘检测信号,更新托盘号 [" + Sw41TrayNum + "] ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down); CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down); CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
...@@ -457,19 +501,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -457,19 +501,25 @@ namespace OnlineStore.DeviceLibrary
} }
} }
else if (IOValue(IO_Type.SW4_StopCheck).Equals(IO_VALUE.HIGH) && else if (IOValue(IO_Type.SW4_StopCheck).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.SW4_StopDown).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.SW4_TrayCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SW4_TrayCheck).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.SW1_TrayCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SW1_TrayCheck).Equals(IO_VALUE.LOW) &&
TrayManager.CanMoveSidesWay(4) && TrayManager.CanMoveSidesWay(1)) (DateTime.Now- lastSw4StopDownTime).TotalSeconds>4 &&
TrayManager.LineCanMoveSW(4) && TrayManager.LineCanMoveSW(1))
{ {
TimeSpan span41 = DateTime.Now - SideWay41Ntime; TimeSpan span41 = DateTime.Now - SideWay41Ntime;
if (SideWay41IsWait && span41.TotalMilliseconds > TraySingleWaitTime) if (SideWay41IsWait && span41.TotalMilliseconds>TrayManager.SwTrayWaitTime)
{ {
SW41_MoveInfo.NewMove(LineMoveType.InStore); //SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait); //SW41_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
UpateSw41TrayNum(); //UpateSw41TrayNum();
SWLog("横移轨道41:检测到SW4_StopCheck, 定位气缸下降 ,更新托盘号 [" + Sw41TrayNum + "] "); //SWLog("横移轨道41:检测到SW4_StopCheck, 定位气缸下降 ,更新托盘号 [" + Sw41TrayNum + "] ");
CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down); //CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down); //CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
//阻挡气缸下降500毫秒然后上升
lastSw4StopDownTime = DateTime.Now;
IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime);
SideWay41IsWait = false;
} }
else if (!SideWay41IsWait) else if (!SideWay41IsWait)
{ {
...@@ -480,7 +530,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -480,7 +530,7 @@ namespace OnlineStore.DeviceLibrary
else if (!SideWay41IsWait) else if (!SideWay41IsWait)
{ {
SideWay41IsWait = true; SideWay41IsWait = true;
SideWay41Ntime = DateTime.Now; SideWay41Ntime = DateTime.Now;
} }
else else
{ {
...@@ -491,17 +541,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -491,17 +541,17 @@ namespace OnlineStore.DeviceLibrary
{ {
SideWay41IsWait = false; SideWay41IsWait = false;
SideWay41BusyProcess(); SideWay41BusyProcess();
} }
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None)) if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None) && FeedingEquipMap[104].runStatus <= LineRunStatus.Wait)
{ {
//检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升, //检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
//顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡4下降,盘通过 //顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡4下降,盘通过
if (IOValue(IO_Type.SW2_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW3_TrayCheck).Equals(IO_VALUE.LOW) && if (IOValue(IO_Type.SW2_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW3_TrayCheck).Equals(IO_VALUE.LOW) &&
TrayManager.CanMoveSidesWay(2) && TrayManager.CanMoveSidesWay(3)) TrayManager.LineCanMoveSW(2) && TrayManager.LineCanMoveSW(3))
{ {
TimeSpan span34 = DateTime.Now - SideWay23Ntime; TimeSpan span34 = DateTime.Now - SideWay23Ntime;
if (SideWay23IsWait && span34.TotalMilliseconds > TraySingleWaitTime) if (SideWay23IsWait && span34.TotalMilliseconds > TrayManager.SwTrayWaitTime)
{ {
SW23_MoveInfo.NewMove(LineMoveType.InStore); SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
UpateSw23TrayNum(); UpateSw23TrayNum();
...@@ -517,19 +567,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -517,19 +567,25 @@ namespace OnlineStore.DeviceLibrary
} }
} }
else if (IOValue(IO_Type.SW2_StopCheck).Equals(IO_VALUE.HIGH) && else if (IOValue(IO_Type.SW2_StopCheck).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.SW2_StopDown).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.SW2_TrayCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SW2_TrayCheck).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.SW3_TrayCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SW3_TrayCheck).Equals(IO_VALUE.LOW) &&
TrayManager.CanMoveSidesWay(2) && TrayManager.CanMoveSidesWay(3)) (DateTime.Now - lastSw2StopDownTime).TotalSeconds > 4 &&
TrayManager.LineCanMoveSW(2) && TrayManager.LineCanMoveSW(3))
{ {
TimeSpan span34 = DateTime.Now - SideWay23Ntime; TimeSpan span34 = DateTime.Now - SideWay23Ntime;
if (SideWay23IsWait && span34.TotalMilliseconds > TraySingleWaitTime) if (SideWay23IsWait && span34.TotalMilliseconds > TrayManager.SwTrayWaitTime)
{ {
SW23_MoveInfo.NewMove(LineMoveType.InStore); //SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait); //SW23_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
UpateSw23TrayNum(); //UpateSw23TrayNum();
SWLog("横移轨道23:检测到SW2_StopCheck, 定位气缸下降 ,更新托盘号 [" + Sw23TrayNum + "] "); //SWLog("横移轨道23:检测到SW2_StopCheck, 定位气缸下降 ,更新托盘号 [" + Sw23TrayNum + "] ");
CylinderMove(SW23_MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW2_LocationCylinder_Down); //CylinderMove(SW23_MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW2_LocationCylinder_Down);
CylinderMove(SW23_MoveInfo, IO_Type.SW3_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down); //CylinderMove(SW23_MoveInfo, IO_Type.SW3_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
//阻挡气缸下降500毫秒然后上升
lastSw2StopDownTime = DateTime.Now;
IOMove(IO_Type.SW2_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime);
SideWay23IsWait = false;
} }
else if (!SideWay23IsWait) else if (!SideWay23IsWait)
{ {
...@@ -601,7 +657,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -601,7 +657,7 @@ namespace OnlineStore.DeviceLibrary
if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait)) if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
{ {
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown);
SWLog("横移轨道41: 阻挡气缸下降 等待 "+TrayManager.StopDownWaitTime); SWLog("横移轨道41: 阻挡气缸下降 等待 " + TrayManager.StopDownWaitTime);
IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
...@@ -658,8 +714,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -658,8 +714,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_TopCylinderDown)) else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_TopCylinderDown))
{ {
if (CheckTrayIsNeed(101, Sw41TrayNum)) //开始入库
bool result = FeedingEquipMap[101].CanStartCheckOut(Sw41TrayNum);
if (result)
{ {
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitTrayGo); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitTrayGo);
SWLog("横移轨道41:关闭皮带电机,不需要等待 托盘离开"); SWLog("横移轨道41:关闭皮带电机,不需要等待 托盘离开");
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
...@@ -686,6 +745,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -686,6 +745,7 @@ namespace OnlineStore.DeviceLibrary
{ {
TrayManager.UpdateSWState(4, 0); TrayManager.UpdateSWState(4, 0);
TrayManager.UpdateSWState(1, 0); TrayManager.UpdateSWState(1, 0);
lastSw4StopDownTime = DateTime.Now;
SW41_MoveInfo.EndMove(); SW41_MoveInfo.EndMove();
SWLog("横移轨道41:横移结束 "); SWLog("横移轨道41:横移结束 ");
} }
...@@ -775,8 +835,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -775,8 +835,9 @@ namespace OnlineStore.DeviceLibrary
} }
} }
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_TopCylinderDown)) else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_TopCylinderDown))
{ //开始入库 {
bool result = FeedingEquipMap[104].CanStartCheckOut(); //开始入库
bool result = FeedingEquipMap[104].CanStartCheckOut(Sw23TrayNum);
if (result) if (result)
{ {
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitTrayGo); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitTrayGo);
...@@ -805,6 +866,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -805,6 +866,7 @@ namespace OnlineStore.DeviceLibrary
{ {
TrayManager.UpdateSWState(2, 0); TrayManager.UpdateSWState(2, 0);
TrayManager.UpdateSWState(3, 0); TrayManager.UpdateSWState(3, 0);
lastSw2StopDownTime = DateTime.Now;
SW23_MoveInfo.EndMove(); SW23_MoveInfo.EndMove();
SWLog("横移轨道23:横移结束 "); SWLog("横移轨道23:横移结束 ");
} }
......
...@@ -418,7 +418,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -418,7 +418,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_StopCylinder1Down);
CheckLog(" 托盘检测:料盘检测StopCylinder_Check1 " + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,最多等待1秒)"); CheckLog(" 托盘检测:料盘检测StopCylinder_Check1 " + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,最多等待1秒)");
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH));
...@@ -442,7 +442,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -442,7 +442,7 @@ namespace OnlineStore.DeviceLibrary
} }
#region 托盘检测 #region 托盘检测
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_StopCylinder1Down)) if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_00_StopCylinder1Down))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升,等待 阻挡2托盘检测=1)"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升,等待 阻挡2托盘检测=1)");
...@@ -450,7 +450,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -450,7 +450,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.LOW)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.LOW));
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_02_FixtureCheck)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_FixtureCheck))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升)"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升)");
......
...@@ -10,6 +10,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -10,6 +10,7 @@ namespace OnlineStore.DeviceLibrary
{ {
partial class ProvidingEquip partial class ProvidingEquip
{ {
public event TrayProcessEnd TrayPEndEvent;
#region 托盘检测 #region 托盘检测
protected override bool CheckWaitResult(LineMoveInfo moveInfo, WaitResultInfo wait) protected override bool CheckWaitResult(LineMoveInfo moveInfo, WaitResultInfo wait)
...@@ -49,7 +50,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -49,7 +50,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_StopCylinder1Down);
TrayManager.UpdateSWState(Config.SidesWayNum, 2); TrayManager.UpdateSWState(Config.SidesWayNum, 2);
CheckLog(" 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,最多等待1秒)"); CheckLog(" 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,最多等待1秒)");
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
...@@ -78,7 +79,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -78,7 +79,7 @@ namespace OnlineStore.DeviceLibrary
} }
#region 托盘检测 #region 托盘检测
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_StopCylinder1Down)) if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_00_StopCylinder1Down))
{ {
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升,等待 阻挡2托盘检测=1)"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升,等待 阻挡2托盘检测=1)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
...@@ -86,7 +87,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,7 +87,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.LOW)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.LOW));
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_02_FixtureCheck)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_FixtureCheck))
{ {
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升)"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸1-1上升)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
...@@ -129,7 +130,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
{ {
bool isFull = TrayManager.TrayIsFull(currTrayNum); bool isFull = TrayManager.TrayIsFull(currTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currTrayNum + "】没有出入料任务,放盘通过~"); LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currTrayNum + "】没有出入料任务,放盘通过~");
CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,移栽2,需要判断是否可以放盘通过,最多等待10000)"); CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
} }
} }
...@@ -139,7 +140,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -139,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayNumError(DeviceID, msg); TrayManager.UpdateTrayNumError(DeviceID, msg);
LogUtil.error(msg); LogUtil.error(msg);
return; return;
} }
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_05_WaitTime)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_05_WaitTime))
{ {
...@@ -201,9 +202,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -201,9 +202,10 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_18_StopCylinder_Back)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_18_StopCylinder_Back))
{ {
//preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
CheckLog("托盘放行 SecondMove:(托盘放行结束) "); CheckLog("托盘放行 SecondMove:(托盘放行结束),出发 TrayPEndEvent ");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
} }
#endregion #endregion
} }
......
...@@ -12,6 +12,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -12,6 +12,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public class TrayManager public class TrayManager
{ {
public static int SwTrayWaitTime = 500;
public static int StopDownWaitTime = 500; public static int StopDownWaitTime = 500;
public static RFID RfidReader = new RFID(); public static RFID RfidReader = new RFID();
/// <summary> /// <summary>
...@@ -249,38 +250,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -249,38 +250,32 @@ namespace OnlineStore.DeviceLibrary
#region 横移状态缓存 #region 横移状态缓存
internal static ConcurrentDictionary<int, int> SidesWayStateMap = new ConcurrentDictionary<int, int>(); // internal static ConcurrentDictionary<int, int> SidesWayStateMap = new ConcurrentDictionary<int, int>();
internal static int GetSwStatus(int swNum) internal static int GetSwStatus(int swNum)
{ {
if (SidesWayStateMap.ContainsKey(swNum)) //if (SidesWayStateMap.ContainsKey(swNum))
{ //{
return SidesWayStateMap[swNum]; // return SidesWayStateMap[swNum];
} //}
return 0; return 0;
} }
internal static bool CanMoveSidesWay(int swNum) internal static bool LineCanMoveSW(int swNum)
{ {
int status = GetSwStatus(swNum); int status = GetSwStatus(swNum);
//若此横移对应的设备未启动,直接可处理 //若此横移对应的设备未启动,直接可处理
foreach (FeedingEquip equip in LineManager.Line.FeedingEquipMap.Values) foreach (FeedingEquip equip in LineManager.Line.FeedingEquipMap.Values)
{ {
if (equip.Config.SidesWayNum.Equals(swNum)) if (equip.Config.SidesWayNum.Equals(swNum))
{ {
if (equip.IsDebug || equip.runStatus <= LineRunStatus.Wait) if (equip.runStatus <= LineRunStatus.Wait || equip.isInSuddenDown || equip.isNoAirCheck)
{ {
return true; return true;
} }
if (equip.SecondMoveInfo.MoveType.Equals(LineMoveType.None))
//上料3如果报警,可以直接处理移栽
if (status.Equals(0) && swNum.Equals(2) && (equip.isInSuddenDown || equip.isNoAirCheck))
{ {
return true; return true;
} }
if (equip.SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return false ;
}
break; break;
} }
} }
...@@ -288,31 +283,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -288,31 +283,17 @@ namespace OnlineStore.DeviceLibrary
{ {
if (equip.Config.SidesWayNum.Equals(swNum)) if (equip.Config.SidesWayNum.Equals(swNum))
{ {
if (equip.IsDebug || equip.runStatus <= LineRunStatus.Wait) if (equip.runStatus <= LineRunStatus.Wait || equip.isInSuddenDown || equip.isNoAirCheck)
{ {
return true; return true;
} }
if (equip.SecondMoveInfo.MoveType.Equals(LineMoveType.None))
if (equip.SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{ {
return false ; return true;
} }
break; break;
} }
} }
if (status.Equals(1) )
{
return true;
}
else if (swNum.Equals(1) || swNum.Equals(3))
{
if (status.Equals(0) )
{
return true;
}
}
return false; return false;
} }
...@@ -323,19 +304,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -323,19 +304,19 @@ namespace OnlineStore.DeviceLibrary
/// <param name="value">0=未处理等待中,1=托盘处理完成,可处理横移,2=托盘检测处理中</param> /// <param name="value">0=未处理等待中,1=托盘处理完成,可处理横移,2=托盘检测处理中</param>
internal static void UpdateSWState(int swNum, int value) internal static void UpdateSWState(int swNum, int value)
{ {
if (swNum <= 0) //if (swNum <= 0)
{ //{
return; // return;
} //}
if (SidesWayStateMap.ContainsKey(swNum)) //if (SidesWayStateMap.ContainsKey(swNum))
{ //{
SidesWayStateMap[swNum] = value; // SidesWayStateMap[swNum] = value;
} //}
else //else
{ //{
SidesWayStateMap.TryAdd(swNum, value); // SidesWayStateMap.TryAdd(swNum, value);
} //}
} }
......
...@@ -7,7 +7,7 @@ using System.Drawing; ...@@ -7,7 +7,7 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
...@@ -386,9 +386,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -386,9 +386,22 @@ namespace OnlineStore.DeviceLibrary
IOMove(IoType, value); IOMove(IoType, value);
} }
} }
public void IOMove(string IoType, IO_VALUE value) public void IOMove(string IoType, IO_VALUE value, int msTime = 0)
{ {
IOManager.IOMove(IoType, value, baseConfig.Id); if (msTime <= 0)
{
IOManager.IOMove(IoType, value, baseConfig.Id);
}
else
{
Task.Factory.StartNew(delegate
{
IOManager.IOMove(IoType, value, baseConfig.Id);
Thread.Sleep(msTime);
IO_VALUE tValue = value.Equals(IO_VALUE.HIGH) ? IO_VALUE.LOW : IO_VALUE.HIGH;
IOManager.IOMove(IoType, tValue, baseConfig.Id);
});
}
} }
public IO_VALUE IOValue(string IoType) public IO_VALUE IOValue(string IoType)
{ {
......
...@@ -265,11 +265,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -265,11 +265,15 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
///移载(流水线)装置出入库处理,阻挡气缸1-1下降 ///移载(流水线)装置出入库处理,阻挡气缸1-1下降
/// </summary> /// </summary>
MIO_01_StopCylinder1Down = 3081, MIO_00_StopCylinder1Down = 3080,
/// <summary> /// <summary>
///移载(流水线)装置出入库处理,夹具检测1-4=1 ///移载(流水线)装置出入库处理,夹具检测1-4=1
/// </summary> /// </summary>
MIO_02_FixtureCheck = 3082, MIO_01_FixtureCheck = 3081,
/// <summary>
/// 移载(流水线)装置出入库处理,等待夹具持续500毫秒
/// </summary>
MIO_02_WaitFixture = 3082,
/// <summary> /// <summary>
///移载(流水线)装置出入库处理,阻挡气缸1-1上升 ///移载(流水线)装置出入库处理,阻挡气缸1-1上升
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!