Commit 40157967 LN

横移机构优化

1 个父辈 ab7e32ab
...@@ -114,11 +114,11 @@ namespace OnlineStore.Common ...@@ -114,11 +114,11 @@ namespace OnlineStore.Common
catch(WebException ex) catch(WebException ex)
{ {
IsTimeOut = true; IsTimeOut = true;
LogUtil.error("POST ["+ url + "]["+paramData+"] WebException :" + ex .ToString(), 101); LogUtil.error("POST ["+ url + "] WebException :" + ex .ToString(), 101);
} }
catch (Exception e) catch (Exception e)
{ {
LogUtil.error("POST [" + url + "][" + paramData + "] ERROR:" + e.ToString(), 101); LogUtil.error("POST [" + url + "] ERROR:" + e.ToString(), 101);
} }
if (!result.Contains("null") && result.Length != 0) if (!result.Contains("null") && result.Length != 0)
{ {
......
...@@ -88,9 +88,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,9 +88,9 @@ namespace OnlineStore.DeviceLibrary
if (Config.SidesWayNum > 0) if (Config.SidesWayNum > 0)
{ {
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH))
{ {
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false) && canProcess) if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false) && canProcess)
{ {
swWaitWatch.Stop(); swWaitWatch.Stop();
...@@ -113,6 +113,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -113,6 +113,7 @@ namespace OnlineStore.DeviceLibrary
else if (Config.SidesWayNum.Equals(2) && IOValue(IO_Type.SW_StopCheck).Equals(IO_VALUE.HIGH) else if (Config.SidesWayNum.Equals(2) && IOValue(IO_Type.SW_StopCheck).Equals(IO_VALUE.HIGH)
&& (DateTime.Now - lastStopDown).TotalSeconds > 3) && (DateTime.Now - lastStopDown).TotalSeconds > 3)
{ {
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false) && canProcess) if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false) && canProcess)
{ {
swWaitWatch.Stop(); swWaitWatch.Stop();
......
...@@ -454,9 +454,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -454,9 +454,7 @@ namespace OnlineStore.DeviceLibrary
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
UpateSw41TrayNum(); UpateSw41TrayNum();
SWLog("横移轨道41:检测到SW4_TrayCheck,再次检测,更新托盘号 [" + Sw41TrayNum + "] "); SWLog("横移轨道41:检测到SW4_TrayCheck,再次检测,更新托盘号 [" + 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.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
} }
} }
else if (IOValue(IO_Type.SW4_StopCheck).Equals(IO_VALUE.HIGH) && else if (IOValue(IO_Type.SW4_StopCheck).Equals(IO_VALUE.HIGH) &&
...@@ -471,12 +469,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -471,12 +469,9 @@ namespace OnlineStore.DeviceLibrary
SW41_MoveInfo.NewMove(LineMoveType.InStore); SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
// UpateSw41TrayNum(); // UpateSw41TrayNum();
LogUtil.info(Name + "横移轨道41:检测到SW4_StopCheck, 开始处理托盘 "); LogUtil.info(Name + "横移轨道41:检测到SW4_StopCheck, 开始处理托盘 ");
//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);
//阻挡气缸下降500毫秒然后上升 //阻挡气缸下降500毫秒然后上升
lastSw4StopDownTime = DateTime.Now; lastSw4StopDownTime = DateTime.Now;
//IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime);
} }
} }
else else
...@@ -502,9 +497,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -502,9 +497,7 @@ namespace OnlineStore.DeviceLibrary
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
UpateSw23TrayNum(); UpateSw23TrayNum();
SWLog("横移轨道23:检测到SW2_TrayCheck,再次检测,更新托盘号 [" + Sw23TrayNum + "] "); SWLog("横移轨道23:检测到SW2_TrayCheck,再次检测,更新托盘号 [" + Sw23TrayNum + "] ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH)); 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 if (IOValue(IO_Type.SW2_StopCheck).Equals(IO_VALUE.HIGH) && else if (IOValue(IO_Type.SW2_StopCheck).Equals(IO_VALUE.HIGH) &&
...@@ -519,12 +512,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -519,12 +512,9 @@ namespace OnlineStore.DeviceLibrary
SW23_MoveInfo.NewMove(LineMoveType.InStore); SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
// UpateSw23TrayNum(); // UpateSw23TrayNum();
LogUtil.info(Name + "横移轨道23:检测到SW2_StopCheck, 开始处理托盘 "); LogUtil.info(Name + "横移轨道23:检测到SW2_StopCheck, 开始处理托盘 ");
//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);
//阻挡气缸下降500毫秒然后上升 //阻挡气缸下降500毫秒然后上升
lastSw2StopDownTime = DateTime.Now; lastSw2StopDownTime = DateTime.Now;
// IOMove(IO_Type.SW2_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime);
} }
} }
else else
...@@ -646,11 +636,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -646,11 +636,22 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_DriveMotorMove)) else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_DriveMotorMove))
{ {
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck); if (IOValue(IO_Type.SW4_TrayCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SW1_TrayCheck).Equals(IO_VALUE.HIGH))
SWLog("横移轨道41:收到SW1_TrayCheck,先顶升4下降 "); {
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck);
CylinderMove(null, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down); SWLog("横移轨道41:收到SW1_TrayCheck,先顶升4下降 ");
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
CylinderMove(null, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH));
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW10_WatOutFixture2);
SWLog("横移轨道41:再次验证托盘是否在出口处,停止横移4的皮带线 ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH));
//需要停止横移4的皮带线
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_MotorRun, IO_VALUE.LOW));
}
} }
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck)) else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck))
{ {
...@@ -717,11 +718,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -717,11 +718,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down); CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
} }
} }
} }
//else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW11_StopDrive))
//{
//}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW12_WaitTrayGo)) else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW12_WaitTrayGo))
{ {
lastSw4StopDownTime = DateTime.Now.AddSeconds(-2); lastSw4StopDownTime = DateTime.Now.AddSeconds(-2);
...@@ -733,10 +730,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -733,10 +730,10 @@ namespace OnlineStore.DeviceLibrary
private void SW41_SW08_DriveMotorMove() private void SW41_SW08_DriveMotorMove()
{ {
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW08_DriveMotorMove); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW08_DriveMotorMove);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
SWLog("横移轨道41:开始转动电机 ,等待1000,SW4_TrayCheck=0, SW1_TrayCheck=1 "); SWLog("横移轨道41:开始转动电机 ,等待1000,SW4_TrayCheck=0, SW1_TrayCheck=1 ");
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.HIGH); IOMove(IO_Type.SW4_MotorRun, IO_VALUE.HIGH);
IOMove(IO_Type.SW1_MotorRun, IO_VALUE.HIGH); IOMove(IO_Type.SW1_MotorRun, IO_VALUE.HIGH);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.LOW)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.LOW));
} }
...@@ -851,7 +848,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -851,7 +848,7 @@ namespace OnlineStore.DeviceLibrary
{ {
UpateSw23TrayNum(); UpateSw23TrayNum();
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
SWLog("横移轨道23: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime+",更新托盘号【"+Sw23TrayNum+"】"); SWLog("横移轨道23: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime + ",更新托盘号【" + Sw23TrayNum + "】");
CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW);
// SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime)); // SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
...@@ -889,11 +886,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -889,11 +886,21 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_DriveMotorMove)) else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_DriveMotorMove))
{ {
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck); if (IOValue(IO_Type.SW2_TrayCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SW3_TrayCheck).Equals(IO_VALUE.HIGH))
SWLog("横移轨道23:收到 SW3_TrayCheck,先顶升2下降, "); {
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck);
CylinderMove(null, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down); SWLog("横移轨道23:收到 SW3_TrayCheck,先顶升2下降, ");
//SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
CylinderMove(null, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
//SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH));
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW10_WatOutFixture2);
SWLog("横移轨道23:再次验证托盘是否在出口处 ,停止横移2的皮带线 ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH));
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_MotorRun, IO_VALUE.LOW));
}
} }
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck)) else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck))
{ {
...@@ -945,8 +952,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -945,8 +952,8 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.LOW)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.LOW));
// SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); // SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
// SW23_MoveInfo.OneWaitCanEndStep = true; // SW23_MoveInfo.OneWaitCanEndStep = true;
} }
else else
{ {
...@@ -972,10 +979,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -972,10 +979,10 @@ namespace OnlineStore.DeviceLibrary
private void SW23_SW08_DriveMotorMove() private void SW23_SW08_DriveMotorMove()
{ {
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW08_DriveMotorMove); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW08_DriveMotorMove);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
SWLog("横移轨道23:开始转动电机 ,等待1000,SW2_TrayCheck=0, SW3_TrayCheck=1 "); SWLog("横移轨道23:开始转动电机 ,等待1000,SW2_TrayCheck=0, SW3_TrayCheck=1 ");
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.HIGH); IOMove(IO_Type.SW2_MotorRun, IO_VALUE.HIGH);
IOMove(IO_Type.SW3_MotorRun, IO_VALUE.HIGH); IOMove(IO_Type.SW3_MotorRun, IO_VALUE.HIGH);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.LOW)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.LOW));
} }
......
...@@ -46,10 +46,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -46,10 +46,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 "); LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
return; return;
} }
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
//int num = TrayManager.GetTrayNum(DeviceID); //int num = TrayManager.GetTrayNum(DeviceID);
if (IOValue(IO_Type.StopCylinder_Check2).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.StopCylinder_Check2).Equals(IO_VALUE.HIGH))
{ {
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
trayCheck2LowWait.Stop(); trayCheck2LowWait.Stop();
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && canProcess) if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && canProcess)
{ {
...@@ -66,6 +66,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,6 +66,7 @@ namespace OnlineStore.DeviceLibrary
bool check2Ok = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false); bool check2Ok = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
if (IOValue(IO_Type.StopCylinder_Check1).Equals(IO_VALUE.HIGH) && (DateTime.Now - lastStopDown).TotalSeconds > 3) if (IOValue(IO_Type.StopCylinder_Check1).Equals(IO_VALUE.HIGH) && (DateTime.Now - lastStopDown).TotalSeconds > 3)
{ {
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2Ok && canProcess) if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2Ok && canProcess)
{ {
trayCheckWait.Stop(); trayCheckWait.Stop();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!