按照秦工的需求,优化取料盘和放料盘逻辑

develop
lhiven 2 months ago
parent ae9eab279c
commit b9110b7ca2

@ -285,9 +285,9 @@ namespace Rs.MotionPlat.Flow.NormalFlow
public void Up()
{
if(CurrentLayer==1)
if(CurrentLayer==0)
{
logInfo = $"{GetClassName()} 料仓{StockIndex}已处于第层,不能再上升";
logInfo = $"{GetClassName()} 料仓{StockIndex}已处于第{CurrentLayer}层,不能再上升";
MessageQueue.Instance.Warn(logInfo);
return;
}
@ -311,11 +311,11 @@ namespace Rs.MotionPlat.Flow.NormalFlow
Thread.Sleep(500);
logInfo = $"{GetClassName()} 料仓{StockIndex}已运动到{CurrentLayer}层cz:{Ops.GetCurPosition($"StockZ{StockIndex}")}";
MessageQueue.Instance.Insert(logInfo);
if (HasTray())
{
ClampTray();
Thread.Sleep(GlobalVar.StepMotorMoveDelayTime);
}
//if (HasTray())
//{
// ClampTray();
// Thread.Sleep(GlobalVar.StepMotorMoveDelayTime);
//}
break;
}
else if (stopwatch.ElapsedMilliseconds > 5000)

@ -25,6 +25,7 @@ namespace Rs.MotionPlat.Flow
,
,
,
,
,
//等待夹磁气缸松开,
,
@ -185,6 +186,8 @@ namespace Rs.MotionPlat.Flow
StockManager.CloseTray(fromStockIndex);
}
AxisPosPrint.PrintTakeTrayXCurrentPos($"已运动到料仓{m_fromTray}取料盘位上方", GetClassName());
//松开夹爪
StockManager.OpenTray(fromStockIndex);
step = ETakeTrayFlowStep.;
}
}
@ -194,6 +197,7 @@ namespace Rs.MotionPlat.Flow
}
break;
case ETakeTrayFlowStep.:
try
{
@ -201,9 +205,9 @@ namespace Rs.MotionPlat.Flow
{
logInfo = GetClassName() + $"料仓{m_fromTray}料盘准备就绪";
MessageQueue.Instance.Insert(logInfo);
TakeTrayModule.CylinderGoDown(GetClassName());
stopwatch.Restart();
step = ETakeTrayFlowStep.;
step = ETakeTrayFlowStep.;
//step = ETakeTrayFlowStep.等待运动到取料位下方;
}
else
{
@ -216,6 +220,26 @@ namespace Rs.MotionPlat.Flow
AlarmCollection.SystemExceptionAlarm(ex);
}
break;
case ETakeTrayFlowStep.:
try
{
StockManager.Up(fromStockIndex);
logInfo = GetClassName() + $"料仓{fromTray}上升一层";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
catch (Exception ex)
{
AlarmCollection.SystemExceptionAlarm(ex);
}
break;
case ETakeTrayFlowStep.:
{
TakeTrayModule.CylinderGoDown(GetClassName());
stopwatch.Restart();
}
break;
case ETakeTrayFlowStep.:
try
@ -227,10 +251,8 @@ namespace Rs.MotionPlat.Flow
stopwatch.Stop();
//打开真空
TakeTrayModule.VacOperation(EIoOperate.Open, GetClassName());
//松开夹爪
//StockModule.ClampTrayCylinder(EIoOperate.Open, fromStockIndex,GetClassName());
StockManager.OpenTray(fromStockIndex);
stopwatch.Restart();
StockManager.CloseTray(fromStockIndex);
//stopwatch.Restart();
step = ETakeTrayFlowStep.;
}
else if (stopwatch.ElapsedMilliseconds > 5000)
@ -245,7 +267,7 @@ namespace Rs.MotionPlat.Flow
{
Msg.ShowError("翻译文件中未找到料盘搬运气缸动位异常");
}
stopwatch.Restart();
//stopwatch.Restart();
}
}
catch (Exception ex)
@ -255,17 +277,18 @@ namespace Rs.MotionPlat.Flow
break;
case ETakeTrayFlowStep.:
try
{
TakeTrayModule.CylinderGoUp(GetClassName());
stopwatch.Restart();
step = ETakeTrayFlowStep.;
}
catch (Exception ex)
{
AlarmCollection.SystemExceptionAlarm(ex);
try
{
TakeTrayModule.CylinderGoUp(GetClassName());
stopwatch.Restart();
step = ETakeTrayFlowStep.;
}
catch (Exception ex)
{
AlarmCollection.SystemExceptionAlarm(ex);
}
}
break;
case ETakeTrayFlowStep.:
try
@ -305,14 +328,29 @@ namespace Rs.MotionPlat.Flow
{
logInfo = GetClassName() + $"料盘已被抓起 OK";
MessageQueue.Instance.Insert(logInfo);
if (StockManager.GetCurrentLayer(fromStockIndex) == 1)
if (fromTray == ETrayType.Input)
{
step = ETakeTrayFlowStep.;
step = ETakeTrayFlowStep.;
}
else
{
step = ETakeTrayFlowStep.;
if (placeTrayGrab && GlobalVar.EnableBeforePlaceTrayToOkGrab)
{
step = ETakeTrayFlowStep.;
}
else
{
step = ETakeTrayFlowStep.;
}
}
//if (StockManager.GetCurrentLayer(fromStockIndex) == 1)
//{
// step = ETakeTrayFlowStep.到放料盘上方;
//}
//else
//{
// step = ETakeTrayFlowStep.上升一层;
//}
}
else
{
@ -320,7 +358,7 @@ namespace Rs.MotionPlat.Flow
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true);
step = ETakeTrayFlowStep.;
step = ETakeTrayFlowStep.;
}
else
{
@ -334,45 +372,18 @@ namespace Rs.MotionPlat.Flow
}
break;
case ETakeTrayFlowStep.:
try
{
StockManager.Up(fromStockIndex);
logInfo = GetClassName() + $"料仓{fromTray}上升一层";
MessageQueue.Instance.Insert(logInfo);
step = ETakeTrayFlowStep.;
}
catch (Exception ex)
{
AlarmCollection.SystemExceptionAlarm(ex);
}
break;
case ETakeTrayFlowStep.:
try
{
if (fromTray == ETrayType.Input)
{
step = ETakeTrayFlowStep.;
}
else
{
if (placeTrayGrab && GlobalVar.EnableBeforePlaceTrayToOkGrab)
{
step = ETakeTrayFlowStep.;
}
else
{
step = ETakeTrayFlowStep.;
}
}
}
catch (Exception ex)
{
AlarmCollection.SystemExceptionAlarm(ex);
}
//case ETakeTrayFlowStep.等待上升一层完成:
// try
// {
// }
// catch (Exception ex)
// {
// AlarmCollection.SystemExceptionAlarm(ex);
// }
break;
// break;
case ETakeTrayFlowStep.:
try
{
@ -501,13 +512,14 @@ namespace Rs.MotionPlat.Flow
//logInfo = GetClassName() + $"料盘真空关 on";
//MessageQueue.Instance.Insert(logInfo);
//Thread.Sleep(100);
//关闭真空吸
TakeTrayModule.VacOperation(EIoOperate.Close, GetClassName());
if (isNeedGoDown)
{
StockManager.Down(toStockIndex);
}
StockManager.CloseTray(toStockIndex);
//关闭真空吸
TakeTrayModule.VacOperation(EIoOperate.Close, GetClassName());
step = ETakeTrayFlowStep.;
}
else if (stopwatch.ElapsedMilliseconds > 5000)

Loading…
Cancel
Save