diff --git a/.gitignore b/.gitignore index 280af97..77b7d96 100644 --- a/.gitignore +++ b/.gitignore @@ -363,3 +363,4 @@ MigrationBackup/ FodyWeavers.xsd /.svn FrameworkLocal/output/ +.idea/ diff --git a/Modules/SicPM/RecipeExecutions/Process.cs b/Modules/SicPM/RecipeExecutions/Process.cs index 6c34efe..0587c90 100644 --- a/Modules/SicPM/RecipeExecutions/Process.cs +++ b/Modules/SicPM/RecipeExecutions/Process.cs @@ -19,6 +19,8 @@ using System.Collections.Generic; using System.Xml; using static SicPM.PmDevices.DicMode; using MECF.Framework.RT.Core.DBProviderEx; +using Aitex.Core.Common.DeviceData.IoDevice; +using MECF.Framework.Common.Fsm; namespace SicPM.RecipeExecutions { @@ -246,6 +248,62 @@ namespace SicPM.RecipeExecutions return Result.RUN; } + #region Heater Resistance Monitor + + #region Heater Resistance Monitor + + private readonly R_TRIG _trigHeaterResOutOfRange = new(); + + private void MonitorHeaterResistance() + { + var reason = ""; + var totalElapseTime = PMDevice.RecipeRunningInfo.TotalElapseTime;//Recipe已经执行的时间 + var totalTime = PMDevice.RecipeRunningInfo.TotalTime;//Recipe总时间 + + if (totalElapseTime == 0) //当开始执行后再去判断时间和电阻 + return; + + // 工艺刚开始和结束前的一段时间,不用检测Heater电阻 + var ignoredDurationSec = SC.GetValue($"PM.{Module}.Heater.ResistanceLimitTime"); + if (!(totalElapseTime > ignoredDurationSec) || + (!(totalTime - totalElapseTime > ignoredDurationSec))) return; + + // 如果在工艺中,检测Heater电阻 + for (var i = 1; i <= 3; i++) //检测出所有的加热丝是否有断开的,不要提前结束循环 + { + var ioPsuData = (IoPsuData)(DATA.Poll($"{Module}.PSU{i}.DeviceData")); + if (ioPsuData != null) + { + if (ioPsuData.IsResistanceOutOfRange)//PSU加热丝断开,后续可能增加条件判断 + reason += $"PSU{i} resistance value exceeds the upper limit , Resistance:{ioPsuData.Resistance}\r\n "; + } + + var ioScrData = (IoPsuData)(DATA.Poll($"{Module}.SCR{i}.DeviceData")); + if (ioScrData != null) + { + if (ioScrData.IsResistanceOutOfRange)//SCR加热丝断开,后续可能增加条件判断 + reason += $"SCR{i} resistance value exceeds the upper limit , Resistance:{ioScrData.Resistance}\r\n "; + } + } + + if (reason.Length > 0) + { + // 某个加热器电阻超标 + _trigHeaterResOutOfRange.CLK = true; + if (_trigHeaterResOutOfRange.Q) + { + var alarmLevel = SC.SafeGetStringValue($"PM.{Module}.Heater.ResistanceLimitLog", "Alarm"); + if (alarmLevel == "Alarm") + Stop(reason); + else + EV.PostWarningLog(Module, reason); + } + } + } + + #endregion + + #endregion public override Result Monitor() { diff --git a/SicRT/Config/System.sccfg b/SicRT/Config/System.sccfg index 16fa35f..69bf391 100644 --- a/SicRT/Config/System.sccfg +++ b/SicRT/Config/System.sccfg @@ -77,18 +77,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -177,6 +177,9 @@ + + +