JetVenusDEPM.cs 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440
  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. }
  366. #endregion
  367. #region 暴露变量
  368. public override bool IsLidClosed => _Lid.OFFFeedback;
  369. public override bool IsSlitDoorClosed
  370. {
  371. get
  372. {
  373. if (Singleton<RouteManager>.Instance.seTM != null)
  374. {
  375. switch (Module)
  376. {
  377. case ModuleName.PMA:
  378. return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorClosed;
  379. case ModuleName.PMB:
  380. return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
  381. case ModuleName.PMC:
  382. return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
  383. case ModuleName.PMD:
  384. return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
  385. default:
  386. return false;
  387. }
  388. }
  389. else
  390. return false;
  391. }
  392. }
  393. public override bool IsLinerDoorClosed => _linerDoor.State == CylinderState.Close;
  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 => _linerDoor.State == CylinderState.Close;
  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;
  455. case ModuleName.PMB:
  456. return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
  457. case ModuleName.PMC:
  458. return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
  459. case ModuleName.PMD:
  460. return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
  461. default:
  462. return true;
  463. }
  464. }
  465. }
  466. //public override double ProcessLowPressure => _pressureController.ProcessLow.Value;
  467. //public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
  468. public override double ProcessPressure => _pendulumValve.Pressure >= 950 ? 950 : _pendulumValve.Pressure;
  469. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  470. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  471. public override double TargetPressure => _pressureController.TargetPressure;
  472. public override double ESCHePressure => _pressureController.ESCHeGauge.Value;
  473. public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
  474. public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
  475. public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
  476. public override bool IsHVOn => _ESCHV.IsOn;
  477. public override float CoolantInletWallTempFB
  478. {
  479. get
  480. {
  481. switch (SC.GetValue<int>($"{Module}.WallChiller.CommunicationType"))
  482. {
  483. case (int)CommunicationType.RS232:
  484. return _WallChiller.ControlTcFeedback;
  485. case (int)CommunicationType.RS485:
  486. return _WallChiller.Temperature;
  487. default:
  488. return 0;
  489. }
  490. }
  491. }
  492. public override float CoolantInletTempFB
  493. {
  494. get
  495. {
  496. switch (SC.GetValue<int>($"{Module}.Chiller.CommunicationType"))
  497. {
  498. case (int)CommunicationType.RS232:
  499. return _Chiller.ControlTcFeedback;
  500. case (int)CommunicationType.RS485:
  501. return _Chiller.Temperature;
  502. default:
  503. return 0;
  504. }
  505. }
  506. }
  507. public override float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
  508. public override bool ChillerIsRunning => _Chiller.IsRunning;
  509. public override float ReflectPower => _Generator.ReflectPower;
  510. public override float BiasReflectPower => _GeneratorBias.ReflectPower;
  511. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  512. public override MovementPosition LiftPinPosition
  513. {
  514. get
  515. {
  516. MovementPosition pos = MovementPosition.Unknown;
  517. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  518. {
  519. pos = MovementPosition.Up;
  520. }
  521. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  522. {
  523. pos = MovementPosition.Down;
  524. }
  525. return pos;
  526. }
  527. }
  528. public override double TotalGasSetpoint
  529. {
  530. get
  531. {
  532. double sum = 0;
  533. foreach (var gas in _gasLines)
  534. {
  535. sum += gas.FlowSP;
  536. }
  537. return sum;
  538. }
  539. }
  540. public override bool HasGasOutOfRange
  541. {
  542. get
  543. {
  544. foreach (var gas in _gasLines)
  545. {
  546. if (!gas.IsOutOfRange)
  547. return false;
  548. }
  549. return true;
  550. }
  551. }
  552. public override bool IsLidLoadlockClosed
  553. {
  554. get
  555. {
  556. //LOG.Write(eEvent.ERR_PM,Module,"VenusSE PM is not exist Loadlock!");
  557. return false;
  558. }
  559. }
  560. //public override bool IsATMLoadlock
  561. //{
  562. // get
  563. // {
  564. // //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  565. // return false;
  566. // }
  567. //}
  568. //public override bool IsVACLoadLock
  569. //{
  570. // get
  571. // {
  572. // //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  573. // return false;
  574. // }
  575. //}
  576. public override bool IsLoadlockArmRetract
  577. {
  578. get
  579. {
  580. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  581. return false;
  582. }
  583. }
  584. public override bool IsLoadlockArmExtend
  585. {
  586. get
  587. {
  588. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  589. return false;
  590. }
  591. }
  592. public override bool LoadlockArmRetract
  593. {
  594. get
  595. {
  596. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  597. return false;
  598. }
  599. }
  600. public override bool LoadlockArmExtend
  601. {
  602. get
  603. {
  604. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  605. return false;
  606. }
  607. }
  608. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  609. public override float RFMatchC2 => _Match != null ? _Match.TunePosition1 : 0;
  610. public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  611. public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  612. //public override double LoadlockPressure
  613. //{
  614. // get
  615. // {
  616. // //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  617. // return -100;
  618. // }
  619. //}
  620. public override void Monitor()
  621. {
  622. CheckPermanentInterlock();
  623. }
  624. public override void BuzzerBlinking(double time)
  625. {
  626. LOG.Write(eEvent.ERR_PM, Module, "VenusDE PM is not exist SignalTower!");
  627. }
  628. #endregion
  629. #region 公共方法
  630. public override bool CheckAtm()
  631. {
  632. //检查是否是ATM模式
  633. return _ATM_sw.Value && ChamberPressure > 700000;
  634. }
  635. public override void RTCloseEvent()
  636. {
  637. if (_GeneratorBias.IsPowerOn)
  638. {
  639. GeneratorBiasPowerOn(false);
  640. }
  641. if (PendulumValveIsOpen())
  642. {
  643. TurnPendulumValve(false);
  644. }
  645. }
  646. public override bool CheckChillerStatus()
  647. {
  648. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  649. }
  650. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  651. {
  652. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  653. if (!PMLidClosed)
  654. {
  655. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  656. return false;
  657. }
  658. if (!IsVAC)
  659. {
  660. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  661. return false;
  662. }
  663. //if (!IsWaterFlowOk)
  664. //{
  665. // LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  666. // return false;
  667. //}
  668. if (!IsRFGInterlockOn)
  669. {
  670. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  671. return false;
  672. }
  673. //if (!SourceRFFanInterlock)
  674. //{
  675. // LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  676. // return false;
  677. //}
  678. if (!SlitDoorClosed)
  679. {
  680. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  681. return false;
  682. }
  683. if (!LinerDoorClosed)
  684. {
  685. LOG.Write(evt, Module, $"Cannot Power ON {device} as Liner Door is open.");
  686. return false;
  687. }
  688. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  689. {
  690. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  691. return false;
  692. }
  693. return true;
  694. }
  695. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  696. {
  697. if (_BiasMatch == null) return false;
  698. if (matchWorkMode == MatchWorkMode.Auto)
  699. {
  700. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  701. }
  702. else if (matchWorkMode == MatchWorkMode.Manual)
  703. {
  704. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  705. }
  706. return false;
  707. }
  708. public override bool IsRFAble()
  709. {
  710. return false;
  711. }
  712. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  713. {
  714. OpenValve(ValveType.TurboPumpPumping, true);
  715. if (_TurboPumpPumpingValve.Status)
  716. {
  717. OpenValve(ValveType.Purge, true);
  718. OpenValve(ValveType.GasFinal, false);
  719. //OpenValve(ValveType.N2, true);
  720. OpenValve(ValveType.PVN22, true);
  721. TurnPendulumValve(true);
  722. SetPVPressure(pressureSetpoint);
  723. return true;
  724. }
  725. else
  726. {
  727. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot control pressure,cause Turbo Pump Pumping Valve is Close");
  728. return true;
  729. }
  730. }
  731. public async override void AbortControlPressure()
  732. {
  733. OpenValve(ValveType.PVN22, false);
  734. OpenValve(ValveType.N2, false);
  735. await Task.Delay(2000);
  736. OpenValve(ValveType.GasFinal, false);
  737. OpenValve(ValveType.Purge, false);
  738. //return true;
  739. }
  740. public override void CheckIdleInterlock()
  741. {
  742. if (ForelinePressure > _foreline_interlock_pressure)
  743. {
  744. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  745. {
  746. _pendulumValve.TurnValve(false);
  747. _TurboPumpPurgeValve.TurnValve(false, out _);
  748. _TurboPumpPumpingValve.TurnValve(false, out _);
  749. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  750. }
  751. }
  752. }
  753. public override bool CheckLiftDown()
  754. {
  755. return _LiftPin.State == CylinderState.Close;
  756. }
  757. public override bool CheckLiftUp()
  758. {
  759. return _LiftPin.State == CylinderState.Open;
  760. }
  761. public override bool CheckLinerDoorOpen()
  762. {
  763. return _linerDoor.State == CylinderState.Open;
  764. }
  765. public override bool CheckLinerDoorClose()
  766. {
  767. return IsLinerDoorClosed;
  768. }
  769. public override bool CheckSlitDoorClose()
  770. => IsSlitDoorClosed;
  771. public override bool CheckSlitDoorOpen()
  772. => !IsSlitDoorClosed;// !IsLinerDoorClosed
  773. public override void CloseValves(int? delayTime = null)
  774. {
  775. _PVN21Valve.TurnValve(false, out _);
  776. //_PVN22Valve.TurnValve(false, out _);
  777. _PV11Valve.TurnValve(false, out _);
  778. _PV12Valve.TurnValve(false, out _);
  779. _PV21Valve.TurnValve(false, out _);
  780. _PV22Valve.TurnValve(false, out _);
  781. _PV31Valve.TurnValve(false, out _);
  782. _PV32Valve.TurnValve(false, out _);
  783. _PV41Valve.TurnValve(false, out _);
  784. _PV42Valve.TurnValve(false, out _);
  785. _PVHe1Valve.TurnValve(false, out _);
  786. _PVHe2Valve.TurnValve(false, out _);
  787. _GasFinalValve.TurnValve(false, out _);
  788. //_SoftPumpValve.TurnValve(false, out _);
  789. _FastPumpValve.TurnValve(false, out _);
  790. //_TurboPumpPumpingValve.TurnValve(false, out _);
  791. //_TurboPumpPurgeValve.TurnValve(false, out _);
  792. _GuageValve.TurnValve(false, out _);
  793. _PurgeValve.TurnValve(false, out _);
  794. _N2Valve.TurnValve(false, out _);
  795. _FastPumpValve.TurnValve(false, out _);
  796. _PVHe3Valve.TurnValve(false, out _);
  797. _HeISOValve.TurnValve(false, out _);
  798. _MainPurgeValve.TurnValve(false, out _);
  799. _SecondPurgeValve.TurnValve(false, out _);
  800. //新增
  801. _Mfc1Valve.TurnValve(false, out _);
  802. _Mfc2Valve.TurnValve(false, out _);
  803. _Mfc3Valve.TurnValve(false, out _);
  804. _Mfc4Valve.TurnValve(false, out _);
  805. _Mfc5Valve.TurnValve(false, out _);
  806. _Mfc6Valve.TurnValve(false, out _);
  807. _Mfc7Valve.TurnValve(false, out _);
  808. _Mfc8Valve.TurnValve(false, out _);
  809. _Mfc9Valve.TurnValve(false, out _);
  810. _Mfc10Valve.TurnValve(false, out _);
  811. _Mfc11Valve.TurnValve(false, out _);
  812. _Mfc12Valve.TurnValve(false, out _);
  813. _PV51Valve.TurnValve(false, out _);
  814. _PV52Valve.TurnValve(false, out _);
  815. _PV61Valve.TurnValve(false, out _);
  816. _PV62Valve.TurnValve(false, out _);
  817. _PV71Valve.TurnValve(false, out _);
  818. _PV72Valve.TurnValve(false, out _);
  819. _PV81Valve.TurnValve(false, out _);
  820. _PV82Valve.TurnValve(false, out _);
  821. _PV91Valve.TurnValve(false, out _);
  822. _PV92Valve.TurnValve(false, out _);
  823. _PVA1Valve.TurnValve(false, out _);
  824. _PVA2Valve.TurnValve(false, out _);
  825. _PVB1Valve.TurnValve(false, out _);
  826. _PVB2Valve.TurnValve(false, out _);
  827. _PVC1Valve.TurnValve(false, out _);
  828. _PVC2Valve.TurnValve(false, out _);
  829. foreach (var stick in _gasLines)
  830. {
  831. stick.Stop();
  832. }
  833. }
  834. public override bool ExtendWafer()
  835. {
  836. throw new NotImplementedException();
  837. }
  838. public override bool FlowGas(int gasNum, double val)
  839. {
  840. if (_gasLines.Length <= gasNum)
  841. return false;
  842. _gasLines[gasNum].Flow(val);
  843. return true;
  844. }
  845. public override bool FlowN2(double val)
  846. {
  847. _gasLineN2.Flow(val);
  848. return true;
  849. }
  850. public override bool GeneratorBiasPowerOn(bool on)
  851. {
  852. if (_GeneratorBias == null) return false;
  853. if (on && !IsRFGInterlockOn)
  854. {
  855. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  856. return false;
  857. }
  858. return _GeneratorBias.SetPowerOnOff(on, out _);
  859. }
  860. //public override bool MagnetPowerOn(bool on)
  861. //{
  862. // if (_Magnet == null) return false;
  863. // return _Magnet.SetMagnetOnOff(on, out _);
  864. //}
  865. public override bool GeneratorBiasSetMatchMode(bool val)
  866. {
  867. if (_GeneratorBias == null) return false;
  868. string reason = string.Empty;
  869. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  870. return true;
  871. }
  872. public override bool GeneratorBiasSetpower(float val)
  873. {
  874. if (_GeneratorBias == null) return false;
  875. _GeneratorBias.SetPower((ushort)val);
  876. return true;
  877. }
  878. public override bool GeneratorPowerOn(bool on)
  879. {
  880. if (_Generator == null) return false;
  881. if (on && !IsRFGInterlockOn)
  882. {
  883. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  884. return false;
  885. }
  886. return _Generator.SetPowerOnOff(on, out _);
  887. }
  888. public override bool GeneratorSetpower(float val)
  889. {
  890. if (_Generator == null) return false;
  891. if (Math.Abs(val) > 0.01)
  892. _Generator.SetPower((ushort)val);
  893. return true;
  894. }
  895. public override bool MagnetSetpower(float val)
  896. {
  897. if (_Magnet == null) return false;
  898. if (Math.Abs(val) >= 0)
  899. _Magnet.SetMagnetPower(val);
  900. return true;
  901. }
  902. public override bool SetFieldRatio(float val)
  903. {
  904. if (_Magnet == null) return false;
  905. _Magnet.SetFieldRatio(val);
  906. return true;
  907. }
  908. public override bool SetWaveform(int val)
  909. {
  910. if (_Magnet == null) return false;
  911. _Magnet.SetWaveform(val);
  912. return true;
  913. }
  914. public override float GetPVPosition()
  915. {
  916. return _pendulumValve.Position;
  917. }
  918. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  919. {
  920. _Chiller?.SetChillerTemp((float)value, (float)offset);
  921. await Task.Delay(1000);
  922. _Chiller?.SetChillerOnOff(true);
  923. }
  924. public override void Home()
  925. {
  926. SetLiftPin(MovementPosition.Down, out _);
  927. //转交TM
  928. if (!IsSlitDoorClosed)
  929. {
  930. SetSlitDoor(false, out _);
  931. }
  932. if (!IsLinerDoorClosed) //
  933. {
  934. SetLinerDoor(false, out _);
  935. }
  936. SetLinerDoor(false, out _);
  937. OpenValve(ValveType.PVN22, false);
  938. _GeneratorBias?.ReConnect();
  939. _BiasMatch?.ReConnect();
  940. _MainPump?.ReConnect();
  941. _TurboPump?.ReConnect();
  942. _pendulumValve?.ReConnect();
  943. _GeneratorBias?.Reset();
  944. _BiasMatch?.Reset();
  945. _Magnet?.Reset();
  946. }
  947. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  948. => _Chiller?.SetChillerOnOff(onoff);
  949. public override bool OnOffSetESCHV(bool on)
  950. => _ESCHV.SetPowerOnOff(on);
  951. public override void OpenValve(ValveType vlvType, bool on)
  952. {
  953. if (vlvType != ValveType.SoftPump)
  954. {
  955. if (Valve2IO.ContainsKey(vlvType))
  956. {
  957. if (vlvType == ValveType.TurboPumpPurge && on)
  958. {
  959. if (!IsISOOpen)
  960. {
  961. LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPumpPumping valve is not open, can not turn on TurboPumpPurge valve.");
  962. return;
  963. }
  964. }
  965. else if (vlvType == ValveType.TurboPumpPumping && !on)
  966. {
  967. if (IsTurboPumpRunning)
  968. {
  969. if (IsPenVOpen)
  970. {
  971. LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPump is open but Pendulum Valve is open, can not turn off TurboPumpPumping valve.");
  972. return;
  973. }
  974. }
  975. }
  976. if (vlvType == ValveType.TurboPumpPurge && !_TurboPumpPumpingValve.Status && on)
  977. {
  978. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Purge, cause Turbo Pump Valve not open");
  979. return;
  980. }
  981. if (vlvType == ValveType.TurboPumpPumping && on)
  982. {
  983. if (!_MainPump.IsRunning)
  984. {
  985. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause Dry Pump Valve is not open");
  986. return;
  987. }
  988. if (ForelinePressure > SC.GetValue<int>($"{Module}.TurboPumpPumpingValveMinForelinePressure"))
  989. {
  990. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause forelinePressure:{ForelinePressure}");
  991. return;
  992. }
  993. }
  994. Valve2IO[vlvType].TurnValve(on, out _);
  995. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  996. }
  997. else
  998. {
  999. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  1000. }
  1001. }
  1002. }
  1003. public override bool PendulumValveIsOpen()
  1004. {
  1005. return _pendulumValve.IsOpen;
  1006. }
  1007. public override bool RetractWafer()
  1008. {
  1009. throw new NotImplementedException();
  1010. }
  1011. public override void SetBacksideHeFlow(double flow)
  1012. {
  1013. if (_backsideHe == null) return;
  1014. _backsideHe.Flow(flow);
  1015. }
  1016. public override bool SetBacksideHePressure(float mTorr)
  1017. {
  1018. if (_backsideHe == null) return false;
  1019. return _backsideHe.SetBacksideHelium(mTorr);
  1020. }
  1021. public override bool SetBacksideHeThreshold(float nMin, float nMax)
  1022. {
  1023. if (_backsideHe == null) return false;
  1024. return _backsideHe.SetFlowThreshold(nMin, nMax);
  1025. }
  1026. public override bool SetBiasMatchPosition(float c1, float c2)
  1027. {
  1028. if (_BiasMatch == null) return false;
  1029. string reason = string.Empty;
  1030. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  1031. return true;
  1032. }
  1033. public override bool SetBiasPulseMode(bool on)
  1034. {
  1035. if (_GeneratorBias == null) return false;
  1036. _GeneratorBias.SetPulseMode(on);
  1037. return true;
  1038. }
  1039. public override bool SetBiasPulseRateFreq(int nFreq)
  1040. {
  1041. if (_GeneratorBias == null) return false;
  1042. _GeneratorBias.SetPulseRateFreq(nFreq);
  1043. return true;
  1044. }
  1045. public override bool SetDiasPulseDutyCycle(int percentage)
  1046. {
  1047. if (_GeneratorBias == null) return false;
  1048. _GeneratorBias.SetPulseDutyCycle(percentage);
  1049. return true;
  1050. }
  1051. public override bool SetESCClampVoltage(int nVoltage)
  1052. {
  1053. if (_ESCHV == null) return false;
  1054. return _ESCHV.SetOutputVoltage(nVoltage);
  1055. }
  1056. public override void SetGeneratorCommunicationMode(int mode)
  1057. => _Generator?.SetCommunicationMode(mode);
  1058. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  1059. {
  1060. reason = string.Empty;
  1061. switch (dirt)
  1062. {
  1063. case MovementPosition.Down:
  1064. return _LiftPin.SetCylinder(false, out reason);
  1065. case MovementPosition.Up:
  1066. return _LiftPin.SetCylinder(true, out reason);
  1067. case MovementPosition.Left:
  1068. case MovementPosition.Right:
  1069. case MovementPosition.Middle:
  1070. throw new ArgumentException("Movement argument error");
  1071. }
  1072. return true;
  1073. }
  1074. public override bool SetMatchPosition(float c1, float c2)
  1075. {
  1076. if (_Match == null) return false;
  1077. string reason = string.Empty;
  1078. _Match.SetMatchPosition(c1, c2, out reason);
  1079. return true;
  1080. }
  1081. public override bool SetPVPostion(float position)
  1082. => _pendulumValve.SetPosition(position);
  1083. public override bool SetPVPressure(float pressure)
  1084. => _pendulumValve.SetPressure(pressure / 10);
  1085. public override bool SetSlitDoor(bool open, out string reason)
  1086. {
  1087. reason = string.Empty;
  1088. //OP.DoOperation($"{Singleton<RouteManager>.Instance.seTM.Module}.SetSlitDoor", Module, open);
  1089. return true;
  1090. }
  1091. public override bool SetLinerDoor(bool open, out string reason)
  1092. {
  1093. return _linerDoor.SetCylinder(open, out reason);
  1094. }
  1095. public override bool SetWallTCTemperature(float value)
  1096. => _WallTC.RampTemp(value);
  1097. public override void StopAllGases()
  1098. {
  1099. foreach (var line in _gasLines)
  1100. {
  1101. line.Stop();
  1102. }
  1103. }
  1104. public override bool StopGas(int gasNum)
  1105. {
  1106. if (_gasLines.Length <= gasNum)
  1107. return false;
  1108. _gasLines[gasNum].Stop();
  1109. return true;
  1110. }
  1111. public override bool StopN2()
  1112. {
  1113. _gasLineN2.Stop();
  1114. return true;
  1115. }
  1116. public override void SwitchOnBuzzerAndRed()
  1117. {
  1118. throw new NotImplementedException();
  1119. }
  1120. public override void TurnDryPump(bool on)
  1121. => _MainPump?.SetPumpOnOff(on);
  1122. public override bool TurnPendulumValve(bool on)
  1123. {
  1124. if (on && (!TurboPumpInterlock || !IsCDA_OK || !IsTurboPumpAtSpeed || !IsWLK))
  1125. {
  1126. LOG.Write(eEvent.ERR_PENDULUM_VALVE, Module, "Cannot open PendulumValve, as Interlock not arrival");
  1127. return false;
  1128. }
  1129. return _pendulumValve.TurnValve(on);
  1130. }
  1131. public override void TurnTurboPump(bool on)
  1132. {
  1133. _TurboPump?.SetPumpOnOff(on);
  1134. }
  1135. public override bool PreparePlace()
  1136. {
  1137. if (!SetLinerDoor(true, out string reason))
  1138. {
  1139. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
  1140. return false;
  1141. }
  1142. //
  1143. if (!SetLiftPin(MovementPosition.Down, out reason))
  1144. {
  1145. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1146. return false;
  1147. }
  1148. return true;
  1149. }
  1150. public override bool PreparePick()
  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 (!SetLiftPin(MovementPosition.Up, out reason))
  1158. {
  1159. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1160. return false;
  1161. }
  1162. return true;
  1163. }
  1164. public override bool PreparePlaceIsOK()
  1165. {
  1166. return LiftPinIsDown && CheckLinerDoorOpen();
  1167. }
  1168. public override bool PreparePickIsOK()
  1169. {
  1170. return LiftPinIsUp && CheckLinerDoorOpen();
  1171. }
  1172. public override bool EndPlace()
  1173. {
  1174. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1175. {
  1176. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1177. return false;
  1178. }
  1179. if (!SetLinerDoor(false, out reason))
  1180. {
  1181. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
  1182. return false;
  1183. }
  1184. return true;
  1185. }
  1186. public override bool EndPick()
  1187. {
  1188. if (!SetLinerDoor(false, out string reason))
  1189. {
  1190. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
  1191. return false;
  1192. }
  1193. return true;
  1194. }
  1195. private void ALARM_Notify()
  1196. {
  1197. if (Singleton<RouteManager>.Instance.GetPM(Module).IsProcessing)
  1198. Singleton<RouteManager>.Instance.GetPM(Module).PostMsg(FSM_MSG.ALARM);
  1199. }
  1200. private void SensorWithAlarm()
  1201. {
  1202. _WLK_sw.WarningAction += ALARM_Notify;
  1203. _PM_Lid_Closed.WarningAction += ALARM_Notify;
  1204. _RFG_Interlock.WarningAction += ALARM_Notify;
  1205. _TurboPumpInterlock.WarningAction += ALARM_Notify;
  1206. _GasBoxDoor.WarningAction += ALARM_Notify;
  1207. _GasBoxPressure.WarningAction += ALARM_Notify;
  1208. }
  1209. public override bool EndPlaceIsOK()
  1210. {
  1211. return CheckSlitDoorClose() && LiftPinIsDown && CheckLinerDoorClose();
  1212. }
  1213. public override bool EndPickIsOK()
  1214. {
  1215. return CheckSlitDoorClose() && CheckLinerDoorClose();
  1216. }
  1217. #endregion
  1218. protected override void CheckPermanentInterlock()
  1219. {
  1220. if (ChamberPressure > 950 && _GuageValve.SetPoint)
  1221. {
  1222. _GuageValve.TurnValve(false, out _);
  1223. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed 950 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1224. }
  1225. if (ChamberPressure < 950 && !_GuageValve.SetPoint)
  1226. {
  1227. _GuageValve.TurnValve(true, out _);
  1228. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed 950 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1229. }
  1230. }
  1231. public override void PMInError()
  1232. {
  1233. CloseValves();
  1234. GeneratorPowerOn(false);
  1235. GeneratorBiasPowerOn(false);
  1236. OpenValve(ValveType.TurboPumpPumping, true);
  1237. OpenValve(ValveType.TurboPumpPurge, true);
  1238. if (IsTurboPumpAtSpeed)
  1239. {
  1240. OpenValve(ValveType.TurboPumpPumping, true);
  1241. _pendulumValve.SetPosition(1000);
  1242. }
  1243. OnOffSetESCHV(false);
  1244. }
  1245. }
  1246. }