JetKepler2200APM.cs 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  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 MECF.Framework.Common.Device.Bases;
  7. using MECF.Framework.Common.Equipment;
  8. using System;
  9. using Venus_Core;
  10. using Venus_RT.Devices.IODevices;
  11. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  12. using IoHeartbeat = Venus_RT.Devices.IODevices.IoHeartbeat;
  13. using System.Threading.Tasks;
  14. using System.Diagnostics;
  15. using Aitex.Core.RT.DataCenter;
  16. using Aitex.Core.Util;
  17. using Venus_RT.Modules.PMs;
  18. using Aitex.Core.RT.IOCore;
  19. using VenusCommon;
  20. namespace Venus_RT.Devices
  21. {
  22. class JetKepler2200APM : JetPMBase
  23. {
  24. private readonly IoLid _Lid;
  25. //private readonly IoLid _LidLoadlock;
  26. private readonly IoCylinder _slitDoor;
  27. //private readonly IoCylinder _LiftPin;
  28. //private readonly IoCylinder _LoadLockArm;
  29. private readonly IoValve _PVN21Valve;
  30. private readonly IoValve _PVN22Valve;
  31. private readonly IoValve _PV11Valve;
  32. private readonly IoValve _PV12Valve;
  33. private readonly IoValve _PV21Valve;
  34. private readonly IoValve _PV22Valve;
  35. private readonly IoValve _PV31Valve;
  36. private readonly IoValve _PV32Valve;
  37. private readonly IoValve _PV41Valve;
  38. private readonly IoValve _PV42Valve;
  39. private readonly IoValve _N2Valve;
  40. private readonly IoValve _O2Valve;
  41. private readonly IoValve _PurgeValve;
  42. private readonly IoValve _Mfc1Valve;
  43. private readonly IoValve _Mfc2Valve;
  44. private readonly IoValve _Mfc3Valve;
  45. private readonly IoValve _Mfc4Valve;
  46. private readonly IoValve _Mfc5Valve;
  47. private readonly IoValve _Mfc6Valve;
  48. private readonly IoValve _Mfc7Valve;
  49. private readonly IoValve _Mfc8Valve;
  50. //private readonly IoValve _PVHe1Valve;
  51. //private readonly IoValve _PVHe2Valve;
  52. private readonly IoValve _GasFinalValve;
  53. private readonly IoValve _SoftPumpValve;
  54. private readonly IoValve _FastPumpValve;
  55. private readonly IoValve _TurboPumpPumpingValve;
  56. private readonly IoValve _TurboPumpPurgeValve;
  57. private readonly IoValve _GuageValve;
  58. //private readonly IoValve _LoadlockVentValve;
  59. //private readonly IoValve _LoadlockPumpingValve;
  60. private readonly IoValve _N2Purge1Valve;
  61. private readonly IoValve _N2Purge2Valve;
  62. private readonly IoValve _PenningGuageValve;
  63. private readonly IoSensor _ATM_sw;
  64. private readonly IoSensor _CDAPressure;
  65. //private readonly IoSensor _ATM_Loadlock_sw;
  66. private readonly IoSensor _N2Pressure_sw;
  67. private readonly IoSensor _VAC_sw;
  68. private readonly IoSensor _WLK_sw;
  69. private readonly IoSensor _Water_Flow;
  70. private readonly IoSensor _RFG_Interlock;
  71. //private readonly IoSensor _PM_Lid_Closed;
  72. private readonly IoSensor _Source_RF_Match_Interlock;
  73. //private readonly IoSensor _PM_SlitDoor_Closed;
  74. private readonly IoSensor _TurboPumpInterlock;
  75. private readonly IoSensor _GasBoxDoor;
  76. private readonly IoSensor _GasBoxPressure;
  77. private readonly IoSensor _GasBoxN2Flow_sw;
  78. private readonly IoSensor _N2PurgePressure_sw;
  79. private readonly IoSensor _WaferTransferPosi_sw;
  80. private readonly IoSensor _TopShieldCoverClosedAlarm;
  81. private readonly IoSensor _ScrubberIsOK;
  82. private readonly F_TRIG ScrubberTrigger = new F_TRIG();
  83. //private readonly IoHeartbeat _Heartbeat;
  84. private readonly IoHighTemperatureHeater _highTemperatureHeater;
  85. //private readonly F_TRIG _GasBoxN2FlowSwitchTrigger = new F_TRIG();
  86. private readonly Stopwatch _GasBoxN2FlowSwitchStopWatch = new Stopwatch();
  87. private readonly PumpBase _MainPump;
  88. private readonly AdixenTurboPump _TurboPump;
  89. private readonly PendulumValve _pendulumValve;
  90. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  91. private readonly RfMatchBase _Match;
  92. //private readonly RfMatchBase _RFBox;
  93. //private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  94. //private readonly RfMatchBase _BiasMatch;
  95. //private readonly IoSignalTower _SignalTower;
  96. //private readonly IoHeater _ForelineTC;
  97. private readonly IoHeater _WallTC;
  98. private readonly IoPressureControl _pressureController;
  99. private readonly IoGasStick[] _gasLines;
  100. private readonly IoGasStick _gasLineN2;
  101. //private readonly IoBacksideHe _backsideHe;
  102. private readonly double _foreline_interlock_pressure = 750;
  103. private Stopwatch _GasRFStopWatch = new Stopwatch();
  104. private bool _GasFlag = false;
  105. //private PressureType _PressureType;
  106. private double processPressureLimit;
  107. private ScrubberMode _scrubberMode;
  108. private readonly IoSwitch _leakCheckMode;
  109. // 盖子的状态
  110. public override bool IsLidClosed => _Lid.OFFFeedback;
  111. //public override bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  112. public override bool IsSlitDoorClosed => _slitDoor.State == CylinderState.Close;
  113. public override bool IsPumpRunning => _MainPump.IsRunning;
  114. public override bool IsISOOpen => _TurboPumpPumpingValve.Status;
  115. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  116. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  117. public override float TurboPumpSpeed => _TurboPump.Speed;
  118. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  119. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  120. public override bool IsCDA_OK => _CDAPressure.Value;
  121. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  122. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  123. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  124. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  125. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  126. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  127. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  128. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  129. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  130. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  131. public override bool IsGuageValveOpened => _GuageValve.Status;
  132. // 压力信号
  133. public override bool IsATM => _ATM_sw.Value;
  134. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  135. //public override bool LiftPinIsDown => false;
  136. //public override bool LiftPinIsUp => false;
  137. //public override bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  138. //public override bool IsVACLoadLock => LoadlockPressure <= 1000;
  139. public override bool IsVAC => _VAC_sw.Value;
  140. public override bool IsWaterFlowOk => _Water_Flow.Value;
  141. public override bool IsWLK => _WLK_sw.Value;
  142. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  143. //public override bool PMLidClosed => _PM_Lid_Closed.Value;
  144. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  145. public override bool SourceRFMatchInterlock => _Source_RF_Match_Interlock.Value;
  146. //public override bool SlitDoorClosed => _PM_SlitDoor_Closed.Value;
  147. public override HighTemperatureHeaterPosition HighTemperatureHeaterPosition => _highTemperatureHeater.CurrentPosition;
  148. public override double CalculationPressure
  149. {
  150. get
  151. {
  152. if (_GuageValve.Status)
  153. {
  154. return ProcessPressure;
  155. }
  156. else
  157. {
  158. return ChamberPressure;
  159. }
  160. }
  161. }
  162. public override double ProcessPressure => _pendulumValve.Pressure;
  163. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  164. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  165. public override double PenningGuagePressure => _pressureController.PenningGauge.Value;
  166. public override double TargetPressure => ChamberPressure;
  167. public override float ReflectPower => _Generator.ReflectPower;
  168. public override float ForwardPower => _Generator.ForwardPower;
  169. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  170. public override float RFMatchC2 => _Match != null ? _Match.TunePosition2 : 0;
  171. //public override float RFBoxC1 => _RFBox != null ? _RFBox.TunePosition1 : 0;
  172. public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
  173. public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
  174. public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
  175. public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
  176. public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
  177. public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
  178. public override double MFC7FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas7").FeedBack;
  179. public override double MFC8FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas8").FeedBack;
  180. public override float ChamberTemperature => _highTemperatureHeater.HighTemperatureHighHeaterTemperature;
  181. public override float PendulumPressure => _pendulumValve.Pressure;
  182. public override float PendulumPosition => _pendulumValve.Position;
  183. public override bool IsAllowRobotTransfer => _WaferTransferPosi_sw.Value;
  184. public override bool ScrubberIsOK => _ScrubberIsOK.Value;
  185. public new ModuleName Module { get; }
  186. //public override bool CheckAtm()
  187. //{
  188. // return _ATM_sw.Value && ChamberPressure > 700000;
  189. //}
  190. public override bool CheckSlitDoorOpen()
  191. {
  192. return _slitDoor.State == CylinderState.Open;
  193. }
  194. public override bool CheckSlitDoorClose()
  195. {
  196. return _slitDoor.State == CylinderState.Close;
  197. }
  198. public override double TotalGasSetpoint
  199. {
  200. get
  201. {
  202. double sum = 0;
  203. foreach (var gas in _gasLines)
  204. {
  205. sum += gas.FlowSP;
  206. }
  207. return sum;
  208. }
  209. }
  210. public override bool HasGasOutOfRange
  211. {
  212. get
  213. {
  214. foreach (var gas in _gasLines)
  215. {
  216. if (!gas.IsOutOfRange)
  217. return false;
  218. }
  219. return true;
  220. }
  221. }
  222. public override bool PendulumValveIsOpen()
  223. {
  224. return _pendulumValve.IsOpen;
  225. }
  226. public override bool IsBiasRFAble()
  227. {
  228. return false;
  229. }
  230. #region 构造函数
  231. public JetKepler2200APM(ModuleName moduleName) : base(moduleName)
  232. {
  233. Module = moduleName;
  234. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  235. //_LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  236. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  237. //_LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  238. //_LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  239. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  240. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  241. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  242. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  243. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  244. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  245. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  246. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  247. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  248. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  249. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  250. _O2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveO2}");
  251. _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePurge}");
  252. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  253. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  254. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  255. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  256. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  257. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  258. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  259. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  260. //_PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  261. //_PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  262. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  263. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  264. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  265. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  266. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  267. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  268. _N2Purge1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2Purge1}");
  269. _N2Purge2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2Purge2}");
  270. _PenningGuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePenningGauge}");
  271. //_LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  272. //_LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  273. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  274. //_ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  275. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  276. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  277. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  278. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  279. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  280. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  281. //_PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  282. _Source_RF_Match_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.RFMatchInterlock");
  283. //_PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  284. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  285. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  286. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  287. _GasBoxN2Flow_sw = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxN2FlowSwitch");
  288. _N2PurgePressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PurgePressureSwitch");
  289. //_ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  290. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  291. _WaferTransferPosi_sw = DEVICE.GetDevice<IoSensor>($"{Module}.WaferTransferPosi");
  292. _TopShieldCoverClosedAlarm = DEVICE.GetDevice<IoSensor>($"{Module}.TOPShieldCoverClosedAlarm");
  293. //_SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  294. _ScrubberIsOK = DEVICE.GetDevice<IoSensor>($"{Module}.SCRUBBEROK");
  295. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  296. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  297. _leakCheckMode = DEVICE.GetDevice<IoSwitch>($"{Module}.LeakCheckModeSwitch");
  298. _gasLines = new IoGasStick[8];
  299. for (int index = 0; index < 8; index++)
  300. {
  301. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  302. }
  303. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  304. //_backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  305. _highTemperatureHeater = DEVICE.GetDevice<IoHighTemperatureHeater>($"{Module}.HighTemperatureHeater");
  306. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  307. // RS232 Dry pump, SKY
  308. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  309. {
  310. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  311. {
  312. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  313. }
  314. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  315. {
  316. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  317. }
  318. }
  319. //_ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  320. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  321. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  322. //if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  323. // SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  324. //{
  325. // if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  326. // {
  327. // _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  328. // }
  329. // else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  330. // {
  331. // _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  332. // }
  333. //}
  334. // RS223 AdTec Generator
  335. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  336. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  337. {
  338. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  339. }
  340. //_Heartbeat = DEVICE.GetDevice<IoHeartbeat>($"{Module}.{VenusDevice.Heartbeat}");
  341. // Ethernet Comet Generator Bias
  342. //if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  343. //{
  344. // if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  345. // SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  346. // {
  347. // _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  348. // }
  349. // else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  350. // {
  351. // _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  352. // }
  353. //}
  354. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  355. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  356. {
  357. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  358. }
  359. else if (
  360. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.Revtech)
  361. {
  362. _Match = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.Match}");
  363. }
  364. //if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  365. // SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  366. // SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  367. //{
  368. // _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  369. //}
  370. //else if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  371. // SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  372. //{
  373. // _BiasMatch = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  374. //}
  375. //if (SC.GetValue<bool>($"{Module}.RFBox.EnableMatch") &&
  376. // SC.GetValue<int>($"{Module}.RFBox.CommunicationType") == (int)CommunicationType.RS232 &&
  377. // SC.GetValue<int>($"{Module}.RFBox.MFG") == (int)MatchMFG.AdTec)
  378. //{
  379. // _RFBox = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.RFBox}");
  380. //}
  381. //else if (SC.GetValue<bool>($"{Module}.RFBox.EnableMatch") &&
  382. // SC.GetValue<int>($"{Module}.RFBox.MFG") == (int)MatchMFG.Revtech)
  383. //{
  384. // _RFBox = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.RFBox}");
  385. //}
  386. _foreline_interlock_pressure = SC.GetValue<int>($"{Module}.PendulumValve.ForelinePressureLimit");
  387. _GasRFStopWatch.Stop();
  388. processPressureLimit = 260;//unit Pa
  389. _GasBoxN2FlowSwitchStopWatch.Start();
  390. //_PressureType = (PressureType)SC.GetValue<int>("System.PressureUnitType");
  391. DATA.Subscribe($"{Name}.PenningPressure", () => _pressureController.PenningGauge.Value);
  392. _CDAPressure.WarningAction += CDAPressureNotify;
  393. _Water_Flow.WarningAction += WATERFLOWNotify;
  394. _WLK_sw.WarningAction += WATERLEAKNotify;
  395. //_N2Pressure_sw.WarningAction += N2PressureNotify;
  396. _GasBoxDoor.WarningAction += GasBoxDoorNotify;
  397. _GasBoxPressure.WarningAction += GasBoxPressureNotify;
  398. _N2PurgePressure_sw.WarningAction += N2PurgePressureNotify;
  399. }
  400. private void CDAPressureNotify()
  401. {
  402. LOG.Write(eEvent.WARNING_SENSOR_CDAPRESSURE, Module, "CDA Pressure Abnormal");
  403. }
  404. private void WATERFLOWNotify()
  405. {
  406. var waterFlowMode = (WaterFlowMode)SC.GetValue<int>($"{Module}.WaterFlowMode");
  407. switch (waterFlowMode)
  408. {
  409. case WaterFlowMode.Warning:
  410. LOG.Write(eEvent.WARNING_SENSOR_WATERFLOW, Module, "Water Flow Abnormal");
  411. break;
  412. case WaterFlowMode.StopCurrentProcess:
  413. LOG.Write(eEvent.ERR_SENSOR_WATERFLOW_STOP_CURRENTPROCESS, Module, "Water Flow Abnormal,立即停止工艺");
  414. break;
  415. case WaterFlowMode.StopNextProcess:
  416. LOG.Write(eEvent.ERR_SENSOR_WATERFLOW_STOP_NEXTPROCESS, Module, "Water Flow Abnormal,继续当前工艺,后续工艺不再进行");
  417. break;
  418. }
  419. }
  420. private void WATERLEAKNotify()
  421. {
  422. LOG.Write(eEvent.WARNING_SENSOR_WATERLEAK, Module, "Water Leak");
  423. }
  424. //private void N2PressureNotify()
  425. //{
  426. // LOG.Write(eEvent.WARNING_SENSOR_N2PRESSURE, Module, "N2 Pressure Abnormal");
  427. //}
  428. private void GasBoxDoorNotify()
  429. {
  430. LOG.Write(eEvent.WARNING_SENSOR_GASBOXDOOR, Module, "Gas Box Door SW Abnormal");
  431. }
  432. private void GasBoxPressureNotify()
  433. {
  434. LOG.Write(eEvent.WARNING_SENSOR_GASBOXPRESSURE, Module, "Gas Box Pressure Abnormal");
  435. }
  436. private void N2PurgePressureNotify()
  437. {
  438. LOG.Write(eEvent.WARNING_SENSOR_N2PURGEPRESSURE, "N2 Purge Pressure Abnormal");
  439. }
  440. #endregion
  441. public async override void CloseValves(int? delayTime = null)
  442. {
  443. _PVN21Valve.TurnValve(false, out _);
  444. // _PVN22Valve.TurnValve(false, out _);
  445. _PV11Valve.TurnValve(false, out _);
  446. _PV12Valve.TurnValve(false, out _);
  447. _PV21Valve.TurnValve(false, out _);
  448. _PV22Valve.TurnValve(false, out _);
  449. _PV31Valve.TurnValve(false, out _);
  450. _PV32Valve.TurnValve(false, out _);
  451. _PV41Valve.TurnValve(false, out _);
  452. _PV42Valve.TurnValve(false, out _);
  453. //_PVHe1Valve.TurnValve(false, out _);
  454. //_PVHe2Valve.TurnValve(false, out _);
  455. _SoftPumpValve.TurnValve(false, out _);
  456. _FastPumpValve.TurnValve(false, out _);
  457. //_TurboPumpPumpingValve.TurnValve(false, out _);
  458. _TurboPumpPurgeValve.TurnValve(false, out _);
  459. //_GuageValve.TurnValve(false, out _);
  460. _N2Valve.TurnValve(false, out _);
  461. _O2Valve.TurnValve(false, out _);
  462. //_N2Purge1Valve.TurnValve(false, out _);
  463. _N2Purge2Valve.TurnValve(false, out _);
  464. _FastPumpValve.TurnValve(false, out _);
  465. _Mfc1Valve.TurnValve(false, out _);
  466. _Mfc2Valve.TurnValve(false, out _);
  467. _Mfc3Valve.TurnValve(false, out _);
  468. _Mfc4Valve.TurnValve(false, out _);
  469. _Mfc5Valve.TurnValve(false, out _);
  470. _Mfc6Valve.TurnValve(false, out _);
  471. _Mfc7Valve.TurnValve(false, out _);
  472. _Mfc8Valve.TurnValve(false, out _);
  473. foreach (var stick in _gasLines)
  474. {
  475. stick.Stop();
  476. }
  477. if (delayTime != null)
  478. {
  479. await Task.Delay((int)delayTime);
  480. }
  481. _GasFinalValve.TurnValve(false, out _);
  482. _PurgeValve.TurnValve(false, out _);
  483. }
  484. public override void TurnDryPump(bool on)
  485. {
  486. //_pressureController.StartPump(on);
  487. _MainPump?.SetPumpOnOff(on);
  488. }
  489. public override void TurnTurboPump(bool on)
  490. {
  491. _TurboPump?.SetPumpOnOff(on);
  492. }
  493. public override void OpenValve(ValveType vlvType, bool on)
  494. {
  495. switch (vlvType)
  496. {
  497. case ValveType.PVN21:
  498. _PVN21Valve.TurnValve(on, out _);
  499. break;
  500. case ValveType.PVN22:
  501. _PVN22Valve.TurnValve(on, out _);
  502. break;
  503. case ValveType.PV11:
  504. _PV11Valve.TurnValve(on, out _);
  505. break;
  506. case ValveType.PV12:
  507. _PV12Valve.TurnValve(on, out _);
  508. break;
  509. case ValveType.PV21:
  510. _PV21Valve.TurnValve(on, out _);
  511. break;
  512. case ValveType.PV22:
  513. _PV22Valve.TurnValve(on, out _);
  514. break;
  515. case ValveType.PV31:
  516. _PV31Valve.TurnValve(on, out _);
  517. break;
  518. case ValveType.PV32:
  519. _PV32Valve.TurnValve(on, out _);
  520. break;
  521. case ValveType.PV41:
  522. _PV41Valve.TurnValve(on, out _);
  523. break;
  524. case ValveType.PV42:
  525. _PV42Valve.TurnValve(on, out _);
  526. break;
  527. case ValveType.N2:
  528. _N2Valve.TurnValve(on, out _);
  529. break;
  530. case ValveType.Purge:
  531. _PurgeValve.TurnValve(on, out _);
  532. break;
  533. case ValveType.GasFinal:
  534. _GasFinalValve.TurnValve(on, out _);
  535. break;
  536. case ValveType.SoftPump:
  537. _SoftPumpValve.TurnValve(on, out _);
  538. break;
  539. case ValveType.FastPump:
  540. _FastPumpValve.TurnValve(on, out _);
  541. break;
  542. case ValveType.TurboPumpPumping:
  543. _TurboPumpPumpingValve.TurnValve(on, out _);
  544. break;
  545. case ValveType.TurboPumpPurge:
  546. _TurboPumpPurgeValve.TurnValve(on, out _);
  547. break;
  548. case ValveType.Guage:
  549. _GuageValve.TurnValve(on, out _);
  550. break;
  551. //case ValveType.LoadlockVent:
  552. // _LoadlockVentValve.TurnValve(on, out _);
  553. // break;
  554. //case ValveType.LoadlockPumping:
  555. // _LoadlockPumpingValve.TurnValve(on, out _);
  556. // break;
  557. case ValveType.Mfc1:
  558. _Mfc1Valve.TurnValve(on, out _);
  559. break;
  560. case ValveType.Mfc2:
  561. _Mfc2Valve.TurnValve(on, out _);
  562. break;
  563. case ValveType.Mfc3:
  564. _Mfc3Valve.TurnValve(on, out _);
  565. break;
  566. case ValveType.Mfc4:
  567. _Mfc4Valve.TurnValve(on, out _);
  568. break;
  569. case ValveType.Mfc5:
  570. _Mfc5Valve.TurnValve(on, out _);
  571. break;
  572. case ValveType.Mfc6:
  573. _Mfc6Valve.TurnValve(on, out _);
  574. break;
  575. case ValveType.Mfc7:
  576. _Mfc7Valve.TurnValve(on, out _);
  577. break;
  578. case ValveType.Mfc8:
  579. _Mfc8Valve.TurnValve(on, out _);
  580. break;
  581. case ValveType.O2:
  582. _O2Valve.TurnValve(on, out _);
  583. break;
  584. case ValveType.N2Purge1:
  585. _N2Purge1Valve.TurnValve(on, out _);
  586. break;
  587. case ValveType.N2Purge2:
  588. _N2Purge2Valve.TurnValve(on, out _);
  589. break;
  590. case ValveType.PenningGauge:
  591. _PenningGuageValve.TurnValve(on, out _);
  592. break;
  593. //default:
  594. // throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  595. }
  596. }
  597. public override void Monitor()
  598. {
  599. CheckScrubber();
  600. foreach (var gas in _gasLines)
  601. {
  602. gas.Monitor();
  603. }
  604. CheckPermanentInterlock();
  605. //if (_GasBoxN2FlowSwitchStopWatch.ElapsedMilliseconds > 10 * 1000)
  606. //{
  607. // _GasBoxN2FlowSwitchStopWatch.Stop();
  608. //}
  609. CheckHighTemperatureHeaterInterlock();
  610. }
  611. private void CheckScrubber()
  612. {
  613. ScrubberTrigger.CLK = ScrubberIsOK;
  614. if (ScrubberTrigger.Q)
  615. {
  616. _scrubberMode = (ScrubberMode)SC.GetValue<int>($"{Module}.ScrubberMode");
  617. switch (_scrubberMode)
  618. {
  619. case ScrubberMode.Warning:
  620. LOG.Write(eEvent.WARN_PM_SCRUBBER_NOOK, Module, $"{Module} Scrubber Warning");
  621. break;
  622. case ScrubberMode.StopTransferStopProcess:
  623. LOG.Write(eEvent.ERR_PM_SCRUBBER_NOOK_STOPPROCESS, Module, $"{Module} Scrubber Alarm,Stop Process if Processing,Switch to Offline");
  624. break;
  625. case ScrubberMode.StopTranferContinueProcess:
  626. LOG.Write(eEvent.ERR_PM_SCRUBBER_NOOK_CONTINUEPROCESS, Module, $"{Module} Scrubber Alarm,Continue Process if Processing,Switch to Offline");
  627. break;
  628. }
  629. }
  630. }
  631. private void CheckHighTemperatureHeaterInterlock()
  632. {
  633. if (_highTemperatureHeater.HighTemperatureHeaterIsOn == false)
  634. {
  635. return;
  636. }
  637. if (_GasBoxN2Flow_sw.Value)
  638. {
  639. _GasBoxN2FlowSwitchStopWatch.Reset();
  640. }
  641. else
  642. {
  643. _GasBoxN2FlowSwitchStopWatch.Start();
  644. }
  645. if (_GasBoxN2FlowSwitchStopWatch.ElapsedMilliseconds > 10 * 1000 && _GasBoxN2FlowSwitchStopWatch.IsRunning)
  646. {
  647. _GasBoxN2FlowSwitchStopWatch.Reset();
  648. var limitTemperature = SC.GetValue<double>($"{Module}.HighTemperatureHeater.N2WarningTemperatureLimit");
  649. if (limitTemperature < ChamberTemperature)
  650. {
  651. SetHighTemperatureHeaterTemperature((int)limitTemperature);
  652. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Gas Box N2 Flow Trigger Warning,HighTemperatureHeater Cool Down to {limitTemperature} ℃,Current Purge N2 Flow {_highTemperatureHeater.HighTemperatureHeaterN2Flow}");
  653. }
  654. }
  655. }
  656. protected override void CheckPermanentInterlock()
  657. {
  658. if (ChamberPressure >= processPressureLimit && _GuageValve.SetPoint)
  659. {
  660. _GuageValve.TurnValve(false, out _);
  661. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed {processPressureLimit} Pa, Guage Valve (DO-31) closed automaticlly.");
  662. }
  663. if (ChamberPressure < processPressureLimit && !_GuageValve.SetPoint)
  664. {
  665. _GuageValve.TurnValve(true, out _);
  666. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} less than {processPressureLimit} Pa, Guage Valve (DO-31) open automaticlly.");
  667. }
  668. }
  669. public override async void CheckIdleInterlock(int delaytime)
  670. {
  671. if (ForelinePressure > _foreline_interlock_pressure)
  672. {
  673. await Task.Delay(500);
  674. if (ForelinePressure < _foreline_interlock_pressure)
  675. {
  676. return;
  677. }
  678. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  679. {
  680. _pendulumValve.TurnValve(false);
  681. _TurboPumpPurgeValve.TurnValve(false, out _);
  682. _TurboPumpPumpingValve.TurnValve(false, out _);
  683. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} Pa, Pendulum valve & PV6 & PV7 closed automaticlly.");
  684. }
  685. }
  686. if (_TurboPumpPumpingValve.SetPoint == false && _pendulumValve.IsOpen)
  687. {
  688. _pendulumValve.TurnValve(false);
  689. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"ISO Valve Closed, Pendulum valve closed automaticlly.");
  690. }
  691. }
  692. public override void Home()
  693. {
  694. _Generator?.ReConnect();
  695. _Match?.ReConnect();
  696. _MainPump?.ReConnect();
  697. _TurboPump?.ReConnect();
  698. _pendulumValve?.ReConnect();
  699. }
  700. public override bool HomeIsOK(out string reason)
  701. {
  702. if (!IsSlitDoorClosed)
  703. {
  704. reason = "Door is not Close";
  705. return false;
  706. }
  707. if (!_highTemperatureHeater.LiftIsOK())
  708. {
  709. reason = "HighTemperatureHeater Lift is not OK";
  710. return false;
  711. }
  712. if (SC.GetValue<bool>($"{Module}.{VenusDevice.PendulumValve}.NoCheck"))
  713. {
  714. reason = "PendulumValve No Check is not Close";
  715. return false;
  716. }
  717. reason = "";
  718. return true;
  719. }
  720. public override bool FlowGas(int gasNum, double val)
  721. {
  722. if (_gasLines.Length <= gasNum)
  723. return false;
  724. //double value = (val / _gasLines[gasNum]._mfc.Scale) * 100;
  725. //double setPoint =Math.Round( value / 8000 * _gasLines[gasNum]._mfc.Scale,2);
  726. _gasLines[gasNum].Flow(val);
  727. return true;
  728. }
  729. public override bool PumpGas(int gasNum)
  730. {
  731. if (_gasLines.Length <= gasNum)
  732. return false;
  733. switch (gasNum)
  734. {
  735. case 0:
  736. OpenValve(ValveType.PV12, true);
  737. break;
  738. case 1:
  739. OpenValve(ValveType.PV22, true);
  740. break;
  741. case 2:
  742. OpenValve(ValveType.PV32, true);
  743. break;
  744. case 3:
  745. OpenValve(ValveType.PV42, true);
  746. break;
  747. }
  748. _gasLines[gasNum].Pump();
  749. OpenValve(ValveType.N2Purge2, true);
  750. return true;
  751. }
  752. public override bool PurgeGas(int gasNum)
  753. {
  754. if (_gasLines.Length <= gasNum)
  755. return false;
  756. switch (gasNum)
  757. {
  758. case 0:
  759. OpenValve(ValveType.PV12, true);
  760. break;
  761. case 1:
  762. OpenValve(ValveType.PV22, true);
  763. break;
  764. case 2:
  765. OpenValve(ValveType.PV32, true);
  766. break;
  767. case 3:
  768. OpenValve(ValveType.PV42, true);
  769. break;
  770. }
  771. _gasLines[gasNum].Pump();
  772. OpenValve(ValveType.PVN21, true);
  773. return true;
  774. }
  775. public override bool StopGas(int gasNum)
  776. {
  777. if (_gasLines.Length <= gasNum)
  778. return false;
  779. _gasLines[gasNum].Stop();
  780. return true;
  781. }
  782. public override bool FlowN2(double val)
  783. {
  784. _gasLineN2.Flow(val);
  785. return true;
  786. }
  787. public override bool StopN2()
  788. {
  789. _gasLineN2.Stop();
  790. return true;
  791. }
  792. public override void StopAllGases()
  793. {
  794. foreach (var line in _gasLines)
  795. {
  796. line.Stop();
  797. }
  798. }
  799. public override bool TurnPendulumValve(bool on)
  800. {
  801. return _pendulumValve.TurnValve(on);
  802. }
  803. public override bool SetPVPressure(float pressure)
  804. {
  805. return _pendulumValve.SetPressure(pressure);
  806. }
  807. public override bool SetPVPostion(float position)
  808. {
  809. return _pendulumValve.SetPosition(position);
  810. }
  811. public override float GetPVPosition()
  812. {
  813. return _pendulumValve.Position;
  814. }
  815. public override void SetGeneratorCommunicationMode(int mode)
  816. {
  817. _Generator?.SetCommunicationMode(mode);
  818. }
  819. public override bool GeneratorPowerOn(bool on)
  820. {
  821. if (_Generator == null) return false;
  822. if (on && !IsRFGInterlockOn)
  823. {
  824. LOG.Write(eEvent.ERR_RF_RFGInterlock, Module, "射频电源 Interlock条件不满足");
  825. return false;
  826. }
  827. if (on && !_TopShieldCoverClosedAlarm.Value)
  828. {
  829. LOG.Write(eEvent.ERR_RF, Module, "DI-21 Top Shield Cover closed alarm,射频条件不满足");
  830. return false;
  831. }
  832. return _Generator.SetPowerOnOff(on, out _);
  833. }
  834. public override bool GeneratorSetpower(float val)
  835. {
  836. if (_Generator == null) return false;
  837. if (Math.Abs(val) > 0.01)
  838. _Generator.SetPower((ushort)val);
  839. return true;
  840. }
  841. //public override bool SetRFBoxC1Position(float c1)
  842. //{
  843. // if (_RFBox == null) return false;
  844. // _RFBox.SetMatchPositionC1(c1, out _);
  845. // return true;
  846. //}
  847. public override bool SetWallTCTemperature(float value)
  848. {
  849. return _WallTC.RampTemp(value);
  850. }
  851. public override bool SetMatchPosition(float c1, float c2)
  852. {
  853. if (_Match == null) return false;
  854. string reason = string.Empty;
  855. _Match.SetMatchPosition(c1, c2, out reason);
  856. return true;
  857. }
  858. public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  859. {
  860. if (_Match == null) return false;
  861. if (matchWorkMode == MatchWorkMode.Auto)
  862. {
  863. return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  864. }
  865. else if (matchWorkMode == MatchWorkMode.Manual)
  866. {
  867. return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  868. }
  869. return false;
  870. }
  871. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  872. {
  873. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  874. if (!IsLidClosed)
  875. {
  876. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  877. return false;
  878. }
  879. if (!IsVAC)
  880. {
  881. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  882. return false;
  883. }
  884. if (!IsWaterFlowOk)
  885. {
  886. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  887. return false;
  888. }
  889. if (!IsRFGInterlockOn)
  890. {
  891. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  892. return false;
  893. }
  894. if (!SlitDoorClosed)
  895. {
  896. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  897. return false;
  898. }
  899. return true;
  900. }
  901. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  902. {
  903. OpenValve(ValveType.Purge, true);
  904. //OpenValve(ValveType.N2, true);
  905. OpenValve(ValveType.PVN22, true);
  906. OpenValve(ValveType.GasFinal, false);
  907. OpenValve(ValveType.TurboPumpPumping, true);
  908. if (_pendulumValve.IsOpen == false)
  909. {
  910. TurnPendulumValve(true);
  911. }
  912. SetPVPressure(pressureSetpoint);
  913. return true;
  914. }
  915. public async override void AbortControlPressure()
  916. {
  917. //OpenValve(ValveType.N2, false);
  918. OpenValve(ValveType.PVN22, false);
  919. OpenValve(ValveType.TurboPumpPumping, true);
  920. //SetPVPressure(0);
  921. TurnPendulumValve(true);
  922. //SetPVPostion(1000);
  923. await Task.Delay(0);
  924. OpenValve(ValveType.Purge, false);
  925. //return true;
  926. }
  927. public override bool HighTemperatureHeaterGotoPosition(HighTemperatureHeaterPosition highTemperatureHeaterPosition)
  928. {
  929. return _highTemperatureHeater.GotoPosition(highTemperatureHeaterPosition);
  930. }
  931. public override bool SetHighTemperatureHeaterTemperature(int temperature)
  932. {
  933. _highTemperatureHeater.HighTemperatureHighHeaterTemperature = temperature;
  934. return true;
  935. }
  936. public override bool SetHighTemperatureHeaterRatio(int ratio)
  937. {
  938. _highTemperatureHeater.HighTemperatureHeaterRatio = ratio;
  939. return true;
  940. }
  941. public override bool PreparePlace()
  942. {
  943. //if (!SetSlitDoor(true, out string reason))
  944. //{
  945. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  946. // return false;
  947. //}
  948. return _highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position1);
  949. }
  950. public override bool PreparePick()
  951. {
  952. //if (!SetSlitDoor(true, out string reason))
  953. //{
  954. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  955. // return false;
  956. //}
  957. return _highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position1);
  958. }
  959. public override bool PreparePlaceIsOK()
  960. {
  961. return _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position1 && _WaferTransferPosi_sw.Value;
  962. }
  963. public override bool PreparePickIsOK()
  964. {
  965. return _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position1 && _WaferTransferPosi_sw.Value;
  966. }
  967. public override bool EndPlace()
  968. {
  969. //if (!SetSlitDoor(false, out string reason))
  970. //{
  971. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  972. // return false;
  973. //}
  974. if (!_highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position2))
  975. {
  976. LOG.Write(eEvent.ERR_HighTemperatureHeater, Module, $"Set High Temperature Heater To Position2 failed");
  977. return false;
  978. }
  979. return true;
  980. }
  981. public override bool EndPick()
  982. {
  983. //if (!SetSlitDoor(false, out string reason))
  984. //{
  985. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  986. // return false;
  987. //}
  988. return true;
  989. }
  990. public override bool EndPlaceIsOK()
  991. {
  992. return _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position2;
  993. }
  994. public override bool EndPickIsOK()
  995. {
  996. return CheckSlitDoorClose();
  997. }
  998. public override void RTCloseEvent()
  999. {
  1000. if (_Generator.IsPowerOn)
  1001. {
  1002. GeneratorPowerOn(false);
  1003. }
  1004. if (PendulumValveIsOpen())
  1005. {
  1006. TurnPendulumValve(false);
  1007. }
  1008. }
  1009. public override bool RFInterlock(VenusDevice device)
  1010. {
  1011. eEvent evt = eEvent.ERR_RF;
  1012. if (!IsWaterFlowOk)
  1013. {
  1014. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  1015. return false;
  1016. }
  1017. if (!IsRFGInterlockOn)
  1018. {
  1019. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  1020. return false;
  1021. }
  1022. if (GasIsOff())
  1023. {
  1024. LOG.Write(evt, Module, $"Cannot Power ON {device} as Gas is OFF.");
  1025. return false;
  1026. }
  1027. return true;
  1028. }
  1029. private bool GasIsOff()
  1030. {
  1031. if ((IsMfc1ValveOpened == false && IsMfc2ValveOpened == false && IsMfc3ValveOpened == false && IsMfc4ValveOpened == false && IsMfc5ValveOpened == false && IsMfc6ValveOpened == false && IsMfc7ValveOpened == false && IsMfc8ValveOpened == false && _GasFlag == false) || (MFC1FeedBack < 1 && MFC2FeedBack < 1 && MFC3FeedBack < 1 && MFC4FeedBack < 1 && MFC5FeedBack < 1 && MFC6FeedBack < 1 && MFC7FeedBack < 1 && MFC8FeedBack < 1 && _GasFlag == false))
  1032. {
  1033. if (_GasRFStopWatch.IsRunning == false)
  1034. {
  1035. _GasRFStopWatch.Start();
  1036. }
  1037. if (_GasRFStopWatch.ElapsedMilliseconds > 1500 && _GasRFStopWatch.ElapsedMilliseconds < 2500)
  1038. {
  1039. //var item = _GasRFStopWatch.ElapsedMilliseconds;
  1040. _GasRFStopWatch.Reset();
  1041. _GasFlag = true;
  1042. return true;
  1043. }
  1044. }
  1045. else
  1046. {
  1047. _GasRFStopWatch.Reset();
  1048. _GasFlag = false;
  1049. }
  1050. return false;
  1051. }
  1052. public override void PMInError()
  1053. {
  1054. CloseValves();
  1055. GeneratorPowerOn(false);
  1056. GeneratorBiasPowerOn(false);
  1057. }
  1058. public override bool SetLeakCheckMode(bool ison)
  1059. {
  1060. if (ison)
  1061. {
  1062. _leakCheckMode.TurnOn();
  1063. }
  1064. else
  1065. {
  1066. _leakCheckMode.TurnOff();
  1067. }
  1068. return true;
  1069. }
  1070. }
  1071. }