JetPM.cs 45 KB

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