JetVenusDEPM.cs 55 KB

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