JetVenusDEPM.cs 52 KB

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