using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using VirgoRT.Devices; namespace VirgoRT.Modules.PMs { class VentRoutine : PMRoutineBase, IRoutine { private enum VentSequence { kCloseValves, kOpenSoftVentValve, kOpenFastVentValve, kVentToPrecision, kVentDelay, kCloseVentValve, kEnd, kCheckLidSignal, kCheckSlitDoor, kCheckThrottleValveStatus, kCheckN2, kOpenProcessValve, kOpenN2Supply, kCheckChamberPressure, kCheckATM } private int _ventTime; private int _ventTimeDelay = 1; //执行Vent程序时(自动或手动Vent),先关闭PV2,延时2秒后打开PV3。 private int _checkATMTimeout = 90; public VentRoutine(JetPM chamber) : base(chamber) { Name = "vent"; bUINotify = true; } public Result Start(params object[] objs) { // 预检查 if (CheckLid() == Result.RUN && CheckSlitDoor() == Result.RUN && CheckCDA() == Result.RUN) { Reset(); _chamber.CloseValves(); //_PressureTrip1 = SC.GetValue($"{Module}.Pump.PressureTrip1") * 1000; _ventTime = (int)SC.GetValue($"{Module}.VentTime"); _checkATMTimeout = SC.GetValue($"{Module}.CheckATMTimeout"); _ventTimeDelay = SC.GetValue($"{Module}.VentTimeDelay"); Notify("开始"); return Result.RUN; } return Result.FAIL; } public Result Monitor() { try { //CheckThrottleValveFullOpen((int)VentSequence.kCheckThrottleValveStatus); // 开阀 //OpenValve((int)VentSequence.kOpenSoftVentValve, ValveType.PURGE, true); SetValve((int)VentSequence.kOpenProcessValve, ValveType.PROCESS, true); // 监控压力 //CheckPressure((int)VentSequence.kCheckChamberPressure, _PressureTrip1, true, 30); // 开阀 SetValve((int)VentSequence.kOpenFastVentValve, ValveType.FAST_VENT, true); CheckATM2((int)VentSequence.kCheckATM, true, _checkATMTimeout); // delay 3 seconds TimeDelay((int)VentSequence.kVentDelay, _ventTimeDelay); // 结束并关闭所有阀 CloseAllValve((int)VentSequence.kCloseValves, 0); End((int)VentSequence.kEnd); } catch (RoutineBreakException) { return Result.RUN; } catch (RoutineFaildException) { //_chamber.OpenValve(ValveType.N2_SUPPLY, false); _chamber.SetValveOnOff(ValveType.FAST_VENT, false); _chamber.SetValveOnOff(ValveType.PURGE, false); _chamber.SetValveOnOff(ValveType.PROCESS, false); Notify("出错"); return Result.FAIL; } catch (System.Exception ex) { Stop(ex.Message); return Result.FAIL; } Notify("结束"); return Result.DONE; } public override void Abort() { _chamber.CloseValves(); } } }