|
@@ -23,20 +23,17 @@ namespace PunkHPX8_RT.Modules.Reservoir
|
|
{
|
|
{
|
|
private enum InitializeStep
|
|
private enum InitializeStep
|
|
{
|
|
{
|
|
- AutoDiReplen,
|
|
|
|
|
|
+ OpenIsolationValve,
|
|
CAPump,
|
|
CAPump,
|
|
CAPumpWait,
|
|
CAPumpWait,
|
|
ANPump,
|
|
ANPump,
|
|
ANPumpWait,
|
|
ANPumpWait,
|
|
- ManualCellDisableHED,
|
|
|
|
|
|
+ CheckFlowWait,
|
|
|
|
+ CellManualCheckFlow,
|
|
|
|
+ CellAutoCheckFlow,
|
|
|
|
+ CheckDiReplen,
|
|
|
|
+ AutoDiReplen,
|
|
AutoCellAutoEnableHED,
|
|
AutoCellAutoEnableHED,
|
|
- AutoCellAutoEnableHEDDelay,
|
|
|
|
- AutoCellAutoEnableHEDCheck,
|
|
|
|
- AutoCellAutoCheckPowerSupplier,
|
|
|
|
- AutoCellAutoLinmotReset,
|
|
|
|
- AutoCellAutoLinmotResetCheck,
|
|
|
|
- CellWSUnclamp,
|
|
|
|
- AutoCloseBypass,
|
|
|
|
End
|
|
End
|
|
}
|
|
}
|
|
#region 常量
|
|
#region 常量
|
|
@@ -53,6 +50,9 @@ namespace PunkHPX8_RT.Modules.Reservoir
|
|
private TemperatureController _temperatureController;
|
|
private TemperatureController _temperatureController;
|
|
private double _hedFlowLowLimit;
|
|
private double _hedFlowLowLimit;
|
|
private int _autoHedDelay = 0;
|
|
private int _autoHedDelay = 0;
|
|
|
|
+ private int _flowFaultHoldOffTime = 1000;
|
|
|
|
+ private double _cellFlowStartLowLimit = 3;
|
|
|
|
+ private double _anFlowStartLowLimit = 0.5;
|
|
#endregion
|
|
#endregion
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// 构造函数
|
|
@@ -76,27 +76,58 @@ namespace PunkHPX8_RT.Modules.Reservoir
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public RState Monitor()
|
|
public RState Monitor()
|
|
{
|
|
{
|
|
- Runner.RunIf(InitializeStep.AutoDiReplen, _recipe.DIReplenEnable || _recipe.ANDIReplenEnable, CheckFacilitiesDiReplenStatus, _delay_1ms)
|
|
|
|
- .Run(InitializeStep.CAPump, () => { return _caPumpOnRoutine.Start() == RState.Running; }, _delay_1s)
|
|
|
|
- .WaitWithStopCondition(InitializeStep.CAPumpWait, () => CommonFunction.CheckRoutineEndState(_caPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_caPumpOnRoutine))
|
|
|
|
- .Run(InitializeStep.ANPump, () => { return _anPumpOnRoutine.Start() == RState.Running; }, _delay_1ms)
|
|
|
|
- .WaitWithStopCondition(InitializeStep.ANPumpWait, () => CommonFunction.CheckRoutineEndState(_anPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_anPumpOnRoutine))
|
|
|
|
- //Manual cell Bypass同时Enable HED
|
|
|
|
- .Run(InitializeStep.AutoCellAutoEnableHED, AutoHedOn, _delay_1ms)
|
|
|
|
- .Delay(InitializeStep.AutoCellAutoEnableHEDDelay, _autoHedDelay)
|
|
|
|
- .Run(InitializeStep.AutoCellAutoEnableHEDCheck, AutoHedSuccess, _delay_1ms)
|
|
|
|
- //检验PowerSupplier通信
|
|
|
|
- .Run(InitializeStep.AutoCellAutoCheckPowerSupplier, AutoMetalsPowerSupplierCommuncationStatus, _delay_1ms)
|
|
|
|
- //Cell Linmot Reset
|
|
|
|
-
|
|
|
|
- .WaitWithStopCondition(InitializeStep.AutoCellAutoLinmotResetCheck, CheckAutoMetalResetStatus, CheckAutoMetalResetStopStatus)
|
|
|
|
- //Cell Unclamp
|
|
|
|
- .Run(InitializeStep.CellWSUnclamp, MetalsWHUnclampOn, _delay_1ms)
|
|
|
|
-
|
|
|
|
- .End(InitializeStep.End, ClearAlarmDataError, _delay_1ms);
|
|
|
|
|
|
+ Runner.Run(InitializeStep.OpenIsolationValve, OpenIsolationValve,_delay_1ms)
|
|
|
|
+ .Run(InitializeStep.CAPump, () => { return _caPumpOnRoutine.Start() == RState.Running; }, _delay_1s)
|
|
|
|
+ .WaitWithStopCondition(InitializeStep.CAPumpWait, () => CommonFunction.CheckRoutineEndState(_caPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_caPumpOnRoutine))
|
|
|
|
+ .Run(InitializeStep.ANPump, () => { return _anPumpOnRoutine.Start() == RState.Running; }, _delay_1ms)
|
|
|
|
+ .WaitWithStopCondition(InitializeStep.ANPumpWait, () => CommonFunction.CheckRoutineEndState(_anPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_anPumpOnRoutine))
|
|
|
|
+ .Delay(InitializeStep.CheckFlowWait, _flowFaultHoldOffTime)
|
|
|
|
+ .RunIf(InitializeStep.CellManualCheckFlow,_dmReservoirDevice.OperationMode == MANUAL,ManualCheckFlow,_delay_1ms)
|
|
|
|
+ .RunIf(InitializeStep.CellManualCheckFlow,_dmReservoirDevice.OperationMode == AUTO, AutoCheckFlow, _delay_1ms)
|
|
|
|
+ .RunIf(InitializeStep.AutoDiReplen, _recipe.DIReplenEnable || _recipe.ANDIReplenEnable, CheckFacilitiesDiReplenStatus, _delay_1ms)
|
|
|
|
+ .Run(InitializeStep.AutoCellAutoEnableHED, AutoHedOn, _delay_1ms)
|
|
|
|
+ .End(InitializeStep.End, ClearAlarmDataError, _delay_1ms);
|
|
return Runner.Status;
|
|
return Runner.Status;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
|
|
+ /// 打开Isolation valve
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private bool OpenIsolationValve()
|
|
|
|
+ {
|
|
|
|
+ return _dmReservoirDevice.ANIsolationOn() && _dmReservoirDevice.CAIsolationOn();
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 检查cell flow 和an flow是否大于配置项
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private bool ManualCheckFlow()
|
|
|
|
+ {
|
|
|
|
+ //cell flow 校验待完成
|
|
|
|
+
|
|
|
|
+ if(_dmReservoirDevice.ReservoirData.AnFlow < _anFlowStartLowLimit)
|
|
|
|
+ {
|
|
|
|
+ _dmReservoirDevice.AnPumpOff();
|
|
|
|
+ _dmReservoirDevice.ANIsolationOff();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 检查cell flow 和an flow是否大于recipe的设定
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private bool AutoCheckFlow()
|
|
|
|
+ {
|
|
|
|
+ //cell flow 校验待完成
|
|
|
|
+
|
|
|
|
+ if (_dmReservoirDevice.ReservoirData.AnFlow < _recipe.ANFlowRateErrorLow)
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
/// 检验总Di有没有开
|
|
/// 检验总Di有没有开
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
@@ -148,16 +179,15 @@ namespace PunkHPX8_RT.Modules.Reservoir
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
private bool AutoHedOn()
|
|
private bool AutoHedOn()
|
|
{
|
|
{
|
|
- //double hedFlow = _dmReservoirDevice.ReservoirData.CAHedFlow;
|
|
|
|
- //bool result = hedFlow > _hedFlowLowLimit;
|
|
|
|
- //if (!result)
|
|
|
|
- //{
|
|
|
|
- // LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"HED Flow {hedFlow} is less than {_hedFlowLowLimit}");
|
|
|
|
- // return false;
|
|
|
|
- //}
|
|
|
|
- //_autoHedDelay = _delay_2s;
|
|
|
|
- //_temperatureController.EnableOperation("", null);
|
|
|
|
- //_temperatureController.SetTargetTemperatureOperation("", new object[] { _recipe.TemperatureSetPoint });
|
|
|
|
|
|
+
|
|
|
|
+ bool result = _dmReservoirDevice.ReservoirData.CaFlow < _cellFlowStartLowLimit;
|
|
|
|
+ if (result)
|
|
|
|
+ {
|
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"CA Flow {_dmReservoirDevice.ReservoirData.CaFlow} is less than CellFlowStartLowLimit{_cellFlowStartLowLimit}");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ _temperatureController.EnableOperation("", null);
|
|
|
|
+ _temperatureController.SetTargetTemperatureOperation("", new object[] { _recipe.TemperatureSetPoint });
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -331,8 +361,9 @@ namespace PunkHPX8_RT.Modules.Reservoir
|
|
|
|
|
|
_temperatureController = (TemperatureController)objs[1];
|
|
_temperatureController = (TemperatureController)objs[1];
|
|
_recipe = _dmReservoirDevice.Recipe;
|
|
_recipe = _dmReservoirDevice.Recipe;
|
|
- _autoHedDelay = 0;
|
|
|
|
- _hedFlowLowLimit = SC.GetValue<double>($"Reservoir.{Module}.HEDFlowLowLimit");
|
|
|
|
|
|
+ _flowFaultHoldOffTime = SC.GetValue<int>($"PlatingCell.FlowFaultHoldOffTime");
|
|
|
|
+ _cellFlowStartLowLimit = SC.GetValue<double>($"PlatingCell.CellFlowStartLowLimit");
|
|
|
|
+ _anFlowStartLowLimit = SC.GetValue<double>($"PlatingCell.ANFlowStartLowLimit");
|
|
if (!CheckPreCondition())
|
|
if (!CheckPreCondition())
|
|
{
|
|
{
|
|
return RState.Failed;
|
|
return RState.Failed;
|
|
@@ -356,6 +387,37 @@ namespace PunkHPX8_RT.Modules.Reservoir
|
|
LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "Temperature is not connected");
|
|
LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "Temperature is not connected");
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ if (!CheckFacility())
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 检验facility
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private bool CheckFacility()
|
|
|
|
+ {
|
|
|
|
+ SystemFacilities systemFacilities = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
|
|
|
|
+ if (systemFacilities == null)
|
|
|
|
+ {
|
|
|
|
+ if (systemFacilities.HouseChilledWaterEnable)
|
|
|
|
+ {
|
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "HouseChilledWaterEnable is false");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (systemFacilities.DIFillEnable)
|
|
|
|
+ {
|
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "DIFillEnable is false");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (systemFacilities.DIReplenEnable)
|
|
|
|
+ {
|
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "DIReplenEnable is false");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|