JetKepler2200BPM.cs 48 KB

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