|
@@ -18,6 +18,9 @@ using System.Linq;
|
|
|
using System.Reflection;
|
|
|
using System.Diagnostics;
|
|
|
using MECF.Framework.Common.IOCore;
|
|
|
+using Aitex.Core.RT.SCCore;
|
|
|
+using CyberX8_RT.Devices.PowerSupplier;
|
|
|
+using MECF.Framework.Common.ToolLayout;
|
|
|
|
|
|
|
|
|
namespace CyberX8_RT.Devices.Metal
|
|
@@ -35,6 +38,9 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
private const string CELL_FLOW = "CellFlow";
|
|
|
private const string WH_CLAMP = "WaferHolderClamp";
|
|
|
private const string CIRCULATION = "Circulation";
|
|
|
+ private const string REGULATE_PUMP_SIGNAL_IN = "RegulatePumpSignalIn";
|
|
|
+ private const string REGULATE_PUMP_SPEED = "RegulatePumpSpeed";
|
|
|
+ private const string REGULATE_PUMP = "RegulatPump";
|
|
|
#endregion
|
|
|
#region 内部变量
|
|
|
/// <summary>
|
|
@@ -57,6 +63,18 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
/// Flow Valve计时
|
|
|
/// </summary>
|
|
|
private Stopwatch _flowValveStopWatch = new Stopwatch();
|
|
|
+ /// <summary>
|
|
|
+ /// 调速泵Pump速度
|
|
|
+ /// </summary>
|
|
|
+ private double _regulatePumpSpeed;
|
|
|
+ /// <summary>
|
|
|
+ /// 是否为调速类型的pump
|
|
|
+ /// </summary>
|
|
|
+ private bool _isRegulatePump = false;
|
|
|
+ /// <summary>
|
|
|
+ /// Metal项
|
|
|
+ /// </summary>
|
|
|
+ private MetalItem _metalItem;
|
|
|
#endregion
|
|
|
|
|
|
#region 属性
|
|
@@ -65,6 +83,10 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
/// </summary>
|
|
|
public StandardHotMetalDeviceData MetalDeviceData { get { return _metalDeviceData; } }
|
|
|
/// <summary>
|
|
|
+ /// 是否调速泵
|
|
|
+ /// </summary>
|
|
|
+ public bool IsRegulatePump { get { return _isRegulatePump; } }
|
|
|
+ /// <summary>
|
|
|
/// Flow Valve稳定状态
|
|
|
/// </summary>
|
|
|
public bool FlowValveStable { get { return _metalDeviceData.Circulation && _flowValveStopWatch.ElapsedMilliseconds >= 3000; } }
|
|
@@ -101,6 +123,12 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
{
|
|
|
LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "Persistent Value Object is not exist");
|
|
|
}
|
|
|
+ _metalItem = MetalItemManager.Instance.GetMetalItem(Module);
|
|
|
+ if (_metalItem != null)
|
|
|
+ {
|
|
|
+ _isRegulatePump = "Regulate" == _metalItem.PumpType;
|
|
|
+ }
|
|
|
+ _regulatePumpSpeed = SC.GetValue<double>("Reservoir.DefaultPumpSpeed");
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化Routine
|
|
@@ -119,6 +147,9 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
DATA.Subscribe($"{Module}.WaferShuttleClamped", () => _metalDeviceData.WaferHolderClamp, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.CellFlow", () => _metalDeviceData.CellFlow, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.Circulation", () => _metalDeviceData.Circulation, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
+ DATA.Subscribe($"{Module}.IsRegulatePump", () => _isRegulatePump, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
+ DATA.Subscribe($"{Module}.PumpSpeed", () => _regulatePumpSpeed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
+
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 订阅变量数值发生变化
|
|
@@ -129,6 +160,7 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
BeckhoffIoSubscribeUpdateVariable(CELL_FLOW);
|
|
|
BeckhoffIoSubscribeUpdateVariable(WH_CLAMP);
|
|
|
BeckhoffIoSubscribeUpdateVariable(CIRCULATION);
|
|
|
+ BeckhoffIoSubscribeUpdateVariable(REGULATE_PUMP_SIGNAL_IN);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 订阅Operation
|
|
@@ -136,14 +168,15 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
protected override void InitializeOperation()
|
|
|
{
|
|
|
base.InitializeOperation();
|
|
|
- OP.Subscribe($"{Module}.PumpEnable", (cmd, args) => { return PumpOnOperation(cmd, args); });
|
|
|
- OP.Subscribe($"{Module}.PumpDisable", (cmd, args) => { return PumpOffOperation(cmd, args); });
|
|
|
+ OP.Subscribe($"{Module}.PumpEnable", OpenPump);
|
|
|
+ OP.Subscribe($"{Module}.PumpDisable", ClosePump);
|
|
|
OP.Subscribe($"{Module}.CellSwitchToBypass", (cmd, args) => { return SwitchToBypass(cmd, args); });
|
|
|
OP.Subscribe($"{Module}.CellSwitchToFlow", (cmd, args) => { return SwitchToFlow(cmd, args); });
|
|
|
OP.Subscribe($"{Module}.ClampOn", (cmd, args) => { return WaferHolderClampOn(cmd, args); });
|
|
|
OP.Subscribe($"{Module}.ClampOff", (cmd, args) => { return WaferHolderClampOff(cmd, args); });
|
|
|
OP.Subscribe($"{Module}.WaferHolderClampOn", (cmd, args) => { return WaferHolderClampOn(cmd, args); });
|
|
|
OP.Subscribe($"{Module}.WaferHolderUnclampOn", (cmd, args) => { return WaferHolderClampOff(cmd, args); });
|
|
|
+ OP.Subscribe($"{Module}.RegulatPumpSpeed", RegulatePumpSpeedOperation);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -185,7 +218,98 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ public bool OpenPump(string cmd, Object[] args)
|
|
|
+ {
|
|
|
+ bool result = false;
|
|
|
+ if (_isRegulatePump)
|
|
|
+ {
|
|
|
+ result = RegulatePumpOn(cmd, args);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result = PumpOnOperation(cmd, args);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ public bool ClosePump(string cmd, Object[] args)
|
|
|
+ {
|
|
|
+ bool result = false;
|
|
|
+ if (_isRegulatePump)
|
|
|
+ {
|
|
|
+ result = RegulatePumpOff(cmd, args);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result = PumpOffOperation(cmd, args);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
+ #region Regulat Pump
|
|
|
+ /// <summary>
|
|
|
+ /// 调速pump
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="cmd"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool RegulatePumpSpeedOperation(string cmd, object[] args)
|
|
|
+ {
|
|
|
+ double MaxPumpSpeed = 0;
|
|
|
+ if (SC.ContainsItem("Reservoir.MaxPumpSpeed"))
|
|
|
+ {
|
|
|
+ MaxPumpSpeed = SC.GetValue<double>("Reservoir.MaxPumpSpeed");
|
|
|
+ }
|
|
|
+ if (double.TryParse(args[0].ToString(), out double speed))
|
|
|
+ {
|
|
|
+ _regulatePumpSpeed = speed;
|
|
|
+ if (_regulatePumpSpeed > MaxPumpSpeed)
|
|
|
+ {
|
|
|
+ _regulatePumpSpeed = SC.GetValue<double>("Reservoir.DefaultPumpSpeed");//恢复成默认泵速
|
|
|
+ LOG.WriteLog(eEvent.WARN_METAL, Module, $"Pump speed:{_regulatePumpSpeed} is over max pump speed {MaxPumpSpeed}!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return RegulatePumpSpeed(_regulatePumpSpeed);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_METAL, Module, $"{args[0]} is nor invalid speed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 设置泵速
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="PumpSpeed"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool RegulatePumpSpeed(double PumpSpeed)
|
|
|
+ {
|
|
|
+ string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{REGULATE_PUMP_SPEED}");
|
|
|
+ return IOModuleManager.Instance.WriteIoValue(ioName, PumpSpeed);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Pump On
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="cmd"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool RegulatePumpOn(string cmd, object[] args)
|
|
|
+ {
|
|
|
+ string enableIOName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{REGULATE_PUMP}");
|
|
|
+ return IOModuleManager.Instance.WriteIoValue(enableIOName, true);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Pump Off
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="cmd"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool RegulatePumpOff(string cmd, object[] args)
|
|
|
+ {
|
|
|
+ string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Module}.{REGULATE_PUMP}");
|
|
|
+ return IOModuleManager.Instance.WriteIoValue(ioName, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
#region CellPump
|
|
|
/// <summary>
|
|
|
/// Cell Pump On操作
|
|
@@ -290,7 +414,7 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
{
|
|
|
if (_metalDeviceData.CellPump)
|
|
|
{
|
|
|
- PumpOffOperation("", null);
|
|
|
+ ClosePump("", null);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -309,7 +433,7 @@ namespace CyberX8_RT.Devices.Metal
|
|
|
if (rsState == RState.Failed || rsState == RState.Timeout)
|
|
|
{
|
|
|
_status = RState.Failed;
|
|
|
- PumpOff();
|
|
|
+ ClosePump("", null);
|
|
|
_currentOperation = MetalOperation.None;
|
|
|
}
|
|
|
else if (rsState == RState.End)
|