JetVenusSEPM.cs 50 KB

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