JetPM.cs 45 KB

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