Commit 04bea6bc LN

横移修改

1 个父辈 066a96c2
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<add key ="DebugDeviceId" value ="103"/> <add key ="DebugDeviceId" value ="103"/>
<add key ="NeedScanCode" value ="1"/> <add key ="NeedScanCode" value ="1"/>
<add key ="Server_Log_Open" value ="0"/> <add key ="Server_Log_Open" value ="0"/>
<add key ="CodeCount" value ="1"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -81,6 +81,6 @@ namespace OnlineStore.Common ...@@ -81,6 +81,6 @@ namespace OnlineStore.Common
public static string DebugDeviceId = "DebugDeviceId"; public static string DebugDeviceId = "DebugDeviceId";
public static string NeedScanCode = "NeedScanCode"; public static string NeedScanCode = "NeedScanCode";
public static string CodeCount = "CodeCount";
} }
} }
...@@ -239,17 +239,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -239,17 +239,7 @@ namespace OnlineStore.DeviceLibrary
//顶升气缸下降 //顶升气缸下降
CylinderMove(null, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); CylinderMove(null, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
Thread.Sleep(30); Thread.Sleep(30);
} }
//else if (baseConfig.DType.Equals(DeviceType.FeedingEquip))
//{
// FeedingEquip equip = (FeedingEquip)this;
// if (equip.Config.SidesWayNum <= 0)
// {
// CylinderMove(null, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down);
// }
// CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//}
} }
internal virtual void CloseCylinderStop() internal virtual void CloseCylinderStop()
{ {
...@@ -269,19 +259,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -269,19 +259,15 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.TopCylinder_UP, IO_VALUE.LOW); IOMove(IO_Type.TopCylinder_UP, IO_VALUE.LOW);
IOMove(IO_Type.TopCylinder_Down, IO_VALUE.LOW); IOMove(IO_Type.TopCylinder_Down, IO_VALUE.LOW);
Thread.Sleep(30); Thread.Sleep(30);
} }
//else if (baseConfig.DType.Equals(DeviceType.FeedingEquip)) }
//{
// FeedingEquip equip = (FeedingEquip)this;
// if (equip.Config.SidesWayNum <= 0)
// {
// IOMove(IO_Type.FL_TopCylinder_Up, IO_VALUE.LOW);
// IOMove(IO_Type.FL_TopCylinder_Down, IO_VALUE.LOW);
// }
// IOMove(IO_Type.SL_MoveCylinder_Down, IO_VALUE.LOW);
// IOMove(IO_Type.SL_MoveCylinder_Up, IO_VALUE.LOW);
//} internal bool UpdateTrayNum()
{
//此处先对托盘号进行验证
preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID, true);
return true;
} }
#region 伺服运动 #region 伺服运动
......
...@@ -378,7 +378,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -378,7 +378,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogInfo(" 上升横移机构 "); LogInfo(" 上升横移机构 ");
} }
CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); //CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
} }
internal override void CloseCylinderStop() internal override void CloseCylinderStop()
{ {
...@@ -430,6 +430,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -430,6 +430,20 @@ namespace OnlineStore.DeviceLibrary
moveinfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_TrayLocation2_Before, IO_VALUE.LOW)); moveinfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_TrayLocation2_Before, IO_VALUE.LOW));
} }
} }
/// <summary>
/// 升降盘是否在后退端
/// </summary>
public bool IsTrayLCylinderAfter( )
{
if (IOValue(IO_Type.SL_TrayLocation1_After).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.SL_TrayLocation1_Before).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.SL_TrayLocation2_After).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.SL_TrayLocation2_Before).Equals(IO_VALUE.LOW) )
{
return true;
}return false;
}
/// <summary> /// <summary>
/// 判断上料横移机构是否可以横移运动 /// 判断上料横移机构是否可以横移运动
......
...@@ -58,9 +58,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -58,9 +58,12 @@ namespace OnlineStore.DeviceLibrary
bool isNeedTray = (LineManager.Line.SwNoProcess(Config.SidesWayNum)); bool isNeedTray = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && (isTestNeed || isNeedTray)) if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && (isTestNeed || isNeedTray))
{ {
int num = TrayManager.GetTrayNum(DeviceID); UpdateTrayNum();
// preTrayNum = currTrayNum;
//int num = TrayManager.GetTrayNum(DeviceID);
//currTrayNum = num;
//判断是否是需要的托盘 //判断是否是需要的托盘
if (CurrTrayIsNeed(num, true)) if (CurrTrayIsNeed(currTrayNum, true))
{ {
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam); SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
TrayManager.UpdateSWState(Config.SidesWayNum, 2); TrayManager.UpdateSWState(Config.SidesWayNum, 2);
...@@ -70,16 +73,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -70,16 +73,12 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
preTrayNum = currTrayNum; // currTrayNum = num;
currTrayNum = num;
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) && (isTestNeed || isNeedTray))
{ {
////判断是否是需要的托盘
//if (CurrTrayIsNeed(num, true))
//{
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_01_StopCylinder1Down);
...@@ -87,13 +86,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -87,13 +86,6 @@ namespace OnlineStore.DeviceLibrary
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.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
//}
//else
//{
// preTrayNum = currTrayNum;
// currTrayNum = num;
// TrayManager.UpdateSWState(Config.SidesWayNum, 1);
//}
} }
} }
else else
...@@ -101,7 +93,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,7 +93,6 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.FL_StopCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.FL_StopCheck).Equals(IO_VALUE.HIGH))
{ {
// int num = TrayManager.GetTrayNum(DeviceID);
//托盘在两个阻挡内 //托盘在两个阻挡内
if (IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH))
{ {
...@@ -159,13 +150,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -159,13 +150,6 @@ namespace OnlineStore.DeviceLibrary
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 if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_02_FixtureCheck))
//{
// SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
// CheckLog("托盘检测:" + SecondMoveInfo.SLog + "FL阻挡1上升)");
// IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW));
//}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_StopCylinder2Down)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_StopCylinder2Down))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait);
...@@ -174,9 +158,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -174,9 +158,9 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait))
{ {
preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID); //currTrayNum = TrayManager.GetTrayNum(DeviceID);
UpdateTrayNum();
//出料中,需要拦盘 //出料中,需要拦盘
if (CurrTrayIsNeed(currTrayNum, true)) if (CurrTrayIsNeed(currTrayNum, true))
{ {
...@@ -266,7 +250,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -266,7 +250,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//更新横移托盘已处理完成 //更新横移托盘已处理完成
TrayManager.UpdateSWState(Config.SidesWayNum, 1); TrayManager.UpdateSWState(Config.SidesWayNum, 1);
preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
CheckLog("托盘放行: 此处为环形线横移2,顶升气缸不需要下降, (托盘放行结束) "); CheckLog("托盘放行: 此处为环形线横移2,顶升气缸不需要下降, (托盘放行结束) ");
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
} }
...@@ -292,7 +276,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -292,7 +276,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//更新横移托盘已处理完成 //更新横移托盘已处理完成
TrayManager.UpdateSWState(Config.SidesWayNum, 1); TrayManager.UpdateSWState(Config.SidesWayNum, 1);
preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) "); CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) ");
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
} }
...@@ -321,7 +305,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -321,7 +305,7 @@ 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("托盘放行 SecondStoreMove:(托盘放行结束) "); CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) ");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
...@@ -911,7 +895,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -911,7 +895,7 @@ namespace OnlineStore.DeviceLibrary
if (Config.IsCanOut.Equals(1)) if (Config.IsCanOut.Equals(1))
{ {
//此托盘是紧急出料盘,需要通过料架出库 //此托盘是紧急出料盘,需要通过料架出库
bool debugNeed = IsDebug && runStatus >= LineRunStatus.Runing&&info.IsFull&&info.InOrOutStore.Equals(2); bool debugNeed = (runStatus >= LineRunStatus.Runing)&&info.IsFull&&info.InOrOutStore.Equals(2);
if (info.PosId.Equals("")) if (info.PosId.Equals(""))
{ {
param = new InOutParam(trayNum, "紧急出料测试", "1#AC1_3_2", 12, 7); param = new InOutParam(trayNum, "紧急出料测试", "1#AC1_3_2", 12, 7);
......
...@@ -72,9 +72,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -72,9 +72,19 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_00_BatchAxisToP2); //如果升降盘在锁紧状态,需要返回P2
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed); if (IsTrayLCylinderAfter())
OutLog("准备出库料架, " + MoveInfo.SLog + " :提升伺服先回到P2"); {
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
OutLog("准备出库料架, " + MoveInfo.SLog + " :升降盘定位气缸后退");
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FO_00_BatchAxisToP2);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
OutLog("准备出库料架,升降盘不在后退端 " + MoveInfo.SLog + " :提升伺服先回到P2");
}
} }
return true; return true;
} }
...@@ -100,7 +110,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -100,7 +110,7 @@ namespace OnlineStore.DeviceLibrary
//阻挡工位有料架,流水线转动一个工位 //阻挡工位有料架,流水线转动一个工位
else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart); MoveInfo.NextMoveStep(LineMoveStep.FO_03_LineStart);
OutLog("准备出库料架: " + MoveInfo.SLog + " 阻挡工位检测有料架,进料阻挡下降,缓冲阻挡下降,流水线转动 1000"); OutLog("准备出库料架: " + MoveInfo.SLog + " 阻挡工位检测有料架,进料阻挡下降,缓冲阻挡下降,流水线转动 1000");
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH);
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW); IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);
...@@ -111,7 +121,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -111,7 +121,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart); MoveInfo.NextMoveStep(LineMoveStep.FO_03_LineStart);
OutLog("准备出库料架: " + MoveInfo.SLog + " 进料口检测有料架,进料阻挡上升,缓冲阻挡上升,流水线转动 1000"); OutLog("准备出库料架: " + MoveInfo.SLog + " 进料口检测有料架,进料阻挡上升,缓冲阻挡上升,流水线转动 1000");
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);//进料阻挡上升 IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);//进料阻挡上升
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH);//缓冲阻挡下降 IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH);//缓冲阻挡下降
...@@ -357,12 +367,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -357,12 +367,13 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_216_UpdownAxisToP1)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_216_UpdownAxisToP1))
{ {
int trayNum = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.TrayNumber : currTrayNum;
MoveInfo.NextMoveStep(LineMoveStep.FO_217_MoveCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.FO_217_MoveCylinder_Up);
OutLog("紧急出料移栽" + MoveInfo.SLog + ":上料横移机构上升,更新【" + currTrayNum + "】为空托盘"); OutLog("紧急出料移栽" + MoveInfo.SLog + ":上料横移机构上升,更新【" + trayNum + "】为空托盘");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//更新此托盘为空托盘 //更新此托盘为空托盘
TrayManager.UpdateTrayInfo(currTrayNum, false); TrayManager.UpdateTrayInfo(trayNum, false);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_217_MoveCylinder_Up)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_217_MoveCylinder_Up))
......
...@@ -439,25 +439,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -439,25 +439,30 @@ namespace OnlineStore.DeviceLibrary
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.CanMoveSidesWay(4) && TrayManager.CanMoveSidesWay(1))
{ {
TimeSpan span12 = DateTime.Now - SideWay41Ntime; TimeSpan span41 = DateTime.Now - SideWay41Ntime;
if (SideWay41IsWait && span12.TotalMilliseconds > TraySingleWaitTime) if (SideWay41IsWait && span41.TotalMilliseconds > TraySingleWaitTime)
{ {
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:定位气缸下降, 等待横移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);
} }
else if (!SideWay41IsWait)
{
SideWay41IsWait = true;
SideWay41Ntime = DateTime.Now;
}
} }
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_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)) TrayManager.CanMoveSidesWay(4) && TrayManager.CanMoveSidesWay(1))
{ {
TimeSpan span14 = DateTime.Now - SideWay41Ntime; TimeSpan span41 = DateTime.Now - SideWay41Ntime;
if (SideWay41IsWait && span14.TotalMilliseconds > TraySingleWaitTime) if (SideWay41IsWait && span41.TotalMilliseconds > TraySingleWaitTime)
{ {
SW41_MoveInfo.NewMove(LineMoveType.InStore); SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
...@@ -500,7 +505,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -500,7 +505,7 @@ namespace OnlineStore.DeviceLibrary
SW23_MoveInfo.NewMove(LineMoveType.InStore); SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
UpateSw23TrayNum(); UpateSw23TrayNum();
SWLog("横移轨道23:定位气缸下降, 等待横移2拖盘检测信号 ,更新托盘号 [" + Sw23TrayNum + "] "); SWLog("横移轨道23:检测到SW2_TrayCheck,定位气缸下降,等待横移2托盘检测信号,更新托盘号 [" + 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);
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);
...@@ -520,7 +525,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -520,7 +525,7 @@ namespace OnlineStore.DeviceLibrary
if (SideWay23IsWait && span34.TotalMilliseconds > TraySingleWaitTime) if (SideWay23IsWait && span34.TotalMilliseconds > TraySingleWaitTime)
{ {
SW23_MoveInfo.NewMove(LineMoveType.InStore); SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown); 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);
...@@ -595,7 +600,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -595,7 +600,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));
......
...@@ -472,8 +472,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -472,8 +472,9 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要顶升 //判断是否需要顶升
bool isNeed = false; bool isNeed = false;
//此处先对托盘号进行验证 //此处先对托盘号进行验证
preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID,true); //currTrayNum = TrayManager.GetTrayNum(DeviceID,true);
UpdateTrayNum();
bool isFull = TrayManager.TrayIsFull(currTrayNum); bool isFull = TrayManager.TrayIsFull(currTrayNum);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false)) if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{ {
...@@ -613,8 +614,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -613,8 +614,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_18_StopCylinder_Back)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_18_StopCylinder_Back))
{ {
preTrayNum = currTrayNum;
CheckLog("托盘放行 SecondMove:(托盘放行结束) "); CheckLog("托盘放行 SecondMove:(托盘放行结束) ");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
......
...@@ -103,8 +103,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,8 +103,9 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait))
{ {
//此处先对托盘号进行验证 //此处先对托盘号进行验证
preTrayNum = currTrayNum; //preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID,true); //currTrayNum = TrayManager.GetTrayNum(DeviceID,true);
UpdateTrayNum();
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false)) if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{ {
if (TrayManager.ErrorDeviceId.Equals(DeviceID)) if (TrayManager.ErrorDeviceId.Equals(DeviceID))
...@@ -199,7 +200,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -199,7 +200,7 @@ 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:(托盘放行结束) ");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
......
...@@ -147,10 +147,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -147,10 +147,14 @@ namespace OnlineStore.DeviceLibrary
} }
return bitm; return bitm;
} }
private static int codeCount = ConfigAppSettings.GetIntValue(Setting_Init.CodeCount);
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan(List<string> cameraNameList = null) public static List<string> CameraScan(List<string> cameraNameList = null)
{ {
if (codeCount < 1)
{
codeCount = 1;
}
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
//List<CodeInfo> allCodeList = new List<CodeInfo>(); //List<CodeInfo> allCodeList = new List<CodeInfo>();
if (cameraNameList == null) if (cameraNameList == null)
...@@ -184,7 +188,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -184,7 +188,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType); cc = HDCodeHelper.DecodeCode(ho_Image, codeCount, GetCodeParamFilePath(codeType), codeType);
} }
//if (cc.Count > 0) //if (cc.Count > 0)
//{ //{
......
...@@ -363,7 +363,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -363,7 +363,7 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
} }
if (isCheckMove||moveInfo==null) if (isCheckMove)
{ {
CheckAndMove(IoLowType, IO_VALUE.LOW); CheckAndMove(IoLowType, IO_VALUE.LOW);
CheckAndMove(IoHighType, IO_VALUE.HIGH); CheckAndMove(IoHighType, IO_VALUE.HIGH);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!