JetKepler2300PM.cs 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  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 float ForwardPower => _Generator.ForwardPower;
  175. public override float BiasForwardPower => _GeneratorBias.ForwardPower;
  176. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  177. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  178. public override float RFMatchC2 => _Match != null ? _Match.TunePosition2 : 0;
  179. public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  180. public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  181. public new ModuleName Module { get; }
  182. public override MovementPosition LiftPinPosition
  183. {
  184. get
  185. {
  186. MovementPosition pos = MovementPosition.Unknown;
  187. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  188. {
  189. pos = MovementPosition.Up;
  190. }
  191. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  192. {
  193. pos = MovementPosition.Down;
  194. }
  195. return pos;
  196. }
  197. }
  198. public override bool CheckAtm()
  199. {
  200. return _ATM_sw.Value && ChamberPressure > 700000;
  201. }
  202. public override bool CheckSlitDoorOpen()
  203. {
  204. return _slitDoor.State == CylinderState.Open;
  205. }
  206. public override bool CheckSlitDoorClose()
  207. {
  208. return _slitDoor.State == CylinderState.Close;
  209. }
  210. public override bool CheckLiftUp()
  211. {
  212. return _LiftPin.State == CylinderState.Open;
  213. }
  214. public override bool CheckLiftDown()
  215. {
  216. return _LiftPin.State == CylinderState.Close;
  217. }
  218. public override double TotalGasSetpoint
  219. {
  220. get
  221. {
  222. double sum = 0;
  223. foreach (var gas in _gasLines)
  224. {
  225. sum += gas.FlowSP;
  226. }
  227. return sum;
  228. }
  229. }
  230. public override bool HasGasOutOfRange
  231. {
  232. get
  233. {
  234. foreach (var gas in _gasLines)
  235. {
  236. if (!gas.IsOutOfRange)
  237. return false;
  238. }
  239. return true;
  240. }
  241. }
  242. public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
  243. public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
  244. public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
  245. public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
  246. public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
  247. public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
  248. public override double MFC7FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas7").FeedBack;
  249. public override double MFC8FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas8").FeedBack;
  250. public override bool PendulumValveIsOpen()
  251. {
  252. return _pendulumValve.IsOpen;
  253. }
  254. #region 构造函数
  255. public JetKepler2300PM(ModuleName moduleName) : base(moduleName)
  256. {
  257. Module = moduleName;
  258. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  259. _LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  260. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  261. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  262. _LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  263. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  264. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  265. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  266. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  267. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  268. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  269. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  270. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  271. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  272. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  273. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  274. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  275. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  276. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  277. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  278. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  279. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  280. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  281. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  282. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  283. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  284. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  285. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  286. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  287. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  288. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  289. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  290. _LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  291. _LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  292. _heMfc = DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe");
  293. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  294. _ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  295. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  296. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  297. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  298. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  299. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  300. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  301. _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  302. _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
  303. _PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  304. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  305. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  306. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  307. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  308. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  309. _SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  310. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  311. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  312. _gasLines = new IoGasStick[8];
  313. for (int index = 0; index < 8; index++)
  314. {
  315. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  316. }
  317. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  318. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  319. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  320. // RS232 Dry pump, SKY
  321. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  322. {
  323. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  324. {
  325. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  326. }
  327. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  328. {
  329. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  330. }
  331. }
  332. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  333. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  334. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  335. if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  336. SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  337. {
  338. if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  339. {
  340. _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  341. }
  342. else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  343. {
  344. _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  345. }
  346. }
  347. if (SC.GetValue<bool>($"{Module}.InnerChiller.EnableChiller") &&
  348. SC.GetValue<int>($"{Module}.InnerChiller.CommunicationType") == (int)CommunicationType.RS232)
  349. {
  350. if (SC.GetValue<int>($"{Module}.InnerChiller.MFG") == (int)ChillerMFG.SMC)
  351. {
  352. _InnerChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.InnerChiller}");
  353. }
  354. else if (SC.GetValue<int>($"{Module}.InnerChiller.MFG") == (int)ChillerMFG.AIRSYS)
  355. {
  356. _InnerChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.InnerChiller}");
  357. }
  358. }
  359. if (SC.GetValue<bool>($"{Module}.OuterChiller.EnableChiller") &&
  360. SC.GetValue<int>($"{Module}.OuterChiller.CommunicationType") == (int)CommunicationType.RS232)
  361. {
  362. if (SC.GetValue<int>($"{Module}.OuterChiller.MFG") == (int)ChillerMFG.SMC)
  363. {
  364. _OuterChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.OuterChiller}");
  365. }
  366. else if (SC.GetValue<int>($"{Module}.OuterChiller.MFG") == (int)ChillerMFG.AIRSYS)
  367. {
  368. _OuterChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.OuterChiller}");
  369. }
  370. }
  371. if (SC.GetValue<bool>($"{Module}.TopChiller.EnableChiller") &&
  372. SC.GetValue<int>($"{Module}.TopChiller.CommunicationType") == (int)CommunicationType.RS232)
  373. {
  374. if (SC.GetValue<int>($"{Module}.TopChiller.MFG") == (int)ChillerMFG.SMC)
  375. {
  376. _TopChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.TopChiller}");
  377. }
  378. else if (SC.GetValue<int>($"{Module}.TopChiller.MFG") == (int)ChillerMFG.AIRSYS)
  379. {
  380. _TopChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.TopChiller}");
  381. }
  382. }
  383. // RS223 AdTec Generator
  384. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  385. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  386. {
  387. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  388. }
  389. // Ethernet Comet Generator Bias
  390. if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  391. {
  392. if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  393. SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  394. {
  395. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  396. }
  397. else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  398. {
  399. _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  400. }
  401. }
  402. // RS232 AdTec match
  403. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  404. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  405. {
  406. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  407. }
  408. // Bias Match
  409. if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  410. SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  411. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  412. {
  413. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  414. }
  415. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  416. DATA.Subscribe($"{Module}.ChillerInnerTemp", () => _chillerInnerTemp);
  417. DATA.Subscribe($"{Module}.ChillerOuterTemp", () => _chillerOuterTemp);
  418. DATA.Subscribe($"{Module}.ChillerTopTemp", () => _chillerTopTemp);
  419. //DATA.Subscribe($"{Module}.InnerChiller.IsRunning", () => innerChillerIsRunning);
  420. //DATA.Subscribe($"{Module}.OuterChiller.IsRunning", () => outerChillerIsRunning);
  421. //DATA.Subscribe($"{Module}.TopChiller.IsRunning", () => topChillerIsRunning);
  422. //OP.Subscribe($"{Module}.HeatChiller", (cmd, args) => {
  423. // HeatChiller(ChillerType.InnerChiller, Convert.ToDouble(args[1]), Convert.ToDouble(args[2]));
  424. // return true;
  425. //});
  426. //OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) => {
  427. // //HeatChiller(ChillerType.InnerChiller, Convert.ToDouble(args[1]), Convert.ToDouble(args[2]));
  428. // OnOffChiller(ChillerType.InnerChiller, (bool)(args[1]));
  429. // return true;
  430. //});
  431. }
  432. #endregion
  433. public async override void CloseValves()
  434. {
  435. _PVN21Valve.TurnValve(false, out _);
  436. // _PVN22Valve.TurnValve(false, out _);
  437. _PV11Valve.TurnValve(false, out _);
  438. _PV12Valve.TurnValve(false, out _);
  439. _PV21Valve.TurnValve(false, out _);
  440. _PV22Valve.TurnValve(false, out _);
  441. _PV31Valve.TurnValve(false, out _);
  442. _PV32Valve.TurnValve(false, out _);
  443. _PV41Valve.TurnValve(false, out _);
  444. _PV42Valve.TurnValve(false, out _);
  445. _PVHe1Valve.TurnValve(false, out _);
  446. _PVHe2Valve.TurnValve(false, out _);
  447. _SoftPumpValve.TurnValve(false, out _);
  448. _FastPumpValve.TurnValve(false, out _);
  449. _TurboPumpPumpingValve.TurnValve(false, out _);
  450. _TurboPumpPurgeValve.TurnValve(false, out _);
  451. _GuageValve.TurnValve(false, out _);
  452. _N2Valve.TurnValve(false, out _);
  453. _FastPumpValve.TurnValve(false, out _);
  454. _Mfc1Valve.TurnValve(false, out _);
  455. _Mfc2Valve.TurnValve(false, out _);
  456. _Mfc3Valve.TurnValve(false, out _);
  457. _Mfc4Valve.TurnValve(false, out _);
  458. _Mfc5Valve.TurnValve(false, out _);
  459. _Mfc6Valve.TurnValve(false, out _);
  460. _Mfc7Valve.TurnValve(false, out _);
  461. _Mfc8Valve.TurnValve(false, out _);
  462. foreach (var stick in _gasLines)
  463. {
  464. stick.Stop();
  465. }
  466. await Task.Delay(1000);
  467. _GasFinalValve.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. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  488. break;
  489. case ValveType.PV11:
  490. _PV11Valve.TurnValve(on, out _);
  491. break;
  492. case ValveType.PV12:
  493. _PV12Valve.TurnValve(on, out _);
  494. break;
  495. case ValveType.PV21:
  496. _PV21Valve.TurnValve(on, out _);
  497. break;
  498. case ValveType.PV22:
  499. _PV22Valve.TurnValve(on, out _);
  500. break;
  501. case ValveType.PV31:
  502. _PV31Valve.TurnValve(on, out _);
  503. break;
  504. case ValveType.PV32:
  505. _PV32Valve.TurnValve(on, out _);
  506. break;
  507. case ValveType.PV41:
  508. _PV41Valve.TurnValve(on, out _);
  509. break;
  510. case ValveType.PV42:
  511. _PV42Valve.TurnValve(on, out _);
  512. break;
  513. case ValveType.N2:
  514. _N2Valve.TurnValve(on, out _);
  515. break;
  516. case ValveType.PVHe1:
  517. _PVHe1Valve.TurnValve(on, out _);
  518. break;
  519. case ValveType.PVHe2:
  520. _PVHe2Valve.TurnValve(on, out _);
  521. break;
  522. case ValveType.GasFinal:
  523. _GasFinalValve.TurnValve(on, out _);
  524. break;
  525. case ValveType.SoftPump:
  526. _SoftPumpValve.TurnValve(on, out _);
  527. break;
  528. case ValveType.FastPump:
  529. _FastPumpValve.TurnValve(on, out _);
  530. break;
  531. case ValveType.TurboPumpPumping:
  532. _TurboPumpPumpingValve.TurnValve(on, out _);
  533. break;
  534. case ValveType.TurboPumpPurge:
  535. _TurboPumpPurgeValve.TurnValve(on, out _);
  536. break;
  537. case ValveType.Guage:
  538. _GuageValve.TurnValve(on, out _);
  539. break;
  540. case ValveType.LoadlockVent:
  541. _LoadlockVentValve.TurnValve(on, out _);
  542. break;
  543. case ValveType.LoadlockPumping:
  544. _LoadlockPumpingValve.TurnValve(on, out _);
  545. break;
  546. case ValveType.Mfc1:
  547. _Mfc1Valve.TurnValve(on, out _);
  548. break;
  549. case ValveType.Mfc2:
  550. _Mfc2Valve.TurnValve(on, out _);
  551. break;
  552. case ValveType.Mfc3:
  553. _Mfc3Valve.TurnValve(on, out _);
  554. break;
  555. case ValveType.Mfc4:
  556. _Mfc4Valve.TurnValve(on, out _);
  557. break;
  558. case ValveType.Mfc5:
  559. _Mfc5Valve.TurnValve(on, out _);
  560. break;
  561. case ValveType.Mfc6:
  562. _Mfc6Valve.TurnValve(on, out _);
  563. break;
  564. case ValveType.Mfc7:
  565. _Mfc7Valve.TurnValve(on, out _);
  566. break;
  567. case ValveType.Mfc8:
  568. _Mfc8Valve.TurnValve(on, out _);
  569. break;
  570. default:
  571. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  572. }
  573. }
  574. public override void Monitor()
  575. {
  576. foreach (var gas in _gasLines)
  577. {
  578. gas.Monitor();
  579. }
  580. CheckPermanentInterlock();
  581. }
  582. protected override void CheckPermanentInterlock()
  583. {
  584. var isOnline= DATA.Poll(Module.ToString(), "IsOnline");
  585. if (isOnline==null)
  586. {
  587. return;
  588. }
  589. if (Convert.ToBoolean(isOnline) == false)
  590. {
  591. if (ProcessLowPressure > 95 && _GuageValve.SetPoint)
  592. {
  593. _GuageValve.TurnValve(false, out _);
  594. //LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Low pressure:{ProcessPressure} > 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  595. }
  596. }
  597. else
  598. {
  599. if (ProcessLowPressure > 95 && _GuageValve.SetPoint)
  600. {
  601. _GuageValve.TurnValve(false, out _);
  602. //LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Low pressure:{ProcessPressure} > 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  603. }
  604. if (ProcessHighPressure < 95 && _GuageValve.SetPoint == false)
  605. {
  606. _GuageValve.TurnValve(true, out _);
  607. //LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"High pressure:{ProcessPressure} < 100 mtorr, Guage Valve (DO-31) open automaticlly.");
  608. }
  609. }
  610. }
  611. public override void CheckIdleInterlock()
  612. {
  613. if (ForelinePressure > _foreline_interlock_pressure)
  614. {
  615. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  616. {
  617. _pendulumValve.TurnValve(false);
  618. _TurboPumpPurgeValve.TurnValve(false, out _);
  619. _TurboPumpPumpingValve.TurnValve(false, out _);
  620. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  621. }
  622. }
  623. }
  624. public override void BuzzerBlinking(double time)
  625. {
  626. _SignalTower.BuzzerBlinking(time);
  627. }
  628. public override void SwitchOnBuzzerAndRed()
  629. {
  630. _SignalTower.SwitchOnBuzzerAndRed("", null);
  631. }
  632. public override void Home()
  633. {
  634. // 与yp讨论过,PM 初始化不需要
  635. SetLiftPin(MovementPosition.Down, out _);
  636. if (_slitDoor.State == CylinderState.Open)
  637. {
  638. SetSlitDoor(true, out _);
  639. }
  640. else
  641. {
  642. SetSlitDoor(false, out _);
  643. }
  644. SetSlitDoor(false, out _);
  645. //2023/03/08添加
  646. OpenValve(ValveType.PVN22, true);
  647. //2023/04/25临时添加
  648. //RetractWafer();
  649. }
  650. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  651. {
  652. reason = string.Empty;
  653. switch (dirt)
  654. {
  655. case MovementPosition.Down:
  656. return _LiftPin.SetCylinder(false, out reason);
  657. case MovementPosition.Up:
  658. return _LiftPin.SetCylinder(true, out reason);
  659. case MovementPosition.Left:
  660. case MovementPosition.Right:
  661. case MovementPosition.Middle:
  662. throw new ArgumentException("Movement argument error");
  663. }
  664. return true;
  665. }
  666. public override bool SetSlitDoor(bool open, out string reason)
  667. {
  668. if (open)
  669. {
  670. if (RouteManager.IsATMMode)
  671. {
  672. if (!IsATM)
  673. {
  674. reason = $"{Module} is not ATM, can not open slit door";
  675. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  676. return false;
  677. }
  678. if (!IsTMATM)
  679. {
  680. reason = $"LoadLock is not ATM, can not open slit door";
  681. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  682. return false;
  683. }
  684. }
  685. else
  686. {
  687. double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  688. if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  689. {
  690. reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  691. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  692. return false;
  693. }
  694. }
  695. }
  696. return _slitDoor.SetCylinder(open, out reason);
  697. }
  698. public override bool RetractWafer()
  699. {
  700. return _LoadLockArm.SetCylinder(false, out _);
  701. }
  702. public override bool ExtendWafer()
  703. {
  704. return _LoadLockArm.SetCylinder(true, out _);
  705. }
  706. public override bool FlowGas(int gasNum, double val)
  707. {
  708. if (_gasLines.Length <= gasNum)
  709. return false;
  710. _gasLines[gasNum].Flow(val);
  711. return true;
  712. }
  713. public override bool StopGas(int gasNum)
  714. {
  715. if (_gasLines.Length <= gasNum)
  716. return false;
  717. _gasLines[gasNum].Stop();
  718. return true;
  719. }
  720. public override bool FlowN2(double val)
  721. {
  722. _gasLineN2.Flow(val);
  723. return true;
  724. }
  725. public override bool StopN2()
  726. {
  727. _gasLineN2.Stop();
  728. return true;
  729. }
  730. public override void StopAllGases()
  731. {
  732. foreach (var line in _gasLines)
  733. {
  734. line.Stop();
  735. }
  736. }
  737. public override bool TurnPendulumValve(bool on)
  738. {
  739. return _pendulumValve.TurnValve(on);
  740. }
  741. public override bool SetPVPressure(int pressure)
  742. {
  743. return _pendulumValve.SetPressure(pressure);
  744. }
  745. public override bool SetPVPostion(int position)
  746. {
  747. return _pendulumValve.SetPosition(position);
  748. }
  749. public override int GetPVPosition()
  750. {
  751. return _pendulumValve.Position;
  752. }
  753. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  754. {
  755. switch (chillerType)
  756. {
  757. case ChillerType.Chiller:
  758. _Chiller?.SetChillerTemp((float)value, (float)offset);
  759. await Task.Delay(1000);
  760. _Chiller?.SetChillerOnOff(true);
  761. break;
  762. case ChillerType.InnerChiller:
  763. _InnerChiller?.SetChillerTemp((float)value, (float)offset);
  764. await Task.Delay(1000);
  765. _InnerChiller?.SetChillerOnOff(true);
  766. break;
  767. case ChillerType.OuterChiller:
  768. _OuterChiller?.SetChillerTemp((float)value, (float)offset);
  769. await Task.Delay(1000);
  770. _OuterChiller?.SetChillerOnOff(true);
  771. break;
  772. case ChillerType.TopChiller:
  773. _TopChiller?.SetChillerTemp((float)value, (float)offset);
  774. await Task.Delay(1000);
  775. _TopChiller?.SetChillerOnOff(true);
  776. break;
  777. }
  778. }
  779. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  780. {
  781. switch (chillerType)
  782. {
  783. case ChillerType.Chiller:
  784. _Chiller?.SetChillerOnOff(onoff);
  785. break;
  786. case ChillerType.InnerChiller:
  787. _InnerChiller?.SetChillerOnOff(onoff);
  788. break;
  789. case ChillerType.OuterChiller:
  790. _OuterChiller?.SetChillerOnOff(onoff);
  791. break;
  792. case ChillerType.TopChiller:
  793. _TopChiller?.SetChillerOnOff(onoff);
  794. break;
  795. }
  796. }
  797. public override bool CheckChillerStatus()
  798. {
  799. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  800. }
  801. public override void SetGeneratorCommunicationMode(int mode)
  802. {
  803. _Generator?.SetCommunicationMode(mode);
  804. }
  805. public override bool GeneratorPowerOn(bool on)
  806. {
  807. if (_Generator == null) return false;
  808. if (on && !IsRFGInterlockOn)
  809. {
  810. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  811. return false;
  812. }
  813. return _Generator.SetPowerOnOff(on, out _);
  814. }
  815. public override bool GeneratorSetpower(float val)
  816. {
  817. if (_Generator == null) return false;
  818. if (Math.Abs(val) > 0.01)
  819. _Generator.SetPower((ushort)val);
  820. return true;
  821. }
  822. public override bool GeneratorBiasPowerOn(bool on)
  823. {
  824. if (_GeneratorBias == null) return false;
  825. if (on && !IsRFGInterlockOn)
  826. {
  827. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  828. return false;
  829. }
  830. return _GeneratorBias.SetPowerOnOff(on, out _);
  831. }
  832. public override bool GeneratorBiasSetpower(float val)
  833. {
  834. if (_GeneratorBias == null) return false;
  835. if (Math.Abs(val) > 0.01)
  836. _GeneratorBias.SetPower((ushort)val);
  837. return true;
  838. }
  839. public override bool OnOffSetESCHV(bool val)
  840. {
  841. return _ESCHV.SetPowerOnOff(val);
  842. }
  843. public override bool SetWallTCTemperature(float value)
  844. {
  845. return _WallTC.RampTemp(value);
  846. }
  847. public override bool GeneratorBiasSetMatchMode(bool val)
  848. {
  849. if (_GeneratorBias == null) return false;
  850. string reason = string.Empty;
  851. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  852. return true;
  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 SetBiasMatchPosition(float c1, float c2)
  875. {
  876. if (_BiasMatch == null) return false;
  877. string reason = string.Empty;
  878. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  879. return true;
  880. }
  881. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  882. {
  883. if (_BiasMatch == null) return false;
  884. if (matchWorkMode == MatchWorkMode.Auto)
  885. {
  886. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  887. }
  888. else if (matchWorkMode == MatchWorkMode.Manual)
  889. {
  890. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  891. }
  892. return false;
  893. }
  894. public override bool SetBiasPulseMode(bool on)
  895. {
  896. if (_GeneratorBias == null) return false;
  897. _GeneratorBias.SetPulseMode(on);
  898. return true;
  899. }
  900. public override bool SetBiasPulseRateFreq(int nFreq)
  901. {
  902. if (_GeneratorBias == null) return false;
  903. _GeneratorBias.SetPulseRateFreq(nFreq);
  904. return true;
  905. }
  906. public override bool SetDiasPulseDutyCycle(int percentage)
  907. {
  908. if (_GeneratorBias == null) return false;
  909. _GeneratorBias.SetPulseDutyCycle(percentage);
  910. return true;
  911. }
  912. public override bool SetESCClampVoltage(int nVoltage)
  913. {
  914. if (_ESCHV == null) return false;
  915. return _ESCHV.SetOutputVoltage(nVoltage);
  916. }
  917. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  918. {
  919. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  920. if (!PMLidClosed)
  921. {
  922. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  923. return false;
  924. }
  925. if (!IsVAC)
  926. {
  927. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  928. return false;
  929. }
  930. if (!IsWaterFlowOk)
  931. {
  932. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  933. return false;
  934. }
  935. if (!IsRFGInterlockOn)
  936. {
  937. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  938. return false;
  939. }
  940. if (!SourceRFFanInterlock)
  941. {
  942. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  943. return false;
  944. }
  945. if (!SlitDoorClosed)
  946. {
  947. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  948. return false;
  949. }
  950. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  951. {
  952. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  953. return false;
  954. }
  955. return true;
  956. }
  957. public override void SetBacksideHeFlow(double flow)
  958. {
  959. if (_backsideHe == null) return;
  960. _backsideHe.Flow(flow);
  961. }
  962. public override bool SetBacksideHePressure(float mTorr)
  963. {
  964. if (_backsideHe == null) return false;
  965. return _backsideHe.SetBacksideHelium(mTorr);
  966. }
  967. public override bool SetBacksideHeThreshold(int nMin, int nMax)
  968. {
  969. if (_backsideHe == null) return false;
  970. return _backsideHe.SetFlowThreshold(nMin, nMax);
  971. }
  972. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  973. {
  974. OpenValve(ValveType.GasFinal, true);
  975. FlowGas(5, flowSetpoint);
  976. TurnPendulumValve(true);
  977. SetPVPressure(pressureSetpoint);
  978. return true;
  979. }
  980. public async override Task<bool> AbortControlPressure()
  981. {
  982. FlowGas(5, 0);
  983. await Task.Delay(1000);
  984. OpenValve(ValveType.GasFinal, false);
  985. return true;
  986. }
  987. public override bool PreparePlace()
  988. {
  989. if (!SetSlitDoor(true, out string reason))
  990. {
  991. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  992. return false;
  993. }
  994. if (!SetLiftPin(MovementPosition.Down, out reason))
  995. {
  996. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  997. return false;
  998. }
  999. return true;
  1000. }
  1001. public override bool PreparePick()
  1002. {
  1003. if (!SetSlitDoor(true, out string reason))
  1004. {
  1005. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  1006. return false;
  1007. }
  1008. if (!SetLiftPin(MovementPosition.Up, out reason))
  1009. {
  1010. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1011. return false;
  1012. }
  1013. return true;
  1014. }
  1015. public override bool PreparePlaceIsOK()
  1016. {
  1017. return CheckSlitDoorOpen() && LiftPinIsDown;
  1018. }
  1019. public override bool PreparePickIsOK()
  1020. {
  1021. return CheckSlitDoorOpen() && LiftPinIsUp;
  1022. }
  1023. public override bool EndPlace()
  1024. {
  1025. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1026. {
  1027. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1028. return false;
  1029. }
  1030. if (!SetSlitDoor(false, out reason))
  1031. {
  1032. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1033. return false;
  1034. }
  1035. return true;
  1036. }
  1037. public override bool EndPick()
  1038. {
  1039. if (!SetSlitDoor(false, out string reason))
  1040. {
  1041. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1042. return false;
  1043. }
  1044. return true;
  1045. }
  1046. public override bool EndPlaceIsOK()
  1047. {
  1048. return CheckSlitDoorClose() && LiftPinIsDown;
  1049. }
  1050. public override bool EndPickIsOK()
  1051. {
  1052. return CheckSlitDoorClose();
  1053. }
  1054. }
  1055. }