JetVenusDEPM.cs 58 KB

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