JetPM.cs 45 KB

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