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 && _linerDoor.OFFFeedback;
  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 StartControlPressure(int pressureSetpoint, int flowSetpoint)
  707. {
  708. OpenValve(ValveType.TurboPumpPumping, true);
  709. if (_TurboPumpPumpingValve.Status)
  710. {
  711. OpenValve(ValveType.Purge, true);
  712. OpenValve(ValveType.GasFinal, false);
  713. //OpenValve(ValveType.N2, true);
  714. OpenValve(ValveType.PVN22, true);
  715. TurnPendulumValve(true);
  716. SetPVPressure(pressureSetpoint);
  717. return true;
  718. }
  719. else
  720. {
  721. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot control pressure,cause Turbo Pump Pumping Valve is Close");
  722. return true;
  723. }
  724. }
  725. public async override void AbortControlPressure()
  726. {
  727. OpenValve(ValveType.PVN22, false);
  728. OpenValve(ValveType.N2, false);
  729. await Task.Delay(2000);
  730. OpenValve(ValveType.GasFinal, false);
  731. OpenValve(ValveType.Purge, false);
  732. //return true;
  733. }
  734. public override void CheckIdleInterlock()
  735. {
  736. if (ForelinePressure > _foreline_interlock_pressure)
  737. {
  738. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  739. {
  740. _pendulumValve.TurnValve(false);
  741. _TurboPumpPurgeValve.TurnValve(false, out _);
  742. _TurboPumpPumpingValve.TurnValve(false, out _);
  743. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  744. }
  745. }
  746. }
  747. public override bool CheckLiftDown()
  748. {
  749. return _LiftPin.State == CylinderState.Close;
  750. }
  751. public override bool CheckLiftUp()
  752. {
  753. return _LiftPin.State == CylinderState.Open;
  754. }
  755. public override bool CheckLinerDoorOpen()
  756. {
  757. return _linerDoor.State == CylinderState.Open;
  758. }
  759. public override bool CheckLinerDoorClose()
  760. {
  761. return _linerDoor.State == CylinderState.Close;
  762. }
  763. public override bool CheckSlitDoorClose()
  764. => IsSlitDoorClosed && IsLinerDoorClosed;
  765. public override bool CheckSlitDoorOpen()
  766. => !IsSlitDoorClosed && !IsLinerDoorClosed;
  767. public override void CloseValves(int? delayTime = null)
  768. {
  769. _PVN21Valve.TurnValve(false, out _);
  770. //_PVN22Valve.TurnValve(false, out _);
  771. _PV11Valve.TurnValve(false, out _);
  772. _PV12Valve.TurnValve(false, out _);
  773. _PV21Valve.TurnValve(false, out _);
  774. _PV22Valve.TurnValve(false, out _);
  775. _PV31Valve.TurnValve(false, out _);
  776. _PV32Valve.TurnValve(false, out _);
  777. _PV41Valve.TurnValve(false, out _);
  778. _PV42Valve.TurnValve(false, out _);
  779. _PVHe1Valve.TurnValve(false, out _);
  780. _PVHe2Valve.TurnValve(false, out _);
  781. _GasFinalValve.TurnValve(false, out _);
  782. //_SoftPumpValve.TurnValve(false, out _);
  783. _FastPumpValve.TurnValve(false, out _);
  784. //_TurboPumpPumpingValve.TurnValve(false, out _);
  785. //_TurboPumpPurgeValve.TurnValve(false, out _);
  786. _GuageValve.TurnValve(false, out _);
  787. _PurgeValve.TurnValve(false, out _);
  788. _N2Valve.TurnValve(false, out _);
  789. _FastPumpValve.TurnValve(false, out _);
  790. _PVHe3Valve.TurnValve(false, out _);
  791. _HeISOValve.TurnValve(false, out _);
  792. _MainPurgeValve.TurnValve(false, out _);
  793. _SecondPurgeValve.TurnValve(false, out _);
  794. //新增
  795. _Mfc1Valve.TurnValve(false, out _);
  796. _Mfc2Valve.TurnValve(false, out _);
  797. _Mfc3Valve.TurnValve(false, out _);
  798. _Mfc4Valve.TurnValve(false, out _);
  799. _Mfc5Valve.TurnValve(false, out _);
  800. _Mfc6Valve.TurnValve(false, out _);
  801. _Mfc7Valve.TurnValve(false, out _);
  802. _Mfc8Valve.TurnValve(false, out _);
  803. _Mfc9Valve.TurnValve(false, out _);
  804. _Mfc10Valve.TurnValve(false, out _);
  805. _Mfc11Valve.TurnValve(false, out _);
  806. _Mfc12Valve.TurnValve(false, out _);
  807. _PV51Valve.TurnValve(false, out _);
  808. _PV52Valve.TurnValve(false, out _);
  809. _PV61Valve.TurnValve(false, out _);
  810. _PV62Valve.TurnValve(false, out _);
  811. _PV71Valve.TurnValve(false, out _);
  812. _PV72Valve.TurnValve(false, out _);
  813. _PV81Valve.TurnValve(false, out _);
  814. _PV82Valve.TurnValve(false, out _);
  815. _PV91Valve.TurnValve(false, out _);
  816. _PV92Valve.TurnValve(false, out _);
  817. _PVA1Valve.TurnValve(false, out _);
  818. _PVA2Valve.TurnValve(false, out _);
  819. _PVB1Valve.TurnValve(false, out _);
  820. _PVB2Valve.TurnValve(false, out _);
  821. _PVC1Valve.TurnValve(false, out _);
  822. _PVC2Valve.TurnValve(false, out _);
  823. foreach (var stick in _gasLines)
  824. {
  825. stick.Stop();
  826. }
  827. }
  828. public override bool ExtendWafer()
  829. {
  830. throw new NotImplementedException();
  831. }
  832. public override bool FlowGas(int gasNum, double val)
  833. {
  834. if (_gasLines.Length <= gasNum)
  835. return false;
  836. _gasLines[gasNum].Flow(val);
  837. return true;
  838. }
  839. public override bool FlowN2(double val)
  840. {
  841. _gasLineN2.Flow(val);
  842. return true;
  843. }
  844. public override bool GeneratorBiasPowerOn(bool on)
  845. {
  846. if (_GeneratorBias == null) return false;
  847. if (on && !IsRFGInterlockOn)
  848. {
  849. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  850. return false;
  851. }
  852. return _GeneratorBias.SetPowerOnOff(on, out _);
  853. }
  854. //public override bool MagnetPowerOn(bool on)
  855. //{
  856. // if (_Magnet == null) return false;
  857. // return _Magnet.SetMagnetOnOff(on, out _);
  858. //}
  859. public override bool GeneratorBiasSetMatchMode(bool val)
  860. {
  861. if (_GeneratorBias == null) return false;
  862. string reason = string.Empty;
  863. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  864. return true;
  865. }
  866. public override bool GeneratorBiasSetpower(float val)
  867. {
  868. if (_GeneratorBias == null) return false;
  869. _GeneratorBias.SetPower((ushort)val);
  870. return true;
  871. }
  872. public override bool GeneratorPowerOn(bool on)
  873. {
  874. if (_Generator == null) return false;
  875. if (on && !IsRFGInterlockOn)
  876. {
  877. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  878. return false;
  879. }
  880. return _Generator.SetPowerOnOff(on, out _);
  881. }
  882. public override bool GeneratorSetpower(float val)
  883. {
  884. if (_Generator == null) return false;
  885. if (Math.Abs(val) > 0.01)
  886. _Generator.SetPower((ushort)val);
  887. return true;
  888. }
  889. public override bool MagnetSetpower(float val)
  890. {
  891. if (_Magnet == null) return false;
  892. if (Math.Abs(val) >= 0)
  893. _Magnet.SetMagnetPower(val);
  894. return true;
  895. }
  896. public override bool SetFieldRatio(float val)
  897. {
  898. if (_Magnet == null) return false;
  899. _Magnet.SetFieldRatio(val);
  900. return true;
  901. }
  902. public override bool SetWaveform(int val)
  903. {
  904. if (_Magnet == null) return false;
  905. _Magnet.SetWaveform(val);
  906. return true;
  907. }
  908. public override float GetPVPosition()
  909. {
  910. return _pendulumValve.Position;
  911. }
  912. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  913. {
  914. _Chiller?.SetChillerTemp((float)value, (float)offset);
  915. await Task.Delay(1000);
  916. _Chiller?.SetChillerOnOff(true);
  917. }
  918. public override void Home()
  919. {
  920. SetLiftPin(MovementPosition.Down, out _);
  921. //转交TM
  922. if (!IsSlitDoorClosed)
  923. {
  924. SetSlitDoor(true, out _);
  925. }
  926. else
  927. {
  928. SetSlitDoor(false, out _);
  929. }
  930. if (_linerDoor.State == CylinderState.Open)
  931. {
  932. SetLinerDoor(true, out _);
  933. }
  934. else
  935. {
  936. SetLinerDoor(false, out _);
  937. }
  938. SetLinerDoor(false, out _);
  939. //SetSlitDoor(false, out _);
  940. OpenValve(ValveType.PVN22, false);
  941. _MainPump?.ReConnect();
  942. _TurboPump?.ReConnect();
  943. _pendulumValve?.ReConnect();
  944. _GeneratorBias.Reset();
  945. _BiasMatch.Reset();
  946. _GeneratorBias.ReConnect();
  947. }
  948. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  949. => _Chiller?.SetChillerOnOff(onoff);
  950. public override bool OnOffSetESCHV(bool on)
  951. => _ESCHV.SetPowerOnOff(on);
  952. public override void OpenValve(ValveType vlvType, bool on)
  953. {
  954. if (vlvType != ValveType.SoftPump)
  955. {
  956. if (Valve2IO.ContainsKey(vlvType))
  957. {
  958. if (vlvType == ValveType.TurboPumpPurge && on)
  959. {
  960. if (!IsISOOpen)
  961. {
  962. LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPumpPumping valve is not open, can not turn on TurboPumpPurge valve.");
  963. return;
  964. }
  965. }
  966. else if (vlvType == ValveType.TurboPumpPumping && !on)
  967. {
  968. if (IsTurboPumpRunning)
  969. {
  970. if (IsPenVOpen)
  971. {
  972. LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPump is open but Pendulum Valve is open, can not turn off TurboPumpPumping valve.");
  973. return;
  974. }
  975. }
  976. }
  977. if (vlvType == ValveType.TurboPumpPurge && !_TurboPumpPumpingValve.Status && on)
  978. {
  979. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Purge, cause Turbo Pump Valve not open");
  980. return;
  981. }
  982. if (vlvType == ValveType.TurboPumpPumping && on)
  983. {
  984. if (!_MainPump.IsRunning)
  985. {
  986. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause Dry Pump Valve is not open");
  987. return;
  988. }
  989. if (ForelinePressure > SC.GetValue<int>($"{Module}.TurboPumpPumpingValveMinForelinePressure"))
  990. {
  991. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause forelinePressure:{ForelinePressure}");
  992. return;
  993. }
  994. }
  995. Valve2IO[vlvType].TurnValve(on, out _);
  996. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  997. }
  998. else
  999. {
  1000. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  1001. }
  1002. }
  1003. }
  1004. public override bool PendulumValveIsOpen()
  1005. {
  1006. return _pendulumValve.IsOpen;
  1007. }
  1008. public override bool RetractWafer()
  1009. {
  1010. throw new NotImplementedException();
  1011. }
  1012. public override void SetBacksideHeFlow(double flow)
  1013. {
  1014. if (_backsideHe == null) return;
  1015. _backsideHe.Flow(flow);
  1016. }
  1017. public override bool SetBacksideHePressure(float mTorr)
  1018. {
  1019. if (_backsideHe == null) return false;
  1020. return _backsideHe.SetBacksideHelium(mTorr);
  1021. }
  1022. public override bool SetBacksideHeThreshold(float nMin, float nMax)
  1023. {
  1024. if (_backsideHe == null) return false;
  1025. return _backsideHe.SetFlowThreshold(nMin, nMax);
  1026. }
  1027. public override bool SetBiasMatchPosition(float c1, float c2)
  1028. {
  1029. if (_BiasMatch == null) return false;
  1030. string reason = string.Empty;
  1031. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  1032. return true;
  1033. }
  1034. public override bool SetBiasPulseMode(bool on)
  1035. {
  1036. if (_GeneratorBias == null) return false;
  1037. _GeneratorBias.SetPulseMode(on);
  1038. return true;
  1039. }
  1040. public override bool SetBiasPulseRateFreq(int nFreq)
  1041. {
  1042. if (_GeneratorBias == null) return false;
  1043. _GeneratorBias.SetPulseRateFreq(nFreq);
  1044. return true;
  1045. }
  1046. public override bool SetDiasPulseDutyCycle(int percentage)
  1047. {
  1048. if (_GeneratorBias == null) return false;
  1049. _GeneratorBias.SetPulseDutyCycle(percentage);
  1050. return true;
  1051. }
  1052. public override bool SetESCClampVoltage(int nVoltage)
  1053. {
  1054. if (_ESCHV == null) return false;
  1055. return _ESCHV.SetOutputVoltage(nVoltage);
  1056. }
  1057. public override void SetGeneratorCommunicationMode(int mode)
  1058. => _Generator?.SetCommunicationMode(mode);
  1059. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  1060. {
  1061. reason = string.Empty;
  1062. switch (dirt)
  1063. {
  1064. case MovementPosition.Down:
  1065. return _LiftPin.SetCylinder(false, out reason);
  1066. case MovementPosition.Up:
  1067. return _LiftPin.SetCylinder(true, out reason);
  1068. case MovementPosition.Left:
  1069. case MovementPosition.Right:
  1070. case MovementPosition.Middle:
  1071. throw new ArgumentException("Movement argument error");
  1072. }
  1073. return true;
  1074. }
  1075. public override bool SetMatchPosition(float c1, float c2)
  1076. {
  1077. if (_Match == null) return false;
  1078. string reason = string.Empty;
  1079. _Match.SetMatchPosition(c1, c2, out reason);
  1080. return true;
  1081. }
  1082. public override bool SetPVPostion(float position)
  1083. => _pendulumValve.SetPosition(position);
  1084. public override bool SetPVPressure(float pressure)
  1085. => _pendulumValve.SetPressure(pressure / 10);
  1086. public override bool SetSlitDoor(bool open, out string reason)
  1087. {
  1088. reason = string.Empty;
  1089. OP.DoOperation($"{ModuleName.SETM}.SetSlitDoor", Module, open);
  1090. return true;
  1091. }
  1092. public override bool SetLinerDoor(bool open, out string reason)
  1093. {
  1094. if (open)
  1095. {
  1096. if (RouteManager.IsATMMode)
  1097. {
  1098. if (!IsATM)
  1099. {
  1100. reason = $"{Module} is not ATM, can not open slit door";
  1101. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  1102. return false;
  1103. }
  1104. }
  1105. //else
  1106. //{
  1107. // double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  1108. // if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  1109. // {
  1110. // reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  1111. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  1112. // return false;
  1113. // }
  1114. //}
  1115. }
  1116. return _linerDoor.SetCylinder(open, out reason);
  1117. }
  1118. public override bool SetWallTCTemperature(float value)
  1119. => _WallTC.RampTemp(value);
  1120. public override void StopAllGases()
  1121. {
  1122. foreach (var line in _gasLines)
  1123. {
  1124. line.Stop();
  1125. }
  1126. }
  1127. public override bool StopGas(int gasNum)
  1128. {
  1129. if (_gasLines.Length <= gasNum)
  1130. return false;
  1131. _gasLines[gasNum].Stop();
  1132. return true;
  1133. }
  1134. public override bool StopN2()
  1135. {
  1136. _gasLineN2.Stop();
  1137. return true;
  1138. }
  1139. public override void SwitchOnBuzzerAndRed()
  1140. {
  1141. throw new NotImplementedException();
  1142. }
  1143. public override void TurnDryPump(bool on)
  1144. => _MainPump?.SetPumpOnOff(on);
  1145. public override bool TurnPendulumValve(bool on)
  1146. {
  1147. if (on && (!TurboPumpInterlock || !IsCDA_OK || !IsTurboPumpAtSpeed || !IsWLK))
  1148. {
  1149. LOG.Write(eEvent.ERR_PENDULUM_VALVE, Module, "Cannot open PendulumValve, as Interlock not arrival");
  1150. return false;
  1151. }
  1152. return _pendulumValve.TurnValve(on);
  1153. }
  1154. public override void TurnTurboPump(bool on)
  1155. {
  1156. _TurboPump?.SetPumpOnOff(on);
  1157. }
  1158. public override bool PreparePlace()
  1159. {
  1160. if (!SetSlitDoor(true, out string reason))
  1161. {
  1162. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  1163. return false;
  1164. }
  1165. //
  1166. if (!SetLinerDoor(true, out reason))
  1167. {
  1168. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
  1169. return false;
  1170. }
  1171. if (!SetLiftPin(MovementPosition.Down, out reason))
  1172. {
  1173. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1174. return false;
  1175. }
  1176. return true;
  1177. }
  1178. public override bool PreparePick()
  1179. {
  1180. if (!SetSlitDoor(true, out string reason))
  1181. {
  1182. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  1183. return false;
  1184. }
  1185. if (!SetLinerDoor(true, out reason))
  1186. {
  1187. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
  1188. return false;
  1189. }
  1190. if (!SetLiftPin(MovementPosition.Up, out reason))
  1191. {
  1192. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1193. return false;
  1194. }
  1195. return true;
  1196. }
  1197. public override bool PreparePlaceIsOK()
  1198. {
  1199. return CheckSlitDoorOpen() && LiftPinIsDown && CheckLinerDoorOpen();
  1200. }
  1201. public override bool PreparePickIsOK()
  1202. {
  1203. return CheckSlitDoorOpen() && LiftPinIsUp && CheckLinerDoorOpen();
  1204. }
  1205. public override bool EndPlace()
  1206. {
  1207. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1208. {
  1209. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1210. return false;
  1211. }
  1212. if (!SetSlitDoor(false, out reason))
  1213. {
  1214. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1215. return false;
  1216. }
  1217. if (!SetLinerDoor(false, out reason))
  1218. {
  1219. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
  1220. return false;
  1221. }
  1222. return true;
  1223. }
  1224. public override bool EndPick()
  1225. {
  1226. if (!SetLinerDoor(false, out string reason))
  1227. {
  1228. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
  1229. return false;
  1230. }
  1231. if (!SetSlitDoor(false, out reason))
  1232. {
  1233. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1234. return false;
  1235. }
  1236. return true;
  1237. }
  1238. private void ALARM_Notify()
  1239. {
  1240. Singleton<RouteManager>.Instance.GetPM(Module).PostMsg(FSM_MSG.ALARM);
  1241. }
  1242. private void SensorWithAlarm()
  1243. {
  1244. _WLK_sw.WarningAction += ALARM_Notify;
  1245. _PM_Lid_Closed.WarningAction += ALARM_Notify;
  1246. _RFG_Interlock.WarningAction += ALARM_Notify;
  1247. _TurboPumpInterlock.WarningAction += ALARM_Notify;
  1248. _GasBoxDoor.WarningAction += ALARM_Notify;
  1249. _GasBoxPressure.WarningAction += ALARM_Notify;
  1250. }
  1251. public override bool EndPlaceIsOK()
  1252. {
  1253. return CheckSlitDoorClose() && LiftPinIsDown;
  1254. }
  1255. public override bool EndPickIsOK()
  1256. {
  1257. return CheckSlitDoorClose();
  1258. }
  1259. #endregion
  1260. protected override void CheckPermanentInterlock()
  1261. {
  1262. if (ChamberPressure > 950 && _GuageValve.SetPoint)
  1263. {
  1264. _GuageValve.TurnValve(false, out _);
  1265. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed 950 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1266. }
  1267. if (ChamberPressure < 950 && !_GuageValve.SetPoint)
  1268. {
  1269. _GuageValve.TurnValve(true, out _);
  1270. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed 950 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1271. }
  1272. }
  1273. public override void PMInError()
  1274. {
  1275. CloseValves();
  1276. GeneratorPowerOn(false);
  1277. GeneratorBiasPowerOn(false);
  1278. OpenValve(ValveType.TurboPumpPumping, true);
  1279. OpenValve(ValveType.TurboPumpPurge, true);
  1280. _pendulumValve.SetPosition(1000);
  1281. OnOffSetESCHV(false);
  1282. }
  1283. }
  1284. }