|
|
|
@ -675,6 +675,14 @@ namespace Rs.AutoDischarge.V3.Flow
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case EStockTrayUnloadFlowStep.到下料降速位:
|
|
|
|
|
//determine whether there is a tray at the silo,and alarm if there is a tray
|
|
|
|
|
if (Ops.IsOn($"{(int)m_stockType}号料仓上料位光电检测"))
|
|
|
|
|
{
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.皮带上有料盘报警).Transform((int)m_stockType);
|
|
|
|
|
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (m_stockType == ETrayType.Ok || m_stockType == ETrayType.Ng || m_stockType == ETrayType.Multi)
|
|
|
|
|
{
|
|
|
|
|
if (!GlobalVar.DisableStockTrayKnock && GlobalVar.EnableTrayPreUnloadKnock)
|
|
|
|
@ -696,6 +704,8 @@ namespace Rs.AutoDischarge.V3.Flow
|
|
|
|
|
alarmEntity = AlarmCollection.Get($"{StockFlow.Config.AxisName}运动异常").Transform(errCode.ToString());
|
|
|
|
|
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case EStockTrayUnloadFlowStep.等待到下料降速位:
|
|
|
|
|
if (Ops.IsStop(StockFlow) || GlobalVar.VirtualAxis)
|
|
|
|
@ -707,7 +717,7 @@ namespace Rs.AutoDischarge.V3.Flow
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case EStockTrayUnloadFlowStep.到下料结束位:
|
|
|
|
|
targetFlow = 1000;
|
|
|
|
|
targetFlow = 100000;
|
|
|
|
|
errCode = StockFlow.MoveOffset(targetFlow, GlobalVar.StockBeltSpeed / 4);
|
|
|
|
|
Thread.Sleep(30);
|
|
|
|
|
if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis)
|
|
|
|
@ -730,11 +740,90 @@ namespace Rs.AutoDischarge.V3.Flow
|
|
|
|
|
{
|
|
|
|
|
logInfo = GetClassName() + $"{GetTrayName()}料仓{(int)m_stockType}号料仓上料位光电检测 OK";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
int checkCount = 1;
|
|
|
|
|
int hasSing = 0;
|
|
|
|
|
Stopwatch sw= Stopwatch.StartNew();
|
|
|
|
|
bool exit = false;
|
|
|
|
|
while (!exit)
|
|
|
|
|
{
|
|
|
|
|
if(sw.ElapsedMilliseconds < 1000 * GlobalVar.StockFlowSlowSpeedTime)
|
|
|
|
|
{
|
|
|
|
|
while (checkCount <= 10)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
|
if (Ops.IsOn($"{(int)m_stockType}号料仓上料位光电检测") || GlobalVar.VirtualAxis)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Debug($"{checkCount} 次检测{(int)m_stockType}号料仓上料位光电检测 OK{hasSing}");
|
|
|
|
|
hasSing++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Debug($"{checkCount} 次检测{(int)m_stockType}号料仓上料位光电检测 NG");
|
|
|
|
|
}
|
|
|
|
|
checkCount++;
|
|
|
|
|
}
|
|
|
|
|
if (hasSing > 8)
|
|
|
|
|
{
|
|
|
|
|
StockFlow.Stop();
|
|
|
|
|
Thread.Sleep(200);
|
|
|
|
|
|
|
|
|
|
unloadStep = EStockTrayUnloadFlowStep.到下料托盘气缸下方;
|
|
|
|
|
sw.Stop();
|
|
|
|
|
exit = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
checkCount = 0;
|
|
|
|
|
hasSing = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Debug("10秒内未检测到料盘");
|
|
|
|
|
sw.Stop();
|
|
|
|
|
StockFlow.Stop();
|
|
|
|
|
Ops.On($"{(int)m_stockType}号料仓斜推气缸");
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
Ops.Off($"{(int)m_stockType}号料仓斜推气缸");
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
|
|
|
|
|
switch (m_stockType)
|
|
|
|
|
{
|
|
|
|
|
case ETrayType.Empty1:
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.料仓上料位光电检测1号报警).Transform(m_stockType.ToString());
|
|
|
|
|
break;
|
|
|
|
|
case ETrayType.Input:
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.料仓上料位光电检测2号报警).Transform(m_stockType.ToString());
|
|
|
|
|
break;
|
|
|
|
|
case ETrayType.Ok:
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.料仓上料位光电检测3号报警).Transform(m_stockType.ToString());
|
|
|
|
|
break;
|
|
|
|
|
case ETrayType.Ng:
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.料仓上料位光电检测4号报警).Transform(m_stockType.ToString());
|
|
|
|
|
break;
|
|
|
|
|
case ETrayType.Multi:
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.料仓上料位光电检测5号报警).Transform(m_stockType.ToString());
|
|
|
|
|
break;
|
|
|
|
|
case ETrayType.Empty2:
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.料仓上料位光电检测6号报警).Transform(m_stockType.ToString());
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (alarmEntity != null)
|
|
|
|
|
{
|
|
|
|
|
MessageQueue.Instance.Warn(GetClassName() + alarmEntity.CN);
|
|
|
|
|
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Retry, null);
|
|
|
|
|
timer.Restart();
|
|
|
|
|
exit = true;
|
|
|
|
|
unloadStep = EStockTrayUnloadFlowStep.到下料结束位;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Msg.ShowError($"翻译文件中未找到料仓上料位光电检测{(int)m_stockType}号报警");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|