|
@@ -255,6 +255,22 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
OP.Subscribe($"{Module}.CAPumpSpeed", CAPumpSpeedOperation);
|
|
|
OP.Subscribe($"{Module}.CAPumpDisable", CAPumpOff);
|
|
|
OP.Subscribe($"{Module}.LoadRecipe", LoadRecipeOperation);
|
|
|
+ OP.Subscribe($"{Module}.ReturnValveOn", ReturnValveOn);
|
|
|
+ OP.Subscribe($"{Module}.ReturnValveOff", (cmd, para) => { return ReturnValveOff();});
|
|
|
+ OP.Subscribe($"{Module}.ReturnValvePercent", ReturnValvePercentOperation);
|
|
|
+
|
|
|
+ OP.Subscribe($"{Module}.CAIsolationOn", (cmd, para) => { return CAIsolationOn(); });
|
|
|
+ OP.Subscribe($"{Module}.CAIsolationOff", (cmd, para) => { return CAIsolationOff(); });
|
|
|
+ OP.Subscribe($"{Module}.ANIsolationOn", (cmd, para) => { return ANIsolationOn(); });
|
|
|
+ OP.Subscribe($"{Module}.ANIsolationOff", (cmd, para) => { return ANIsolationOff(); });
|
|
|
+ OP.Subscribe($"{Module}.SampleOutValveOn", (cmd, para) => { return SampleOutValveOn(); });
|
|
|
+ OP.Subscribe($"{Module}.SampleOutValveOff", (cmd, para) => { return SampleOutValveOff(); });
|
|
|
+ OP.Subscribe($"{Module}.DegasValveOn", (cmd, para) => { return DegasValveOn(); });
|
|
|
+ OP.Subscribe($"{Module}.DegasValveOff", (cmd, para) => { return DegasValveOff(); });
|
|
|
+ OP.Subscribe($"{Module}.PhValveOn", (cmd, para) => { return PhValveOn(); });
|
|
|
+ OP.Subscribe($"{Module}.PhValveOff", (cmd, para) => { return PhValveOff(); });
|
|
|
+ OP.Subscribe($"{Module}.HedValveOn", (cmd, para) => { return HedValveOn(); });
|
|
|
+ OP.Subscribe($"{Module}.HedValveOff", (cmd, para) => { return HedValveOff(); });
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 订阅变量数值发生变化
|
|
@@ -273,6 +289,9 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
IoSubscribeUpdateVariable(RETURN_VALVE_OPENING);
|
|
|
IoSubscribeUpdateVariable(RETURN_VALVE_PERCENT);
|
|
|
IoSubscribeUpdateVariable(SAMPLE_OUT);
|
|
|
+ IoSubscribeUpdateVariable(CA_ISOLATION);
|
|
|
+ IoSubscribeUpdateVariable(AN_ISOLATION);
|
|
|
+ IoSubscribeUpdateVariable(DEGAS_ENABLE);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 订阅IO变量
|
|
@@ -310,6 +329,19 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 写变量
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="variable"></param>
|
|
|
+ /// <param name="value"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool WriteVariableValue(string variable, object value)
|
|
|
+ {
|
|
|
+ string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{variable}");
|
|
|
+ return IOModuleManager.Instance.WriteIoValue(ioName, value);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
/// 定时器
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
@@ -578,6 +610,8 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
ReservoirsPersistentManager.Instance.UpdatePersistentValue(Module);
|
|
|
return true;
|
|
|
}
|
|
|
+ #endregion
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 加载Recipe
|
|
|
/// </summary>
|
|
@@ -598,7 +632,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
LOG.WriteLog(eEvent.INFO_RESERVOIR, Module.ToString(), $"Load {recipeRoute} Recipe {_resRecipe.Ppid} Success");
|
|
|
return true;
|
|
|
}
|
|
|
- #endregion
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
|
/// 监控
|
|
@@ -692,11 +726,11 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
if (double.TryParse(args[0].ToString(), out double percent))
|
|
|
{
|
|
|
_returnValvePercent = percent;
|
|
|
- return CAPumpSpeed(_caPumpSpeed);
|
|
|
+ return ReturnValvePercent(_returnValvePercent);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{args[0]} is nor invalid speed");
|
|
|
+ LOG.WriteLog(eEvent.ERR_METAL, Module, $"{args[0]} is invalid percent");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -707,7 +741,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
/// <returns></returns>
|
|
|
public bool ReturnValvePercent(double percent)
|
|
|
{
|
|
|
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{RETURN_VALVE_PERCENT}");
|
|
|
+ string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{RETURN_VALVE_OPENING}");
|
|
|
return BeckhoffIOManager.Instance.WriteIoValue(ioName, percent);
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -722,8 +756,9 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
bool result = ReturnValvePercent(percent);
|
|
|
if (result)
|
|
|
{
|
|
|
- string enableIOName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{RETURN_VALVE}");
|
|
|
- return BeckhoffIOManager.Instance.WriteIoValue(enableIOName, true);
|
|
|
+ //string enableIOName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{RETURN_VALVE}");
|
|
|
+ //return BeckhoffIOManager.Instance.WriteIoValue(enableIOName, true);
|
|
|
+ return WriteVariableValue(RETURN_VALVE, true);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -736,13 +771,110 @@ namespace PunkHPX8_RT.Devices.Reservoir
|
|
|
/// <param name="cmd"></param>
|
|
|
/// <param name="args"></param>
|
|
|
/// <returns></returns>
|
|
|
- private bool ReturnValveOff(string cmd, object[] args)
|
|
|
+ public bool ReturnValveOff()
|
|
|
{
|
|
|
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{RETURN_VALVE}");
|
|
|
- return BeckhoffIOManager.Instance.WriteIoValue(ioName, false);
|
|
|
+ //string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{RETURN_VALVE}");
|
|
|
+ //return BeckhoffIOManager.Instance.WriteIoValue(ioName, false);
|
|
|
+ return WriteVariableValue(RETURN_VALVE, false);
|
|
|
}
|
|
|
-
|
|
|
#endregion
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// ANIsolationOn
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool ANIsolationOn()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(AN_ISOLATION, true);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// ANIsolationOff
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool ANIsolationOff()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(AN_ISOLATION, false);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// CAIsolationOn
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool CAIsolationOn()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(CA_ISOLATION, true);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// CAIsolationOff
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool CAIsolationOff()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(CA_ISOLATION, false);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// DegasValveOn
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool DegasValveOn()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(DEGAS_ENABLE, true);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// DegasValveOff
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool DegasValveOff()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(DEGAS_ENABLE, false);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// HedValveOn
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool HedValveOn()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(HED_FLOW_ENABLE, true);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// HedValveOff
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool HedValveOff()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(HED_FLOW_ENABLE, false);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// PhValveOn
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool PhValveOn()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(PH_FLOW_VALVE, true);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// PhValveOff
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool PhValveOff()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(PH_FLOW_VALVE, false);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// SampleOutValveOn
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool SampleOutValveOn()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(SAMPLE_OUT, true);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// SampleOutValveOff
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool SampleOutValveOff()
|
|
|
+ {
|
|
|
+ return WriteVariableValue(SAMPLE_OUT, false);
|
|
|
+ }
|
|
|
|
|
|
#region CA DiReplen
|
|
|
/// <summary>
|