JetKepler2300PM.cs 48 KB

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