Commit 4a70e617 LN

1.入料逻辑修改。

1 个父辈 f9e97528
...@@ -386,7 +386,7 @@ namespace OnlineStore.AssemblyLine ...@@ -386,7 +386,7 @@ namespace OnlineStore.AssemblyLine
} }
private void btnFeedSideWayCylinder_Click(object sender, EventArgs e) private void btnFeedSideWayCylinder_Click(object sender, EventArgs e)
{ {
if (equipBean.MoveCylineCanTakeOrGive()) if (equipBean.MoveCylineIsUp())
{ {
BtnMove(btnFeedSideWayCylinder, "上料横移气缸取料端", "上料横移气缸放料端", IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); BtnMove(btnFeedSideWayCylinder, "上料横移气缸取料端", "上料横移气缸放料端", IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
} }
......
...@@ -205,7 +205,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -205,7 +205,7 @@ namespace OnlineStore.DeviceLibrary
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
break; break;
case LineMoveStep.FR_05_UpdownAxis_P1: case LineMoveStep.FR_05_UpdownAxis_P1:
if (MoveCylineCanTakeOrGive()) if (MoveCylineIsUp())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FR_06_CylinderGive); MoveInfo.NextMoveStep(LineMoveStep.FR_06_CylinderGive);
...@@ -539,9 +539,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -539,9 +539,10 @@ namespace OnlineStore.DeviceLibrary
/// 判断上料横移机构是否可以横移运动 /// 判断上料横移机构是否可以横移运动
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public bool MoveCylineCanTakeOrGive() public bool MoveCylineIsUp()
{ {
if (IOValue(IO_Type.SL_MoveCylinder_Down).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SL_MoveCylinder_Up).Equals(IO_VALUE.HIGH)) if(CylinderIsOk(IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up))
// if (IOValue(IO_Type.SL_MoveCylinder_Down).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SL_MoveCylinder_Up).Equals(IO_VALUE.HIGH))
{ {
return true; return true;
} }
......
...@@ -733,13 +733,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -733,13 +733,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_WaitNoLocationCheck)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_WaitNoLocationCheck))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_19_BatchAxisToP3); MoveInfo.NextMoveStep(LineMoveStep.FI_19_BatchAxisToP3);
LastWidth = GetWidth(); InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,盘宽【" + LastWidth + "】,横移气缸上升 ");
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,盘宽【"+LastWidth+"】,横移气缸上升 或到放料端"); if (!CylinderIsOk(IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up))
if (CylinderIsOk(IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up))
{
CylinderMove(null, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{ {
CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
} }
...@@ -747,20 +742,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -747,20 +742,21 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_BatchAxisToP3)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_BatchAxisToP3))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
//if (MoveCylineCanTakeOrGive())
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderGive);
// InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
// CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
//}
//else
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize); // MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
if (MoveCylineCanTakeOrGive()) // InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
{ // CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive); //}
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
LastWidth = GetWidth();
LastHeight = GetHeight(); LastHeight = GetHeight();
if (LastWidth.Equals(7) && LastHeight > 16) if (LastWidth.Equals(7) && LastHeight > 16)
{ {
...@@ -774,6 +770,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -774,6 +770,8 @@ namespace OnlineStore.DeviceLibrary
int chaz = Math.Abs(currP - Config.BatchAxisP3); int chaz = Math.Abs(currP - Config.BatchAxisP3);
if (chaz < BatchAxis.Config.CanErrorCountMax) if (chaz < BatchAxis.Config.CanErrorCountMax)
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
InLog("料盘移栽" + MoveInfo.SLog + ":记录 高度【" + LastHeight + "】宽度【" + LastWidth + "】,已经没有料盘,且已达到P3:" + Config.BatchAxisP3 + ",提升轴开始回下降待机点P2"); InLog("料盘移栽" + MoveInfo.SLog + ":记录 高度【" + LastHeight + "】宽度【" + LastWidth + "】,已经没有料盘,且已达到P3:" + Config.BatchAxisP3 + ",提升轴开始回下降待机点P2");
MoveInfo.ShelfNoTray = true; MoveInfo.ShelfNoTray = true;
BatchAxis.AbsMove(null, Config.BatchAxisP2, Config.BatchAxis_P2Speed); BatchAxis.AbsMove(null, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
...@@ -791,22 +789,41 @@ namespace OnlineStore.DeviceLibrary ...@@ -791,22 +789,41 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_SaveSize)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_SaveSize))
{ {
if (MoveCylineCanTakeOrGive()) MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
int maxtPosition = Config.BatchAxisP3 - Config.Height_ChangeValue * 30; //在上料位置基础上下降30mm
int currPositon = BatchAxis.GetAclPosition();
int targetPosition = currPositon - Config.Height_ChangeValue * 30;
if (targetPosition <= Config.BatchAxisP2)
{
targetPosition = Config.BatchAxisP2;
}
else if (targetPosition > maxtPosition)
{
targetPosition = maxtPosition;
}
InLog("料盘移栽" + MoveInfo.SLog + ":提升轴下降到料盘不溢出(" + (currPositon - Config.Height_ChangeValue * 40) + "):" + targetPosition);
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_BatchAxisDown))
{
if (MoveCylineIsUp())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive); MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderGive);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL"); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize); MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸"); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
} }
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_CylinderGive)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_CylinderGive))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_22_WaitTray); MoveInfo.NextMoveStep(LineMoveStep.FI_23_WaitTray);
int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth); int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth);
string log = ":移栽伺服下降到P2:" + targetPositon; string log = ":移栽伺服下降到P2:" + targetPositon;
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed); UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
...@@ -842,7 +859,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -842,7 +859,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_WaitTray))//TODO else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_WaitTray))//TODO
{ {
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember)) if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))
{ {
...@@ -1020,7 +1037,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1020,7 +1037,7 @@ namespace OnlineStore.DeviceLibrary
private void FI_12_MoveCylinder_Give() private void FI_12_MoveCylinder_Give()
{ {
if (MoveCylineCanTakeOrGive()) if (MoveCylineIsUp())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_12_CylinderGive); MoveInfo.NextMoveStep(LineMoveStep.FI_12_CylinderGive);
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构到放料端"); InLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构到放料端");
...@@ -1257,7 +1274,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1257,7 +1274,7 @@ namespace OnlineStore.DeviceLibrary
if (trayCanUse && runStatus.Equals(LineRunStatus.Busy) && MoveInfo.MoveType.Equals(LineMoveType.InStore)) if (trayCanUse && runStatus.Equals(LineRunStatus.Busy) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{ {
//入料执行中, 且需要空托盘 //入料执行中, 且需要空托盘
if (MoveInfo.MoveStep .Equals(LineMoveStep.FI_22_WaitTray)&&MoveInfo.IsInWait.Equals(false)) if (MoveInfo.MoveStep .Equals(LineMoveStep.FI_23_WaitTray)&&MoveInfo.IsInWait.Equals(false))
//if (MoveInfo.MoveStep >= LineMoveStep.FI_11_CylinderUp && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray) //if (MoveInfo.MoveStep >= LineMoveStep.FI_11_CylinderUp && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
{ {
if (NeedSaveParam) if (NeedSaveParam)
......
...@@ -357,7 +357,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -357,7 +357,7 @@ namespace OnlineStore.DeviceLibrary
//判断伺服检测信号是否亮 //判断伺服检测信号是否亮
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW) || BatchAxis.IsInPosition(Config.BatchAxisP2)) if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW) || BatchAxis.IsInPosition(Config.BatchAxisP2))
{ {
if (MoveCylineCanTakeOrGive()) if (MoveCylineIsUp())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_212_CylinderTake); MoveInfo.NextMoveStep(LineMoveStep.FO_212_CylinderTake);
OutLog("紧急出料" + MoveInfo.SLog + ":上料横移机构取料端"); OutLog("紧急出料" + MoveInfo.SLog + ":上料横移机构取料端");
...@@ -428,7 +428,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -428,7 +428,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_217_UpdownAxisToP1)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_217_UpdownAxisToP1))
{ {
if (MoveCylineCanTakeOrGive()) if (MoveCylineIsUp())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_218_CylinderGive); MoveInfo.NextMoveStep(LineMoveStep.FO_218_CylinderGive);
OutLog("紧急出料" + MoveInfo.SLog + ":上料横移机构到放料端"); OutLog("紧急出料" + MoveInfo.SLog + ":上料横移机构到放料端");
...@@ -475,7 +475,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -475,7 +475,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_221_UpdownAxisToP1)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_221_UpdownAxisToP1))
{ {
if (MoveCylineCanTakeOrGive()) if (MoveCylineIsUp())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_222_CylinderTake); MoveInfo.NextMoveStep(LineMoveStep.FO_222_CylinderTake);
OutLog("紧急出料" + MoveInfo.SLog + ":上料横移机构回到取料端"); OutLog("紧急出料" + MoveInfo.SLog + ":上料横移机构回到取料端");
......
...@@ -660,15 +660,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -660,15 +660,19 @@ namespace OnlineStore.DeviceLibrary
/// 料盘移栽:记录高度尺寸 /// 料盘移栽:记录高度尺寸
/// </summary> /// </summary>
FI_20_SaveSize , FI_20_SaveSize ,
/// <summary>
/// 提升轴下降到料盘不溢出的位置
/// </summary>
FI_21_BatchAxisDown,
/// <summary> /// <summary>
/// 料盘移栽: 上料横移气缸放料SOL /// 料盘移栽: 上料横移气缸放料SOL
/// </summary> /// </summary>
FI_21_CylinderGive , FI_22_CylinderGive ,
/// <summary> /// <summary>
/// 料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码 /// 料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码
/// </summary> /// </summary>
FI_22_WaitTray, FI_23_WaitTray,
///// <summary> ///// <summary>
///// 料盘移栽:移栽伺服下降到P2 ///// 料盘移栽:移栽伺服下降到P2
///// </summary> ///// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!