JetVenusDEPM.cs 61 KB

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