Commit 2249979a LN

1

1 个父辈 ebfa4432
doc/1.png

142.9 KB

......@@ -80,10 +80,10 @@ DO,1,进仓1升降上升SOL,UpDownCylinder_Up,12,PRO_AOI_IP_36,,进仓1升降上升SOL,Y563,
DO,1,进仓1升降下降SOL,UpDownCylinder_Down,13,PRO_AOI_IP_36,,进仓1升降下降SOL,Y564,Y564
,,,,14,PRO_AOI_IP_36,,,Y565,Y565
,,,,,,,,,
DI,1000,环形线横移4托盘检测,SW4_SideWay_TrayCheck,5,192.168.200.46,0,环形线横移4托盘检测,X556,X556
DI,1000,环形线横移4料盘检测1,SW4_SideWay_ReelCheck,6,192.168.200.46,0,环形线横移4料盘检测1,X557,X557
DI,1000,环形线横移4顶升上升端,SW4_TopCylinder_Up,7,192.168.200.46,0,环形线横移4顶升上升端,X558,X558
DI,1000,环形线横移4顶升下降端,SW4_TopCylinder_Down,8,192.168.200.46,0,环形线横移4顶升下降端,X559,X559
DI,1000,环形线横移4托盘检测,SW4_SideWay_TrayCheck,5,PRO_AOI_IP_36,0,环形线横移4托盘检测,X556,X556
DI,1000,环形线横移4料盘检测1,SW4_SideWay_ReelCheck,6,PRO_AOI_IP_36,0,环形线横移4料盘检测1,X557,X557
DI,1000,环形线横移4顶升上升端,SW4_TopCylinder_Up,7,PRO_AOI_IP_36,0,环形线横移4顶升上升端,X558,X558
DI,1000,环形线横移4顶升下降端,SW4_TopCylinder_Down,8,PRO_AOI_IP_36,0,环形线横移4顶升下降端,X559,X559
,,,,,,,,,
DO,1000,环形线横移4顶升上升SOL,SW4_TopCylinder_Up,6,192.168.200.46,0,环形线横移4顶升上升SOL,Y557,Y557
DO,1000,环形线横移4顶升下降SOL,SW4_TopCylinder_Down,7,192.168.200.46,0,环形线横移4顶升下降SOL,Y558,Y558
DO,1000,环形线横移4顶升上升SOL,SW4_TopCylinder_Up,6,PRO_AOI_IP_36,0,环形线横移4顶升上升SOL,Y557,Y557
DO,1000,环形线横移4顶升下降SOL,SW4_TopCylinder_Down,7,PRO_AOI_IP_36,0,环形线横移4顶升下降SOL,Y558,Y558
......@@ -234,12 +234,10 @@ namespace OnlineStore.DeviceLibrary
//上下气缸上升
if (UseAxis.Equals(false))
{
IOMove(IO_Type.UpDownCylinder_Down, IO_VALUE.LOW);
IOMove(IO_Type.UpDownCylinder_Up, IO_VALUE.HIGH);
CylinderMove(null, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Down);
}
//顶升气缸下降
IOMove(IO_Type.TopCylinder_UP, IO_VALUE.LOW);
IOMove(IO_Type.TopCylinder_Down, IO_VALUE.HIGH);
CylinderMove(null, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
}
internal virtual void CloseCylinderStop()
......@@ -459,12 +457,27 @@ namespace OnlineStore.DeviceLibrary
protected void InStoreLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
LogUtil.info(Name + "【" + posId + "】" + msg);
if (posId.Equals(""))
{
LogUtil.info(Name + msg);
}
else
{
LogUtil.info(Name + "[" + posId + "]" + msg);
}
}
protected void OutStoreLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
LogUtil.info(Name + "【" + posId + "】" + msg);
if (posId.Equals(""))
{
LogUtil.info(Name + msg);
}
else
{
LogUtil.info(Name + "[" + posId + "]" + msg);
}
}
public string GetMoveStr()
......
......@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.ResetMove;
IOMove(IO_Type.SL_HddLed, IO_VALUE.HIGH);
MoveInfo.NextMoveStep(LineMoveStep.FR_01_MoveCylinder_Up);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":上料横移机构上升,出口顶升下降,所有阻挡气缸上升");
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.SLog + ":上料横移机构上升,出口顶升下降,所有阻挡气缸上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
if (Config.SidesWayNum <= 0)
......@@ -147,7 +147,7 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.FR_01_MoveCylinder_Up:
MoveInfo.NextMoveStep(LineMoveStep.FR_02_BatchAxisHome);
MoveInfo.TimeOutSeconds = 120;
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":提升伺服回原点,升降伺服回原点,所有阻挡气缸上升");
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.SLog + ":提升伺服回原点,升降伺服回原点,所有阻挡气缸上升");
BatchAxis.HomeMove(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
break;
......@@ -314,7 +314,7 @@ namespace OnlineStore.DeviceLibrary
StartInStoreP();
}
}
if (LineManager.Line.CanProcessLine() && SecondMoveInfo.MoveType.Equals(LineMoveType.None))
if ( SecondMoveInfo.MoveType.Equals(LineMoveType.None))
{
StartCheckFixture();
}
......
......@@ -40,33 +40,23 @@ namespace OnlineStore.DeviceLibrary
#region 托盘检测
private void StartCheckFixture()
{
if (!LineManager.Line.CanProcessLine())
{
return;
}
if (Config.SidesWayNum > 0)
{
int num = TrayManager.GetTrayNum(DeviceID);
if (LineManager.Line.IsDebug && IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW_ReelCheck).Equals(IO_VALUE.LOW))
{
if (NeedCurrTray())
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
TrayManager.UpdateSWState(Config.SidesWayNum, 2);
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_06_TopCylinderUp 横移顶升气缸上 升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_06_TopCylinderUp);
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up);
}
else
{
preTrayNum = num;
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
}
}
else if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && num > 0 && preTrayNum.Equals(num).Equals(false) && LineManager.Line.SwNoProcess(Config.SidesWayNum))
{
bool isTestNeed = LineManager.Line.runStatus <= LineRunStatus.Wait && IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW_ReelCheck).Equals(IO_VALUE.LOW);
bool isNeedTray = IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && num > 0 && preTrayNum.Equals(num).Equals(false) && LineManager.Line.SwNoProcess(Config.SidesWayNum);
if (isTestNeed||isNeedTray)
{
//判断是否是需要的托盘
if (NeedCurrTray())
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
TrayManager.UpdateSWState(Config.SidesWayNum, 2);
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_06_TopCylinderUp 横移顶升气缸上 升 )");
CheckLog("托盘检测:(MIO_06_TopCylinderUp 横移顶升气缸上 升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_06_TopCylinderUp);
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up);
}
......@@ -86,7 +76,7 @@ namespace OnlineStore.DeviceLibrary
if (num > 0 && IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH))
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down FL阻挡1上升)");
CheckLog("托盘检测:(MIO_03_StopCylinder2Down FL阻挡1上升)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW));
......@@ -123,23 +113,23 @@ namespace OnlineStore.DeviceLibrary
#region 托盘检测
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_StopCylinder1Down))
{
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_02_FixtureCheck FL阻挡1上升,等待FL_TrayCheck=1)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_02_FixtureCheck);
CheckLog("托盘检测:" + SecondMoveInfo.MoveStep + "阻挡1上升,等待FL_TrayCheck=1)");
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_TrayCheck, IO_VALUE.HIGH));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_02_FixtureCheck))
{
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down FL阻挡1上升)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
CheckLog("托盘检测:" + SecondMoveInfo.MoveStep + "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))
{
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_04_Wait ,等待编码信号稳定)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait);
CheckLog("托盘检测:" + SecondMoveInfo.MoveStep + " ,等待编码信号稳定)");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait))
......@@ -164,10 +154,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
bool isFull = TrayManager.TrayIsFull(currTrayNum);
LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currTrayNum + "】没有出入料任务,放盘通过~");
CheckLog("托盘放行 SecondStoreMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
CheckLog("托盘放行 " + SecondMoveInfo.MoveStep + " ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
}
}
else
......@@ -180,14 +170,14 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_05_WaitTime))
{
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_06_TopCylinderUp 顶升气缸上 升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_06_TopCylinderUp);
CheckLog("托盘检测: " + SecondMoveInfo.MoveStep + " 顶升气缸上 升 )");
CylinderMove(SecondMoveInfo, IO_Type.FL_TopCylinder_Down, IO_Type.FL_TopCylinder_Up);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopCylinderUp))
{
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_07_LocationCylinderUp , 定位气缸上升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_07_LocationCylinderUp);
CheckLog("托盘检测: " + SecondMoveInfo.MoveStep + " , 定位气缸上升 )");
if (Config.SidesWayNum > 0)
{
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Down, IO_Type.SW_LocationCylinder_Up);
......@@ -208,63 +198,56 @@ namespace OnlineStore.DeviceLibrary
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要出库,开始出库处理,升降伺服到P1点");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点");
InStoreLog(" 紧急出料移栽 " + SecondMoveInfo.MoveStep + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else
{
CheckLog("托盘检测 SecondStoreMove:(MO_13_LoactionCylinder_Down ,托盘号【" + currTrayNum + "】,直接放盘通过,定位气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
CheckLog("托盘检测 " + SecondMoveInfo.MoveStep + ",托盘号【" + currTrayNum + "】,直接放盘通过,定位气缸下降)");
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_08_WaitInStore) && MoveInfo.MoveType.Equals(LineMoveType.None))
{
CheckLog("托盘放行 SecondStoreMove:(MIO_09_WaitLetFixtureGo ,等待移栽完成后放开阻挡)");
StartOutStoreMove(SecondMoveInfo.MoveParam);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_09_WaitLetFixtureGo);
CheckLog("托盘放行 " + SecondMoveInfo.MoveStep + " ,等待移栽完成后放开阻挡)");
}
#endregion
#region 不需要出出料,直接放行
#region 不需要托盘或移栽入库料盘完成
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_MoveOk))
{
////更新托盘条码信息
//string code = CodeManager.ProcessCode(LastCodeList);
//TrayManager.UpdateTrayCode(currTrayNum, code);
//if (code.Equals(""))
//{
// TrayManager.UpdateInStoreNG(currTrayNum, true);
//}
////从服务器获取库位号
//string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
//if (!result.Equals(""))
//{
// TrayManager.UpdateInStoreNG(currTrayNum, true);
// LogUtil.error(result);
//}
InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_13_LoactionCylinder_Down))
{
CheckLog("托盘检测 SecondStoreMove:(MO_14_TopCylinder_Down ,托盘号【" + currTrayNum + "】,直接放盘通过,顶升气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
//只有2号横移不需要下降
if (Config.SidesWayNum.Equals(2))
{
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
//更新横移托盘已处理完成
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
preTrayNum = currTrayNum;
CheckLog("托盘放行: 此处为环形线横移2,不需要下降, (托盘放行结束) ");
SecondMoveInfo.EndMove();
}
else if (Config.SidesWayNum > 0)
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
InStoreLog("托盘放行, " + SecondMoveInfo.MoveStep + " 托盘开始放行,环形线定位气缸下降");
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
CheckLog("托盘放行, " + SecondMoveInfo.MoveStep + " , 顶升气缸下降)");
CylinderMove(SecondMoveInfo, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_13_LoactionCylinder_Down))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
CheckLog("托盘放行, " + SecondMoveInfo.MoveStep + " ,环形线顶升气缸下降)");
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_TopCylinder_Down))
{
if (Config.SidesWayNum > 0)
......@@ -277,28 +260,28 @@ namespace OnlineStore.DeviceLibrary
}
else
{
CheckLog("托盘放行 SecondStoreMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
CheckLog("托盘放行 " + SecondMoveInfo.MoveStep + " ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_15_WaitCanGo))
{
CheckLog("托盘放行 SecondStoreMove:(MO_15_StopCylinder2_Down ,阻挡气缸1-2下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_StopCylinder2_Down);
CheckLog("托盘放行 " + SecondMoveInfo.MoveStep + " ,阻挡气缸1-2下降)");
IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down2, IO_VALUE.HIGH));
// SecondMoveInfo.EndStepWait();
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_16_StopCylinder2_Down))
{
CheckLog("托盘放行 SecondStoreMove:(MO_16_Tray_Check , 阻挡2托盘检测=0), 延时2秒)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_17_Tray_Check);
CheckLog("托盘放行 " + SecondMoveInfo.MoveStep + " , 阻挡2托盘检测=0), 延时2秒)");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.LOW));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_17_Tray_Check))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_18_StopCylinder_Back);
CheckLog("托盘放行 SecondStoreMove:(MO_17_StopCylinder_Back ,FL阻挡2上升 )");
CheckLog("托盘放行 " + SecondMoveInfo.MoveStep + " ,FL阻挡2上升 )");
IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
......@@ -316,48 +299,48 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_201_UpDownToP1) && MoveInfo.MoveStep >= (LineMoveStep.FO_07_LocationCylinder_Up))
{
if ( MoveCylineCanTakeOrGive())
if (MoveCylineCanTakeOrGive())
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_202_MoveCylinder_Give);
InStoreLog(" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端");
InStoreLog("紧急出料移栽"+SecondMoveInfo.MoveStep+":上料横移机构到放料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:上料横移机构到放料端前先上升横移气缸");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_202_MoveCylinder_Give))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_203_MoveCylinder_Down);
InStoreLog(" MO_203_MoveCylinder_Down 紧急出料移栽:上料横移机构下降");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构下降");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_203_MoveCylinder_Down))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_204_UpdownAxisToP2);
int targetP = Config.GetUpdownPositionP2(SecondMoveInfo.MoveParam.PlateH);
InStoreLog(" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置" + targetP);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":升降伺服下降到指定位置" + targetP);
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_204_UpdownAxisToP2))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_205_MoveCylinder_Tighten);
InStoreLog(" MO_205_MoveCylinder_Tighten 紧急出料移栽:上料气缸夹紧");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料气缸夹紧");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_205_MoveCylinder_Tighten))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_206_UpdownAxisToP1);
InStoreLog(" MO_206_UpdownAxisToP1 紧急出料移栽:升降伺服到P1");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":升降伺服到P1");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_206_UpdownAxisToP1))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up);
InStoreLog(" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构上升,更新【" + currTrayNum + "】为空托盘");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构上升,更新【" + currTrayNum + "】为空托盘");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//更新此托盘为空托盘
......@@ -368,20 +351,20 @@ namespace OnlineStore.DeviceLibrary
if (MoveCylineCanTakeOrGive())
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_208_MoveCylinder_Take);
InStoreLog(" MO_208_MoveCylinder_Take 紧急出料移栽:上料横移机构到取料端");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到取料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up);
InStoreLog(" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构到放料端前先上升横移气缸");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_208_MoveCylinder_Take))
{
InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 托盘开始放行,定位气缸下降");
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + " 托盘开始放行,定位气缸下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
}
......@@ -434,7 +417,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
InStoreLog("检测到料架, FI_01_TrayLocation_After :升降盘定位气缸下降");
InStoreLog("检测到料架, "+MoveInfo.MoveStep+" :升降盘定位气缸下降");
}
return true ;
}
......@@ -445,7 +428,7 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架:FI_07_LocationCylinder_Up缓冲阻挡上升, 定位气缸上升");
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
......@@ -467,7 +450,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
InStoreLog(" FI_03_InLineStart 入料检测:阻挡检测有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
InStoreLog(" 入料检测: " + MoveInfo.SLog + " 阻挡检测有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
}
else
{
......@@ -490,13 +473,13 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep.Equals(LineMoveStep.Wait))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
InStoreLog(" FI_01_TrayLocation_After 开始:升降盘定位气缸下降");
InStoreLog(" 料架入库" + MoveInfo.SLog + " :升降盘定位气缸下降");
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_01_TrayLocation_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_02_LocationCylinder_Down);
InStoreLog(" FI_02_LocationCylinder_Down 开始:定位气缸下降,提升伺服移动到P1");
InStoreLog(" 料架入库" + MoveInfo.SLog + ":定位气缸下降,提升伺服移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
......@@ -512,7 +495,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_07_LocationCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_08_BatchAxisToP2);
InStoreLog(" FI_08_BatchAxisToP2 开始:提升轴下降到位P2,定位气缸上升");
InStoreLog(" 料架入库" + MoveInfo.SLog + ":提升轴下降到位P2,定位气缸上升");
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SL_LocationCylinder_Up);
......@@ -520,15 +503,15 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_08_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_09_TrayLocation_Before);
InStoreLog(" FI_09_TrayLocation_Before 开始:升降盘定位气缸前进");
InStoreLog(" 料架入库" + MoveInfo.SLog + ":升降盘定位气缸前进");
TrayLCylinderBefore(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_09_TrayLocation_Before))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_10_AxisUpMove);
InStoreLog(" FI_10_AxisUpMove 开始:上料轴开始慢速上升到P3点,等待检测到料盘");
InStoreLog(" 料架入库" + MoveInfo.SLog + ":上料轴开始慢速上升到P3点,等待检测到料盘");
BatchAxisToP3();
}
}
#endregion
#region 检测到托盘,扫码,取料并放入托盘
......@@ -545,7 +528,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
InStoreLog(" FI_13_ScanCode 料盘移栽:开始扫码:暂时不扫码");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:暂时不扫码");
LastCodeList = new List<string>();
//MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
......@@ -568,104 +551,111 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_ScanCode))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_14_MoveCylinder_Take);
InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:上料横移取料端");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_MoveCylinder_Take))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_15_UpdownAxisToP3);
InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:升降轴到P3");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":升降轴到P3");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP3, Config.UpdownAxis_P3Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_15_UpdownAxisToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_16_MoveCylinder_Tighten);
InStoreLog(" FI_13_MoveCylinder_Tighten 料盘移栽:上料横移机构夹紧");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移机构夹紧");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_16_MoveCylinder_Tighten))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_17_UpdownAxisToP1);
InStoreLog(" FI_14_MoveCylinder_Up 料盘移栽:升降伺服到P1点,同时伺服运动到P3");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
BatchAxisToP3();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_UpdownAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_17_BatchAxisToP3);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3");
BatchAxisToP3();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_BatchAxisToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
LastHeight = GetHeight();
LastWidth = GetWidth();
InStoreLog(" FI_15_SaveSize 料盘移栽:记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_SaveSize))
{
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_19_MoveCylinder_Emptying);
InStoreLog(" FI_16_MoveCylinder_Emptying 料盘移栽:上料横移气缸放料SOL");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
InStoreLog(" FI_15_SaveSize 料盘移栽:上料横移气缸放料SOL前先上升横移气缸");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_MoveCylinder_Emptying))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray);
InStoreLog(" FI_17_WaitTray 料盘移栽:等待空托盘到达,并顶升上升,定位上升");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":等待空托盘到达,并顶升上升,定位上升");
//TODO 此处需要等待空托盘
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray) && SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))//TODO
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_MoveCylinder_Down);
InStoreLog(" FI_18_MoveCylinder_Down 料盘移栽:上料机构下降");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_MoveCylinder_Down))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_22_UpdownAxisToP2);
int targetPositon = Config.GetUpdownPositionP2(LastHeight);
InStoreLog(" FI_19_UpdownAxisToP2 料盘移栽:移栽伺服下降到指定位置:" + targetPositon);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":移栽伺服下降到指定位置:" + targetPositon);
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_UpdownAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_MoveCylinder_Slack);
InStoreLog(" FI_20_MoveCylinder_Slack 料盘移栽:上料气缸放松");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_MoveCylinder_Slack))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_24_UpDownAxisToP1);
InStoreLog(" FI_21_UpDownAxisToP1 料盘移栽:升降伺服到P1点");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_UpDownAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_MoveCylinder_Up);
InStoreLog(" FI_22_MoveCylinder_Up 料盘移栽:上料横移机构上升,记录托盘尺寸, 开始放行,");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移机构上升,记录托盘尺寸, 托盘开始放行");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
TrayManager.UpdateTrayInfo(currTrayNum, true, 1, "", "", LastHeight, LastWidth);
//更新托盘条码信息
string code = CodeManager.ProcessCode(LastCodeList);
TrayManager.UpdateTrayCode(currTrayNum, code);
if (code.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
}
//从服务器获取库位号
string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
if (!result.Equals(""))
Task.Factory.StartNew(delegate
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
LogUtil.error(result);
}
//更新托盘条码信息
string code = CodeManager.ProcessCode(LastCodeList);
TrayManager.UpdateTrayInfo(currTrayNum, true, 1, code, "", LastHeight, LastWidth);
if (code.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
}
//从服务器获取库位号
string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
if (!result.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
LogUtil.error(result);
}
});
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_MoveCylinder_Up))
{
......@@ -678,19 +668,19 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_31_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_32_TrayLocationCylinder_After);
InStoreLog(" FI_32_TrayLocationCylinder_After 上料完成: 升降盘定位气缸后退");
InStoreLog(" 上料完成" + MoveInfo.SLog + ": 升降盘定位气缸后退");
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_32_TrayLocationCylinder_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_33_BatchAxisToP1);
InStoreLog(" FI_33_BatchAxisToP1 上料完成:提升伺服到P1点");
InStoreLog(" 上料完成" + MoveInfo.SLog + ":提升伺服到P1点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_33_BatchAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_35_OutTopCylinder_Up);
InStoreLog(" FI_34_LocationCylinder_Down 上料完成,出口顶升气缸上升,出料缓冲阻挡上升");
InStoreLog(" 上料完成" + MoveInfo.SLog + ",出口顶升气缸上升,出料缓冲阻挡上升");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Down, IO_Type.SL_OutTopCylinder_Up);
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.LOW);
}
......@@ -699,7 +689,7 @@ namespace OnlineStore.DeviceLibrary
{
//TODO
MoveInfo.NextMoveStep(LineMoveStep.FI_36_SideWayLineRun);
InStoreLog(" FI_36_SideWayLineRun 上料完成, 线体横移电机运转,等待SL1线体出口横移检测");
InStoreLog(" 上料完成" + MoveInfo.SLog + ", 线体横移电机运转,等待SL1线体出口横移检测");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
MoveInfo.OneWaitCanEndStep = true;
......@@ -710,7 +700,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_37_LineStop);
InStoreLog(" FI_37_LineStop 上料完成, 料架到达出口,线体横移电机停止 ");
InStoreLog(" 上料完成" + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止 ");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.LOW);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
......@@ -719,7 +709,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_37_LineStop))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_38_TopCylinderDown);
InStoreLog(" FI_38_TopCylinderDown 上料完成, 料架到达出口,出口顶升下降,定位气缸下降, ");
InStoreLog(" 上料完成" + MoveInfo.SLog + ", 料架到达出口,出口顶升下降,定位气缸下降, ");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
......@@ -732,22 +722,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog(" 上料完成, ,料架到达出口处, 通知AGV取空料架, 入料流程结束");
AgvClient.ReadyEmpty(Config.AgvOutName);
}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_40_OutLineRun))
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_40_OutLineRun);
// InStoreLog(" FI_40_OutLineRun 上料完成, AGV到达,继续转动出口线体,送走出料料架, ");
//}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_40_OutLineRun))
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_41_OutLineRun);
// InStoreLog(" FI_41_OutLineRun 上料完成, 上料完成, 料架送出, ");
//}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_41_OutLineRun))
//{
// MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing;
// LogUtil.info("空料架已送出,入料结束");
//}
#endregion
}
private void FI_12_MoveCylinder_Give()
......@@ -755,14 +730,14 @@ namespace OnlineStore.DeviceLibrary
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_12_MoveCylinder_Give);
InStoreLog(" FI_12_MoveCylinder_Up 料盘移栽:横移机构到放料端");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":横移机构到放料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
//有料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_11_MoveCylinder_Up);
InStoreLog(" FI_11_MoveCylinder_Up 料盘移栽:检测到料盘,横移机构上升");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":检测到料盘,横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
......@@ -776,7 +751,7 @@ namespace OnlineStore.DeviceLibrary
{
//无料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
InStoreLog(" FI_31_BatchAxisToP2 料盘移栽:未检测到料盘,提升伺服到P2点");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
}
......@@ -849,7 +824,7 @@ namespace OnlineStore.DeviceLibrary
/// 是否需要拦截当前托盘进行处理
/// </summary>
/// <returns></returns>
internal bool NeedCurrTray(bool checkAndMove = false )
internal bool NeedCurrTray(bool checkAndMove = false)
{
if (IsDebug && runStatus <= LineRunStatus.Wait)
{
......@@ -864,11 +839,11 @@ namespace OnlineStore.DeviceLibrary
if (Config.IsCanOut.Equals(1))
{
//此托盘是紧急出料盘,需要通过料架出库
if ((IOValue(IO_Type.SW_ReelCheck).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.FL_ReelCheck).Equals(IO_VALUE.HIGH))&&info.EmergencyOut)
if ((IOValue(IO_Type.SW_ReelCheck).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.FL_ReelCheck).Equals(IO_VALUE.HIGH)) && info.EmergencyOut)
{
if (isFull && runStatus.Equals(LineRunStatus.Runing) && MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
lastOutParam = param;
if (checkAndMove)
{
......@@ -882,8 +857,8 @@ namespace OnlineStore.DeviceLibrary
}
else
{
if ((LineManager.Line.IsDebug&&MoveInfo.MoveType.Equals(LineMoveType.InStore))||
( !isFull && runStatus.Equals(LineRunStatus.Runing) && MoveInfo.MoveType.Equals(LineMoveType.InStore)))
bool trayCanUse = LineManager.Line.runStatus <= LineRunStatus.Wait || (!isFull);
if (trayCanUse && runStatus.Equals(LineRunStatus.Runing) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{
//入料执行中, 且需要空托盘
if (MoveInfo.MoveStep >= LineMoveStep.FI_11_MoveCylinder_Up && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
......@@ -923,7 +898,7 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FO_07_LocationCylinder_Up);
InStoreLog(" FO_07_LocationCylinder_Up 定位工位检测到料架:缓冲阻挡上升, 定位气缸上升");
OutStoreLog(" 定位工位检测到料架"+MoveInfo.MoveStep+":缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
......@@ -936,7 +911,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
InStoreLog(" FO_03_InLineStart 出料检测:阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
OutStoreLog(" 出料检测" + MoveInfo.SLog + ":阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
}
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
......@@ -946,7 +921,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
InStoreLog(" FO_03_InLineStart 出料检测:入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000");
OutStoreLog(" 出料检测" + MoveInfo.SLog + ":入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000");
}
else
{
......@@ -969,12 +944,12 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
InStoreLog("检测到料架, FO_01_TrayLocation_After :升降盘定位气缸后退");
OutStoreLog(" 出料检测" + MoveInfo.SLog + ":升降盘定位气缸后退");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_01_TrayLocation_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_02_LocationCylinder_Down);
InStoreLog(" FO_02_LocationCylinder_Down 开始:定位气缸下降,提升轴移动到P1");
OutStoreLog("出库: " + MoveInfo.SLog + " 开始:定位气缸下降,提升轴移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
......@@ -990,26 +965,26 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_07_LocationCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_08_BatchAxisToP2);
InStoreLog(" FO_08_BatchAxisToP2 开始:提升轴下降到位P2");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :提升轴下降到位P2");
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_08_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_09_TrayLocation_Before);
InStoreLog(" FO_09_TrayLocation_Before 开始:升降盘定位气缸前进");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :升降盘定位气缸前进");
TrayLCylinderBefore(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_09_TrayLocation_Before))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_10_AxisUpMove);
InStoreLog(" FO_10_AxisUpMove 开始:上料轴开始慢速上升到P3点");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :上料轴开始慢速上升到P3点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP3, Config.BatchAxis_TargetSpeed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_10_AxisUpMove))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_11_AxisDownMove);
InStoreLog(" FO_31_BatchAxisToP2 料盘移栽:提升伺服下降指定的高度");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :提升伺服下降指定的高度");
int targetPosition = Config.BatchAxisP3 + lastOutParam.PlateH * Config.Height_ChangeValue;
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_TargetSpeed);
......@@ -1017,43 +992,43 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_11_AxisDownMove))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_12_MoveCylinder_Down);
InStoreLog(" FO_12_MoveCylinder_Down 料盘移栽:出料横移机构下降");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":出料横移机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_12_MoveCylinder_Down))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_13_MoveCylinder_Slack);
InStoreLog(" FO_13_MoveCylinder_Slack 料盘移栽:出料横移机构放松");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":出料横移机构放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_13_MoveCylinder_Slack))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_14_MoveCylinder_Up);
InStoreLog(" FO_14_MoveCylinder_Up 料盘移栽:上料横移机构上升");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":上料横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_14_MoveCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_31_BatchAxisToP2);
InStoreLog(" FO_31_BatchAxisToP2 出料完成:未检测到料盘,提升伺服到P2点");
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_31_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_32_TrayLocationCylinder_After);
InStoreLog(" FO_32_TrayLocationCylinder_After 出料完成: 升降盘定位气缸后退");
OutStoreLog("出料完成 " + MoveInfo.SLog + ": 升降盘定位气缸后退");
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_32_TrayLocationCylinder_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_33_BatchAxisToP1);
InStoreLog(" FO_33_BatchAxisToP1 出料完成:提升伺服到P1点");
OutStoreLog("出料完成 " + MoveInfo.SLog + ":提升伺服到P1点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_33_BatchAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_35_OutTopCylinder_Up);
InStoreLog(" FO_34_LocationCylinder_Down 出料完成,出口顶升气缸上升,出料缓冲阻挡上升");
OutStoreLog("出料完成 " + MoveInfo.SLog + ",出口顶升气缸上升,出料缓冲阻挡上升");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Down, IO_Type.SL_OutTopCylinder_Up);
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.LOW);
}
......@@ -1065,7 +1040,7 @@ namespace OnlineStore.DeviceLibrary
{
//TODO
MoveInfo.NextMoveStep(LineMoveStep.FO_36_SideWayLineRun);
InStoreLog(" FO_36_SideWayLineRun 出料完成, 线体横移电机运转,等待料架到达出口");
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 线体横移电机运转,等待料架到达出口");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
MoveInfo.OneWaitCanEndStep = true;
......@@ -1076,7 +1051,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FO_37_LineStop);
InStoreLog(" FO_37_LineStop 出料完成, 料架到达出口,线体横移电机停止 ");
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止 ");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.LOW);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
......@@ -1085,7 +1060,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_37_LineStop))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_38_TopCylinderDown);
InStoreLog(" FO_38_TopCylinderDown 出料完成, 料架到达出口,出口顶升下降,定位气缸下降, ");
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,出口顶升下降,定位气缸下降, ");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
......@@ -1093,17 +1068,17 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_38_TopCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_39_OutLineRun);
InStoreLog(" FO_39_OutLineRun 出料完成, 出口线体运转,料架到达出口处, 通知AGV取空料架, ");
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 出口线体运转,料架到达出口处, 通知AGV取空料架, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_40_OutLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_40_OutLineRun);
InStoreLog(" FO_40_OutLineRun 出料完成, AGV到达,继续转动出口线体,送走出料料架, ");
OutStoreLog("出料完成 " + MoveInfo.SLog + ", AGV到达,继续转动出口线体,送走出料料架, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_40_OutLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_41_OutLineRun);
InStoreLog(" FO_41_OutLineRun 出料完成, 上料完成, 料架送出, ");
OutStoreLog("上料完成 " + MoveInfo.SLog + ", 料架送出, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_41_OutLineRun))
{
......
......@@ -116,39 +116,52 @@ namespace OnlineStore.DeviceLibrary
//初始化摄像机配置
CodeManager.LoadConfig();
List<string> cioList = new List<string>(ioList);
string ids = ConfigAppSettings.GetValue(Setting_Init.DebugDeviceId);
if (IsDebug)
{
try
{
cioList = new List<string>();
string[] testDeviceIdList = ids.Split(',');
ioList = new List<string>();
foreach (string str in testDeviceIdList)
{
int id = Convert.ToInt32(str);
if (FeedingEquipMap.ContainsKey(id))
{
FeedingEquip feed = FeedingEquipMap[id];
ioList.AddRange(feed.Config.IOIPList);
cioList.AddRange(feed.Config.IOIPList);
}
else if (ProvidingEquipMap.ContainsKey(id))
{
ProvidingEquip feed = ProvidingEquipMap[id];
ioList.AddRange(feed.Config.IOIPList);
cioList.AddRange(feed.Config.IOIPList);
}
else if (DisLineMap.ContainsKey(id))
{
DischargeLine feed = DisLineMap[id];
ioList.AddRange(feed.Config.IOIPList);
cioList.AddRange(feed.Config.IOIPList);
}
else if (MoveEquipMap.ContainsKey(id))
{
MoveEquip equip = MoveEquipMap[id];
ioList.AddRange(equip.Config.IOIPList);
cioList.AddRange(equip.Config.IOIPList);
}else if (id.Equals(0))
{
ioList.AddRange(Config.IOIPList);
cioList = new List<string>();
cioList.AddRange(ioList);
List<string> removeList = new List<string>() {
"192.168.101.22",
"192.168.101.23"
};
foreach(string s in removeList)
{
if (cioList.Contains(s))
{
cioList.Remove(s);
}
}
}
}
}
......@@ -160,7 +173,7 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate
{
IOManager.instance.ConnectionIOList(ioList);
IOManager.instance.ConnectionIOList(cioList);
Thread.Sleep(5);
if (!IsDebug)
{
......@@ -253,7 +266,7 @@ namespace OnlineStore.DeviceLibrary
{
AgvClient.Init();
}
lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.HomeMoving;
StartTime = DateTime.Now;
......@@ -296,7 +309,8 @@ namespace OnlineStore.DeviceLibrary
TrayManager.TrayErrorMsg = "";
SetWarnMsg("");
PreIsHasProcess = true;
MoveInfo.NewMove(LineMoveType.Reset);
MoveInfo.NextMoveStep(LineMoveStep.Wait);
if (TrayManager.ErrorStoreId > 0)
{
if (MoveEquipMap.ContainsKey(TrayManager.ErrorStoreId))
......@@ -308,13 +322,21 @@ namespace OnlineStore.DeviceLibrary
WriteDrivetMotorRun( IO_VALUE.LOW);
//NG气缸后退
CylinderMove(null, IO_Type.NGCylinder_Before, IO_Type.NGCylinder_After);
CylinderMove(MoveInfo, IO_Type.NGCylinder_Before, IO_Type.NGCylinder_After);
////阻挡都上升
//IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
//IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW);
//横移轨道下降
SideWayReset();
SideWayStop();
CylinderMove(MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW2_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW3_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
}
......@@ -336,8 +358,9 @@ namespace OnlineStore.DeviceLibrary
}
//停止运动
MoveInfo.EndMove();
MoveInfo.EndMove();
lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.Reset;
//重置通用处理
......@@ -461,7 +484,7 @@ namespace OnlineStore.DeviceLibrary
}
private void WriteDrivetMotorRun(IO_VALUE value)
public void WriteDrivetMotorRun(IO_VALUE value)
{
IOMove(IO_Type.DriveMotor_Run1, value);
IOMove(IO_Type.DriveMotor_Run2, value);
......@@ -487,37 +510,37 @@ namespace OnlineStore.DeviceLibrary
}
private void SleepProcess()
{
//休眠处理
//判断所有的盘的都是空盘
bool isHasO = isHasProcess();
////休眠处理
////判断所有的盘的都是空盘
//bool isHasO = isHasProcess();
if (!isHasO)
{
if (IsSleep)
{
return;
}
if (PreIsHasProcess.Equals(isHasO))
{
//判断时间是否需要休眠
TimeSpan span = DateTime.Now - LastNoOperateTime;
if (span.TotalSeconds > Config.Sleep_MSeconds)
{
LogUtil.info( Name + "***********已经【" + span.TotalSeconds + "】秒没有操作了,开始进入休眠状态");
UpdateSleep(true);
}
}
else
{
PreIsHasProcess = isHasO;
LastNoOperateTime = DateTime.Now;
}
}
else
{
PreIsHasProcess = isHasO;
UpdateSleep(false);
}
//if (!isHasO)
//{
// if (IsSleep)
// {
// return;
// }
// if (PreIsHasProcess.Equals(isHasO))
// {
// //判断时间是否需要休眠
// TimeSpan span = DateTime.Now - LastNoOperateTime;
// if (span.TotalSeconds > Config.Sleep_MSeconds)
// {
// LogUtil.info( Name + "***********已经【" + span.TotalSeconds + "】秒没有操作了,开始进入休眠状态");
// UpdateSleep(true);
// }
// }
// else
// {
// PreIsHasProcess = isHasO;
// LastNoOperateTime = DateTime.Now;
// }
//}
//else
//{
// PreIsHasProcess = isHasO;
// UpdateSleep(false);
//}
}
#endregion
......@@ -815,7 +838,7 @@ namespace OnlineStore.DeviceLibrary
internal override void StopMove()
{
{
foreach (MoveEquip equip in this.AllEquipMap.Values)
{
......@@ -830,7 +853,7 @@ namespace OnlineStore.DeviceLibrary
}
MoveInfo.EndMove();
WriteDrivetMotorRun( IO_VALUE.LOW);
WriteDrivetMotorRun(IO_VALUE.LOW);
IOMove(IO_Type.NGCylinder_After, IO_VALUE.LOW);
IOMove(IO_Type.NGCylinder_Before, IO_VALUE.LOW);
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
......@@ -844,54 +867,62 @@ namespace OnlineStore.DeviceLibrary
protected override void ResetProcess()
{
bool isOk = true;
//判断是否所有的已经返回完成
foreach (MoveEquip moveEquip in this.AllEquipMap.Values)
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
}
if (!MoveInfo.IsInWait)
{
if ((moveEquip.runStatus.Equals(LineRunStatus.HomeMoving) || moveEquip.runStatus.Equals(LineRunStatus.Reset)) && moveEquip.IsDebug.Equals(false))
bool isOk = true;
//判断是否所有的已经返回完成
foreach (MoveEquip moveEquip in this.AllEquipMap.Values)
{
if (moveEquip.alarmType.Equals(LineAlarmType.None))
{
isOk = false;
break;
}
else
if ((moveEquip.runStatus.Equals(LineRunStatus.HomeMoving) || moveEquip.runStatus.Equals(LineRunStatus.Reset)) && moveEquip.IsDebug.Equals(false))
{
SetWarnMsg( moveEquip.Name + "在复位过程中报警,需要重新复位");
if (moveEquip.alarmType.Equals(LineAlarmType.None))
{
isOk = false;
break;
}
else
{
SetWarnMsg(moveEquip.Name + "在复位过程中报警,需要重新复位");
}
}
}
}
if (!ResetSingleISOk())
{
isOk = false;
}
if (isOk)
{
PreIsHasProcess = false;
//打开流水线
WriteDrivetMotorRun( IO_VALUE.HIGH);
//所有原点重置完成
runStatus = LineRunStatus.Runing;
LogUtil.info( Name + "所有设备重置完成,打开流水线,开始运转!");
}
}
private bool ResetSingleISOk()
{
//气缸需要到位
if (IOValue(IO_Type.SW4_TopCylinder_Down).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.NGCylinder_After).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.SW4_TopCylinder_Up).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.NGCylinder_Before).Equals(IO_VALUE.LOW)
)
{
return true;
}
else
{
return false;
//if (!ResetSingleISOk())
//{
// isOk = false;
//}
if (isOk)
{
PreIsHasProcess = false;
//打开流水线
WriteDrivetMotorRun(IO_VALUE.HIGH);
//所有原点重置完成
runStatus = LineRunStatus.Runing;
lineStatus = LineStatus.StoreOnline;
LogUtil.info(Name + "所有设备重置完成,打开流水线,开始运转!");
}
}
}
//private bool ResetSingleISOk()
//{
// //气缸需要到位
// if (IOValue(IO_Type.SW4_TopCylinder_Down).Equals(IO_VALUE.HIGH) &&
// IOValue(IO_Type.NGCylinder_After).Equals(IO_VALUE.HIGH) &&
// IOValue(IO_Type.SW4_TopCylinder_Up).Equals(IO_VALUE.LOW) &&
// IOValue(IO_Type.NGCylinder_Before).Equals(IO_VALUE.LOW)
// )
// {
// return true;
// }
// else
// {
// return false;
// }
//}
}
......
......@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary
public bool CanProcessLine(bool isCheckSleep = true)
{
if (IsDebug)
if (runStatus<=LineRunStatus.Wait)
{
return true;
}
......@@ -356,7 +356,7 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 横移处理
#region 横移处理-
/// <summary>
/// 横移无处理
/// </summary>
......@@ -386,19 +386,7 @@ namespace OnlineStore.DeviceLibrary
}
private static LineMoveInfo SW41_MoveInfo = null;
private static LineMoveInfo SW23_MoveInfo = null;
private bool SideWayReset()
{
SideWayStop();
CylinderMove(null, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
CylinderMove(null, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
CylinderMove(null, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
CylinderMove(null, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
CylinderMove(null, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
return true;
}
private void SideWayStop()
{
SideWay41IsWait = false;
......
......@@ -130,13 +130,13 @@ namespace OnlineStore.DeviceLibrary
{
case LineMoveStep.MH_UpDownHomeMove:
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
LogInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始");
LogInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始");
UpdownUpMove();
break;
case LineMoveStep.MH_UpDownCylinder_Up:
MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back);
LogInfo(MoveInfo.MoveType + " :: (上升到位,顶升气缸下降,前后气缸回退 )开始");
LogInfo(MoveInfo.MoveType + " : (上升到位,顶升气缸下降,前后气缸回退 )开始");
CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
......
......@@ -62,41 +62,41 @@ namespace OnlineStore.DeviceLibrary
#region 移载装置 移栽物品操作
if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_50_StartOutProcess))
{
OutStoreLog("出库: MO_51_BeforeAfterCylinderBefore ( 前后气缸前进 )");
MoveInfo.NextMoveStep(LineMoveStep.MO_51_BeforeAfterCylinderBefore);
OutStoreLog("出库 "+MoveInfo.MoveStep+": 前后气缸前进 )");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_51_BeforeAfterCylinderBefore))
{
OutStoreLog("出库: MO_52_UpDownCylinderDown ( 上下气缸1下降 )");
MoveInfo.NextMoveStep(LineMoveStep.MO_52_UpDownCylinderDown);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1下降 )");
UpdownDownBoxMove(MoveInfo.MoveParam.PlateH);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_52_UpDownCylinderDown))
{
OutStoreLog("出库: MO_53_UpDownCylinderDownWait ( 上下气缸1下降 后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作)");
MoveInfo.NextMoveStep(LineMoveStep.MO_53_UpDownCylinderDownWait);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1下降 后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作)");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_53_UpDownCylinderDownWait))
{
OutStoreLog("出库: MO_54_ClampCylinderSlack ( 夹料气缸1夹紧)");
MoveInfo.NextMoveStep(LineMoveStep.MO_54_ClampCylinderSlack);
OutStoreLog("出库 " + MoveInfo.SLog + ": 夹料气缸1夹紧)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_54_ClampCylinderSlack))
{
OutStoreLog("出库: MO_55_UpDownCylinderUp ( 上下气缸1上升)");
MoveInfo.NextMoveStep(LineMoveStep.MO_55_UpDownCylinderUp);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1上升)");
UpdownUpMove();
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_55_UpDownCylinderUp))
{
OutStoreLog("出库: MO_56_BeforeAfterCylinderAfter( 前后气缸1后退)");
MoveInfo.NextMoveStep(LineMoveStep.MO_56_BeforeAfterCylinderAfter);
OutStoreLog("出库 " + MoveInfo.SLog + ": 前后气缸1后退)");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
}
#endregion
......@@ -106,7 +106,9 @@ namespace OnlineStore.DeviceLibrary
&& MoveInfo.MoveStep.Equals(LineMoveStep.MO_56_BeforeAfterCylinderAfter)
&& !SecondMoveInfo.IsInWait)
{
OutStoreLog("出库:( MO_06_UpDownCylinderDown,夹具检测编码完成, 上下气缸1下降 )");
//去掉直接丢盘处理
MoveInfo.NextMoveStep(LineMoveStep.MO_58_UpDownCylinderDown);
OutStoreLog("出库 " + MoveInfo.SLog + ": 夹具检测编码完成, 上下气缸1下降 )");
if (MoveInfo.MoveParam != null)
{
MoveInfo.MoveParam.TrayNumber = SecondMoveInfo.MoveParam.TrayNumber;
......@@ -116,8 +118,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.MoveParam = SecondMoveInfo.MoveParam;
}
//去掉直接丢盘处理
MoveInfo.NextMoveStep(LineMoveStep.MO_58_UpDownCylinderDown);
UpdownDownMove(MoveInfo.MoveParam.PlateH);
////判断盘号,如果是七寸盘,不需要下降,直接放盘
......@@ -137,7 +137,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_58_UpDownCylinderDown))
{
OutStoreLog("出库:(MO_07_ClampCylinderTighten 夹料气缸1放松 )");
OutStoreLog("出库 " + MoveInfo.SLog + ": 夹料气缸1放松 )");
int bagWidth = MoveInfo.MoveParam.PlateW;
LogInfo("【" + posId + "】出库时,更新盘空满信息 托盘号【" + MoveInfo.MoveParam.TrayNumber + "】,是否有料盘【" + true + "】,出库入库【" + 2 + "】");
......@@ -150,8 +150,8 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_59_ClampCylinderTighten))
{
OutStoreLog("出库:(MO_08_UpDownCylinderUp 上下气缸1上升)");
this.MoveInfo.NextMoveStep(LineMoveStep.MO_60_UpDownCylinderUp);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1上升)");
UpdownUpMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_60_UpDownCylinderUp))
......@@ -224,21 +224,21 @@ namespace OnlineStore.DeviceLibrary
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_07_UpDownCylinderDown))
{
InStoreLog("入库:(MI_07_UpDownCylinderDownWait, 编码与仓位一致,上下气缸1下降后等待0.3秒再夹紧,防止没有下降到位就夹紧");
MoveInfo.NextMoveStep(LineMoveStep.MI_07_UpDownCylinderDownWait);
InStoreLog("入库 " + MoveInfo.SLog + ": 编码与仓位一致,上下气缸1下降后等待0.3秒再夹紧,防止没有下降到位就夹紧");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
//只有当BOX可以进行出入库时,移栽物品,防止卡住
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_07_UpDownCylinderDownWait))
{
InStoreLog("入库:(MI_08_ClampCylinderSlack,夹料气缸1夹紧)");
MoveInfo.NextMoveStep(LineMoveStep.MI_08_ClampCylinderSlack);
InStoreLog("入库 " + MoveInfo.SLog + ": 夹料气缸1夹紧)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_08_ClampCylinderSlack))
{
InStoreLog("入库:(MI_09_UpDownCylinderUp,上下气缸1上升)");
MoveInfo.NextMoveStep(LineMoveStep.MI_09_UpDownCylinderUp);
InStoreLog("入库 " + MoveInfo.SLog + ": 上下气缸1上升)");
UpdownUpMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_09_UpDownCylinderUp))
......
......@@ -255,21 +255,21 @@ namespace OnlineStore.DeviceLibrary
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_01_UpDownCylinderDown))
{
InStoreLog("出料:(PO_02_UpDownCylinderDownWait, 上下气缸1下降后等待0.3秒再夹紧");
MoveInfo.NextMoveStep(LineMoveStep.PO_02_UpDownCylinderDownWait);
OutStoreLog("出库 "+MoveInfo.SLog+" : 上下气缸1下降后等待0.3秒再夹紧");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
//只有当BOX可以进行出出料时,移栽物品,防止卡住
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_02_UpDownCylinderDownWait))
{
InStoreLog("出料:(PO_02_UpDownCylinderDownWait,夹料气缸夹紧)");
MoveInfo.NextMoveStep(LineMoveStep.PO_03_ClampCylinderSlack);
OutStoreLog("出库 " + MoveInfo.SLog + " : 夹料气缸夹紧)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_03_ClampCylinderSlack))
{
InStoreLog("出料:(PO_04_UpDownCylinderUp,上下气缸上升)");
MoveInfo.NextMoveStep(LineMoveStep.PO_04_UpDownCylinderUp);
OutStoreLog("出库 " + MoveInfo.SLog + " : 上下气缸上升)");
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
UpdownUpMove();
}
......@@ -292,34 +292,34 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_05_WaitBox))
{
InStoreLog("出料:(PO_06_BeforeAfterCylinderBefore,前后气缸前进)");
MoveInfo.NextMoveStep(LineMoveStep.PO_06_BeforeAfterCylinderBefore);
OutStoreLog("出库:PO_06_BeforeAfterCylinderBefore,前后气缸前进)");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_06_BeforeAfterCylinderBefore))
{
InStoreLog("出料:(PO_07_UpDownCylinderDown ,上下气缸下降)");
MoveInfo.NextMoveStep(LineMoveStep.PO_07_UpDownCylinderDown);
OutStoreLog("出库:PO_07_UpDownCylinderDown ,上下气缸下降)");
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
UpdownDownP3Move(MoveInfo.MoveParam.PlateH);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_07_UpDownCylinderDown))
{
InStoreLog("出料: (PO_08_ClampCylinderTighten,夹料气缸放松)");
MoveInfo.NextMoveStep(LineMoveStep.PO_08_ClampCylinderTighten);
InStoreLog("出料: (PO_08_ClampCylinderTighten,夹料气缸放松)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_08_ClampCylinderTighten))
{
InStoreLog("出料:(PO_09_UpdownCylinderUp,上下气缸上升)");
MoveInfo.NextMoveStep(LineMoveStep.PO_09_UpdownCylinderUp);
OutStoreLog("出库:PO_09_UpdownCylinderUp,上下气缸上升)");
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
UpdownUpMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_09_UpdownCylinderUp))
{
InStoreLog("出料:(PO_10_BeforeAfterCylinderAfter,前后气缸后退,等待4000 )");
MoveInfo.NextMoveStep(LineMoveStep.PO_10_BeforeAfterCylinderAfter);
OutStoreLog("出库:PO_10_BeforeAfterCylinderAfter,前后气缸后退,等待4000 )");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(4000));
......
......@@ -152,6 +152,7 @@ namespace OnlineStore.DeviceLibrary
internal static bool RightTrayCode(int trayNum, int preTrayNum, bool isCanUpdateMax)
{
return true;
int defNext = preTrayNum + 1;
if (preTrayNum.Equals(0) || MaxTrayNum.Equals(0) || trayNum.Equals(defNext))
{
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.DeviceLibrary
{
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
Thread.Sleep(60);
Thread.Sleep(10);
}
else
{
......
......@@ -82,6 +82,10 @@ namespace OnlineStore.DeviceLibrary
{
get { return moveStep; }
}
public string SLog
{
get { return moveStep + ""; }
}
public void NextMoveStep(LineMoveStep step)
{
......
......@@ -623,7 +623,10 @@ namespace OnlineStore.DeviceLibrary
/// 料盘移栽:上料横移机构上升,同时伺服运动到P3
/// </summary>
FI_17_UpdownAxisToP1 ,
/// <summary>
/// 料盘移栽:批量轴到P3点,检测是否有料盘
/// </summary>
FI_17_BatchAxisToP3,
/// <summary>
/// 料盘移栽:记录高度尺寸
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!