JetVenusDEPM.cs 56 KB

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