JetKepler2200APM.cs 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.SCCore;
  5. using Aitex.Core.RT.Log;
  6. using MECF.Framework.Common.Device.Bases;
  7. using MECF.Framework.Common.Equipment;
  8. using System;
  9. using Venus_Core;
  10. using Venus_RT.Devices.IODevices;
  11. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  12. using IoHeartbeat = Venus_RT.Devices.IODevices.IoHeartbeat;
  13. using System.Threading.Tasks;
  14. using System.Diagnostics;
  15. using Aitex.Core.RT.DataCenter;
  16. using Aitex.Core.Util;
  17. namespace Venus_RT.Devices
  18. {
  19. class JetKepler2200APM : JetPMBase
  20. {
  21. private readonly IoLid _Lid;
  22. //private readonly IoLid _LidLoadlock;
  23. private readonly IoCylinder _slitDoor;
  24. //private readonly IoCylinder _LiftPin;
  25. //private readonly IoCylinder _LoadLockArm;
  26. private readonly IoValve _PVN21Valve;
  27. private readonly IoValve _PVN22Valve;
  28. private readonly IoValve _PV11Valve;
  29. private readonly IoValve _PV12Valve;
  30. private readonly IoValve _PV21Valve;
  31. private readonly IoValve _PV22Valve;
  32. private readonly IoValve _PV31Valve;
  33. private readonly IoValve _PV32Valve;
  34. private readonly IoValve _PV41Valve;
  35. private readonly IoValve _PV42Valve;
  36. private readonly IoValve _N2Valve;
  37. private readonly IoValve _O2Valve;
  38. private readonly IoValve _PurgeValve;
  39. private readonly IoValve _Mfc1Valve;
  40. private readonly IoValve _Mfc2Valve;
  41. private readonly IoValve _Mfc3Valve;
  42. private readonly IoValve _Mfc4Valve;
  43. private readonly IoValve _Mfc5Valve;
  44. private readonly IoValve _Mfc6Valve;
  45. private readonly IoValve _Mfc7Valve;
  46. private readonly IoValve _Mfc8Valve;
  47. //private readonly IoValve _PVHe1Valve;
  48. //private readonly IoValve _PVHe2Valve;
  49. private readonly IoValve _GasFinalValve;
  50. private readonly IoValve _SoftPumpValve;
  51. private readonly IoValve _FastPumpValve;
  52. private readonly IoValve _TurboPumpPumpingValve;
  53. private readonly IoValve _TurboPumpPurgeValve;
  54. private readonly IoValve _GuageValve;
  55. //private readonly IoValve _LoadlockVentValve;
  56. //private readonly IoValve _LoadlockPumpingValve;
  57. private readonly IoValve _N2Purge1Valve;
  58. private readonly IoValve _N2Purge2Valve;
  59. private readonly IoValve _PenningGuageValve;
  60. private readonly IoSensor _ATM_sw;
  61. private readonly IoSensor _CDAPressure;
  62. //private readonly IoSensor _ATM_Loadlock_sw;
  63. private readonly IoSensor _N2Pressure_sw;
  64. private readonly IoSensor _VAC_sw;
  65. private readonly IoSensor _WLK_sw;
  66. private readonly IoSensor _Water_Flow;
  67. private readonly IoSensor _RFG_Interlock;
  68. //private readonly IoSensor _PM_Lid_Closed;
  69. private readonly IoSensor _Source_RF_Match_Interlock;
  70. //private readonly IoSensor _PM_SlitDoor_Closed;
  71. private readonly IoSensor _TurboPumpInterlock;
  72. private readonly IoSensor _GasBoxDoor;
  73. private readonly IoSensor _GasBoxPressure;
  74. private readonly IoSensor _GasBoxN2Flow_sw;
  75. private readonly IoSensor _N2PurgePressure_sw;
  76. private readonly IoSensor _WaferTransferPosi_sw;
  77. private readonly IoSensor _TopShieldCoverClosedAlarm;
  78. private readonly IoSensor _ScrubberIsOK;
  79. private readonly F_TRIG ScrubberTrigger=new F_TRIG();
  80. //private readonly IoHeartbeat _Heartbeat;
  81. private readonly IoHighTemperatureHeater _highTemperatureHeater;
  82. //private readonly F_TRIG _GasBoxN2FlowSwitchTrigger = new F_TRIG();
  83. private readonly Stopwatch _GasBoxN2FlowSwitchStopWatch = new Stopwatch();
  84. private readonly PumpBase _MainPump;
  85. private readonly AdixenTurboPump _TurboPump;
  86. private readonly PendulumValve _pendulumValve;
  87. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  88. private readonly RfMatchBase _Match;
  89. //private readonly RfMatchBase _RFBox;
  90. //private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  91. //private readonly RfMatchBase _BiasMatch;
  92. //private readonly IoSignalTower _SignalTower;
  93. //private readonly IoHeater _ForelineTC;
  94. private readonly IoHeater _WallTC;
  95. private readonly IoPressureControl _pressureController;
  96. private readonly IoGasStick[] _gasLines;
  97. private readonly IoGasStick _gasLineN2;
  98. //private readonly IoBacksideHe _backsideHe;
  99. private readonly double _foreline_interlock_pressure = 750;
  100. private Stopwatch _GasRFStopWatch = new Stopwatch();
  101. private bool _GasFlag = false;
  102. //private PressureType _PressureType;
  103. private double processPressureLimit;
  104. private ScrubberMode _scrubberMode;
  105. // 盖子的状态
  106. public override bool IsLidClosed => _Lid.OFFFeedback;
  107. //public override bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  108. public override bool IsSlitDoorClosed => _slitDoor.State == CylinderState.Close;
  109. public override bool IsPumpRunning => _MainPump.IsRunning;
  110. public override bool IsISOOpen => _TurboPumpPumpingValve.Status;
  111. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  112. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  113. public override float TurboPumpSpeed => _TurboPump.Speed;
  114. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  115. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  116. public override bool IsCDA_OK => _CDAPressure.Value;
  117. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  118. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  119. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  120. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  121. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  122. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  123. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  124. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  125. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  126. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  127. public override bool IsGuageValveOpened => _GuageValve.Status;
  128. // 压力信号
  129. public override bool IsATM => _ATM_sw.Value;
  130. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  131. //public override bool LiftPinIsDown => false;
  132. //public override bool LiftPinIsUp => false;
  133. //public override bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  134. //public override bool IsVACLoadLock => LoadlockPressure <= 1000;
  135. public override bool IsVAC => _VAC_sw.Value;
  136. public override bool IsWaterFlowOk => _Water_Flow.Value;
  137. public override bool IsWLK => _WLK_sw.Value;
  138. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  139. //public override bool PMLidClosed => _PM_Lid_Closed.Value;
  140. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  141. public override bool SourceRFMatchInterlock => _Source_RF_Match_Interlock.Value;
  142. //public override bool SlitDoorClosed => _PM_SlitDoor_Closed.Value;
  143. public override HighTemperatureHeaterPosition HighTemperatureHeaterPosition => _highTemperatureHeater.CurrentPosition;
  144. public override double CalculationPressure
  145. {
  146. get
  147. {
  148. if (_GuageValve.Status)
  149. {
  150. return ProcessPressure;
  151. }
  152. else
  153. {
  154. return ChamberPressure;
  155. }
  156. }
  157. }
  158. public override double ProcessPressure => _pendulumValve.Pressure;
  159. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  160. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  161. public override double PenningGuagePressure => _pressureController.PenningGauge.Value;
  162. public override double TargetPressure => ChamberPressure;
  163. public override float ReflectPower => _Generator.ReflectPower;
  164. public override float ForwardPower => _Generator.ForwardPower;
  165. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  166. public override float RFMatchC2 => _Match != null ? _Match.TunePosition2 : 0;
  167. //public override float RFBoxC1 => _RFBox != null ? _RFBox.TunePosition1 : 0;
  168. public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
  169. public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
  170. public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
  171. public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
  172. public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
  173. public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
  174. public override double MFC7FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas7").FeedBack;
  175. public override double MFC8FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas8").FeedBack;
  176. public override float ChamberTemperature => _highTemperatureHeater.HighTemperatureHighHeaterTemperature;
  177. public override float PendulumPressure => _pendulumValve.Pressure;
  178. public override float PendulumPosition => _pendulumValve.Position;
  179. public override bool IsAllowRobotTransfer => _WaferTransferPosi_sw.Value;
  180. public override bool ScrubberIsOK => _ScrubberIsOK.Value;
  181. public new ModuleName Module { get; }
  182. //public override bool CheckAtm()
  183. //{
  184. // return _ATM_sw.Value && ChamberPressure > 700000;
  185. //}
  186. public override bool CheckSlitDoorOpen()
  187. {
  188. return _slitDoor.State == CylinderState.Open;
  189. }
  190. public override bool CheckSlitDoorClose()
  191. {
  192. return _slitDoor.State == CylinderState.Close;
  193. }
  194. public override double TotalGasSetpoint
  195. {
  196. get
  197. {
  198. double sum = 0;
  199. foreach (var gas in _gasLines)
  200. {
  201. sum += gas.FlowSP;
  202. }
  203. return sum;
  204. }
  205. }
  206. public override bool HasGasOutOfRange
  207. {
  208. get
  209. {
  210. foreach (var gas in _gasLines)
  211. {
  212. if (!gas.IsOutOfRange)
  213. return false;
  214. }
  215. return true;
  216. }
  217. }
  218. public override bool PendulumValveIsOpen()
  219. {
  220. return _pendulumValve.IsOpen;
  221. }
  222. public override bool IsBiasRFAble()
  223. {
  224. return false;
  225. }
  226. #region 构造函数
  227. public JetKepler2200APM(ModuleName moduleName) : base(moduleName)
  228. {
  229. Module = moduleName;
  230. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  231. //_LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  232. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  233. //_LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  234. //_LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  235. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  236. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  237. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  238. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  239. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  240. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  241. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  242. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  243. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  244. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  245. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  246. _O2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveO2}");
  247. _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePurge}");
  248. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  249. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  250. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  251. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  252. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  253. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  254. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  255. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  256. //_PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  257. //_PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  258. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  259. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  260. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  261. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  262. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  263. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  264. _N2Purge1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2Purge1}");
  265. _N2Purge2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2Purge2}");
  266. _PenningGuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePenningGauge}");
  267. //_LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  268. //_LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  269. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  270. //_ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  271. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  272. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  273. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  274. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  275. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  276. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  277. //_PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  278. _Source_RF_Match_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.RFMatchInterlock");
  279. //_PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  280. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  281. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  282. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  283. _GasBoxN2Flow_sw = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxN2FlowSwitch");
  284. _N2PurgePressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PurgePressureSwitch");
  285. //_ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  286. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  287. _WaferTransferPosi_sw = DEVICE.GetDevice<IoSensor>($"{Module}.WaferTransferPosi");
  288. _TopShieldCoverClosedAlarm = DEVICE.GetDevice<IoSensor>($"{Module}.TOPShieldCoverClosedAlarm");
  289. //_SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  290. _ScrubberIsOK = DEVICE.GetDevice<IoSensor>($"{Module}.SCRUBBEROK");
  291. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  292. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  293. _gasLines = new IoGasStick[8];
  294. for (int index = 0; index < 8; index++)
  295. {
  296. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  297. }
  298. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  299. //_backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  300. _highTemperatureHeater = DEVICE.GetDevice<IoHighTemperatureHeater>($"{Module}.HighTemperatureHeater");
  301. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  302. // RS232 Dry pump, SKY
  303. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  304. {
  305. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  306. {
  307. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  308. }
  309. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  310. {
  311. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  312. }
  313. }
  314. //_ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  315. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  316. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  317. //if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  318. // SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  319. //{
  320. // if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  321. // {
  322. // _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  323. // }
  324. // else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  325. // {
  326. // _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  327. // }
  328. //}
  329. // RS223 AdTec Generator
  330. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  331. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  332. {
  333. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  334. }
  335. //_Heartbeat = DEVICE.GetDevice<IoHeartbeat>($"{Module}.{VenusDevice.Heartbeat}");
  336. // Ethernet Comet Generator Bias
  337. //if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  338. //{
  339. // if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  340. // SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  341. // {
  342. // _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  343. // }
  344. // else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  345. // {
  346. // _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  347. // }
  348. //}
  349. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  350. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  351. {
  352. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  353. }
  354. else if (
  355. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.Revtech)
  356. {
  357. _Match = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.Match}");
  358. }
  359. //if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  360. // SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  361. // SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  362. //{
  363. // _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  364. //}
  365. //else if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  366. // SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  367. //{
  368. // _BiasMatch = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  369. //}
  370. //if (SC.GetValue<bool>($"{Module}.RFBox.EnableMatch") &&
  371. // SC.GetValue<int>($"{Module}.RFBox.CommunicationType") == (int)CommunicationType.RS232 &&
  372. // SC.GetValue<int>($"{Module}.RFBox.MFG") == (int)MatchMFG.AdTec)
  373. //{
  374. // _RFBox = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.RFBox}");
  375. //}
  376. //else if (SC.GetValue<bool>($"{Module}.RFBox.EnableMatch") &&
  377. // SC.GetValue<int>($"{Module}.RFBox.MFG") == (int)MatchMFG.Revtech)
  378. //{
  379. // _RFBox = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.RFBox}");
  380. //}
  381. _foreline_interlock_pressure = SC.GetValue<int>($"{Module}.PendulumValve.ForelinePressureLimit");
  382. _GasRFStopWatch.Stop();
  383. processPressureLimit = 260;//unit Pa
  384. _GasBoxN2FlowSwitchStopWatch.Start();
  385. //_PressureType = (PressureType)SC.GetValue<int>("System.PressureUnitType");
  386. DATA.Subscribe($"{Name}.PenningPressure", () => _pressureController.PenningGauge.Value);
  387. }
  388. #endregion
  389. public async override void CloseValves(int? delayTime = null)
  390. {
  391. _PVN21Valve.TurnValve(false, out _);
  392. // _PVN22Valve.TurnValve(false, out _);
  393. _PV11Valve.TurnValve(false, out _);
  394. _PV12Valve.TurnValve(false, out _);
  395. _PV21Valve.TurnValve(false, out _);
  396. _PV22Valve.TurnValve(false, out _);
  397. _PV31Valve.TurnValve(false, out _);
  398. _PV32Valve.TurnValve(false, out _);
  399. _PV41Valve.TurnValve(false, out _);
  400. _PV42Valve.TurnValve(false, out _);
  401. //_PVHe1Valve.TurnValve(false, out _);
  402. //_PVHe2Valve.TurnValve(false, out _);
  403. _SoftPumpValve.TurnValve(false, out _);
  404. _FastPumpValve.TurnValve(false, out _);
  405. //_TurboPumpPumpingValve.TurnValve(false, out _);
  406. _TurboPumpPurgeValve.TurnValve(false, out _);
  407. //_GuageValve.TurnValve(false, out _);
  408. _N2Valve.TurnValve(false, out _);
  409. _O2Valve.TurnValve(false, out _);
  410. //_N2Purge1Valve.TurnValve(false, out _);
  411. _N2Purge2Valve.TurnValve(false, out _);
  412. _FastPumpValve.TurnValve(false, out _);
  413. _Mfc1Valve.TurnValve(false, out _);
  414. _Mfc2Valve.TurnValve(false, out _);
  415. _Mfc3Valve.TurnValve(false, out _);
  416. _Mfc4Valve.TurnValve(false, out _);
  417. _Mfc5Valve.TurnValve(false, out _);
  418. _Mfc6Valve.TurnValve(false, out _);
  419. _Mfc7Valve.TurnValve(false, out _);
  420. _Mfc8Valve.TurnValve(false, out _);
  421. foreach (var stick in _gasLines)
  422. {
  423. stick.Stop();
  424. }
  425. if (delayTime != null)
  426. {
  427. await Task.Delay((int)delayTime);
  428. }
  429. _GasFinalValve.TurnValve(false, out _);
  430. _PurgeValve.TurnValve(false, out _);
  431. }
  432. public override void TurnDryPump(bool on)
  433. {
  434. //_pressureController.StartPump(on);
  435. _MainPump?.SetPumpOnOff(on);
  436. }
  437. public override void TurnTurboPump(bool on)
  438. {
  439. _TurboPump?.SetPumpOnOff(on);
  440. }
  441. public override void OpenValve(ValveType vlvType, bool on)
  442. {
  443. switch (vlvType)
  444. {
  445. case ValveType.PVN21:
  446. _PVN21Valve.TurnValve(on, out _);
  447. break;
  448. case ValveType.PVN22:
  449. _PVN22Valve.TurnValve(on, out _);
  450. break;
  451. case ValveType.PV11:
  452. _PV11Valve.TurnValve(on, out _);
  453. break;
  454. case ValveType.PV12:
  455. _PV12Valve.TurnValve(on, out _);
  456. break;
  457. case ValveType.PV21:
  458. _PV21Valve.TurnValve(on, out _);
  459. break;
  460. case ValveType.PV22:
  461. _PV22Valve.TurnValve(on, out _);
  462. break;
  463. case ValveType.PV31:
  464. _PV31Valve.TurnValve(on, out _);
  465. break;
  466. case ValveType.PV32:
  467. _PV32Valve.TurnValve(on, out _);
  468. break;
  469. case ValveType.PV41:
  470. _PV41Valve.TurnValve(on, out _);
  471. break;
  472. case ValveType.PV42:
  473. _PV42Valve.TurnValve(on, out _);
  474. break;
  475. case ValveType.N2:
  476. _N2Valve.TurnValve(on, out _);
  477. break;
  478. case ValveType.Purge:
  479. _PurgeValve.TurnValve(on, out _);
  480. break;
  481. case ValveType.GasFinal:
  482. _GasFinalValve.TurnValve(on, out _);
  483. break;
  484. case ValveType.SoftPump:
  485. _SoftPumpValve.TurnValve(on, out _);
  486. break;
  487. case ValveType.FastPump:
  488. _FastPumpValve.TurnValve(on, out _);
  489. break;
  490. case ValveType.TurboPumpPumping:
  491. _TurboPumpPumpingValve.TurnValve(on, out _);
  492. break;
  493. case ValveType.TurboPumpPurge:
  494. _TurboPumpPurgeValve.TurnValve(on, out _);
  495. break;
  496. case ValveType.Guage:
  497. _GuageValve.TurnValve(on, out _);
  498. break;
  499. //case ValveType.LoadlockVent:
  500. // _LoadlockVentValve.TurnValve(on, out _);
  501. // break;
  502. //case ValveType.LoadlockPumping:
  503. // _LoadlockPumpingValve.TurnValve(on, out _);
  504. // break;
  505. case ValveType.Mfc1:
  506. _Mfc1Valve.TurnValve(on, out _);
  507. break;
  508. case ValveType.Mfc2:
  509. _Mfc2Valve.TurnValve(on, out _);
  510. break;
  511. case ValveType.Mfc3:
  512. _Mfc3Valve.TurnValve(on, out _);
  513. break;
  514. case ValveType.Mfc4:
  515. _Mfc4Valve.TurnValve(on, out _);
  516. break;
  517. case ValveType.Mfc5:
  518. _Mfc5Valve.TurnValve(on, out _);
  519. break;
  520. case ValveType.Mfc6:
  521. _Mfc6Valve.TurnValve(on, out _);
  522. break;
  523. case ValveType.Mfc7:
  524. _Mfc7Valve.TurnValve(on, out _);
  525. break;
  526. case ValveType.Mfc8:
  527. _Mfc8Valve.TurnValve(on, out _);
  528. break;
  529. case ValveType.O2:
  530. _O2Valve.TurnValve(on, out _);
  531. break;
  532. case ValveType.N2Purge1:
  533. _N2Purge1Valve.TurnValve(on, out _);
  534. break;
  535. case ValveType.N2Purge2:
  536. _N2Purge2Valve.TurnValve(on, out _);
  537. break;
  538. case ValveType.PenningGauge:
  539. _PenningGuageValve.TurnValve(on, out _);
  540. break;
  541. //default:
  542. // throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  543. }
  544. }
  545. public override void Monitor()
  546. {
  547. CheckScrubber();
  548. foreach (var gas in _gasLines)
  549. {
  550. gas.Monitor();
  551. }
  552. CheckPermanentInterlock();
  553. //if (_GasBoxN2FlowSwitchStopWatch.ElapsedMilliseconds > 10 * 1000)
  554. //{
  555. // _GasBoxN2FlowSwitchStopWatch.Stop();
  556. //}
  557. CheckHighTemperatureHeaterInterlock();
  558. }
  559. private void CheckScrubber()
  560. {
  561. ScrubberTrigger.CLK = ScrubberIsOK;
  562. if (ScrubberTrigger.Q)
  563. {
  564. _scrubberMode = (ScrubberMode)SC.GetValue<int>($"{Module}.ScrubberMode");
  565. switch (_scrubberMode)
  566. {
  567. case ScrubberMode.Warning:
  568. LOG.Write(eEvent.WARN_PM_SCRUBBER_NOOK, Module, $"{Module} Scrubber Warning");
  569. break;
  570. case ScrubberMode.StopTransferStopProcess:
  571. LOG.Write(eEvent.ERR_PM_SCRUBBER_NOOK_STOPPROCESS, Module, $"{Module} Scrubber Alarm,Stop Process if Processing,Switch to Offline");
  572. break;
  573. case ScrubberMode.StopTranferContinueProcess:
  574. LOG.Write(eEvent.ERR_PM_SCRUBBER_NOOK_CONTINUEPROCESS, Module, $"{Module} Scrubber Alarm,Continue Process if Processing,Switch to Offline");
  575. break;
  576. }
  577. }
  578. }
  579. private void CheckHighTemperatureHeaterInterlock()
  580. {
  581. if (_highTemperatureHeater.HighTemperatureHeaterIsOn == false)
  582. {
  583. return;
  584. }
  585. if (_GasBoxN2Flow_sw.Value)
  586. {
  587. _GasBoxN2FlowSwitchStopWatch.Reset();
  588. }
  589. else
  590. {
  591. _GasBoxN2FlowSwitchStopWatch.Start();
  592. }
  593. if (_GasBoxN2FlowSwitchStopWatch.ElapsedMilliseconds > 10 * 1000 && _GasBoxN2FlowSwitchStopWatch.IsRunning)
  594. {
  595. _GasBoxN2FlowSwitchStopWatch.Reset();
  596. var limitTemperature = SC.GetValue<double>($"{Module}.HighTemperatureHeater.N2WarningTemperatureLimit");
  597. if (limitTemperature < ChamberTemperature)
  598. {
  599. SetHighTemperatureHeaterTemperature((int)limitTemperature);
  600. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Gas Box N2 Flow Trigger Warning,HighTemperatureHeater Cool Down to {limitTemperature} ℃,Current Purge N2 Flow {_highTemperatureHeater.HighTemperatureHeaterN2Flow}");
  601. }
  602. }
  603. }
  604. protected override void CheckPermanentInterlock()
  605. {
  606. if (ChamberPressure >= processPressureLimit && _GuageValve.SetPoint)
  607. {
  608. _GuageValve.TurnValve(false, out _);
  609. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed {processPressureLimit} Pa, Guage Valve (DO-31) closed automaticlly.");
  610. }
  611. if (ChamberPressure < processPressureLimit && !_GuageValve.SetPoint)
  612. {
  613. _GuageValve.TurnValve(true, out _);
  614. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} less than {processPressureLimit} Pa, Guage Valve (DO-31) open automaticlly.");
  615. }
  616. }
  617. public override async void CheckIdleInterlock(int delaytime)
  618. {
  619. if (ForelinePressure > _foreline_interlock_pressure)
  620. {
  621. await Task.Delay(500);
  622. if (ForelinePressure < _foreline_interlock_pressure)
  623. {
  624. return;
  625. }
  626. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  627. {
  628. _pendulumValve.TurnValve(false);
  629. _TurboPumpPurgeValve.TurnValve(false, out _);
  630. _TurboPumpPumpingValve.TurnValve(false, out _);
  631. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} Pa, Pendulum valve & PV6 & PV7 closed automaticlly.");
  632. }
  633. }
  634. if (_TurboPumpPumpingValve.SetPoint == false && _pendulumValve.IsOpen)
  635. {
  636. _pendulumValve.TurnValve(false);
  637. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"ISO Valve Closed, Pendulum valve closed automaticlly.");
  638. }
  639. }
  640. public override void Home()
  641. {
  642. _Generator?.ReConnect();
  643. _Match?.ReConnect();
  644. _MainPump?.ReConnect();
  645. _TurboPump?.ReConnect();
  646. _pendulumValve?.ReConnect();
  647. }
  648. public override bool HomeIsOK(out string reason)
  649. {
  650. if (!IsSlitDoorClosed)
  651. {
  652. reason = "Door is not Close";
  653. return false;
  654. }
  655. if (!_highTemperatureHeater.LiftIsOK())
  656. {
  657. reason = "HighTemperatureHeater Lift is not OK";
  658. return false;
  659. }
  660. if (SC.GetValue<bool>($"{Module}.{VenusDevice.PendulumValve}.NoCheck"))
  661. {
  662. reason = "PendulumValve No Check is not Close";
  663. return false;
  664. }
  665. reason = "";
  666. return true;
  667. }
  668. public override bool FlowGas(int gasNum, double val)
  669. {
  670. if (_gasLines.Length <= gasNum)
  671. return false;
  672. //double value = (val / _gasLines[gasNum]._mfc.Scale) * 100;
  673. //double setPoint =Math.Round( value / 8000 * _gasLines[gasNum]._mfc.Scale,2);
  674. _gasLines[gasNum].Flow(val);
  675. return true;
  676. }
  677. public override bool PumpGas(int gasNum)
  678. {
  679. if (_gasLines.Length <= gasNum)
  680. return false;
  681. switch (gasNum)
  682. {
  683. case 0:
  684. OpenValve(ValveType.PV12, true);
  685. break;
  686. case 1:
  687. OpenValve(ValveType.PV22, true);
  688. break;
  689. case 2:
  690. OpenValve(ValveType.PV32, true);
  691. break;
  692. case 3:
  693. OpenValve(ValveType.PV42, true);
  694. break;
  695. }
  696. _gasLines[gasNum].Pump();
  697. OpenValve(ValveType.N2Purge2, true);
  698. return true;
  699. }
  700. public override bool PurgeGas(int gasNum)
  701. {
  702. if (_gasLines.Length <= gasNum)
  703. return false;
  704. switch (gasNum)
  705. {
  706. case 0:
  707. OpenValve(ValveType.PV12, true);
  708. break;
  709. case 1:
  710. OpenValve(ValveType.PV22, true);
  711. break;
  712. case 2:
  713. OpenValve(ValveType.PV32, true);
  714. break;
  715. case 3:
  716. OpenValve(ValveType.PV42, true);
  717. break;
  718. }
  719. _gasLines[gasNum].Pump();
  720. OpenValve(ValveType.PVN21, true);
  721. return true;
  722. }
  723. public override bool StopGas(int gasNum)
  724. {
  725. if (_gasLines.Length <= gasNum)
  726. return false;
  727. _gasLines[gasNum].Stop();
  728. return true;
  729. }
  730. public override bool FlowN2(double val)
  731. {
  732. _gasLineN2.Flow(val);
  733. return true;
  734. }
  735. public override bool StopN2()
  736. {
  737. _gasLineN2.Stop();
  738. return true;
  739. }
  740. public override void StopAllGases()
  741. {
  742. foreach (var line in _gasLines)
  743. {
  744. line.Stop();
  745. }
  746. }
  747. public override bool TurnPendulumValve(bool on)
  748. {
  749. return _pendulumValve.TurnValve(on);
  750. }
  751. public override bool SetPVPressure(float pressure)
  752. {
  753. return _pendulumValve.SetPressure(pressure);
  754. }
  755. public override bool SetPVPostion(float position)
  756. {
  757. return _pendulumValve.SetPosition(position);
  758. }
  759. public override float GetPVPosition()
  760. {
  761. return _pendulumValve.Position;
  762. }
  763. public override void SetGeneratorCommunicationMode(int mode)
  764. {
  765. _Generator?.SetCommunicationMode(mode);
  766. }
  767. public override bool GeneratorPowerOn(bool on)
  768. {
  769. if (_Generator == null) return false;
  770. if (on && !IsRFGInterlockOn)
  771. {
  772. LOG.Write(eEvent.ERR_RF_RFGInterlock, Module, "射频电源 Interlock条件不满足");
  773. return false;
  774. }
  775. if (on && !_TopShieldCoverClosedAlarm.Value)
  776. {
  777. LOG.Write(eEvent.ERR_RF, Module, "DI-21 Top Shield Cover closed alarm,射频条件不满足");
  778. return false;
  779. }
  780. return _Generator.SetPowerOnOff(on, out _);
  781. }
  782. public override bool GeneratorSetpower(float val)
  783. {
  784. if (_Generator == null) return false;
  785. if (Math.Abs(val) > 0.01)
  786. _Generator.SetPower((ushort)val);
  787. return true;
  788. }
  789. //public override bool SetRFBoxC1Position(float c1)
  790. //{
  791. // if (_RFBox == null) return false;
  792. // _RFBox.SetMatchPositionC1(c1, out _);
  793. // return true;
  794. //}
  795. public override bool SetWallTCTemperature(float value)
  796. {
  797. return _WallTC.RampTemp(value);
  798. }
  799. public override bool SetMatchPosition(float c1, float c2)
  800. {
  801. if (_Match == null) return false;
  802. string reason = string.Empty;
  803. _Match.SetMatchPosition(c1, c2, out reason);
  804. return true;
  805. }
  806. public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  807. {
  808. if (_Match == null) return false;
  809. if (matchWorkMode == MatchWorkMode.Auto)
  810. {
  811. return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  812. }
  813. else if (matchWorkMode == MatchWorkMode.Manual)
  814. {
  815. return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  816. }
  817. return false;
  818. }
  819. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  820. {
  821. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  822. if (!IsLidClosed)
  823. {
  824. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  825. return false;
  826. }
  827. if (!IsVAC)
  828. {
  829. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  830. return false;
  831. }
  832. if (!IsWaterFlowOk)
  833. {
  834. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  835. return false;
  836. }
  837. if (!IsRFGInterlockOn)
  838. {
  839. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  840. return false;
  841. }
  842. if (!SlitDoorClosed)
  843. {
  844. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  845. return false;
  846. }
  847. return true;
  848. }
  849. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  850. {
  851. OpenValve(ValveType.Purge, true);
  852. //OpenValve(ValveType.N2, true);
  853. OpenValve(ValveType.PVN22, true);
  854. OpenValve(ValveType.GasFinal, false);
  855. OpenValve(ValveType.TurboPumpPumping, true);
  856. if (_pendulumValve.IsOpen == false)
  857. {
  858. TurnPendulumValve(true);
  859. }
  860. SetPVPressure(pressureSetpoint);
  861. return true;
  862. }
  863. public async override void AbortControlPressure()
  864. {
  865. //OpenValve(ValveType.N2, false);
  866. OpenValve(ValveType.PVN22, false);
  867. OpenValve(ValveType.TurboPumpPumping, true);
  868. //SetPVPressure(0);
  869. TurnPendulumValve(true);
  870. //SetPVPostion(1000);
  871. await Task.Delay(0);
  872. OpenValve(ValveType.Purge, false);
  873. //return true;
  874. }
  875. public override bool HighTemperatureHeaterGotoPosition(HighTemperatureHeaterPosition highTemperatureHeaterPosition)
  876. {
  877. return _highTemperatureHeater.GotoPosition(highTemperatureHeaterPosition);
  878. }
  879. public override bool SetHighTemperatureHeaterTemperature(int temperature)
  880. {
  881. _highTemperatureHeater.HighTemperatureHighHeaterTemperature = temperature;
  882. return true;
  883. }
  884. public override bool SetHighTemperatureHeaterRatio(int ratio)
  885. {
  886. _highTemperatureHeater.HighTemperatureHeaterRatio = ratio;
  887. return true;
  888. }
  889. public override bool PreparePlace()
  890. {
  891. //if (!SetSlitDoor(true, out string reason))
  892. //{
  893. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  894. // return false;
  895. //}
  896. return _highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position1);
  897. }
  898. public override bool PreparePick()
  899. {
  900. //if (!SetSlitDoor(true, out string reason))
  901. //{
  902. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  903. // return false;
  904. //}
  905. return _highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position1);
  906. }
  907. public override bool PreparePlaceIsOK()
  908. {
  909. return _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position1 && _WaferTransferPosi_sw.Value;
  910. }
  911. public override bool PreparePickIsOK()
  912. {
  913. return _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position1 && _WaferTransferPosi_sw.Value;
  914. }
  915. public override bool EndPlace()
  916. {
  917. //if (!SetSlitDoor(false, out string reason))
  918. //{
  919. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  920. // return false;
  921. //}
  922. if (!_highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position2))
  923. {
  924. LOG.Write(eEvent.ERR_HighTemperatureHeater, Module, $"Set High Temperature Heater To Position2 failed");
  925. return false;
  926. }
  927. return true;
  928. }
  929. public override bool EndPick()
  930. {
  931. //if (!SetSlitDoor(false, out string reason))
  932. //{
  933. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  934. // return false;
  935. //}
  936. return true;
  937. }
  938. public override bool EndPlaceIsOK()
  939. {
  940. return _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position2;
  941. }
  942. public override bool EndPickIsOK()
  943. {
  944. return CheckSlitDoorClose();
  945. }
  946. public override void RTCloseEvent()
  947. {
  948. if (_Generator.IsPowerOn)
  949. {
  950. GeneratorPowerOn(false);
  951. }
  952. if (PendulumValveIsOpen())
  953. {
  954. TurnPendulumValve(false);
  955. }
  956. }
  957. public override bool RFInterlock(VenusDevice device)
  958. {
  959. eEvent evt = eEvent.ERR_RF;
  960. if (!IsWaterFlowOk)
  961. {
  962. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  963. return false;
  964. }
  965. if (!IsRFGInterlockOn)
  966. {
  967. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  968. return false;
  969. }
  970. if (GasIsOff())
  971. {
  972. LOG.Write(evt, Module, $"Cannot Power ON {device} as Gas is OFF.");
  973. return false;
  974. }
  975. return true;
  976. }
  977. private bool GasIsOff()
  978. {
  979. if ((IsMfc1ValveOpened == false && IsMfc2ValveOpened == false && IsMfc3ValveOpened == false && IsMfc4ValveOpened == false && IsMfc5ValveOpened == false && IsMfc6ValveOpened == false && IsMfc7ValveOpened == false && IsMfc8ValveOpened == false && _GasFlag == false) || (MFC1FeedBack < 1 && MFC2FeedBack < 1 && MFC3FeedBack < 1 && MFC4FeedBack < 1 && MFC5FeedBack < 1 && MFC6FeedBack < 1 && MFC7FeedBack < 1 && MFC8FeedBack < 1 && _GasFlag == false))
  980. {
  981. if (_GasRFStopWatch.IsRunning == false)
  982. {
  983. _GasRFStopWatch.Start();
  984. }
  985. if (_GasRFStopWatch.ElapsedMilliseconds > 1500 && _GasRFStopWatch.ElapsedMilliseconds < 2500)
  986. {
  987. //var item = _GasRFStopWatch.ElapsedMilliseconds;
  988. _GasRFStopWatch.Reset();
  989. _GasFlag = true;
  990. return true;
  991. }
  992. }
  993. else
  994. {
  995. _GasRFStopWatch.Reset();
  996. _GasFlag = false;
  997. }
  998. return false;
  999. }
  1000. public override void PMInError()
  1001. {
  1002. CloseValves();
  1003. GeneratorPowerOn(false);
  1004. GeneratorBiasPowerOn(false);
  1005. }
  1006. }
  1007. }