JetVenusSEPM.cs 50 KB

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