JetKepler2300PM.cs 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  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 Aitex.Core.Util;
  7. using MECF.Framework.Common.Device.Bases;
  8. using MECF.Framework.Common.Equipment;
  9. using System;
  10. using System.Collections.Generic;
  11. using Venus_Core;
  12. using Venus_RT.Modules;
  13. using Venus_RT.Devices.IODevices;
  14. using Venus_RT.Devices.EPD;
  15. using MECF.Framework.Common.SubstrateTrackings;
  16. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  17. using System.Threading.Tasks;
  18. using Aitex.Core.RT.DataCenter;
  19. using Aitex.Core.Backend;
  20. using Aitex.Core.RT.OperationCenter;
  21. namespace Venus_RT.Devices
  22. {
  23. class JetKepler2300PM : JetPMBase
  24. {
  25. private readonly IoLid _Lid;
  26. private readonly IoLid _LidLoadlock;
  27. private readonly IoCylinder _slitDoor;
  28. private readonly IoCylinder _LiftPin;
  29. private readonly IoCylinder _LoadLockArm;
  30. private readonly IoValve _PVN21Valve;
  31. private readonly IoValve _PVN22Valve;
  32. private readonly IoValve _PV11Valve;
  33. private readonly IoValve _PV12Valve;
  34. private readonly IoValve _PV21Valve;
  35. private readonly IoValve _PV22Valve;
  36. private readonly IoValve _PV31Valve;
  37. private readonly IoValve _PV32Valve;
  38. private readonly IoValve _PV41Valve;
  39. private readonly IoValve _PV42Valve;
  40. private readonly IoValve _N2Valve;
  41. private readonly IoValve _Mfc1Valve;
  42. private readonly IoValve _Mfc2Valve;
  43. private readonly IoValve _Mfc3Valve;
  44. private readonly IoValve _Mfc4Valve;
  45. private readonly IoValve _Mfc5Valve;
  46. private readonly IoValve _Mfc6Valve;
  47. private readonly IoValve _Mfc7Valve;
  48. private readonly IoValve _Mfc8Valve;
  49. private readonly IoValve _PVHe1Valve;
  50. private readonly IoValve _PVHe2Valve;
  51. private readonly IoValve _GasFinalValve;
  52. private readonly IoValve _SoftPumpValve;
  53. private readonly IoValve _FastPumpValve;
  54. private readonly IoValve _TurboPumpPumpingValve;
  55. private readonly IoValve _TurboPumpPurgeValve;
  56. private readonly IoValve _GuageValve;
  57. private readonly IoValve _LoadlockVentValve;
  58. private readonly IoValve _LoadlockPumpingValve;
  59. private readonly IoSensor _ATM_sw;
  60. private readonly IoSensor _CDAPressure;
  61. private readonly IoSensor _ATM_Loadlock_sw;
  62. private readonly IoSensor _N2Pressure_sw;
  63. private readonly IoSensor _VAC_sw;
  64. private readonly IoSensor _WLK_sw;
  65. private readonly IoSensor _Water_Flow;
  66. private readonly IoSensor _RFG_Interlock;
  67. private readonly IoSensor _PM_Lid_Closed;
  68. private readonly IoSensor _Source_RF_Fan;
  69. private readonly IoSensor _PM_SlitDoor_Closed;
  70. private readonly IoSensor _TurboPumpInterlock;
  71. private readonly IoSensor _GasBoxDoor;
  72. private readonly IoSensor _GasBoxPressure;
  73. private readonly PumpBase _MainPump;
  74. private readonly ESC5HighVoltage _ESCHV;
  75. private readonly AdixenTurboPump _TurboPump;
  76. private readonly PendulumValve _pendulumValve;
  77. private readonly ChillerBase _Chiller;
  78. private readonly ChillerBase _InnerChiller;
  79. private readonly ChillerBase _OuterChiller;
  80. private readonly ChillerBase _TopChiller;
  81. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  82. private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  83. private readonly RfMatchBase _Match;
  84. private readonly RfMatchBase _BiasMatch;
  85. private readonly IoSignalTower _SignalTower;
  86. private readonly IoHeater _ForelineTC;
  87. private readonly IoHeater _WallTC;
  88. private readonly IoPressureControl _pressureController;
  89. private readonly IoGasStick[] _gasLines;
  90. private readonly IoGasStick _gasLineN2;
  91. private readonly IoBacksideHe _backsideHe;
  92. private readonly IoMfc _heMfc;
  93. private readonly double _foreline_interlock_pressure = 750;
  94. private float _chillerInnerTemp => GetAiValue($"{Module}.AI_ESC_inner_coolant_outlet_TC_Temp");
  95. private float _chillerOuterTemp => GetAiValue($"{Module}.AI_ESC_outer_coolant_outlet_TC_Temp");
  96. private float _chillerTopTemp => GetAiValue($"{Module}.AI_Top_Plate_coolant_outlet_TC_Temp");
  97. // 盖子的状态
  98. public override bool IsLidClosed => _Lid.OFFFeedback;
  99. public override bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  100. public override bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  101. public override bool IsPumpRunning => _MainPump.IsRunning;
  102. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  103. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  104. public override float TurboPumpSpeed => _TurboPump.Speed;
  105. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  106. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  107. public override bool IsCDA_OK => _CDAPressure.Value;
  108. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  109. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  110. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  111. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  112. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  113. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  114. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  115. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  116. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  117. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  118. public override bool IsGuageValveOpened => _GuageValve.Status;
  119. // 压力信号
  120. public override bool IsATM => _ATM_sw.Value;
  121. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  122. public override bool LiftPinIsDown => _LiftPin.OFFFeedback;
  123. public override bool LiftPinIsUp => _LiftPin.ONFeedback;
  124. public override bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  125. public override bool IsVACLoadLock => LoadlockPressure <= 1000;
  126. public override bool IsVAC => _VAC_sw.Value;
  127. public override bool IsWaterFlowOk => true;
  128. public override bool IsWLK => _WLK_sw.Value;
  129. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  130. public override bool PMLidClosed => _PM_Lid_Closed.Value;
  131. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  132. public override bool SourceRFFanInterlock => _Source_RF_Fan.Value;
  133. public override bool SlitDoorClosed => _PM_SlitDoor_Closed.Value;
  134. public override double ProcessLowPressure => _pressureController.ProcessLow.Value;
  135. public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
  136. public override double CalculationPressure
  137. {
  138. get
  139. {
  140. if (ProcessPressure < 100)
  141. {
  142. return ProcessPressure;
  143. }
  144. else
  145. {
  146. return ChamberPressure;
  147. }
  148. }
  149. }
  150. public override double ProcessPressure => _pressureController.ProcessGauge.Value;
  151. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  152. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  153. public override double TargetPressure => _pressureController.TargetPressure;
  154. public override double LoadlockPressure => 0;
  155. public override double ESCHePressure => _pressureController.ESCHeGauge.Value;
  156. public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
  157. public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
  158. public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
  159. public override bool IsHVOn => _ESCHV.IsOn;
  160. public override float CoolantInletTempFB => 0;
  161. public override float CoolantOutletTempFB => 0;
  162. public override bool ChillerIsRunning => false;
  163. public bool innerChillerIsRunning=>_InnerChiller.IsRunning;
  164. public bool outerChillerIsRunning => _OuterChiller.IsRunning;
  165. public bool topChillerIsRunning => _TopChiller.IsRunning;
  166. //Loadlock_Arm
  167. public override bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
  168. public override bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
  169. //Loadlock_Arm DO
  170. public override bool LoadlockArmRetract => _LoadLockArm.OFFSetPoint;
  171. public override bool LoadlockArmExtend => _LoadLockArm.ONSetPoint;
  172. public override float ReflectPower => _Generator.ReflectPower;
  173. public override float BiasReflectPower => _GeneratorBias.ReflectPower;
  174. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  175. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  176. public override float RFMatchC2 => _Match != null ? _Match.TunePosition2 : 0;
  177. public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  178. public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  179. public new ModuleName Module { get; }
  180. public override MovementPosition LiftPinPosition
  181. {
  182. get
  183. {
  184. MovementPosition pos = MovementPosition.Unknown;
  185. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  186. {
  187. pos = MovementPosition.Up;
  188. }
  189. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  190. {
  191. pos = MovementPosition.Down;
  192. }
  193. return pos;
  194. }
  195. }
  196. public override bool CheckAtm()
  197. {
  198. return _ATM_sw.Value && ChamberPressure > 700000;
  199. }
  200. public override bool CheckSlitDoorOpen()
  201. {
  202. return _slitDoor.State == CylinderState.Open;
  203. }
  204. public override bool CheckSlitDoorClose()
  205. {
  206. return _slitDoor.State == CylinderState.Close;
  207. }
  208. public override bool CheckLiftUp()
  209. {
  210. return _LiftPin.State == CylinderState.Open;
  211. }
  212. public override bool CheckLiftDown()
  213. {
  214. return _LiftPin.State == CylinderState.Close;
  215. }
  216. public override double TotalGasSetpoint
  217. {
  218. get
  219. {
  220. double sum = 0;
  221. foreach (var gas in _gasLines)
  222. {
  223. sum += gas.FlowSP;
  224. }
  225. return sum;
  226. }
  227. }
  228. public override bool HasGasOutOfRange
  229. {
  230. get
  231. {
  232. foreach (var gas in _gasLines)
  233. {
  234. if (!gas.IsOutOfRange)
  235. return false;
  236. }
  237. return true;
  238. }
  239. }
  240. public override bool PendulumValveIsOpen()
  241. {
  242. return _pendulumValve.IsOpen;
  243. }
  244. #region 构造函数
  245. public JetKepler2300PM(ModuleName moduleName) : base(moduleName)
  246. {
  247. Module = moduleName;
  248. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  249. _LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  250. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  251. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  252. _LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  253. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  254. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  255. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  256. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  257. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  258. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  259. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  260. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  261. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  262. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  263. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  264. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  265. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  266. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  267. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  268. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  269. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  270. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  271. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  272. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  273. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  274. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  275. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  276. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  277. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  278. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  279. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  280. _LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  281. _LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  282. _heMfc = DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe");
  283. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  284. _ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  285. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  286. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  287. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  288. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  289. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  290. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  291. _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  292. _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
  293. _PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  294. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  295. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  296. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  297. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  298. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  299. _SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  300. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  301. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  302. _gasLines = new IoGasStick[8];
  303. for (int index = 0; index < 8; index++)
  304. {
  305. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  306. }
  307. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  308. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  309. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  310. // RS232 Dry pump, SKY
  311. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  312. {
  313. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  314. {
  315. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  316. }
  317. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  318. {
  319. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  320. }
  321. }
  322. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  323. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  324. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  325. if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  326. SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  327. {
  328. if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  329. {
  330. _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  331. }
  332. else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  333. {
  334. _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  335. }
  336. }
  337. if (SC.GetValue<bool>($"{Module}.InnerChiller.EnableChiller") &&
  338. SC.GetValue<int>($"{Module}.InnerChiller.CommunicationType") == (int)CommunicationType.RS232)
  339. {
  340. if (SC.GetValue<int>($"{Module}.InnerChiller.MFG") == (int)ChillerMFG.SMC)
  341. {
  342. _InnerChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.InnerChiller}");
  343. }
  344. else if (SC.GetValue<int>($"{Module}.InnerChiller.MFG") == (int)ChillerMFG.AIRSYS)
  345. {
  346. _InnerChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.InnerChiller}");
  347. }
  348. }
  349. if (SC.GetValue<bool>($"{Module}.OuterChiller.EnableChiller") &&
  350. SC.GetValue<int>($"{Module}.OuterChiller.CommunicationType") == (int)CommunicationType.RS232)
  351. {
  352. if (SC.GetValue<int>($"{Module}.OuterChiller.MFG") == (int)ChillerMFG.SMC)
  353. {
  354. _OuterChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.OuterChiller}");
  355. }
  356. else if (SC.GetValue<int>($"{Module}.OuterChiller.MFG") == (int)ChillerMFG.AIRSYS)
  357. {
  358. _OuterChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.OuterChiller}");
  359. }
  360. }
  361. if (SC.GetValue<bool>($"{Module}.TopChiller.EnableChiller") &&
  362. SC.GetValue<int>($"{Module}.TopChiller.CommunicationType") == (int)CommunicationType.RS232)
  363. {
  364. if (SC.GetValue<int>($"{Module}.TopChiller.MFG") == (int)ChillerMFG.SMC)
  365. {
  366. _TopChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.TopChiller}");
  367. }
  368. else if (SC.GetValue<int>($"{Module}.TopChiller.MFG") == (int)ChillerMFG.AIRSYS)
  369. {
  370. _TopChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.TopChiller}");
  371. }
  372. }
  373. // RS223 AdTec Generator
  374. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  375. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  376. {
  377. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  378. }
  379. // Ethernet Comet Generator Bias
  380. if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  381. {
  382. if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  383. SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  384. {
  385. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  386. }
  387. else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  388. {
  389. _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  390. }
  391. }
  392. // RS232 AdTec match
  393. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  394. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  395. {
  396. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  397. }
  398. // Bias Match
  399. if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  400. SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  401. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  402. {
  403. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  404. }
  405. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  406. DATA.Subscribe($"{Module}.ChillerInnerTemp", () => _chillerInnerTemp);
  407. DATA.Subscribe($"{Module}.ChillerOuterTemp", () => _chillerOuterTemp);
  408. DATA.Subscribe($"{Module}.ChillerTopTemp", () => _chillerTopTemp);
  409. //DATA.Subscribe($"{Module}.InnerChiller.IsRunning", () => innerChillerIsRunning);
  410. //DATA.Subscribe($"{Module}.OuterChiller.IsRunning", () => outerChillerIsRunning);
  411. //DATA.Subscribe($"{Module}.TopChiller.IsRunning", () => topChillerIsRunning);
  412. //OP.Subscribe($"{Module}.HeatChiller", (cmd, args) => {
  413. // HeatChiller(ChillerType.InnerChiller, Convert.ToDouble(args[1]), Convert.ToDouble(args[2]));
  414. // return true;
  415. //});
  416. //OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) => {
  417. // //HeatChiller(ChillerType.InnerChiller, Convert.ToDouble(args[1]), Convert.ToDouble(args[2]));
  418. // OnOffChiller(ChillerType.InnerChiller, (bool)(args[1]));
  419. // return true;
  420. //});
  421. }
  422. #endregion
  423. public override void CloseValves()
  424. {
  425. _PVN21Valve.TurnValve(false, out _);
  426. // _PVN22Valve.TurnValve(false, out _);
  427. _PV11Valve.TurnValve(false, out _);
  428. _PV12Valve.TurnValve(false, out _);
  429. _PV21Valve.TurnValve(false, out _);
  430. _PV22Valve.TurnValve(false, out _);
  431. _PV31Valve.TurnValve(false, out _);
  432. _PV32Valve.TurnValve(false, out _);
  433. _PV41Valve.TurnValve(false, out _);
  434. _PV42Valve.TurnValve(false, out _);
  435. _PVHe1Valve.TurnValve(false, out _);
  436. _PVHe2Valve.TurnValve(false, out _);
  437. _GasFinalValve.TurnValve(false, out _);
  438. _SoftPumpValve.TurnValve(false, out _);
  439. _FastPumpValve.TurnValve(false, out _);
  440. _TurboPumpPumpingValve.TurnValve(false, out _);
  441. _TurboPumpPurgeValve.TurnValve(false, out _);
  442. _GuageValve.TurnValve(false, out _);
  443. _N2Valve.TurnValve(false, out _);
  444. _FastPumpValve.TurnValve(false, out _);
  445. _Mfc1Valve.TurnValve(false, out _);
  446. _Mfc2Valve.TurnValve(false, out _);
  447. _Mfc3Valve.TurnValve(false, out _);
  448. _Mfc4Valve.TurnValve(false, out _);
  449. _Mfc5Valve.TurnValve(false, out _);
  450. _Mfc6Valve.TurnValve(false, out _);
  451. _Mfc7Valve.TurnValve(false, out _);
  452. _Mfc8Valve.TurnValve(false, out _);
  453. foreach (var stick in _gasLines)
  454. {
  455. stick.Stop();
  456. }
  457. }
  458. public override void TurnDryPump(bool on)
  459. {
  460. //_pressureController.StartPump(on);
  461. _MainPump?.SetPumpOnOff(on);
  462. }
  463. public override void TurnTurboPump(bool on)
  464. {
  465. _TurboPump?.SetPumpOnOff(on);
  466. }
  467. public override void OpenValve(ValveType vlvType, bool on)
  468. {
  469. switch (vlvType)
  470. {
  471. case ValveType.PVN21:
  472. _PVN21Valve.TurnValve(on, out _);
  473. break;
  474. case ValveType.PVN22:
  475. _PVN22Valve.TurnValve(on, out _);
  476. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  477. break;
  478. case ValveType.PV11:
  479. _PV11Valve.TurnValve(on, out _);
  480. break;
  481. case ValveType.PV12:
  482. _PV12Valve.TurnValve(on, out _);
  483. break;
  484. case ValveType.PV21:
  485. _PV21Valve.TurnValve(on, out _);
  486. break;
  487. case ValveType.PV22:
  488. _PV22Valve.TurnValve(on, out _);
  489. break;
  490. case ValveType.PV31:
  491. _PV31Valve.TurnValve(on, out _);
  492. break;
  493. case ValveType.PV32:
  494. _PV32Valve.TurnValve(on, out _);
  495. break;
  496. case ValveType.PV41:
  497. _PV41Valve.TurnValve(on, out _);
  498. break;
  499. case ValveType.PV42:
  500. _PV42Valve.TurnValve(on, out _);
  501. break;
  502. case ValveType.N2:
  503. _N2Valve.TurnValve(on, out _);
  504. break;
  505. case ValveType.PVHe1:
  506. _PVHe1Valve.TurnValve(on, out _);
  507. break;
  508. case ValveType.PVHe2:
  509. _PVHe2Valve.TurnValve(on, out _);
  510. break;
  511. case ValveType.GasFinal:
  512. _GasFinalValve.TurnValve(on, out _);
  513. break;
  514. case ValveType.SoftPump:
  515. _SoftPumpValve.TurnValve(on, out _);
  516. break;
  517. case ValveType.FastPump:
  518. _FastPumpValve.TurnValve(on, out _);
  519. break;
  520. case ValveType.TurboPumpPumping:
  521. _TurboPumpPumpingValve.TurnValve(on, out _);
  522. break;
  523. case ValveType.TurboPumpPurge:
  524. _TurboPumpPurgeValve.TurnValve(on, out _);
  525. break;
  526. case ValveType.Guage:
  527. _GuageValve.TurnValve(on, out _);
  528. break;
  529. case ValveType.LoadlockVent:
  530. _LoadlockVentValve.TurnValve(on, out _);
  531. break;
  532. case ValveType.LoadlockPumping:
  533. _LoadlockPumpingValve.TurnValve(on, out _);
  534. break;
  535. case ValveType.Mfc1:
  536. _Mfc1Valve.TurnValve(on, out _);
  537. break;
  538. case ValveType.Mfc2:
  539. _Mfc2Valve.TurnValve(on, out _);
  540. break;
  541. case ValveType.Mfc3:
  542. _Mfc3Valve.TurnValve(on, out _);
  543. break;
  544. case ValveType.Mfc4:
  545. _Mfc4Valve.TurnValve(on, out _);
  546. break;
  547. case ValveType.Mfc5:
  548. _Mfc5Valve.TurnValve(on, out _);
  549. break;
  550. case ValveType.Mfc6:
  551. _Mfc6Valve.TurnValve(on, out _);
  552. break;
  553. case ValveType.Mfc7:
  554. _Mfc7Valve.TurnValve(on, out _);
  555. break;
  556. case ValveType.Mfc8:
  557. _Mfc8Valve.TurnValve(on, out _);
  558. break;
  559. default:
  560. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  561. }
  562. }
  563. public override void Monitor()
  564. {
  565. foreach (var gas in _gasLines)
  566. {
  567. gas.Monitor();
  568. }
  569. CheckPermanentInterlock();
  570. }
  571. protected override void CheckPermanentInterlock()
  572. {
  573. var isOnline= DATA.Poll(Module.ToString(), "IsOnline");
  574. if (isOnline==null)
  575. {
  576. return;
  577. }
  578. if (Convert.ToBoolean(isOnline) == false)
  579. {
  580. if (ProcessLowPressure > 95 && _GuageValve.SetPoint)
  581. {
  582. _GuageValve.TurnValve(false, out _);
  583. //LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Low pressure:{ProcessPressure} > 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  584. }
  585. }
  586. else
  587. {
  588. if (ProcessLowPressure > 95 && _GuageValve.SetPoint)
  589. {
  590. _GuageValve.TurnValve(false, out _);
  591. //LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Low pressure:{ProcessPressure} > 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  592. }
  593. if (ProcessHighPressure < 95 && _GuageValve.SetPoint == false)
  594. {
  595. _GuageValve.TurnValve(true, out _);
  596. //LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"High pressure:{ProcessPressure} < 100 mtorr, Guage Valve (DO-31) open automaticlly.");
  597. }
  598. }
  599. }
  600. public override void CheckIdleInterlock()
  601. {
  602. if (ForelinePressure > _foreline_interlock_pressure)
  603. {
  604. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  605. {
  606. _pendulumValve.TurnValve(false);
  607. _TurboPumpPurgeValve.TurnValve(false, out _);
  608. _TurboPumpPumpingValve.TurnValve(false, out _);
  609. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  610. }
  611. }
  612. }
  613. public override void BuzzerBlinking(double time)
  614. {
  615. _SignalTower.BuzzerBlinking(time);
  616. }
  617. public override void SwitchOnBuzzerAndRed()
  618. {
  619. _SignalTower.SwitchOnBuzzerAndRed("", null);
  620. }
  621. public override void Home()
  622. {
  623. // 与yp讨论过,PM 初始化不需要
  624. SetLiftPin(MovementPosition.Down, out _);
  625. if (_slitDoor.State == CylinderState.Open)
  626. {
  627. SetSlitDoor(true, out _);
  628. }
  629. else
  630. {
  631. SetSlitDoor(false, out _);
  632. }
  633. SetSlitDoor(false, out _);
  634. //2023/03/08添加
  635. OpenValve(ValveType.PVN22, true);
  636. //2023/04/25临时添加
  637. //RetractWafer();
  638. }
  639. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  640. {
  641. reason = string.Empty;
  642. switch (dirt)
  643. {
  644. case MovementPosition.Down:
  645. return _LiftPin.SetCylinder(false, out reason);
  646. case MovementPosition.Up:
  647. return _LiftPin.SetCylinder(true, out reason);
  648. case MovementPosition.Left:
  649. case MovementPosition.Right:
  650. case MovementPosition.Middle:
  651. throw new ArgumentException("Movement argument error");
  652. }
  653. return true;
  654. }
  655. public override bool SetSlitDoor(bool open, out string reason)
  656. {
  657. if (open)
  658. {
  659. if (RouteManager.IsATMMode)
  660. {
  661. if (!IsATM)
  662. {
  663. reason = $"{Module} is not ATM, can not open slit door";
  664. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  665. return false;
  666. }
  667. if (!IsTMATM)
  668. {
  669. reason = $"LoadLock is not ATM, can not open slit door";
  670. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  671. return false;
  672. }
  673. }
  674. else
  675. {
  676. double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  677. if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  678. {
  679. reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  680. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  681. return false;
  682. }
  683. }
  684. }
  685. return _slitDoor.SetCylinder(open, out reason);
  686. }
  687. public override bool RetractWafer()
  688. {
  689. return _LoadLockArm.SetCylinder(false, out _);
  690. }
  691. public override bool ExtendWafer()
  692. {
  693. return _LoadLockArm.SetCylinder(true, out _);
  694. }
  695. public override bool FlowGas(int gasNum, double val)
  696. {
  697. if (_gasLines.Length <= gasNum)
  698. return false;
  699. _gasLines[gasNum].Flow(val);
  700. return true;
  701. }
  702. public override bool StopGas(int gasNum)
  703. {
  704. if (_gasLines.Length <= gasNum)
  705. return false;
  706. _gasLines[gasNum].Stop();
  707. return true;
  708. }
  709. public override bool FlowN2(double val)
  710. {
  711. _gasLineN2.Flow(val);
  712. return true;
  713. }
  714. public override bool StopN2()
  715. {
  716. _gasLineN2.Stop();
  717. return true;
  718. }
  719. public override void StopAllGases()
  720. {
  721. foreach (var line in _gasLines)
  722. {
  723. line.Stop();
  724. }
  725. }
  726. public override bool TurnPendulumValve(bool on)
  727. {
  728. return _pendulumValve.TurnValve(on);
  729. }
  730. public override bool SetPVPressure(int pressure)
  731. {
  732. return _pendulumValve.SetPressure(pressure);
  733. }
  734. public override bool SetPVPostion(int position)
  735. {
  736. return _pendulumValve.SetPosition(position);
  737. }
  738. public override int GetPVPosition()
  739. {
  740. return _pendulumValve.Position;
  741. }
  742. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  743. {
  744. switch (chillerType)
  745. {
  746. case ChillerType.Chiller:
  747. _Chiller?.SetChillerTemp((float)value, (float)offset);
  748. await Task.Delay(1000);
  749. _Chiller?.SetChillerOnOff(true);
  750. break;
  751. case ChillerType.InnerChiller:
  752. _InnerChiller?.SetChillerTemp((float)value, (float)offset);
  753. await Task.Delay(1000);
  754. _InnerChiller?.SetChillerOnOff(true);
  755. break;
  756. case ChillerType.OuterChiller:
  757. _OuterChiller?.SetChillerTemp((float)value, (float)offset);
  758. await Task.Delay(1000);
  759. _OuterChiller?.SetChillerOnOff(true);
  760. break;
  761. case ChillerType.TopChiller:
  762. _TopChiller?.SetChillerTemp((float)value, (float)offset);
  763. await Task.Delay(1000);
  764. _TopChiller?.SetChillerOnOff(true);
  765. break;
  766. }
  767. }
  768. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  769. {
  770. switch (chillerType)
  771. {
  772. case ChillerType.Chiller:
  773. _Chiller?.SetChillerOnOff(onoff);
  774. break;
  775. case ChillerType.InnerChiller:
  776. _InnerChiller?.SetChillerOnOff(onoff);
  777. break;
  778. case ChillerType.OuterChiller:
  779. _OuterChiller?.SetChillerOnOff(onoff);
  780. break;
  781. case ChillerType.TopChiller:
  782. _TopChiller?.SetChillerOnOff(onoff);
  783. break;
  784. }
  785. }
  786. public override bool CheckChillerStatus()
  787. {
  788. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  789. }
  790. public override void SetGeneratorCommunicationMode(int mode)
  791. {
  792. _Generator?.SetCommunicationMode(mode);
  793. }
  794. public override bool GeneratorPowerOn(bool on)
  795. {
  796. if (_Generator == null) return false;
  797. if (on && !IsRFGInterlockOn)
  798. {
  799. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  800. return false;
  801. }
  802. return _Generator.SetPowerOnOff(on, out _);
  803. }
  804. public override bool GeneratorSetpower(float val)
  805. {
  806. if (_Generator == null) return false;
  807. if (Math.Abs(val) > 0.01)
  808. _Generator.SetPower((ushort)val);
  809. return true;
  810. }
  811. public override bool GeneratorBiasPowerOn(bool on)
  812. {
  813. if (_GeneratorBias == null) return false;
  814. if (on && !IsRFGInterlockOn)
  815. {
  816. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  817. return false;
  818. }
  819. return _GeneratorBias.SetPowerOnOff(on, out _);
  820. }
  821. public override bool GeneratorBiasSetpower(float val)
  822. {
  823. if (_GeneratorBias == null) return false;
  824. if (Math.Abs(val) > 0.01)
  825. _GeneratorBias.SetPower((ushort)val);
  826. return true;
  827. }
  828. public override bool OnOffSetESCHV(bool val)
  829. {
  830. return _ESCHV.SetPowerOnOff(val);
  831. }
  832. public override bool SetWallTCTemperature(float value)
  833. {
  834. return _WallTC.RampTemp(value);
  835. }
  836. public override bool GeneratorBiasSetMatchMode(bool val)
  837. {
  838. if (_GeneratorBias == null) return false;
  839. string reason = string.Empty;
  840. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  841. return true;
  842. }
  843. public override bool SetMatchPosition(float c1, float c2)
  844. {
  845. if (_Match == null) return false;
  846. string reason = string.Empty;
  847. _Match.SetMatchPosition(c1, c2, out reason);
  848. return true;
  849. }
  850. public override bool SetBiasMatchPosition(float c1, float c2)
  851. {
  852. if (_BiasMatch == null) return false;
  853. string reason = string.Empty;
  854. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  855. return true;
  856. }
  857. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  858. {
  859. if (_BiasMatch == null) return false;
  860. if (matchWorkMode == MatchWorkMode.Auto)
  861. {
  862. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  863. }
  864. else if (matchWorkMode == MatchWorkMode.Manual)
  865. {
  866. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  867. }
  868. return false;
  869. }
  870. public override bool SetBiasPulseMode(bool on)
  871. {
  872. if (_GeneratorBias == null) return false;
  873. _GeneratorBias.SetPulseMode(on);
  874. return true;
  875. }
  876. public override bool SetBiasPulseRateFreq(int nFreq)
  877. {
  878. if (_GeneratorBias == null) return false;
  879. _GeneratorBias.SetPulseRateFreq(nFreq);
  880. return true;
  881. }
  882. public override bool SetDiasPulseDutyCycle(int percentage)
  883. {
  884. if (_GeneratorBias == null) return false;
  885. _GeneratorBias.SetPulseDutyCycle(percentage);
  886. return true;
  887. }
  888. public override bool SetESCClampVoltage(int nVoltage)
  889. {
  890. if (_ESCHV == null) return false;
  891. return _ESCHV.SetOutputVoltage(nVoltage);
  892. }
  893. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  894. {
  895. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  896. if (!PMLidClosed)
  897. {
  898. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  899. return false;
  900. }
  901. if (!IsVAC)
  902. {
  903. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  904. return false;
  905. }
  906. if (!IsWaterFlowOk)
  907. {
  908. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  909. return false;
  910. }
  911. if (!IsRFGInterlockOn)
  912. {
  913. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  914. return false;
  915. }
  916. if (!SourceRFFanInterlock)
  917. {
  918. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  919. return false;
  920. }
  921. if (!SlitDoorClosed)
  922. {
  923. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  924. return false;
  925. }
  926. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  927. {
  928. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  929. return false;
  930. }
  931. return true;
  932. }
  933. public override void SetBacksideHeFlow(double flow)
  934. {
  935. if (_backsideHe == null) return;
  936. _backsideHe.Flow(flow);
  937. }
  938. public override bool SetBacksideHePressure(float mTorr)
  939. {
  940. if (_backsideHe == null) return false;
  941. return _backsideHe.SetBacksideHelium(mTorr);
  942. }
  943. public override bool SetBacksideHeThreshold(int nMin, int nMax)
  944. {
  945. if (_backsideHe == null) return false;
  946. return _backsideHe.SetFlowThreshold(nMin, nMax);
  947. }
  948. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  949. {
  950. OpenValve(ValveType.GasFinal, true);
  951. FlowGas(5, flowSetpoint);
  952. TurnPendulumValve(true);
  953. SetPVPressure(pressureSetpoint);
  954. return true;
  955. }
  956. public override bool AbortControlPressure()
  957. {
  958. OpenValve(ValveType.GasFinal, false);
  959. FlowGas(5, 0);
  960. return true;
  961. }
  962. public override bool PreparePlace()
  963. {
  964. if (!SetSlitDoor(true, out string reason))
  965. {
  966. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  967. return false;
  968. }
  969. if (!SetLiftPin(MovementPosition.Down, out reason))
  970. {
  971. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  972. return false;
  973. }
  974. return true;
  975. }
  976. public override bool PreparePick()
  977. {
  978. if (!SetSlitDoor(true, out string reason))
  979. {
  980. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  981. return false;
  982. }
  983. if (!SetLiftPin(MovementPosition.Up, out reason))
  984. {
  985. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  986. return false;
  987. }
  988. return true;
  989. }
  990. public override bool PreparePlaceIsOK()
  991. {
  992. return CheckSlitDoorOpen() && LiftPinIsDown;
  993. }
  994. public override bool PreparePickIsOK()
  995. {
  996. return CheckSlitDoorOpen() && LiftPinIsUp;
  997. }
  998. public override bool EndPlace()
  999. {
  1000. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1001. {
  1002. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1003. return false;
  1004. }
  1005. if (!SetSlitDoor(false, out reason))
  1006. {
  1007. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1008. return false;
  1009. }
  1010. return true;
  1011. }
  1012. public override bool EndPick()
  1013. {
  1014. if (!SetSlitDoor(false, out string reason))
  1015. {
  1016. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1017. return false;
  1018. }
  1019. return true;
  1020. }
  1021. public override bool EndPlaceIsOK()
  1022. {
  1023. return CheckSlitDoorClose() && LiftPinIsDown;
  1024. }
  1025. public override bool EndPickIsOK()
  1026. {
  1027. return CheckSlitDoorClose();
  1028. }
  1029. }
  1030. }