VentRountine.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.Core.RT.SCCore;
  3. using JetVirgoPM.Devices;
  4. using MECF.Framework.Common.Routine;
  5. namespace JetVirgoPM.PMs.Routines
  6. {
  7. class VentRoutine : PMRoutineBase, IStepRoutine
  8. {
  9. private enum VentSequence
  10. {
  11. kCloseValves,
  12. kOpenSoftVentValve,
  13. kOpenFastVentValve,
  14. kVentToPrecision,
  15. kVentDelay,
  16. kCloseVentValve,
  17. kEnd,
  18. kCheckLidSignal,
  19. kCheckSlitDoor,
  20. kCheckThrottleValveStatus,
  21. kCheckN2,
  22. kOpenProcessValve,
  23. kOpenN2Supply,
  24. kCheckChamberPressure,
  25. kCheckATM
  26. }
  27. private int _ventTime;
  28. private int _ventTimeDelay = 1; //执行Vent程序时(自动或手动Vent),先关闭PV2,延时2秒后打开PV3。
  29. private int _checkATMTimeout = 90;
  30. public VentRoutine(JetDualPM chamber) : base(chamber)
  31. {
  32. Name = "vent";
  33. bUINotify = true;
  34. }
  35. public RState Start(params object[] objs)
  36. {
  37. // 预检查
  38. if (!SC.IsATMMode && _chamber.IsSlitDoor1Closed && _chamber.IsSlitDoor2Closed && _chamber.CheckAtm())
  39. {
  40. Notify($"ATM 信号 ON,{_chamber.IsATM},此时腔体压力{_chamber.ChamberPressurePressure}");
  41. return RState.End;
  42. }
  43. if (CheckLid() == RState.Running &&
  44. CheckSlitDoor1() == RState.Running && CheckSlitDoor2() == RState.Running)
  45. {
  46. Reset();
  47. _chamber.CloseValves();
  48. //_PressureTrip1 = SC.GetValue<int>($"{Module}.Pump.PressureTrip1") * 1000;
  49. _ventTime = (int)SC.GetValue<double>($"{Module}.VentTime");
  50. _checkATMTimeout = SC.GetValue<int>($"{Module}.CheckATMTimeout");
  51. _ventTimeDelay = SC.GetValue<int>($"{Module}.VentTimeDelay");
  52. return Runner.Start(_chamber.Module.ToString(), Name);
  53. }
  54. return RState.Failed;
  55. }
  56. public RState Monitor()
  57. {
  58. Runner.Run(VentSequence.kOpenN2Supply, HOFs.Apply(OpenValve, ValveType.N2, true), HOFs.Apply(CheckValve, ValveType.N2, true), 500)
  59. .Run(VentSequence.kOpenFastVentValve, HOFs.Apply(OpenValve, ValveType.FAST_VENT, true), HOFs.Apply(CheckValve, ValveType.FAST_VENT, true), 500)
  60. .Run(VentSequence.kCheckATM, HOFs.Apply(ATM2, true), HOFs.Apply(CheckATM2, true), _checkATMTimeout * 1000)
  61. .Delay(VentSequence.kVentDelay, _ventTimeDelay * 1000)
  62. .Wait(VentSequence.kCloseValves, CloseAllValve, _delay_50ms)
  63. .End(VentSequence.kEnd, EndFunc, _delay_0s);
  64. if (Runner.Status == RState.Failed)
  65. {
  66. _chamber.OpenValve(ValveType.FAST_VENT, false);
  67. _chamber.OpenValve(ValveType.PURGE, false);
  68. _chamber.OpenValve(ValveType.PROCESS, false);
  69. _chamber.OpenValve(ValveType.N2, false);
  70. Notify("出错");
  71. }
  72. return Runner.Status;
  73. }
  74. public override void Abort()
  75. {
  76. _chamber.CloseValves();
  77. }
  78. }
  79. }