JetVenusSEPM.cs 54 KB

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