JetVenusDEPM.cs 58 KB

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