JetVenusDEPM.cs 57 KB

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