JetVenusSEPM.cs 54 KB

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