|
@@ -10,7 +10,6 @@ using MECF.Framework.Common.CommonData.Reservoir;
|
|
|
using MECF.Framework.Common.Persistent.Reservoirs;
|
|
|
using MECF.Framework.Common.RecipeCenter;
|
|
|
using MECF.Framework.Common.ToolLayout;
|
|
|
-using MECF.Framework.Common.TwinCat;
|
|
|
using CyberX8_Core;
|
|
|
using CyberX8_RT.Devices.Facilities;
|
|
|
using CyberX8_RT.Devices.Metal;
|
|
@@ -29,7 +28,7 @@ using CyberX8_RT.Devices.Safety;
|
|
|
using MECF.Framework.Common.ProcessCell;
|
|
|
using MECF.Framework.Common.Alarm;
|
|
|
using MECF.Framework.Common.IOCore;
|
|
|
-using Aitex.Core.RT.Routine;
|
|
|
+using static CyberX8_RT.Devices.Reservoir.ReservoirDiReplenHelper;
|
|
|
|
|
|
|
|
|
namespace CyberX8_RT.Devices.Reservoir
|
|
@@ -300,6 +299,21 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// 每隔30秒打印槽体相关的信息
|
|
|
/// </summary>
|
|
|
private DateTime _periodLogTime;
|
|
|
+ /// <summary>
|
|
|
+ /// Facility DIReplenOn
|
|
|
+ /// </summary>
|
|
|
+ public bool TotalDIReplenOn
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ var facilitiesDevice = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
|
|
|
+ return facilitiesDevice != null ? facilitiesDevice.DIReplenEnable : false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 注水是否出错
|
|
|
+ /// </summary>
|
|
|
+ public bool IsDiReplenInFault { get { return _isDiReplenInFault; } }
|
|
|
#endregion
|
|
|
/// <summary>
|
|
|
/// 初始化成功清除对应的错误log
|
|
@@ -407,7 +421,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
if (_direplenHelper != null)
|
|
|
{
|
|
|
_direplenHelper.MonitorPeriodTime(DiReplenTimeOutOpeartion);
|
|
|
- if (!DiReplenMaxTimeOut)
|
|
|
+ if (!_diReplenMaxTimeOut && !_isDiReplenInFault && TotalDIReplenOn)
|
|
|
{
|
|
|
if (_currentOperation == ReservoirOperation.ManualDiReplen && _reservoirData.DiReplen)
|
|
|
{
|
|
@@ -419,19 +433,19 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
}
|
|
|
else if (_currentOperation == ReservoirOperation.AutoDiReplen && _reservoirData.DiReplen)
|
|
|
{
|
|
|
- bool result = _direplenHelper.AutoDiReplenMonitorTimeOut(DIReplenOff, DiReplenTimeOutOpeartion);
|
|
|
- if (result)
|
|
|
+ var result = _direplenHelper.AutoDiReplenMonitorTimeOut(DIReplenOff, DiReplenTimeOutOpeartion);
|
|
|
+ if (result.Item1)
|
|
|
{
|
|
|
_currentOperation = ReservoirOperation.None;
|
|
|
//触发注水异常信号
|
|
|
- _isDiReplenInFault = true;
|
|
|
+ if (result.Item2 == DIReplenFaultType.PerFillTimeOut) _isDiReplenInFault = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//按液位补水
|
|
|
- result = _direplenHelper.AutoDiReplenMonitorComplete(_reservoirData.Level, _resRecipe.ReservoirCALevel, _resRecipe.DIReplenEnable,
|
|
|
+ var result1 = _direplenHelper.AutoDiReplenMonitorComplete(_reservoirData.Level, _resRecipe.ReservoirCALevel, _resRecipe.DIReplenEnable,
|
|
|
_resRecipe.DIReplenTimeRate, _resRecipe.DIReplenCurrentRate, DIReplenOff);
|
|
|
- if (result)
|
|
|
+ if (result1)
|
|
|
{
|
|
|
//补水完成打印日志
|
|
|
LOG.WriteLog(eEvent.INFO_RESERVOIR, Module, $"{Module} CADIReplen State :False, " +
|
|
@@ -493,13 +507,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
- /// <summary>
|
|
|
- /// DI Replen超时
|
|
|
- /// </summary>
|
|
|
- private void DiReplenTimeOutOpeartion(bool timeOutFlag)
|
|
|
- {
|
|
|
- _diReplenMaxTimeOut = timeOutFlag;
|
|
|
- }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Low Level 触发操作
|
|
|
/// </summary>
|
|
@@ -842,6 +850,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
DATA.Subscribe($"{Module}.PumpSpeed", () => _regulatePumpSpeed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.IsCMMConfig", () => _isCMMConfig, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.SubordinateReservoirPump", () => _reservoirData.RegulatePumpSignalIn, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
+ DATA.Subscribe($"{Module}.DIReplenMaxTimeOut", () => _diReplenMaxTimeOut, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化操作
|
|
@@ -866,7 +875,8 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
OP.Subscribe($"{Module}.StopManualDosing", StopManualDosing);
|
|
|
OP.Subscribe($"{Module}.ResetBottleVolume", ResetBottleVolume);
|
|
|
OP.Subscribe($"{Module}.DosingInitialize", DosingInitialize);
|
|
|
-
|
|
|
+ OP.Subscribe($"{Module}.DIReplenClearError", DIReplenClearError);
|
|
|
+
|
|
|
OP.Subscribe($"{Module}.HedPowerOn", HedPowerOnAction);
|
|
|
OP.Subscribe($"{Module}.HedPowerOff", HedPowerOffAction);
|
|
|
OP.Subscribe($"{Module}.ResPowerOn", ResPowerOnAction);
|
|
@@ -1018,6 +1028,23 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
|
|
|
#region Operation
|
|
|
/// <summary>
|
|
|
+ /// DIReplen Clear Error
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="cmd"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ private bool DIReplenClearError(string cmd, object[] args)
|
|
|
+ {
|
|
|
+ _isDiReplenInFault = false;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// DI Replen超时
|
|
|
+ /// </summary>
|
|
|
+ private void DiReplenTimeOutOpeartion(bool timeOutFlag)
|
|
|
+ {
|
|
|
+ _diReplenMaxTimeOut = timeOutFlag;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 重置时长
|
|
|
/// </summary>
|
|
|
/// <param name="cmd"></param>
|
|
@@ -1025,7 +1052,6 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// <returns></returns>
|
|
|
private bool ResetTotalTime(string cmd, object[] objs)
|
|
|
{
|
|
|
- _isDiReplenInFault = false;
|
|
|
_diReplenMaxTimeOut = false;
|
|
|
_persistentValue.TotalReplen = 0;
|
|
|
_persistentValue.LastTotalReplen = 0;
|
|
@@ -1217,7 +1243,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
reservoirEntity.EnterInit();
|
|
|
_persistentValue.OperatingMode = currentOperation;
|
|
|
if (_reservoirData.DiReplen) DIReplenOff("", null);
|
|
|
- _isDiReplenInFault = false;
|
|
|
+ //_isDiReplenInFault = false;
|
|
|
LOG.WriteLog(eEvent.INFO_RESERVOIR, Module, $"Operating mode is switched from {preOperation} to {currentOperation}");
|
|
|
}
|
|
|
ReservoirsPersistentManager.Instance.UpdatePersistentValue(Module);
|
|
@@ -1478,6 +1504,12 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"Direplen time over conifg's DIValveMaxOnTime:{diValveMaxOnTime} min");
|
|
|
return false;
|
|
|
}
|
|
|
+ if (IsDiReplenInFault)
|
|
|
+ {
|
|
|
+ double diValveMaxOnTimePerFill = SC.GetValue<double>($"Reservoir.{Module}.DIValveMaxOnTimePerFill");
|
|
|
+ LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"Direplen time over conifg's DIValveMaxOnTimePerFill:{diValveMaxOnTimePerFill} min");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
bool result = DIReplenOnOperation("", null);
|
|
|
if (result)
|
|
|
{
|