JetVenusDEPM.cs 49 KB

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