JetPM.cs 45 KB

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