首次上传
This commit is contained in:
@@ -0,0 +1,409 @@
|
||||
using System;
|
||||
using Aitex.Core.RT.Device;
|
||||
using Aitex.Core.RT.Device.Unit;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.EFEM;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.TMs;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.UnLoad;
|
||||
using SicModules.Devices;
|
||||
using SicModules.EFEMs;
|
||||
using SicModules.TMs;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadBaseRoutine : ModuleRoutine, IRoutine
|
||||
{
|
||||
protected UnLoad UnLoadDevice
|
||||
{
|
||||
get { return _unLoad; }
|
||||
}
|
||||
protected TM TMDevice
|
||||
{
|
||||
get { return _tm; }
|
||||
}
|
||||
|
||||
protected EFEM EFEMDevice
|
||||
{
|
||||
get { return _efem; }
|
||||
}
|
||||
|
||||
protected IoClaw WaferClaw
|
||||
{
|
||||
get { return _ulWaferCyShuttle; }
|
||||
}
|
||||
|
||||
protected IoLift4 Lift
|
||||
{
|
||||
get { return _ulLift; }
|
||||
}
|
||||
|
||||
protected IoInterLockEx TmIoInterLock
|
||||
{
|
||||
get { return _tmIoInterLock; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private UnLoad _unLoad = null;
|
||||
private TM _tm = null;
|
||||
private EFEM _efem = null;
|
||||
private IoClaw _ulWaferCyShuttle;
|
||||
private IoLift4 _ulLift;
|
||||
private IoInterLockEx _tmIoInterLock;
|
||||
|
||||
public UnLoadBaseRoutine() : base(ModuleName.UnLoad.ToString())
|
||||
{
|
||||
Module = ModuleName.UnLoad.ToString();
|
||||
|
||||
_unLoad = DEVICE.GetDevice<SicUnLoad>($"{Module}.{Module}");
|
||||
_tm = DEVICE.GetDevice<SicTM>($"{ModuleName.System}.{ModuleName.TM}");
|
||||
_efem= DEVICE.GetDevice<SicEFEM>($"{ModuleName.EFEM}.{ModuleName.EFEM}");
|
||||
_ulWaferCyShuttle= DEVICE.GetDevice<IoClaw>($"{Module}.UnLoadWaferClaw");
|
||||
_ulLift = DEVICE.GetDevice<IoLift4>($"{Module}.UnLoadLift");
|
||||
_tmIoInterLock = DEVICE.GetDevice<IoInterLockEx>("TM.IoInterLock");
|
||||
|
||||
}
|
||||
|
||||
public virtual void Abort()
|
||||
{
|
||||
UnLoadDevice.SetFastVentValve(false, out _);
|
||||
UnLoadDevice.SetSlowPumpValve(false, out _);
|
||||
UnLoadDevice.SetFastPumpValve(false, out _);
|
||||
|
||||
TmIoInterLock.SetUnloadVentRoutineRunning(false, out _);
|
||||
TmIoInterLock.SetUnloadPumpRoutineRunning(false, out _);
|
||||
TmIoInterLock.SetUnloadLeakCheckRoutineRunning(false, out _);
|
||||
TmIoInterLock.SetUnloadPurgeRoutineRunning(false, out _);
|
||||
|
||||
}
|
||||
|
||||
public virtual Result Monitor()
|
||||
{
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public virtual Result Start(params object[] objs)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
protected void LiftMove(int id, bool up, int timeout)
|
||||
{
|
||||
string note = up ? "Up" : "Down";
|
||||
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
||||
{
|
||||
Notify($"Set {Module} Lift to {note}");
|
||||
if (up)
|
||||
{
|
||||
if (!Lift.MoveUp(out string reason))
|
||||
{
|
||||
Stop($"Set {Module} Lift to {note} failed:" + reason);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Lift.MoveDown(out string reason))
|
||||
{
|
||||
Stop($"Set {Module} Lift to {note} failed:" + reason);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}, () =>
|
||||
{
|
||||
if (up)
|
||||
{
|
||||
return Lift.IsUp && !Lift.IsDown;
|
||||
}
|
||||
else
|
||||
{
|
||||
return !Lift.IsUp && Lift.IsDown;
|
||||
}
|
||||
|
||||
}, timeout * 1000);
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else if (ret.Item2 == Result.TIMEOUT) //timeout
|
||||
{
|
||||
Stop($"Set {Module} Lift to {note} Timeout, over {timeout} seconds");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void ClawMove(int id, IoClaw _claw, bool up, int timeout)
|
||||
{
|
||||
string note = up ? "Clawing" : "Opening";
|
||||
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
||||
{
|
||||
Notify($"Set {Module} {note}");
|
||||
if (!_claw.SetValue(up, out string reason))
|
||||
{
|
||||
Stop($"Set {Module} {note} failed:" + reason);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}, () =>
|
||||
{
|
||||
return _claw.State == (up ? ClawStateEnum.Clamp : ClawStateEnum.Open);
|
||||
}, timeout * 1000);
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else if (ret.Item2 == Result.TIMEOUT) //timeout
|
||||
{
|
||||
Stop($"Set {Module} {note} Timeout, over {timeout} seconds");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SlowPump(int id, double switchPressure, int timeout)
|
||||
{
|
||||
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
||||
{
|
||||
Notify($"Open {UnLoadDevice.Name} slow pump valve to {switchPressure} mbar");
|
||||
|
||||
if (!UnLoadDevice.SetSlowPumpValve(true, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}, () =>
|
||||
{
|
||||
return UnLoadDevice.ChamberPressure <= switchPressure;
|
||||
|
||||
}, timeout * 1000);
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else if (ret.Item2 == Result.TIMEOUT) //timeout
|
||||
{
|
||||
UnLoadDevice.SetSlowPumpValve(false, out string _);
|
||||
|
||||
Stop($"{UnLoadDevice.Name} pressure can not pump to {switchPressure} in {timeout} seconds");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void FastPump(int id, double basePressure, int timeout)
|
||||
{
|
||||
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
||||
{
|
||||
Notify($"Open {UnLoadDevice.Name} fast pump valve to {basePressure} mbar");
|
||||
|
||||
if (!UnLoadDevice.SetFastPumpValve(true, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}, () =>
|
||||
{
|
||||
return UnLoadDevice.ChamberPressure <= basePressure;
|
||||
|
||||
}, timeout * 1000);
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else if (ret.Item2 == Result.TIMEOUT) //timeout
|
||||
{
|
||||
UnLoadDevice.SetSlowPumpValve(false, out string _);
|
||||
UnLoadDevice.SetFastPumpValve(false, out string _);
|
||||
|
||||
Stop($"{UnLoadDevice.Name} pressure can not pump to {basePressure} in {timeout} seconds");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseSlowPumpValve(int id)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
Notify($"Close {UnLoadDevice.Name} slow pump valve");
|
||||
|
||||
if (!UnLoadDevice.SetSlowPumpValve(false, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseFastPumpValve(int id)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
Notify($"Close {UnLoadDevice.Name} fast pump valve");
|
||||
|
||||
if (!UnLoadDevice.SetFastPumpValve(false, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SlowVent(int id, double switchPressure, int timeout)
|
||||
{
|
||||
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
||||
{
|
||||
Notify($"Open {UnLoadDevice.Name} slow vent valve to {switchPressure} mbar");
|
||||
|
||||
if (!UnLoadDevice.SetSlowVentValve(true, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}, () =>
|
||||
{
|
||||
return UnLoadDevice.ChamberPressure >= switchPressure;
|
||||
|
||||
}, timeout * 1000);
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else if (ret.Item2 == Result.TIMEOUT) //timeout
|
||||
{
|
||||
UnLoadDevice.SetSlowVentValve(false, out string _);
|
||||
|
||||
Stop($"{UnLoadDevice.Name} pressure can not vent to {switchPressure} mbar in {timeout} seconds");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void SlowVent(int id, double switchPressure, double pressureDiff, int timeout)
|
||||
{
|
||||
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
||||
{
|
||||
Notify($"Open {Module} slow vent valve to {switchPressure} mbar");
|
||||
|
||||
if (!UnLoadDevice.SetSlowVentValve(true, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}, () =>
|
||||
{
|
||||
return UnLoadDevice.ChamberPressure >= switchPressure - pressureDiff;
|
||||
|
||||
}, timeout * 1000);
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else if (ret.Item2 == Result.TIMEOUT) //timeout
|
||||
{
|
||||
UnLoadDevice.SetSlowVentValve(false, out string _);
|
||||
|
||||
Stop($"{Module} pressure can not vent to {switchPressure} mbar in {timeout} seconds");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseVentValve(int id)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
Notify($"Close {UnLoadDevice.Name} slow vent valve");
|
||||
|
||||
if (!UnLoadDevice.SetSlowVentValve(false, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using Aitex.Core.RT.Device.Unit;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadClawRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
LiftMove,
|
||||
ClawMove,
|
||||
}
|
||||
|
||||
|
||||
private bool _llCalw;
|
||||
|
||||
private int _clawMoveTimeOut = 30;
|
||||
|
||||
public UnLoadClawRoutine()
|
||||
{
|
||||
Name = "UnLoad Claw";
|
||||
}
|
||||
|
||||
public void Init(bool isClaw)
|
||||
{
|
||||
_llCalw = isClaw;
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
|
||||
if ((_llCalw && WaferClaw.State == ClawStateEnum.Clamp) || (!_llCalw && WaferClaw.State == ClawStateEnum.Open))
|
||||
{
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
_clawMoveTimeOut = SC.GetValue<int>("UnLoad.ClawMoveTimeOut");
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
//先动夹爪在动Lift
|
||||
ClawMove((int)RoutineStep.ClawMove, WaferClaw, _llCalw, _clawMoveTimeOut);
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
Notify("Finished");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.Util;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadCoolingRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
TimeDealy
|
||||
}
|
||||
|
||||
private DeviceTimer _dt = new DeviceTimer();
|
||||
|
||||
private int _coolingTime;
|
||||
|
||||
public UnLoadCoolingRoutine()
|
||||
{
|
||||
Name = "UnLoad Cooling";
|
||||
}
|
||||
|
||||
public void Init(int coolingTime)
|
||||
{
|
||||
_coolingTime = coolingTime;
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
_dt.Start(0);
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
Delay((int)RoutineStep.TimeDealy, _coolingTime);
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
return Result.FAIL;
|
||||
}
|
||||
_dt.Stop();
|
||||
Notify("Finished");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
if (!_dt.IsIdle())
|
||||
{
|
||||
_dt.Stop();
|
||||
}
|
||||
|
||||
base.Abort();
|
||||
}
|
||||
|
||||
public int GetRemainedTime()
|
||||
{
|
||||
if (!_dt.IsIdle())
|
||||
{
|
||||
int coolingRemain = _coolingTime - (int)(_dt.GetElapseTime() / 1000);
|
||||
return coolingRemain >= 0 ? coolingRemain : 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using Aitex.Core.RT.Log;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadHomeRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
CloseV78,
|
||||
CloseV122,
|
||||
CloseV123
|
||||
}
|
||||
|
||||
private int _homeTimeout;
|
||||
|
||||
public UnLoadHomeRoutine()
|
||||
{
|
||||
Module = ModuleName.UnLoad.ToString();
|
||||
Name = "Home";
|
||||
}
|
||||
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
|
||||
_homeTimeout = SC.GetValue<int>("UnLoad.HomeTimeout");
|
||||
|
||||
Notify("Start");
|
||||
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
CloseVent((int)RoutineStep.CloseV78);
|
||||
CloseFastPump((int)RoutineStep.CloseV122);
|
||||
CloseSlowPump((int)RoutineStep.CloseV123);
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException ex)
|
||||
{
|
||||
LOG.Error(ex.ToString());
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
Notify("Finished");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public void CloseVent(int id)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
Notify($"Close Load vent valve");
|
||||
|
||||
if (!UnLoadDevice.SetFastVentValve(false, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseFastPump(int id)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
Notify($"Close Load fast pump valve");
|
||||
|
||||
if (!UnLoadDevice.SetFastPumpValve(false, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseSlowPump(int id)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
Notify($"Close slow pump valve");
|
||||
|
||||
if (!UnLoadDevice.SetSlowPumpValve(false, out string reason))
|
||||
{
|
||||
Stop(reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
base.Abort();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using MECF.Framework.Common.DBCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadLeakCheckRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
SlowPump,
|
||||
CloseSlowValve,
|
||||
FastPump,
|
||||
PumpDelay,
|
||||
CloseFastValve,
|
||||
CheckDoor,
|
||||
RunPumpRoutine,
|
||||
ContinuePump,
|
||||
ClosePumpValve,
|
||||
DoLeakCheck,
|
||||
DoLeakCheckDelay,
|
||||
CalcLeakCheck,
|
||||
StartLoop,
|
||||
LoopVent,
|
||||
LoopPump,
|
||||
StopLoop,
|
||||
SlowPumpP, FastPumpP, PumpDelayP, CloseFastValveP, CloseSlowValveP, SlowVentV, CloseFastVentValveV, VentDelayV,
|
||||
|
||||
TimeDelay1,
|
||||
TimeDelay2
|
||||
}
|
||||
|
||||
private int _paramContinuePumpTime;
|
||||
private int _paramLeakCheckTime;
|
||||
private double _beginPressure;
|
||||
private double _pumpBasePressure;
|
||||
private double _pumpSwitchPressure;
|
||||
private int _pumpTimeout;
|
||||
private int _ventTimeout;
|
||||
private int _routineTimeOut;
|
||||
private double _leakSpec;
|
||||
private int _purgeCount;
|
||||
|
||||
private double _pumpBasePressure1;
|
||||
private double _ventBasePressure1;
|
||||
private int _pumpDelayTime;
|
||||
private int _ventDelayTime;
|
||||
|
||||
private double _beginTime;
|
||||
private int _calTimes; //第几次计算LeakCheck的值(每60秒计算一次)
|
||||
|
||||
private Stopwatch _swTimer = new Stopwatch();
|
||||
public int ElapsedTime
|
||||
{
|
||||
get { return _swTimer.IsRunning ? (int)(_swTimer.ElapsedMilliseconds / 1000) : 0; }
|
||||
}
|
||||
|
||||
|
||||
public UnLoadLeakCheckRoutine()
|
||||
{
|
||||
Module = ModuleName.UnLoad.ToString();
|
||||
Name = "LeakCheck";
|
||||
}
|
||||
|
||||
internal void Init(int pumpTime, int leakCheckTime)
|
||||
{
|
||||
_paramContinuePumpTime = pumpTime;
|
||||
_paramLeakCheckTime = leakCheckTime;
|
||||
}
|
||||
|
||||
internal void Init()
|
||||
{
|
||||
_paramContinuePumpTime = SC.GetValue<int>("UnLoad.LeakCheck.PumpDelayTime");
|
||||
_paramLeakCheckTime = SC.GetValue<int>("UnLoad.LeakCheck.LeakCheckDelayTime");
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
_swTimer.Restart();
|
||||
|
||||
|
||||
string reason;
|
||||
if (!UnLoadDevice.SetFastVentValve(false, out reason) || !UnLoadDevice.SetSlowVentValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not turn off valves, {reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
bool isAtmMode = SC.GetValue<bool>("System.IsATMMode");
|
||||
|
||||
_pumpSwitchPressure = SC.GetValue<double>("UnLoad.Pump.SlowFastPumpSwitchPressure");
|
||||
_pumpBasePressure = SC.GetValue<double>("UnLoad.Pump.PumpBasePressure");
|
||||
_routineTimeOut = SC.GetValue<int>("UnLoad.LeakCheck.RoutineTimeOut");
|
||||
_leakSpec = SC.GetValue<double>("UnLoad.LeakCheck.LeakSpec");
|
||||
_purgeCount = SC.GetValue<int>("UnLoad.LeakCheck.CyclePurgeCount");
|
||||
|
||||
_pumpTimeout = SC.GetValue<int>("UnLoad.LeakCheck.PumpTimeout");
|
||||
_ventTimeout = SC.GetValue<int>("UnLoad.LeakCheck.VentTimeout");
|
||||
_pumpDelayTime = SC.GetValue<int>("UnLoad.LeakCheck.LoopPumpDelayTime");
|
||||
_ventDelayTime = SC.GetValue<int>("UnLoad.LeakCheck.LoopVentDelayTime");
|
||||
|
||||
_pumpBasePressure1 = SC.GetValue<double>("UnLoad.Pump.PumpBasePressure");
|
||||
_ventBasePressure1 = SC.GetValue<double>("UnLoad.Vent.VentBasePressure");
|
||||
|
||||
|
||||
if (isAtmMode)
|
||||
{
|
||||
EV.PostInfoLog(Module, $"system in atm mode, {Module} pump skipped");
|
||||
return Result.DONE;
|
||||
}
|
||||
if (!UnLoadDevice.CheckLidClose())
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not leakCheck, lid is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TMDevice.SetFastPumpValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not leakCheck, TM fast pump value can not close");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TMDevice.CheckSlitValveClose(ModuleName.LoadLock))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not leakCheck, slit valve is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TmIoInterLock.SetUnloadLeakCheckRoutineRunning(true, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not LeakCheck,{reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
_swTimer.Restart();
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
CheckRoutineTimeOut();
|
||||
|
||||
Loop((int)RoutineStep.StartLoop, _purgeCount);
|
||||
|
||||
SlowPump((int)RoutineStep.SlowPumpP, _pumpSwitchPressure, _pumpTimeout);
|
||||
FastPump((int)RoutineStep.FastPumpP, _pumpBasePressure1, _pumpTimeout);
|
||||
TimeDelay((int)RoutineStep.PumpDelayP, _pumpDelayTime);
|
||||
CloseFastPumpValve((int)RoutineStep.CloseFastValveP);
|
||||
CloseSlowPumpValve((int)RoutineStep.CloseSlowValveP);
|
||||
|
||||
TimeDelay((int)RoutineStep.TimeDelay1, 1);
|
||||
SlowVent((int)RoutineStep.SlowVentV, _ventBasePressure1, _ventTimeout);
|
||||
TimeDelay((int)RoutineStep.VentDelayV, _ventDelayTime);
|
||||
CloseVentValve((int)RoutineStep.CloseFastVentValveV);
|
||||
TimeDelay((int)RoutineStep.TimeDelay2, 1);
|
||||
|
||||
EndLoop((int)RoutineStep.StopLoop);
|
||||
|
||||
SlowPump((int)RoutineStep.SlowPump, _pumpSwitchPressure, _pumpTimeout);
|
||||
FastPump((int)RoutineStep.FastPump, _pumpBasePressure, _pumpTimeout);
|
||||
TimeDelay((int)RoutineStep.PumpDelay, _paramContinuePumpTime);
|
||||
CloseFastPumpValve((int)RoutineStep.CloseFastValve);
|
||||
CloseSlowPumpValve((int)RoutineStep.CloseSlowValve);
|
||||
|
||||
|
||||
DoLeakCheck((int)RoutineStep.DoLeakCheck, _paramLeakCheckTime);
|
||||
TimeDelay((int)RoutineStep.DoLeakCheckDelay, _paramLeakCheckTime);
|
||||
//CalcLeackCheckPerMinute(_paramLeakCheckTime);
|
||||
CalcLeakCheck((int)RoutineStep.CalcLeakCheck, _paramLeakCheckTime);
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
UnLoadDevice.SetSlowPumpValve(false, out _);
|
||||
UnLoadDevice.SetFastPumpValve(false, out _);
|
||||
return Result.FAIL;
|
||||
}
|
||||
TmIoInterLock.SetUnloadLeakCheckRoutineRunning(false, out _);
|
||||
|
||||
Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000)} s");
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
|
||||
private void CheckRoutineTimeOut()
|
||||
{
|
||||
if (_routineTimeOut > 10)
|
||||
{
|
||||
if ((int)(_swTimer.ElapsedMilliseconds / 1000) > _routineTimeOut)
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Routine TimeOut! over {_routineTimeOut} s");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DoLeakCheck(int id, double time)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
Notify($"Keep pressure for {time} seconds");
|
||||
|
||||
_beginTime = _swTimer.ElapsedMilliseconds;
|
||||
_beginPressure = UnLoadDevice.ChamberPressure;
|
||||
_calTimes = 1;
|
||||
return true;
|
||||
});
|
||||
if (ret.Item1)
|
||||
{
|
||||
if (ret.Item2 == Result.FAIL)
|
||||
{
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
else
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void CalcLeackCheckPerMinute(int time)
|
||||
{
|
||||
//大于LeakCheck时间,
|
||||
if ((int)((_swTimer.ElapsedMilliseconds - _beginTime) / 1000) >= time)
|
||||
{
|
||||
int leakSecond = (int)((_swTimer.ElapsedMilliseconds - _beginTime) / 1000);
|
||||
double endPressure = UnLoadDevice.ChamberPressure;
|
||||
double leakSpan = endPressure - _beginPressure;
|
||||
double leakRate = (endPressure - _beginPressure) / (leakSecond / 60.0);
|
||||
if (leakRate > _leakSpec)
|
||||
{
|
||||
LeakCheckDataRecorder.Add(time, (int)_beginPressure, (int)endPressure, leakRate, Result.FAIL.ToString(), Module, Module);
|
||||
EV.PostInfoLog(Module, $"Leak check result: end at {DateTime.Now.ToString("HH:mm:ss")}, start: {_beginPressure:F2}mbar, end: {endPressure:F2}mbar, using {time} seconds, leak rate: {leakRate:F2}");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LeakCheckDataRecorder.Add(time, (int)_beginPressure, (int)endPressure, leakRate, Result.Succeed.ToString(), Module, Module);
|
||||
EV.PostInfoLog(Module, $"Leak check result: end at {DateTime.Now.ToString("HH:mm:ss")}, start: {_beginPressure:F2}mbar, end: {endPressure:F2}mbar, using {time} seconds, leak rate: {leakRate:F2}");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((int)((_swTimer.ElapsedMilliseconds - _beginTime) / 1000) >= 60 * _calTimes)
|
||||
{
|
||||
_calTimes++;
|
||||
int leakSecond = (int)((_swTimer.ElapsedMilliseconds - _beginTime) / 1000);
|
||||
double endPressure = UnLoadDevice.ChamberPressure;
|
||||
double leakSpan = endPressure - _beginPressure;
|
||||
double leakRate = (endPressure - _beginPressure) / (leakSecond / 60.0);
|
||||
if (leakRate > _leakSpec)
|
||||
{
|
||||
EV.PostInfoLog(Module, $"Leak check Failed Count {_calTimes - 1}: using {leakSecond} seconds, leak rate: {leakRate:F2} ,Rate over {_leakSpec}");
|
||||
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
EV.PostInfoLog(Module, $"Leak check Count {_calTimes - 1}: using {leakSecond} seconds, leak rate: {leakRate:F2}");
|
||||
}
|
||||
throw (new RoutineBreakException());
|
||||
}
|
||||
}
|
||||
|
||||
public void CalcLeakCheck(int id, int time)
|
||||
{
|
||||
Tuple<bool, Result> ret = Execute(id, () =>
|
||||
{
|
||||
double endPressure = UnLoadDevice.ChamberPressure; //
|
||||
double leakSpan = endPressure - _beginPressure;
|
||||
double leakRate = (endPressure - _beginPressure) / (time / 60.0);
|
||||
if (leakRate > _leakSpec)
|
||||
{
|
||||
LeakCheckDataRecorder.Add(time, _beginPressure, endPressure, leakRate, Result.FAIL.ToString(), "", Module);
|
||||
EV.PostInfoLog(Module, $"{Module} leakcheck result: end at {DateTime.Now.ToString("HH:mm:ss")}, start: {_beginPressure:F2} mbar, end: {endPressure:F2} mbar, using {time} seconds, leak rate: {leakRate:F2}");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LeakCheckDataRecorder.Add(time, _beginPressure, endPressure, leakRate, Result.Succeed.ToString(), "", Module);
|
||||
EV.PostInfoLog(Module, $"{Module} leakcheck result: end at {DateTime.Now.ToString("HH:mm:ss")}, start: {_beginPressure:F2} mbar, end: {endPressure:F2} mbar, using {time} seconds, leak rate: {leakRate:F2}");
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadLiftRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
LiftMove
|
||||
}
|
||||
|
||||
private bool _pinUp;
|
||||
|
||||
|
||||
private int _liftMoveTimeOut = 30;
|
||||
|
||||
public UnLoadLiftRoutine()
|
||||
{
|
||||
Name = "UnLoad Lift";
|
||||
}
|
||||
|
||||
public void Init(bool isUp)
|
||||
{
|
||||
_pinUp = isUp;
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
|
||||
_liftMoveTimeOut = SC.GetValue<int>("UnLoad.LiftMoveTimeOut");
|
||||
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
//先动夹爪在动Lift
|
||||
LiftMove((int)RoutineStep.LiftMove, _pinUp, _liftMoveTimeOut);
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
Notify("Finished");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadPrepareTransferRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
CheckForelinePressure,
|
||||
RequestPump,
|
||||
RequestPumpDelay,
|
||||
SlowPump,
|
||||
CloseSlowValve,
|
||||
FastPump,
|
||||
PumpDelay,
|
||||
CloseFastValve,
|
||||
Delay,
|
||||
SlowVent,
|
||||
CloseSlowVentValve,
|
||||
|
||||
TimeDelay1,
|
||||
TimeDelay2,
|
||||
}
|
||||
|
||||
private double _pumpSwitchPressure = 100;
|
||||
|
||||
private int _slowPumpTimeout = 100;
|
||||
private int _fastPumpTimeout = 100;
|
||||
private int _slowVentTimeout = 100;
|
||||
|
||||
private double _targetPressure;
|
||||
private double _llVacPressure = 0;
|
||||
private double _balancePressureDiff = 0;
|
||||
|
||||
private double _pumpBasePressure = 0;
|
||||
private int _pumpDelayTime;
|
||||
|
||||
public UnLoadPrepareTransferRoutine()
|
||||
{
|
||||
Module = ModuleName.UnLoad.ToString();
|
||||
Name = "PrepareTransfer";
|
||||
}
|
||||
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
_targetPressure = SC.GetValue<double>("TM.PressureBalance.BalancePressure");
|
||||
_llVacPressure = SC.GetValue<double>("UnLoad.VacuumPressureBase");
|
||||
|
||||
_pumpBasePressure = SC.GetValue<double>("UnLoad.Purge.PumpBasePressure");
|
||||
_balancePressureDiff = SC.GetValue<double>("TM.PressureBalance.BalanceMaxDiffPressure");
|
||||
_pumpSwitchPressure = SC.GetValue<double>("UnLoad.Pump.SlowFastPumpSwitchPressure");
|
||||
_slowPumpTimeout = SC.GetValue<int>("UnLoad.Pump.SlowPumpTimeout");
|
||||
_fastPumpTimeout = SC.GetValue<int>("UnLoad.Pump.FastPumpTimeout");
|
||||
_slowVentTimeout = SC.GetValue<int>("UnLoad.Vent.SlowVentTimeout");
|
||||
|
||||
_pumpDelayTime = SC.GetValue<int>("UnLoad.Purge.PumpDelayTime");
|
||||
|
||||
//PrepareTrasfer需要把压力调到VacuumBasePressure以下
|
||||
if (_targetPressure > _llVacPressure)
|
||||
{
|
||||
_targetPressure = _llVacPressure;
|
||||
}
|
||||
|
||||
string reason;
|
||||
if (!UnLoadDevice.SetFastVentValve(false, out reason) || !UnLoadDevice.SetSlowVentValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not turn off valves, {reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!UnLoadDevice.SetFastPumpValve(false, out reason) || !UnLoadDevice.SetSlowPumpValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not turn off valves, {reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
bool isAtmMode = SC.GetValue<bool>("System.IsATMMode");
|
||||
|
||||
if (isAtmMode)
|
||||
{
|
||||
EV.PostInfoLog(Module, $"system in atm mode, {UnLoadDevice.Module} pump skipped");
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
if (!UnLoadDevice.CheckLidClose())
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not pump, door is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
if (!TMDevice.CheckSlitValveClose(ModuleHelper.Converter(UnLoadDevice.Module)))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"LoadLock Can not servo to pressure, slit valve is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
//if (Math.Abs(_targetPressure - UnLoadDevice.ChamberPressure) < _balancePressureDiff && UnLoadDevice.CheckVacuum())
|
||||
//{
|
||||
// return Result.DONE;
|
||||
//}
|
||||
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
TimeDelay((int)RoutineStep.TimeDelay1, 1);
|
||||
|
||||
SlowPump((int)RoutineStep.SlowPump, _pumpSwitchPressure, _slowPumpTimeout);
|
||||
|
||||
FastPump((int)RoutineStep.FastPump, _pumpBasePressure, _fastPumpTimeout);
|
||||
|
||||
TimeDelay((int)RoutineStep.TimeDelay2, _pumpDelayTime);
|
||||
|
||||
CloseFastPumpValve((int)RoutineStep.CloseFastValve);
|
||||
|
||||
CloseSlowPumpValve((int)RoutineStep.CloseSlowValve);
|
||||
|
||||
SlowVent((int)RoutineStep.SlowVent, _targetPressure - 5, _slowVentTimeout);
|
||||
|
||||
CloseVentValve((int)RoutineStep.CloseSlowVentValve);
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
|
||||
Notify("Finished");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
UnLoadDevice.SetSlowPumpValve(false, out _);
|
||||
UnLoadDevice.SetFastPumpValve(false, out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
using System.Diagnostics;
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadPumpRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
CheckForelinePressure,
|
||||
RequestPump,
|
||||
RequestPumpDelay,
|
||||
SlowPump,
|
||||
CloseSlowValve,
|
||||
FastPump,
|
||||
PumpDelay,
|
||||
CloseFastValve,
|
||||
Delay,
|
||||
TimeDelay1,
|
||||
}
|
||||
|
||||
private double _pumpBasePressure = 0;
|
||||
private double _pumpSwitchPressure = 100;
|
||||
|
||||
private int _slowPumpTimeout;
|
||||
private int _fastPumpTimeout;
|
||||
private int _pumpDelayTime= 5;
|
||||
private int _routineTimeOut;
|
||||
|
||||
|
||||
private bool _useSettingValue;
|
||||
|
||||
private Stopwatch _swTimer = new Stopwatch();
|
||||
|
||||
public UnLoadPumpRoutine()
|
||||
{
|
||||
Module = ModuleName.UnLoad.ToString();
|
||||
Name = "Pump";
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
_useSettingValue = false;
|
||||
}
|
||||
|
||||
public void Init(double basePressure, int pumpDelayTime)
|
||||
{
|
||||
_pumpBasePressure = basePressure;
|
||||
_pumpDelayTime = pumpDelayTime;
|
||||
_useSettingValue = true;
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
|
||||
string reason;
|
||||
if (!UnLoadDevice.SetFastVentValve(false, out reason) || !UnLoadDevice.SetSlowVentValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not turn off valves, {reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
bool isAtmMode = SC.GetValue<bool>("System.IsATMMode");
|
||||
|
||||
_pumpSwitchPressure = SC.GetValue<double>("UnLoad.Pump.SlowFastPumpSwitchPressure");
|
||||
|
||||
_slowPumpTimeout = SC.GetValue<int>("UnLoad.Pump.SlowPumpTimeout");
|
||||
_fastPumpTimeout = SC.GetValue<int>("UnLoad.Pump.FastPumpTimeout");
|
||||
_routineTimeOut = SC.GetValue<int>("UnLoad.Pump.RoutineTimeOut");
|
||||
|
||||
if (!_useSettingValue)
|
||||
{
|
||||
_pumpBasePressure = SC.GetValue<double>("UnLoad.Pump.PumpBasePressure");
|
||||
_pumpDelayTime = SC.GetValue<int>("UnLoad.Pump.PumpDelayTime");
|
||||
}
|
||||
|
||||
if (!TMDevice.SetFastPumpValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not pump, TM fast pump value can not close");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
if (isAtmMode)
|
||||
{
|
||||
EV.PostInfoLog(Module, $"system in atm mode, {Module} pump skipped");
|
||||
return Result.DONE;
|
||||
}
|
||||
if (SC.ContainsItem("UnLoad.RunPumpRoutineEventBelowBasePressure") && !SC.GetValue<bool>("UnLoad.RunPumpRoutineEventBelowBasePressure"))
|
||||
{
|
||||
if (UnLoadDevice.ChamberPressure < _pumpBasePressure)
|
||||
{
|
||||
EV.PostInfoLog(Module, $"{Module} already under pump base pressure");
|
||||
return Result.DONE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UnLoadDevice.CheckLidClose())
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not pump, lid is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
if (!TMDevice.CheckSlitValveClose(ModuleName.UnLoad))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not pump, slit valve is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TMDevice.SetTmToUnLoadVent(false, out _))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not pump,can not close v85!");
|
||||
}
|
||||
if (!EFEMDevice.CheckSlitValveClose(ModuleName.UnLoad,ModuleName.WaferRobot))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not pump, slit valve is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
if (!TmIoInterLock.SetUnloadPumpRoutineRunning(true, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not pump,{reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
_swTimer.Restart();
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
CheckRoutineTimeOut();
|
||||
|
||||
SlowPump((int)RoutineStep.SlowPump, _pumpSwitchPressure, _slowPumpTimeout);
|
||||
|
||||
FastPump((int)RoutineStep.FastPump, _pumpBasePressure, _fastPumpTimeout);
|
||||
|
||||
TimeDelay((int)RoutineStep.PumpDelay, _pumpDelayTime);
|
||||
|
||||
CloseFastPumpValve((int)RoutineStep.CloseFastValve);
|
||||
|
||||
CloseSlowPumpValve((int)RoutineStep.CloseSlowValve);
|
||||
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
UnLoadDevice.SetSlowPumpValve(false, out _);
|
||||
UnLoadDevice.SetFastPumpValve(false, out _);
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
TmIoInterLock.SetUnloadPumpRoutineRunning(false, out _);
|
||||
Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000)} s");
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
//UnLoadDevice.SetSlowPumpValve(false, out _);
|
||||
//UnLoadDevice.SetFastPumpValve(false, out _);
|
||||
|
||||
base.Abort();
|
||||
}
|
||||
private void CheckRoutineTimeOut()
|
||||
{
|
||||
if (_routineTimeOut > 10)
|
||||
{
|
||||
if ((int)(_swTimer.ElapsedMilliseconds / 1000) > _routineTimeOut)
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Routine TimeOut! over {_routineTimeOut} s");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
using System.Diagnostics;
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadPurgeRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
SlowPump,
|
||||
FastPump,
|
||||
PumpDelay,
|
||||
CloseFastValve,
|
||||
CloseSlowValve,
|
||||
SlowVent,
|
||||
FastVent,
|
||||
VentDelay,
|
||||
CloseFastVentValve,
|
||||
CloseSlowVentValve,
|
||||
StartLoop,
|
||||
LoopPump,
|
||||
LoopVent,
|
||||
StopLoop,
|
||||
TimeDelay1,
|
||||
TimeDelay2
|
||||
}
|
||||
|
||||
private int _purgeCount;
|
||||
private int _routineTimeOut;
|
||||
private double _pumpSwitchPressure;
|
||||
private double _pumpBasePressure;
|
||||
private int _pumpDelayTime;
|
||||
private int _pumpTimeOut;
|
||||
private double _ventBasePressure;
|
||||
private int _ventDelayTime;
|
||||
private int _ventTimeOut;
|
||||
|
||||
|
||||
private Stopwatch _swTimer = new Stopwatch();
|
||||
|
||||
public UnLoadPurgeRoutine()
|
||||
{
|
||||
Module = ModuleName.UnLoad.ToString();
|
||||
Name = "Purge";
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
if (objs.Length == 2 && int.TryParse(objs[0].ToString(), out int purgeCount)&& int.TryParse(objs[1].ToString(), out int pumpDelayTime))
|
||||
{
|
||||
_purgeCount = purgeCount;
|
||||
_pumpDelayTime = pumpDelayTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
_purgeCount = SC.GetValue<int>("UnLoad.Purge.CyclePurgeCount");
|
||||
_pumpDelayTime = SC.GetValue<int>("UnLoad.Purge.PumpDelayTime");
|
||||
}
|
||||
|
||||
_routineTimeOut = SC.GetValue<int>("UnLoad.Purge.RoutineTimeOut");
|
||||
_pumpSwitchPressure = SC.GetValue<double>("UnLoad.Pump.SlowFastPumpSwitchPressure");
|
||||
_pumpBasePressure = SC.GetValue<double>("UnLoad.Purge.PumpBasePressure");
|
||||
_pumpTimeOut = SC.GetValue<int>("UnLoad.Purge.PumpTimeOut");
|
||||
_ventBasePressure = SC.GetValue<double>("UnLoad.Purge.VentBasePressure");
|
||||
_ventDelayTime = SC.GetValue<int>("UnLoad.Purge.VentDelayTime");
|
||||
_ventTimeOut = SC.GetValue<int>("UnLoad.Purge.VentTimeOut");
|
||||
|
||||
if (!UnLoadDevice.CheckLidClose())
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not purge, lid is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TMDevice.SetFastPumpValve(false, out string reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not purge, TM fast pump value can not close");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TMDevice.CheckSlitValveClose(ModuleHelper.Converter(UnLoadDevice.Module)))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not purge, slit valve is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TMDevice.SetTmToLLVent(false, out _))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not vent,can not close v85!");
|
||||
}
|
||||
|
||||
if (!TmIoInterLock.SetUnloadPurgeRoutineRunning(true, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not purge,{reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (SC.GetValue<bool>("System.IsATMMode"))
|
||||
{
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
_swTimer.Restart();
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
CheckRoutineTimeOut();
|
||||
|
||||
if (_purgeCount > 0)
|
||||
{
|
||||
Loop((int)RoutineStep.StartLoop, _purgeCount);
|
||||
|
||||
SlowPump((int)RoutineStep.SlowPump, _pumpSwitchPressure, _pumpTimeOut);
|
||||
FastPump((int)RoutineStep.FastPump, _pumpBasePressure, _pumpTimeOut);
|
||||
TimeDelay((int)RoutineStep.PumpDelay, _pumpDelayTime);
|
||||
CloseFastPumpValve((int)RoutineStep.CloseFastValve);
|
||||
CloseSlowPumpValve((int)RoutineStep.CloseSlowValve);
|
||||
|
||||
TimeDelay((int)RoutineStep.TimeDelay1, 1);
|
||||
|
||||
SlowVent((int)RoutineStep.SlowVent, _ventBasePressure, _ventTimeOut);
|
||||
CloseVentValve((int)RoutineStep.CloseSlowVentValve);
|
||||
|
||||
TimeDelay((int)RoutineStep.VentDelay, _ventDelayTime);
|
||||
EndLoop((int)RoutineStep.StopLoop);
|
||||
}
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
return Result.FAIL;
|
||||
}
|
||||
TmIoInterLock.SetUnloadPurgeRoutineRunning(false, out _);
|
||||
|
||||
Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000)} s");
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
TmIoInterLock.SetUnloadPurgeRoutineRunning(false, out _);
|
||||
base.Abort();
|
||||
}
|
||||
|
||||
private void CheckRoutineTimeOut()
|
||||
{
|
||||
if (_routineTimeOut > 10)
|
||||
{
|
||||
if ((int)(_swTimer.ElapsedMilliseconds / 1000) > _routineTimeOut)
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Routine TimeOut! over {_routineTimeOut} s");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadSeparateRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
/*
|
||||
* 1、Unload伺服到传盘压力
|
||||
2、夹爪打开
|
||||
3、顶升晶圆
|
||||
4、夹爪闭合
|
||||
5、顶升缩回
|
||||
6、打开闸板阀
|
||||
7、Robot开始取托盘到TM
|
||||
8、关闭闸板阀
|
||||
*
|
||||
*/
|
||||
enum RoutineStep
|
||||
{
|
||||
ClawOpen,
|
||||
LiftUp,
|
||||
Clawing,
|
||||
LiftDown,
|
||||
TimeDelay1,
|
||||
}
|
||||
|
||||
private int _clawMoveTimeOut = 30;
|
||||
private int _liftMoveTimeOut = 30;
|
||||
|
||||
public UnLoadSeparateRoutine()
|
||||
{
|
||||
Name = "Separate";
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
_liftMoveTimeOut = SC.GetValue<int>("UnLoad.LiftMoveTimeOut");
|
||||
_clawMoveTimeOut = SC.GetValue<int>("UnLoad.ClawMoveTimeOut");
|
||||
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
ClawMove((int)RoutineStep.ClawOpen, WaferClaw, false, _clawMoveTimeOut);
|
||||
LiftMove((int)RoutineStep.LiftUp, true, _liftMoveTimeOut);
|
||||
ClawMove((int)RoutineStep.Clawing, WaferClaw, true, _clawMoveTimeOut);
|
||||
LiftMove((int)RoutineStep.LiftDown, false, _liftMoveTimeOut);
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
Notify("Finished");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadServoToRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
CheckForelinePressure,
|
||||
RequestPump,
|
||||
RequestPumpDelay,
|
||||
SlowPump,
|
||||
CloseSlowValve,
|
||||
FastPump,
|
||||
PumpDelay,
|
||||
CloseFastValve,
|
||||
Delay,
|
||||
SlowVent,
|
||||
CloseSlowVentValve,
|
||||
TimeDelay1,
|
||||
}
|
||||
|
||||
private double _pumpSwitchPressure;
|
||||
|
||||
private int _slowPumpTimeout = 100;
|
||||
private int _fastPumpTimeout = 100;
|
||||
private int _slowVentTimeout = 100;
|
||||
|
||||
|
||||
private bool _useSettingValue;
|
||||
private double _targetPressure;
|
||||
private bool _needPump = false;
|
||||
|
||||
public void Init(double pressure)
|
||||
{
|
||||
_targetPressure = pressure;
|
||||
_useSettingValue = true;
|
||||
}
|
||||
|
||||
public UnLoadServoToRoutine(ModuleName module)
|
||||
{
|
||||
Module = module.ToString();
|
||||
Name = "UnLoadServoTo";
|
||||
}
|
||||
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
if (!_useSettingValue)
|
||||
{
|
||||
_targetPressure = SC.GetConfigItem("TM.PressureBalance.BalancePressure").DoubleValue;
|
||||
}
|
||||
|
||||
|
||||
string reason;
|
||||
if (!UnLoadDevice.SetFastVentValve(false, out reason) || !UnLoadDevice.SetSlowVentValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not turn off valves, {reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!UnLoadDevice.SetFastPumpValve(false, out reason) || !UnLoadDevice.SetSlowPumpValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not turn off valves, {reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
bool isAtmMode = SC.GetValue<bool>("System.IsATMMode");
|
||||
|
||||
if (isAtmMode)
|
||||
{
|
||||
EV.PostInfoLog(Module, $"system in atm mode, {UnLoadDevice.Module} pump skipped");
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
if (!UnLoadDevice.CheckLidClose())
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not pump, door is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
if (!TMDevice.CheckSlitValveClose(ModuleHelper.Converter(UnLoadDevice.Module)))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"LoadLock Can not servo to pressure, slit valve is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (Math.Abs(_targetPressure - UnLoadDevice.ChamberPressure) < SC.GetConfigItem("TM.PressureBalance.BalanceMaxDiffPressure").DoubleValue && UnLoadDevice.CheckVacuum())
|
||||
{
|
||||
return Result.DONE;
|
||||
}
|
||||
_needPump = UnLoadDevice.ChamberPressure > _targetPressure;
|
||||
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
TimeDelay((int)RoutineStep.TimeDelay1, 1);
|
||||
|
||||
if (_needPump)
|
||||
{
|
||||
//需要调节的压力低于打开快抽的压力
|
||||
if (_targetPressure < _pumpSwitchPressure)
|
||||
{
|
||||
SlowPump((int)RoutineStep.SlowPump, _pumpSwitchPressure, _slowPumpTimeout);
|
||||
|
||||
FastPump((int)RoutineStep.FastPump, _targetPressure, _fastPumpTimeout);
|
||||
|
||||
CloseFastPumpValve((int)RoutineStep.CloseFastValve);
|
||||
|
||||
CloseSlowPumpValve((int)RoutineStep.CloseSlowValve);
|
||||
}
|
||||
else
|
||||
{
|
||||
SlowPump((int)RoutineStep.SlowPump, _targetPressure, _slowPumpTimeout);
|
||||
|
||||
CloseSlowPumpValve((int)RoutineStep.CloseSlowValve);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SlowVent((int)RoutineStep.SlowVent, _targetPressure, _slowVentTimeout);
|
||||
|
||||
CloseVentValve((int)RoutineStep.CloseSlowVentValve);
|
||||
}
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
|
||||
Notify("Finished");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
public override void Abort()
|
||||
{
|
||||
UnLoadDevice.SetSlowPumpValve(false, out _);
|
||||
UnLoadDevice.SetFastPumpValve(false, out _);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
using System.Diagnostics;
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
||||
namespace SicModules.UnLoads.Routines
|
||||
{
|
||||
public class UnLoadVentRoutine : UnLoadBaseRoutine
|
||||
{
|
||||
enum RoutineStep
|
||||
{
|
||||
SlowVent,
|
||||
FastVent,
|
||||
VentDelay,
|
||||
CloseSlowVentValve,
|
||||
CloseFastVentValve,
|
||||
CloseValveDelay,
|
||||
}
|
||||
|
||||
private double _ventBasePressure;
|
||||
private int _slowVentTimeout;
|
||||
private int _ventDelayTime;
|
||||
private int _routineTimeOut;
|
||||
private bool _useSettingValue;
|
||||
|
||||
private Stopwatch _swTimer = new Stopwatch();
|
||||
|
||||
public UnLoadVentRoutine()
|
||||
{
|
||||
Module = ModuleName.UnLoad.ToString();
|
||||
Name = "Vent";
|
||||
}
|
||||
|
||||
public void Init(double basePressure, int ventDelayTime)
|
||||
{
|
||||
_ventBasePressure = basePressure;
|
||||
_ventDelayTime = ventDelayTime;
|
||||
_useSettingValue = true;
|
||||
}
|
||||
|
||||
public override Result Start(params object[] objs)
|
||||
{
|
||||
Reset();
|
||||
|
||||
string reason;
|
||||
|
||||
if (UnLoadDevice.CheckAtm())
|
||||
{
|
||||
EV.PostInfoLog(Module, $"{UnLoadDevice.Module} in atm, vent skipped");
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
if (!TMDevice.CheckSlitValveClose(ModuleName.UnLoad))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not vent, slit valve is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!UnLoadDevice.CheckLidClose())
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not vent, lid is open");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
if (!TMDevice.SetFastPumpValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not vent, TM fast pump value can not close");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
if (!UnLoadDevice.SetFastPumpValve(false, out reason)
|
||||
|| !UnLoadDevice.SetSlowPumpValve(false, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Can not turn off valves, {reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
if (!TMDevice.SetTmToLLVent(false, out _))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not vent,can not close v85!");
|
||||
}
|
||||
|
||||
_slowVentTimeout = SC.GetValue<int>("UnLoad.Vent.SlowVentTimeout");
|
||||
if (!_useSettingValue)
|
||||
{
|
||||
_ventBasePressure = SC.GetValue<double>("UnLoad.Vent.VentBasePressure");
|
||||
_ventDelayTime = SC.GetValue<int>("UnLoad.Vent.VentDelayTime");
|
||||
}
|
||||
_routineTimeOut = SC.GetValue<int>("UnLoad.Vent.RoutineTimeOut");
|
||||
|
||||
|
||||
if (!TmIoInterLock.SetUnloadVentRoutineRunning(true, out reason))
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"can not vent,{reason}");
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
|
||||
_swTimer.Restart();
|
||||
Notify("Start");
|
||||
return Result.RUN;
|
||||
}
|
||||
|
||||
public override Result Monitor()
|
||||
{
|
||||
try
|
||||
{
|
||||
CheckRoutineTimeOut();
|
||||
|
||||
SlowVent((int)RoutineStep.SlowVent, _ventBasePressure, _slowVentTimeout);
|
||||
|
||||
TimeDelay((int)RoutineStep.VentDelay, _ventDelayTime);
|
||||
|
||||
CloseVentValve((int)RoutineStep.CloseFastVentValve);
|
||||
|
||||
}
|
||||
catch (RoutineBreakException)
|
||||
{
|
||||
return Result.RUN;
|
||||
}
|
||||
catch (RoutineFaildException)
|
||||
{
|
||||
UnLoadDevice.SetSlowVentValve(false, out _);
|
||||
UnLoadDevice.SetFastVentValve(false, out _);
|
||||
return Result.FAIL;
|
||||
}
|
||||
|
||||
TmIoInterLock.SetUnloadVentRoutineRunning(false, out _);
|
||||
Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000)} s");
|
||||
|
||||
return Result.DONE;
|
||||
}
|
||||
|
||||
|
||||
private void CheckRoutineTimeOut()
|
||||
{
|
||||
if (_routineTimeOut > 10)
|
||||
{
|
||||
if ((int)(_swTimer.ElapsedMilliseconds / 1000) > _routineTimeOut)
|
||||
{
|
||||
EV.PostAlarmLog(Module, $"Routine TimeOut! over {_routineTimeOut} s");
|
||||
throw (new RoutineFaildException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using Aitex.Core.RT.Device;
|
||||
using Aitex.Core.RT.Device.Devices;
|
||||
using Aitex.Core.RT.Device.Unit;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using Aitex.Core.Util;
|
||||
using MECF.Framework.Common.Schedulers;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.UnLoad;
|
||||
|
||||
namespace SicModules.UnLoads
|
||||
{
|
||||
public class SicUnLoad : UnLoad
|
||||
{
|
||||
private IoLift4 _lift;
|
||||
private IoClaw _waferClaw;
|
||||
private IoSensor _lid;
|
||||
private IoValve _ventValve;
|
||||
private IoValve _slowPumpValve;
|
||||
private IoValve _fastPumpValve;
|
||||
private IoSensor _unLoadWaferPlaced;
|
||||
private IoSensor _unLoadTrayPlaed;
|
||||
|
||||
private IoPressureMeter3 _forelineGuage;
|
||||
private IoPressureMeter3 _chamberGuage;
|
||||
|
||||
|
||||
private R_TRIG _trigWafer = new R_TRIG();
|
||||
private F_TRIG _trigNoWafer = new F_TRIG();
|
||||
|
||||
private IoSlitValve _EfemDoor;
|
||||
private IoSlitValve _VacDoor;
|
||||
|
||||
private DeviceTimer _timerJobDone = new DeviceTimer();
|
||||
|
||||
private double _balancePressureDiff = 0;
|
||||
|
||||
public override double ChamberPressure
|
||||
{
|
||||
get
|
||||
{
|
||||
return _chamberGuage.Value;
|
||||
}
|
||||
}
|
||||
|
||||
//public override double ForelinePressure
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return _forelineGuage.Value;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
public SicUnLoad(string module, XmlElement node, string ioModule = "") : base(module)
|
||||
{
|
||||
var attrModule = node.GetAttribute("module");
|
||||
base.Module = string.IsNullOrEmpty(attrModule) ? module : attrModule;
|
||||
base.Name = node.GetAttribute("id");
|
||||
base.Display = node.GetAttribute("display");
|
||||
}
|
||||
|
||||
public override bool Initialize()
|
||||
{
|
||||
_slowPumpValve = DEVICE.GetDevice<IoValve>("TM.UnLoadSlowPump");
|
||||
_fastPumpValve = DEVICE.GetDevice<IoValve>("TM.UnLoadFastPump");
|
||||
|
||||
_ventValve = DEVICE.GetDevice<IoValve>("TM.UnLoadVent");
|
||||
_lid = DEVICE.GetDevice<IoSensor>("UnLoad.UnloadLidClosed");
|
||||
_lift = DEVICE.GetDevice<IoLift4>("UnLoad.UnLoadLift");
|
||||
_waferClaw = DEVICE.GetDevice<IoClaw>("UnLoad.UnLoadWaferClaw");
|
||||
_unLoadWaferPlaced = DEVICE.GetDevice<IoSensor>("TM.UnLoadWaferPlaced");
|
||||
_unLoadTrayPlaed = DEVICE.GetDevice<IoSensor>("TM.UnLoadTrayPlaced");
|
||||
|
||||
_chamberGuage = DEVICE.GetDevice<IoPressureMeter3>("TM.UnLoadPressure");
|
||||
_forelineGuage = DEVICE.GetDevice<IoPressureMeter3>("TM.ForelinePressure");
|
||||
|
||||
_VacDoor = DEVICE.GetDevice<IoSlitValve>("TM.UnLoadDoor");
|
||||
_EfemDoor = DEVICE.GetDevice<IoSlitValve>("EFEM.UnLoadSubDoor");
|
||||
|
||||
_balancePressureDiff = SC.GetValue<double>("TM.PressureBalance.BalanceMaxDiffPressure");
|
||||
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public override bool CheckAtm()
|
||||
{
|
||||
return _chamberGuage.Value >= SC.GetValue<double>("UnLoad.AtmPressureBase");
|
||||
}
|
||||
|
||||
public override bool CheckVacuum()
|
||||
{
|
||||
return _chamberGuage.Value <= SC.GetValue<double>("UnLoad.VacuumPressureBase");
|
||||
}
|
||||
|
||||
public override bool CheckTransferPressure()
|
||||
{
|
||||
return Math.Abs(SC.GetValue<double>("UnLoad.VacuumPressureBase") - _chamberGuage.Value) < _balancePressureDiff;
|
||||
}
|
||||
|
||||
public override bool CheckIsPumping()
|
||||
{
|
||||
return _slowPumpValve.Status || _fastPumpValve.Status;
|
||||
}
|
||||
|
||||
public override bool CheckLidClose()
|
||||
{
|
||||
return _lid.Value == true;
|
||||
}
|
||||
|
||||
public override bool CheckLidOpen()
|
||||
{
|
||||
return _lid.Value != true;
|
||||
}
|
||||
|
||||
public override bool SetLift(bool isUp, out string reason)
|
||||
{
|
||||
if(isUp)
|
||||
{
|
||||
return _lift.MoveUp(out reason);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _lift.MoveDown(out reason);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckLiftDown()
|
||||
{
|
||||
return _lift.IsDown;
|
||||
}
|
||||
|
||||
public override bool CheckLiftUp()
|
||||
{
|
||||
return _lift.IsUp;
|
||||
}
|
||||
|
||||
public override bool CheckWaferClamped()
|
||||
{
|
||||
return _waferClaw.IsClamp;
|
||||
}
|
||||
public override bool CheckWaferUnClamped()
|
||||
{
|
||||
return _waferClaw.IsUnClamp;
|
||||
}
|
||||
public override bool SetWaferClamped(bool clamp, out string reason)
|
||||
{
|
||||
return _waferClaw.SetValue(clamp, out reason);
|
||||
}
|
||||
|
||||
public override bool CheckWaferPlaced()
|
||||
{
|
||||
return _unLoadWaferPlaced.Value;
|
||||
}
|
||||
public override bool CheckTrayPlaced()
|
||||
{
|
||||
return _unLoadTrayPlaed.Value;
|
||||
}
|
||||
|
||||
public override bool SetSlowPumpValve(bool isOpen, out string reason)
|
||||
{
|
||||
return _slowPumpValve.TurnValve(isOpen, out reason);
|
||||
}
|
||||
|
||||
public override bool SetFastPumpValve(bool isOpen, out string reason)
|
||||
{
|
||||
return _fastPumpValve.TurnValve(isOpen, out reason);
|
||||
}
|
||||
|
||||
public override bool SetFastVentValve(bool isOpen, out string reason)
|
||||
{
|
||||
return _ventValve.TurnValve(isOpen, out reason);
|
||||
}
|
||||
|
||||
public override bool SetSlowVentValve(bool isOpen, out string reason)
|
||||
{
|
||||
return _ventValve.TurnValve(isOpen, out reason);
|
||||
}
|
||||
|
||||
public bool CheckSlitValveClosed()
|
||||
{
|
||||
return _VacDoor.IsClose && _EfemDoor.IsClose;
|
||||
}
|
||||
|
||||
|
||||
public override bool CheckEnableTransfer(EnumTransferType type)
|
||||
{
|
||||
return true;// CheckLiftUp() || CheckLiftDown();
|
||||
}
|
||||
|
||||
public override void Monitor()
|
||||
{
|
||||
//增加过冲关闭Vent阀门
|
||||
if (_chamberGuage.FeedBack >= SC.GetValue<double>("UnLoad.VentMaxPressure") && SC.GetValue<double>("UnLoad.VentMaxPressure") > SC.GetValue<double>("UnLoad.AtmPressureBase"))
|
||||
{
|
||||
if (_ventValve.Status)
|
||||
{
|
||||
SetFastVentValve(false, out string reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,715 @@
|
||||
using System;
|
||||
using Aitex.Core.RT.DataCenter;
|
||||
using Aitex.Core.RT.Device;
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.RT.Fsm;
|
||||
using Aitex.Core.RT.OperationCenter;
|
||||
using Aitex.Core.RT.Routine;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using Aitex.Core.Utilities;
|
||||
using Aitex.Sorter.Common;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.Schedulers;
|
||||
using SicModules.UnLoads.Routines;
|
||||
|
||||
namespace SicModules.UnLoads
|
||||
{
|
||||
public class UnLoadModule : UnLoadModuleBase
|
||||
{
|
||||
public enum STATE
|
||||
{
|
||||
NotInstall,
|
||||
Init,
|
||||
Idle,
|
||||
Homing,
|
||||
Pump,
|
||||
Vent,
|
||||
MoveLift,
|
||||
Purge,
|
||||
LeakCheck,
|
||||
Transfer,
|
||||
Error,
|
||||
PrepareTransfer,
|
||||
OpenDoor,
|
||||
CloseDoor,
|
||||
Cooling,
|
||||
Separating,
|
||||
Grouping,
|
||||
}
|
||||
|
||||
public enum MSG
|
||||
{
|
||||
Home,
|
||||
Reset,
|
||||
Abort,
|
||||
Error,
|
||||
Transfer,
|
||||
PrepareTransfer,
|
||||
MoveLift,
|
||||
Pump,
|
||||
Vent,
|
||||
Purge,
|
||||
LeakCheck,
|
||||
OpenDoor,
|
||||
CloseDoor,
|
||||
Cooling,
|
||||
SetOnline,
|
||||
SetOffline,
|
||||
ToInit,
|
||||
Separate,
|
||||
Group,
|
||||
}
|
||||
|
||||
|
||||
public bool IsAlarm
|
||||
{
|
||||
get
|
||||
{
|
||||
return FsmState == (int)STATE.Error;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsReady
|
||||
{
|
||||
get { return FsmState == (int)STATE.Idle && CheckAllMessageProcessed(); }
|
||||
}
|
||||
|
||||
public override bool IsError
|
||||
{
|
||||
get { return FsmState == (int)STATE.Error; }
|
||||
}
|
||||
|
||||
public override bool IsInit
|
||||
{
|
||||
get { return FsmState == (int)STATE.Init; }
|
||||
}
|
||||
|
||||
public bool IsBusy
|
||||
{
|
||||
get { return !IsInit && !IsError && !IsReady; }
|
||||
}
|
||||
|
||||
public override bool IsIdle
|
||||
{
|
||||
get { return FsmState == (int)STATE.Idle && CheckAllMessageProcessed(); }
|
||||
}
|
||||
|
||||
public int CurrentRoutineLoop
|
||||
{
|
||||
get
|
||||
{
|
||||
if (FsmState == (int)STATE.Purge)
|
||||
{
|
||||
return _purgeRoutine.LoopCounter + 1; // CurrentLoop从0开始
|
||||
}
|
||||
else if (FsmState == (int)STATE.LeakCheck)
|
||||
{
|
||||
return _unloadLeakCheckRoutine.LoopCounter + 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int CurrentRoutineLoopTotal
|
||||
{
|
||||
get
|
||||
{
|
||||
if (FsmState == (int)STATE.Purge)
|
||||
{
|
||||
return _purgeRoutine.LoopTotalTime;
|
||||
}
|
||||
else if (FsmState == (int)STATE.LeakCheck)
|
||||
{
|
||||
return _unloadLeakCheckRoutine.LoopTotalTime;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<string> OnEnterError;
|
||||
|
||||
private bool _isInit;
|
||||
|
||||
public SicUnLoad _unLoadDevice { get; set; }
|
||||
|
||||
private UnLoadHomeRoutine _homeRoutine;
|
||||
private UnLoadPumpRoutine _pumpRoutine;
|
||||
private UnLoadVentRoutine _ventRoutine;
|
||||
private UnLoadPurgeRoutine _purgeRoutine;
|
||||
private UnLoadPrepareTransferRoutine _prepareTransferRoutine;
|
||||
//private UnLoadLiftRoutine _liftRoutine;
|
||||
private UnLoadCoolingRoutine _unloadCoolingRoutine;
|
||||
private UnLoadSeparateRoutine _unloadSeparateRoutine;
|
||||
private UnLoadLeakCheckRoutine _unloadLeakCheckRoutine;
|
||||
|
||||
public UnLoadModule(ModuleName module) : base(1)
|
||||
{
|
||||
Module = module.ToString();
|
||||
Name = module.ToString();
|
||||
IsOnline = false;
|
||||
|
||||
EnumLoop<STATE>.ForEach((item) =>
|
||||
{
|
||||
MapState((int)item, item.ToString());
|
||||
});
|
||||
|
||||
EnumLoop<MSG>.ForEach((item) =>
|
||||
{
|
||||
MapMessage((int)item, item.ToString());
|
||||
});
|
||||
|
||||
EnableFsm(50, IsInstalled ? STATE.Init : STATE.NotInstall);
|
||||
}
|
||||
|
||||
public override bool Initialize()
|
||||
{
|
||||
InitRoutine();
|
||||
|
||||
InitDevice();
|
||||
|
||||
InitFsm();
|
||||
|
||||
InitOp();
|
||||
|
||||
InitData();
|
||||
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
private void InitRoutine()
|
||||
{
|
||||
ModuleName module = ModuleHelper.Converter(Module);
|
||||
|
||||
_homeRoutine = new UnLoadHomeRoutine();
|
||||
_pumpRoutine = new UnLoadPumpRoutine();
|
||||
_ventRoutine = new UnLoadVentRoutine();
|
||||
_purgeRoutine = new UnLoadPurgeRoutine();
|
||||
_prepareTransferRoutine = new UnLoadPrepareTransferRoutine();
|
||||
_unloadSeparateRoutine = new UnLoadSeparateRoutine();
|
||||
_unloadCoolingRoutine = new UnLoadCoolingRoutine();
|
||||
_unloadLeakCheckRoutine = new UnLoadLeakCheckRoutine();
|
||||
}
|
||||
|
||||
private void InitDevice()
|
||||
{
|
||||
_unLoadDevice = DEVICE.GetDevice<SicUnLoad>($"{Module}.{Module}");
|
||||
}
|
||||
|
||||
private void InitFsm()
|
||||
{
|
||||
//Error
|
||||
AnyStateTransition(MSG.Error, FsmOnError, STATE.Error);
|
||||
AnyStateTransition(FSM_MSG.ALARM, FsmOnError, STATE.Error);
|
||||
Transition(STATE.Error, MSG.Reset, FsmReset, STATE.Idle);
|
||||
EnterExitTransition<STATE, FSM_MSG>(STATE.Error, FsmEnterError, FSM_MSG.NONE, FsmExitError);
|
||||
|
||||
//Home
|
||||
Transition(STATE.Init, MSG.Home, FsmStartHome, STATE.Homing);
|
||||
Transition(STATE.Error, MSG.Home, FsmStartHome, STATE.Homing);
|
||||
Transition(STATE.Idle, MSG.Home, FsmStartHome, STATE.Homing);
|
||||
Transition(STATE.Homing, FSM_MSG.TIMER, FsmMonitorHomeTask, STATE.Idle);
|
||||
Transition(STATE.Homing, MSG.Error, null, STATE.Init);
|
||||
Transition(STATE.Homing, MSG.Abort, FsmAbortTask, STATE.Init);
|
||||
|
||||
EnterExitTransition((int)STATE.Homing, FsmEnterIdle, (int)FSM_MSG.NONE, FsmExitIdle);
|
||||
|
||||
AnyStateTransition(MSG.ToInit, FsmToInit, STATE.Init);
|
||||
|
||||
//PrepareTransfer
|
||||
Transition(STATE.Idle, MSG.PrepareTransfer, FsmStartPrepareTransfer, STATE.PrepareTransfer);
|
||||
Transition(STATE.PrepareTransfer, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
|
||||
Transition(STATE.PrepareTransfer, MSG.Abort, FsmAbortTask, STATE.Idle);
|
||||
|
||||
//Online
|
||||
Transition(STATE.Idle, MSG.SetOnline, FsmStartSetOnline, STATE.Idle);
|
||||
Transition(STATE.Idle, MSG.SetOffline, FsmStartSetOffline, STATE.Idle);
|
||||
|
||||
//Pump
|
||||
Transition(STATE.Idle, MSG.Pump, FsmStartPump, STATE.Pump);
|
||||
Transition(STATE.Pump, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
|
||||
Transition(STATE.Pump, MSG.Abort, FsmAbortTask, STATE.Idle);
|
||||
|
||||
//Vent
|
||||
Transition(STATE.Idle, MSG.Vent, FsmStartVent, STATE.Vent);
|
||||
Transition(STATE.Vent, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
|
||||
Transition(STATE.Vent, MSG.Abort, FsmAbortTask, STATE.Idle);
|
||||
|
||||
//Purge
|
||||
Transition(STATE.Idle, MSG.Purge, FsmStartPurge, STATE.Purge);
|
||||
Transition(STATE.Purge, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
|
||||
Transition(STATE.Purge, MSG.Abort, FsmAbortTask, STATE.Idle);
|
||||
|
||||
//Leak Check
|
||||
Transition(STATE.Idle, MSG.LeakCheck, FsmStartLeakCheck, STATE.LeakCheck);
|
||||
Transition(STATE.LeakCheck, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
|
||||
Transition(STATE.LeakCheck, MSG.Abort, FsmAbortTask, STATE.Idle);
|
||||
|
||||
//Separate
|
||||
Transition(STATE.Idle, MSG.Separate, FsmStartSeparate, STATE.Separating);
|
||||
Transition(STATE.Separating, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
|
||||
Transition(STATE.Separating, MSG.Abort, FsmAbortTask, STATE.Idle);
|
||||
|
||||
//Cooling
|
||||
Transition(STATE.Idle, MSG.Cooling, FsmStartCooling, STATE.Cooling);
|
||||
Transition(STATE.Cooling, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
|
||||
Transition(STATE.Cooling, MSG.Abort, FsmAbortTask, STATE.Idle);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void InitOp()
|
||||
{
|
||||
OP.Subscribe($"{Name}.Home", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.Home);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.Pump", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.Pump);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.Vent", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.Vent);
|
||||
});
|
||||
OP.Subscribe($"{Name}.Purge", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.Purge);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.LeakCheck", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.LeakCheck, args);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.MoveLift", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.MoveLift, args[0]);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.OpenDoor", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.OpenDoor);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.CloseDoor", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.CloseDoor);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.Reset", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.Reset);
|
||||
});
|
||||
OP.Subscribe($"{Name}.Separate", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.Separate);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Name}.Abort", (string cmd, object[] args) =>
|
||||
{
|
||||
return CheckToPostMessage((int)MSG.Abort);
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Module}.SetOnline", (string cmd, object[] args) => CheckToPostMessage((int)MSG.SetOnline));
|
||||
OP.Subscribe($"{Module}.SetOffline", (string cmd, object[] args) => CheckToPostMessage((int)MSG.SetOffline));
|
||||
}
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
DATA.Subscribe($"{Name}.Status", () => StringFsmStatus);
|
||||
DATA.Subscribe($"{Name}.IsOnline", () => IsOnline);
|
||||
DATA.Subscribe($"{Name}.IsBusy", () => IsBusy);
|
||||
DATA.Subscribe($"{Module}.IsAlarm", () => IsAlarm);
|
||||
|
||||
DATA.Subscribe($"{Name}.CurrentRoutineLoop", () => CurrentRoutineLoop);
|
||||
DATA.Subscribe($"{Name}.CurrentRoutineLoopTotal", () => CurrentRoutineLoopTotal);
|
||||
|
||||
DATA.Subscribe($"{Name}.RemainedCoolingTime", () => _unloadCoolingRoutine.GetRemainedTime());
|
||||
|
||||
|
||||
/*
|
||||
DATA.Subscribe($"{Name}.AtATM", () =>
|
||||
{
|
||||
if (_unLoadDevice.CheckAtm())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
});*/
|
||||
DATA.Subscribe($"{Name}.UnderVAC", () =>
|
||||
{
|
||||
if (_unLoadDevice.CheckVacuum())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
});
|
||||
DATA.Subscribe($"{Name}.LidState", () =>
|
||||
{
|
||||
if (_unLoadDevice.CheckLidClose())
|
||||
{
|
||||
return "Closed";
|
||||
}
|
||||
return "Open";
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private bool FsmOnError(object[] param)
|
||||
{
|
||||
IsOnline = false;
|
||||
|
||||
if (FsmState == (int)STATE.Error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (FsmState == (int)STATE.Init)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmReset(object[] param)
|
||||
{
|
||||
if (FsmState == (int)STATE.Error)
|
||||
{
|
||||
EV.ClearAlarmEvent();
|
||||
}
|
||||
if (!_isInit)
|
||||
{
|
||||
PostMsg(MSG.ToInit);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmExitError(object[] param)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmEnterError(object[] param)
|
||||
{
|
||||
if (OnEnterError != null)
|
||||
OnEnterError(Module);
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmStartHome(object[] param)
|
||||
{
|
||||
Result ret = StartRoutine(_homeRoutine);
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
}
|
||||
|
||||
private bool FsmMonitorHomeTask(object[] param)
|
||||
{
|
||||
Result ret = MonitorRoutine();
|
||||
if (ret == Result.FAIL)
|
||||
{
|
||||
PostMsg(MSG.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ret == Result.DONE)
|
||||
{
|
||||
_isInit = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool FsmAbortTask(object[] param)
|
||||
{
|
||||
AbortRoutine();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmExitIdle(object[] param)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmEnterIdle(object[] param)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmToInit(object[] param)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmStartPrepareTransfer(object[] param)
|
||||
{
|
||||
QueueRoutine.Clear();
|
||||
ModuleName mod = (ModuleName)param[0];
|
||||
|
||||
// if ((mod == ModuleName.TMRobot && (EnumTransferType)param[2] == EnumTransferType.Place)
|
||||
// || mod == ModuleName.WaferRobot)
|
||||
{
|
||||
QueueRoutine.Enqueue(_prepareTransferRoutine);
|
||||
}
|
||||
|
||||
//double tragetPressure = SC.GetConfigItem("TM.PressureBalance.BalancePressure").DoubleValue;
|
||||
//if (tragetPressure > 20) //20mbar以上需要充到一定气压
|
||||
//{
|
||||
// QueueRoutine.Enqueue(_prepareTransferRoutine);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _pumpRoutine.Init();
|
||||
// QueueRoutine.Enqueue(_pumpRoutine);
|
||||
//}
|
||||
if (mod == ModuleName.WaferRobot)
|
||||
{
|
||||
QueueRoutine.Enqueue(_ventRoutine);
|
||||
}
|
||||
|
||||
Result ret = StartRoutine();
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
}
|
||||
|
||||
private bool FsmMonitorTask(object[] param)
|
||||
{
|
||||
Result ret = MonitorRoutine();
|
||||
if (ret == Result.FAIL)
|
||||
{
|
||||
PostMsg(MSG.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
return ret == Result.DONE;
|
||||
}
|
||||
|
||||
private bool FsmStartSetOffline(object[] param)
|
||||
{
|
||||
IsOnline = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmStartSetOnline(object[] param)
|
||||
{
|
||||
IsOnline = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool FsmStartPump(object[] param)
|
||||
{
|
||||
Result ret = StartRoutine(_pumpRoutine);
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
}
|
||||
|
||||
private bool FsmStartVent(object[] param)
|
||||
{
|
||||
Result ret = StartRoutine(_ventRoutine);
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
}
|
||||
|
||||
private bool FsmStartPurge(object[] param)
|
||||
{
|
||||
Result ret = StartRoutine(_purgeRoutine, param);
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
}
|
||||
|
||||
private bool FsmStartSeparate(object[] param)
|
||||
{
|
||||
Result ret = StartRoutine(_unloadSeparateRoutine);
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
}
|
||||
|
||||
private bool FsmStartCooling(object[] param)
|
||||
{
|
||||
_unloadCoolingRoutine.Init((int)param[0]);
|
||||
|
||||
Result ret = StartRoutine(_unloadCoolingRoutine);
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
}
|
||||
|
||||
|
||||
private bool FsmStartLeakCheck(object[] param)
|
||||
{
|
||||
if (param != null && param.Length >= 2)
|
||||
{
|
||||
_unloadLeakCheckRoutine.Init((int)param[0], (int)param[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_unloadLeakCheckRoutine.Init();
|
||||
}
|
||||
|
||||
Result ret = StartRoutine(_unloadLeakCheckRoutine);
|
||||
if (ret == Result.FAIL || ret == Result.DONE)
|
||||
return false;
|
||||
return ret == Result.RUN;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public override bool Home(out string reason)
|
||||
{
|
||||
CheckToPostMessage((int)MSG.Home);
|
||||
reason = string.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int InvokeCooling(int time)
|
||||
{
|
||||
if (CheckToPostMessage((int)MSG.Cooling, time))
|
||||
return (int)MSG.Cooling;
|
||||
|
||||
return (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public override int InvokeVent()
|
||||
{
|
||||
if (CheckToPostMessage((int)MSG.Vent))
|
||||
return (int)MSG.Vent;
|
||||
|
||||
return (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public override int InvokePump()
|
||||
{
|
||||
if (CheckToPostMessage((int)MSG.Pump))
|
||||
return (int)MSG.Pump;
|
||||
|
||||
return (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public override int InvokePurge(params object[] objs)
|
||||
{
|
||||
if (CheckToPostMessage((int)MSG.Purge, objs))
|
||||
return (int)MSG.Purge;
|
||||
|
||||
return (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public override bool CheckAcked(int entityTaskToken)
|
||||
{
|
||||
return FsmState == (int)STATE.Idle && CheckAllMessageProcessed();
|
||||
//return true;
|
||||
}
|
||||
|
||||
public override void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
|
||||
{
|
||||
//CheckToPostMessage(MSG.InTransfer);
|
||||
}
|
||||
|
||||
public override void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
|
||||
{
|
||||
//if (FsmState == (int)STATE.InTransfer)
|
||||
// CheckToPostMessage(MSG.TransferComplete);
|
||||
}
|
||||
|
||||
public override bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
|
||||
{
|
||||
reason = string.Empty;
|
||||
|
||||
if (CheckToPostMessage((int)MSG.PrepareTransfer, robot, targetSlot, transferType))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
|
||||
{
|
||||
reason = string.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
|
||||
{
|
||||
reason = string.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType,
|
||||
out string reason)
|
||||
{
|
||||
reason = string.Empty;
|
||||
|
||||
if (robot == ModuleName.WaferRobot || robot == ModuleName.EfemRobot)
|
||||
{
|
||||
return _unLoadDevice.CheckAtm();
|
||||
}
|
||||
else
|
||||
{
|
||||
return (_unLoadDevice.CheckVacuum() && !SC.GetValue<bool>("System.IsATMMode"))
|
||||
|| (_unLoadDevice.CheckAtm() && SC.GetValue<bool>("System.IsATMMode"));
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckReadyForMap(ModuleName robot, Hand blade, out string reason)
|
||||
{
|
||||
reason = string.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void InvokeOffline()
|
||||
{
|
||||
PostMsg((int)MSG.SetOffline);
|
||||
}
|
||||
|
||||
public void InvokeOnline()
|
||||
{
|
||||
PostMsg((int)MSG.SetOnline);
|
||||
}
|
||||
|
||||
public override int InvokeGroupWaferTray()
|
||||
{
|
||||
if (CheckToPostMessage((int)MSG.Group))
|
||||
return (int)MSG.Group;
|
||||
|
||||
return (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public override int InvokeSeparateWaferTray()
|
||||
{
|
||||
if (CheckToPostMessage((int)MSG.Separate))
|
||||
return (int)MSG.Separate;
|
||||
|
||||
return (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public int InvokeError()
|
||||
{
|
||||
if (CheckToPostMessage((int)MSG.Error))
|
||||
return (int)MSG.Error;
|
||||
|
||||
return (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public override bool CheckSlitValveClosed()
|
||||
{
|
||||
return _unLoadDevice.CheckSlitValveClosed();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using Aitex.Core.RT.Device;
|
||||
using Aitex.Sorter.Common;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.Fsm;
|
||||
using MECF.Framework.Common.Schedulers;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using MECF.Framework.RT.EquipmentLibrary.LogicUnits;
|
||||
|
||||
namespace SicModules.UnLoads
|
||||
{
|
||||
public abstract class UnLoadModuleBase : ModuleFsmDevice, ITransferTarget, IModuleDevice
|
||||
{
|
||||
private int _slot = 1;
|
||||
|
||||
public UnLoadModuleBase(int slot)
|
||||
{
|
||||
_slot = slot;
|
||||
}
|
||||
|
||||
public override bool Initialize()
|
||||
{
|
||||
WaferManager.Instance.SubscribeLocation(Module, _slot);
|
||||
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public abstract bool IsIdle { get; }
|
||||
|
||||
//IModuleDevice
|
||||
public abstract bool IsReady { get; }
|
||||
public abstract bool IsError { get; }
|
||||
public abstract bool IsInit { get; }
|
||||
public abstract bool Home(out string reason);
|
||||
|
||||
//ITransferTarget
|
||||
public abstract bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
|
||||
public abstract bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
|
||||
public abstract bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
|
||||
public abstract bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
|
||||
public abstract void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType);
|
||||
public abstract void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType);
|
||||
public abstract bool CheckReadyForMap(ModuleName robot, Hand blade, out string reason);
|
||||
|
||||
public abstract int InvokeCooling(int time);
|
||||
public abstract int InvokeVent();
|
||||
public abstract int InvokePump();
|
||||
public abstract int InvokePurge(params object[] objs);
|
||||
|
||||
public abstract int InvokeGroupWaferTray();
|
||||
public abstract int InvokeSeparateWaferTray();
|
||||
|
||||
public abstract bool CheckAcked(int entityTaskToken);
|
||||
public abstract bool CheckSlitValveClosed();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user