增加料盘到位超时机制

master
lhiven 2 years ago
parent 71acf9f98b
commit f7cdd1d6b3

@ -4,6 +4,7 @@ using Rs.Motion;
using Rs.Motion.Base;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow;
using System.Diagnostics;
using System.Threading;
namespace Rs.AutoDischarge.V3.Flow
@ -97,6 +98,8 @@ namespace Rs.AutoDischarge.V3.Flow
bool bStop= false;
IAxis StockFlow = null;
IAxis StockZ=null;
Stopwatch timer = new Stopwatch();
string loginfo = "";
public override void Run()
{
@ -262,8 +265,11 @@ namespace Rs.AutoDischarge.V3.Flow
case ETrayTestStep.:
StockFlow.MoveOffset(-1* SysConfigParam.GetValue<double>("LowSpeedDistance"), 3);
Step = ETrayTestStep.;
timer.Restart();
break;
case ETrayTestStep.:
if(timer.ElapsedMilliseconds<=1000*30)
{
if (IoManager.Instance.ReadIn($"{stockNo}号料仓料盘到位光电检测") == 1)
{
switch (stockNo)
@ -305,6 +311,16 @@ namespace Rs.AutoDischarge.V3.Flow
Step = ETrayTestStep.;
Thread.Sleep(200);
}
}
else
{
timer.Stop();
loginfo = $"料仓{stockNo}上料未到位,请手动处理后,点击确定";
MessageQueue.Instance.Warn(loginfo);
LogHelper.Debug(loginfo);
Msg.ShowError(loginfo);
timer.Restart();
}
break;
}
}

Loading…
Cancel
Save