JetKepler2300PM.cs 47 KB

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