Commit 873876e4 刘韬

加密料盘厚度检测频率

1 个父辈 f50f7fd7
......@@ -339,7 +339,7 @@ namespace OnlineStore.DeviceLibrary
{
axisCheckTimer = new System.Timers.Timer();
axisCheckTimer.AutoReset = true;
axisCheckTimer.Interval += 5;
axisCheckTimer.Interval += 10;
axisCheckTimer.Elapsed += CheckTimer_Elapsed;
axisCheckTimer.Enabled = false;
}
......@@ -359,21 +359,18 @@ namespace OnlineStore.DeviceLibrary
return true;
}
private bool IsInProcess = false;
private DateTime lastOkTime = DateTime.Now;
private void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimeSpan pan = DateTime.Now - lastOkTime;
if (IsInProcess && pan.TotalMilliseconds < 100) { return; }
if (IsInProcess ) { return; }
try
{
IsInProcess = true;
lastOkTime = DateTime.Now;
if (IOManager.IOValue(TargetIoType, 0).Equals(TargetIoValue))
{
AxisStopCheckMove();
LogUtil.info(AxisName + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",停止运动,AclPosition=" + GetAclPosition().ToString());
SuddenStop();
LogUtil.info(AxisName + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",停止运动,AclPosition=" + GetAclPosition().ToString());
AxisStopCheckMove();
}
}
catch (Exception ex)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!