JetVenusSEPM.cs 53 KB

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