Commit 261a5797 LN

横移机构可以同时存在两个托盘

1 个父辈 74efec2b
......@@ -162,7 +162,7 @@ AIO的dll更新,增加重连功能。
上料模块,只有料盘到达流水线上方后才拦截托盘。
20200228修改,横移机构可以同时存在两个托盘
......
......@@ -317,7 +317,8 @@ namespace OnlineStore.DeviceLibrary
//横移轨道下降
SideWayStop();
SW23WaitTrayNum = -1;
SW41WaitTrayNum = -1;
CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW);
CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW);
......
......@@ -147,6 +147,9 @@ namespace OnlineStore.DeviceLibrary
{
int storeId = checkWaitInfo.MoveParam.GetStoreId();
wait.IsEnd = LineServer.BoxCanReviceTray(storeId);
}else if (wait.WaitType.Equals(WaitEnum.W010_SWCanTopUp))
{
wait.IsEnd = SwCanUpMove(wait.TargetPosition);
}
if (wait.IsEnd && checkWaitInfo.OneWaitCanEndStep)
{
......@@ -221,11 +224,14 @@ namespace OnlineStore.DeviceLibrary
#region 横移处理-
internal int SW23WaitTrayNum = -1;
internal int SW41WaitTrayNum = -1;
internal int Sw41TrayNum = 0;
internal int Sw23TrayNum = 0;
private void Equip_TrayPEndEvent(int swNum, int trayNum)
{
try {
try
{
if (swNum <= 0 || this.runStatus <= (LineRunStatus.Wait))
{
return;
......@@ -236,16 +242,17 @@ namespace OnlineStore.DeviceLibrary
{
Sw23TrayNum = trayNum;
SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCheck);
SWLog("横移轨道23:检测到SW2_TrayCheck,定位气缸下降,等待横移2托盘检测信号,托盘号 [" + Sw23TrayNum + "] ");
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
SW23WaitTrayNum = -1;
SWLog("横移轨道23:检测到SW2_TrayCheck,再次检测, 托盘号 [" + Sw23TrayNum + "] ,清空 SW23WaitTrayNum=" + SW23WaitTrayNum);
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.SW2_LocationCylinder_Down);
// CylinderMove(SW23_MoveInfo, IO_Type.SW3_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
}
else
{
LogInfo("Equip_TrayPEndEvent【" + swNum + "】【" + trayNum + "】失败,SW23_MoveInfo 忙碌中");
SW23WaitTrayNum = trayNum;
LogInfo("Equip_TrayPEndEvent【" + swNum + "】【" + trayNum + "】失败,SW23_MoveInfo 忙碌中,记录 SW23WaitTrayNum="+ SW23WaitTrayNum);
}
}
else if (swNum.Equals(4))
......@@ -254,96 +261,140 @@ namespace OnlineStore.DeviceLibrary
{
Sw41TrayNum = trayNum;
SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCheck);
SWLog("横移轨道41:检测到SW4_TrayCheck,定位气缸下降, 等待横移4托盘检测信号,更新托盘号 [" + Sw41TrayNum + "] ");
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
SW41WaitTrayNum = -1;
SWLog("横移轨道41:检测到SW4_TrayCheck,再次检测,托盘号 [" + Sw41TrayNum + "] ,清空 SW41WaitTrayNum=" + SW41WaitTrayNum);
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);
//CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
// CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
}
else
{
LogInfo("Equip_TrayPEndEvent【" + swNum + "】【" + trayNum + "】失败,SW41_MoveInfo 忙碌中");
SW41WaitTrayNum = trayNum;
LogInfo("Equip_TrayPEndEvent【" + swNum + "】【" + trayNum + "】失败,SW41_MoveInfo 忙碌中,记录 SW41WaitTrayNum ="+ SW41WaitTrayNum);
}
}
}
}catch(Exception ex)
catch (Exception ex)
{
LogUtil.error(Name + "Equip_TrayPEndEvent出错:",ex);
LogUtil.error(Name + "Equip_TrayPEndEvent出错:", ex);
}
}
/// <summary>
/// 入料三和出料四使用,判断是否可以开始处理托盘
/// 横移无处理,上料机构和出料机构判断使用
/// </summary>
internal bool SwNoProcess(int sidesWayNum)
{
//20200228修改,横移机构可以同时存在两个托盘
try
{
if (LineManager.Line.runStatus <= LineRunStatus.Wait || sidesWayNum <= 0)
{
return true;
}
if (sidesWayNum.Equals(2))
if (sidesWayNum.Equals(2) && SW23WaitTrayNum < 0)
{
LineMoveInfo moveInfo = FeedingEquipMap[104].SecondMoveInfo;
// LineMoveInfo moveInfo = FeedingEquipMap[104].SecondMoveInfo;
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None))
{
if (moveInfo.MoveType.Equals(LineMoveType.None))
{
return true;
}
else if (moveInfo.MoveType.Equals(LineMoveType.CheckFixture) &&
moveInfo.MoveStep >= LineMoveStep.MO_15_WaitCanGo &&
moveInfo.MoveStep <= LineMoveStep.MO_18_StopCylinder_Back)
{
return true;
//if (moveInfo.MoveType.Equals(LineMoveType.None))
//{
// return true;
//}
//else if (moveInfo.MoveType.Equals(LineMoveType.CheckFixture) &&
// moveInfo.MoveStep >= LineMoveStep.MO_15_WaitCanGo &&
//moveInfo.MoveStep <= LineMoveStep.MO_18_StopCylinder_Back)
//{
// return true;
//}
}
} else if (SW23_MoveInfo.MoveStep .Equals( LineMoveStep.SW12_WaitTrayGo)
&& moveInfo.MoveType.Equals(LineMoveType.None))
else if (SW23_MoveInfo.MoveStep <= (LineMoveStep.SW12_WaitTrayGo)
&& SW23_MoveInfo.MoveStep >= (LineMoveStep.SW10_WatOutFixture2))
{
return true;
}
}
else if (sidesWayNum.Equals(3) && runStatus <= LineRunStatus.Wait)
else if (sidesWayNum.Equals(3) && SW23WaitTrayNum < 0 && runStatus <= LineRunStatus.Wait)
{
return true;
}
if (sidesWayNum.Equals(4))
if (sidesWayNum.Equals(4) && SW41WaitTrayNum < 0)
{
LineMoveInfo moveInfo = FeedingEquipMap[101].SecondMoveInfo;
// LineMoveInfo moveInfo = FeedingEquipMap[101].SecondMoveInfo;
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None))
{
if (moveInfo.MoveType.Equals(LineMoveType.None))
return true;
//if (moveInfo.MoveType.Equals(LineMoveType.None))
//{
// return true;
//}
//else if (moveInfo.MoveType.Equals(LineMoveType.CheckFixture) &&
// moveInfo.MoveStep >= LineMoveStep.MO_15_WaitCanGo &&
//moveInfo.MoveStep <= LineMoveStep.MO_18_StopCylinder_Back)
//{
// return true;
//}
}
else if (SW41_MoveInfo.MoveStep <= (LineMoveStep.SW12_WaitTrayGo)
&& SW41_MoveInfo.MoveStep >= (LineMoveStep.SW10_WatOutFixture2))
{
return true;
}
else if (moveInfo.MoveType.Equals(LineMoveType.CheckFixture) &&
moveInfo.MoveStep >= LineMoveStep.MO_15_WaitCanGo &&
moveInfo.MoveStep <= LineMoveStep.MO_18_StopCylinder_Back)
}
else if (sidesWayNum.Equals(3) && SW41WaitTrayNum < 0 && runStatus <= LineRunStatus.Wait)
{
return true;
}
}
else if (SW41_MoveInfo.Equals( LineMoveStep.SW12_WaitTrayGo)
&& moveInfo.MoveType.Equals(LineMoveType.None))
catch (Exception ex)
{
LogUtil.error("SwNoProcess [" + sidesWayNum + "] error :" + ex.ToString());
}
return false;
}
/// <summary>
/// 横移机构横移顶升之前判断
/// 等待横移机构是否可以开始顶升上升横移
/// </summary>
internal bool SwCanUpMove(int sidesWayNum)
{
//20200228修改,横移机构可以同时存在两个托盘
try
{
if (LineManager.Line.runStatus <= LineRunStatus.Wait || sidesWayNum <= 0)
{
return true;
}
if (sidesWayNum.Equals(3))
{
LineMoveInfo moveInfo = FeedingEquipMap[104].SecondMoveInfo;
if (moveInfo.MoveType.Equals(LineMoveType.None))
{
return true;
}
}
else if (sidesWayNum.Equals(3) && runStatus <= LineRunStatus.Wait)
else if (sidesWayNum.Equals(1))
{
LineMoveInfo moveInfo = FeedingEquipMap[101].SecondMoveInfo;
if (moveInfo.MoveType.Equals(LineMoveType.None))
{
return true;
}
}
}
catch (Exception ex)
{
LogUtil.error("SwNoProcess [" + sidesWayNum + "] error :" + ex.ToString());
LogUtil.error("SwCanUpMove [" + sidesWayNum + "] error :" + ex.ToString());
}
return false;
}
private static LineMoveInfo SW41_MoveInfo = null;
private static LineMoveInfo SW23_MoveInfo = null;
......@@ -384,6 +435,15 @@ namespace OnlineStore.DeviceLibrary
sdIsInprocess = false;
return;
}
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None) && SW23WaitTrayNum > 0)
{
Equip_TrayPEndEvent(2, SW23WaitTrayNum);
}
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && SW41WaitTrayNum > 0)
{
Equip_TrayPEndEvent(4, SW41WaitTrayNum);
}
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && ProvidingEquipMap[204].runStatus <= LineRunStatus.Wait)
{
......@@ -393,12 +453,12 @@ namespace OnlineStore.DeviceLibrary
if (TrayManager.checkWatch(sw41WaitWatch, TrayManager.SwTrayWaitTime, true))
{
SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCheck);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
UpateSw41TrayNum();
SWLog("横移轨道41:检测到SW4_TrayCheck,定位气缸下降, 等待横移4托盘检测信号,更新托盘号 [" + Sw41TrayNum + "] ");
SWLog("横移轨道41:检测到SW4_TrayCheck,再次检测,更新托盘号 [" + Sw41TrayNum + "] ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
//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) &&
......@@ -413,9 +473,9 @@ namespace OnlineStore.DeviceLibrary
SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
UpateSw41TrayNum();
SWLog("横移轨道41:检测到SW4_StopCheck, 定位气缸下降 ,更新托盘号 [" + Sw41TrayNum + "] ");
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);
SWLog("横移轨道41:检测到SW4_StopCheck, 开始处理托盘 ,更新托盘号 [" + Sw41TrayNum + "] ");
//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毫秒然后上升
lastSw4StopDownTime = DateTime.Now;
//IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime);
......@@ -441,12 +501,12 @@ namespace OnlineStore.DeviceLibrary
if (TrayManager.checkWatch(sw23WaitWatch, TrayManager.SwTrayWaitTime, true))
{
SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCheck);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
UpateSw23TrayNum();
SWLog("横移轨道23:检测到SW2_TrayCheck,定位气缸下降,等待横移2托盘检测信号,更新托盘号 [" + Sw23TrayNum + "] ");
SWLog("横移轨道23:检测到SW2_TrayCheck,再次检测,更新托盘号 [" + Sw23TrayNum + "] ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
CylinderMove(SW23_MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
CylinderMove(SW23_MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
//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) &&
......@@ -461,9 +521,9 @@ namespace OnlineStore.DeviceLibrary
SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
UpateSw23TrayNum();
SWLog("横移轨道23:检测到SW2_StopCheck, 定位气缸下降 ,更新托盘号 [" + Sw23TrayNum + "] ");
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);
SWLog("横移轨道23:检测到SW2_StopCheck, 开始处理托盘 ,更新托盘号 [" + Sw23TrayNum + "] ");
//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毫秒然后上升
lastSw2StopDownTime = DateTime.Now;
// IOMove(IO_Type.SW2_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime);
......@@ -533,7 +593,7 @@ namespace OnlineStore.DeviceLibrary
if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown);
SWLog("横移轨道41: 阻挡气缸下降 等待 SW4_StopCheck=0" );
SWLog("横移轨道41: 阻挡气缸下降 等待 SW4_StopCheck=0");
IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_StopCheck, IO_VALUE.LOW));
//SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
......@@ -558,10 +618,11 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.SW4_TrayCheck).Equals(IO_VALUE.HIGH))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCheck);
SWLog("横移轨道41: 等待横移4托盘检测信号 ,SW4_StopDown上升 ");
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCanUp);
SWLog("横移轨道41: 等待横移4托盘检测信号 ,SW4_StopDown上升 ,等待横移1(上料1)无托盘处理 ");
CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitSWCanTopUp(1));
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
}
else
......@@ -573,9 +634,16 @@ namespace OnlineStore.DeviceLibrary
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
}
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW04_WaitCheck))
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW04_WaitCanUp))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW05_TopCylinderUp);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW05_LocationDown);
SWLog("横移轨道41:定位气缸下降 ");
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 (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW05_LocationDown))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW06_TopCylinderUp);
SWLog("横移轨道41:顶升气缸上升 ,至少等待1000 ");
IOMove(IO_Type.SW4_StopDown, IO_VALUE.LOW);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
......@@ -583,15 +651,15 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(50);
CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up);
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW05_TopCylinderUp))
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW06_TopCylinderUp))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW06_WaitNoTray);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW07_WaitNoTray);
SWLog("横移轨道41: 等待 SW1_TrayCheck=0 ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.LOW));
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW06_WaitNoTray))
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_WaitNoTray))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW07_DriveMotorMove);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW08_DriveMotorMove);
SWLog("横移轨道41:开始转动电机 ,等待1000,SW4_TrayCheck=0, SW1_TrayCheck=1 ");
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.HIGH);
IOMove(IO_Type.SW1_MotorRun, IO_VALUE.HIGH);
......@@ -599,34 +667,36 @@ namespace OnlineStore.DeviceLibrary
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));
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_DriveMotorMove))
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_DriveMotorMove))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW08_WaitOutCheck);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck);
SWLog("横移轨道41:收到SW1_TrayCheck,先顶升4下降,等待托盘到达出口 ");
CylinderMove(null, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH));
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_WaitOutCheck))
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW09_WatOutFixture2);
SWLog("横移轨道41:再次验证托盘是否在出口处 ");
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW10_WatOutFixture2);
SWLog("横移轨道41:再次验证托盘是否在出口处,停止横移4的皮带线 ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
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_WatOutFixture2))
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW10_WatOutFixture2))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW10_TopDown);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW11_TopDown);
SWLog("横移轨道41:托盘已到达出口,顶升气缸下降,判断入料1是否需要此托盘 ");
CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
Thread.Sleep(50);
// CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
//Thread.Sleep(50);
if (!CheckTrayIsNeed(101, Sw41TrayNum))
{
CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
}
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW10_TopDown))
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW11_TopDown))
{
//开始入库
bool result = FeedingEquipMap[101].CanStartCheckOut(Sw41TrayNum);
......@@ -691,7 +761,7 @@ namespace OnlineStore.DeviceLibrary
if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown);
SWLog("横移轨道23:阻挡气缸下降 等待 SW2_StopCheck=0 " );
SWLog("横移轨道23:阻挡气缸下降 等待 SW2_StopCheck=0 ");
IOMove(IO_Type.SW2_StopDown, IO_VALUE.HIGH);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_StopCheck, IO_VALUE.LOW));
// SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
......@@ -716,10 +786,11 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.SW2_TrayCheck).Equals(IO_VALUE.HIGH))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCheck);
SWLog("横移轨道23: 等待横移4托盘检测信号 ,SW2_StopDown上升 ");
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW04_WaitCanUp);
SWLog("横移轨道23: 等待横移4托盘检测信号 ,SW2_StopDown上升 ,等待横移3(上料4)处无托盘 ");
CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitSWCanTopUp(3));
// SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
}
else
......@@ -731,9 +802,15 @@ namespace OnlineStore.DeviceLibrary
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
}
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW04_WaitCheck))
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW04_WaitCanUp))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW05_TopCylinderUp);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW05_LocationDown);
SWLog("横移轨道23:定位气缸下降 ");
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);
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW05_LocationDown)) {
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW06_TopCylinderUp);
SWLog("横移轨道23:顶升气缸上升 ,至少等待1000 ");
IOMove(IO_Type.SW2_StopDown, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
......@@ -741,15 +818,15 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(50);
CylinderMove(SW23_MoveInfo, IO_Type.SW3_TopCylinder_Down, IO_Type.SW3_TopCylinder_Up);
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW05_TopCylinderUp))
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW06_TopCylinderUp))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW06_WaitNoTray);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW07_WaitNoTray);
SWLog("横移轨道23: 等待 SW3_TrayCheck=0 ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.LOW));
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW06_WaitNoTray))
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_WaitNoTray))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW07_DriveMotorMove);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW08_DriveMotorMove);
SWLog("横移轨道23:开始转动电机 ,等待1000,SW2_TrayCheck=0, SW3_TrayCheck=1 ");
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.HIGH);
IOMove(IO_Type.SW3_MotorRun, IO_VALUE.HIGH);
......@@ -757,34 +834,35 @@ namespace OnlineStore.DeviceLibrary
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));
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_DriveMotorMove))
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_DriveMotorMove))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW08_WaitOutCheck);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck);
SWLog("横移轨道23:收到 SW3_TrayCheck,先顶升2下降,,等待托盘到达出口 ");
CylinderMove(null, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH));
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_WaitOutCheck))
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WatOutFixture2);
SWLog("横移轨道23:再次验证托盘是否在出口处 ");
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW10_WatOutFixture2);
SWLog("横移轨道23:再次验证托盘是否在出口处 ,停止横移2的皮带线 ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
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_WatOutFixture2))
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW10_WatOutFixture2))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW10_TopDown);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW11_TopDown);
SWLog("横移轨道23:托盘已到达出口,顶升气缸下降 ");
CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
Thread.Sleep(50);
// CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
//Thread.Sleep(50);
if (!CheckTrayIsNeed(104, Sw23TrayNum))
{
CylinderMove(SW23_MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down);
}
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW10_TopDown))
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW11_TopDown))
{
//开始入库
bool result = FeedingEquipMap[104].CanStartCheckOut(Sw23TrayNum);
......
......@@ -290,6 +290,13 @@ namespace OnlineStore.DeviceLibrary
wait.WaitType = WaitEnum.W009_BoxCanInstore;
return wait;
}
public static WaitResultInfo WaitSWCanTopUp(int swNum)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W010_SWCanTopUp;
wait.TargetPosition = swNum;
return wait;
}
//public static WaitResultInfo WaitSideWay()
//{
// WaitResultInfo wait = new WaitResultInfo();
......@@ -386,9 +393,9 @@ namespace OnlineStore.DeviceLibrary
else if (WaitType.Equals(WaitEnum.W009_BoxCanInstore))
{
return "BOX可以开始入库";
}else if (WaitType.Equals(WaitEnum.W010_SW34NoTray))
}else if (WaitType.Equals(WaitEnum.W010_SWCanTopUp))
{
return "等待横移34无托盘";
return "等待横移"+TargetPosition+"无托盘";
}
else if (WaitType.Equals(WaitEnum.W101_BatchAxisMove))
{
......@@ -509,9 +516,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
internal static int W009_BoxCanInstore = 9;
/// <summary>
/// 等待横移34无托盘
/// 等待横移模块可以顶升,等待入料四和入料一处无托盘处理
/// </summary>
internal static int W010_SW34NoTray = 10;
internal static int W010_SWCanTopUp = 10;
/// <summary>
/// 入料模块:批量轴缓慢上升,并检测有料盘后停止
/// </summary>
......
......@@ -420,40 +420,39 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
SW03_WaitTime = 5003,
/// <summary>
/// 等待轨道1夹具检测信号
/// 等待轨道1夹具检测信号,等待横移3或横移1无托盘
/// </summary>
SW04_WaitCheck = 5004,
SW04_WaitCanUp= 5004,
/// <summary>
/// 定位气缸下降
/// </summary>
SW05_LocationDown=5005,
/// <summary>
/// 横移轨道顶升气缸上升
/// </summary>
SW05_TopCylinderUp= 5005,
SW06_TopCylinderUp= 5006,
/// <summary>
/// 等待第二个横移没有托盘
/// </summary>
SW06_WaitNoTray=5006,
SW07_WaitNoTray=5007,
/// <summary>
/// 横移轨道点击转动
/// </summary>
SW07_DriveMotorMove=5007,
SW08_DriveMotorMove=5008,
/// <summary>
/// 收到横移轨道2夹具检测信号
/// </summary>
SW08_WaitOutCheck=5008,
SW09_WaitOutCheck=5009,
/// <summary>
/// 等待出口信号持续一段时间
/// </summary>
SW09_WatOutFixture2=5009,
SW10_WatOutFixture2=5010,
/// <summary>
/// 停止横移轨道转动,横移轨道顶升气缸下降
/// </summary>
SW10_TopDown=5010,
SW11_TopDown=5011,
///// <summary>
///// 阻挡2下降,等待托盘流出
///// </summary>
//SW11_StopDrive=5011,
/// <summary>
/// 等待托盘流出,上升阻挡气缸
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!