12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using System.Threading.Tasks;
- using Aitex.Core.Common;
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Device.Unit;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using JetVirgoPM.PMs;
- using JetVirgoPM.PMs.Routines;
- using MECF.Framework.Common.Device.Bases;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Schedulers;
- using MECF.Framework.Common.SubstrateTrackings;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Pumps.EdwardsPump;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Pumps.SkyPump;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.JEL;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Rorze;
- using MECF.Framework.RT.ModuleLibrary.SystemModules;
- namespace JetVirgoPM.Devices
- {
- enum ValveType
- {
- PROCESS,
- N2,
- FAST_PUMP,
- SOFT_PUMP,
- FAST_VENT,
- PURGE,
- Mfc1,
- Mfc2,
- Mfc3,
- Mfc4,
- Mfc5,
- Mfc6,
- }
- class JetDualPM : DualPM
- {
- // ----------------------------Fields--------------------------
- //
- private readonly IoLid _Lid;
- //private readonly IoCylinder _LidLocker;
- private readonly IoMessage _Messager;
- private readonly IoSensor _ATM_sw;
- private readonly IoSensor _VAC_sw;
- //private readonly IoSensor _WLK_sw;
- //private readonly IoSensor _CDAPressure;
- private readonly IoSensor _CoolantInletTC1;
- private readonly IoSensor _CoolantInletTC2;
- private readonly IoSensor _CoolantOutletTC1;
- private readonly IoSensor _CoolantOutletTC2;
- //private readonly IoSensor _ArmNotExtend;
- private readonly IoSensor _N2Pressure_sw;
- private readonly IoSensor _LEOT1;
- private readonly IoSensor _LEOT2;
- private readonly IoSensor _GBInterlock;
- private readonly IoSensor _TMRobotNotExtendToPM1;
- private readonly IoSensor _TMRobotNotExtendToPM2;
- private readonly IoSensor _TMInSafety;
- private readonly IoSensor _CHBOTSW;
- private readonly IoSensor _SourceFan;
- private readonly IoSensor _GeneratorInterlock;
- private readonly IoSensor _SensorWaterFlowOk1;
- private readonly IoSensor _SensorWaterFlowOk2;
- //private readonly IoSensor _RFG_Interlock;
- private readonly IoPressureControl _pressureController;
- private readonly IoHeater _ChamberHeater1;
- private readonly IoHeater _HeaterChamber;
- private readonly IoHeater _ForelineHeater;
- private readonly IoHeater _LEHeater1;
- private readonly IoHeater _LEHeater2;
- private readonly IoValve _SoftPumpValve;
- private readonly IoValve _FastPumpValve;
- private readonly IoValve _ProcessValve;
- private readonly IoValve _N2Valve;
- private readonly IoValve _PurgeValve;
- private readonly IoValve _FastVentValve;
- private readonly IoValve _Mfc1Valve;
- private readonly IoValve _Mfc2Valve;
- private readonly IoValve _Mfc3Valve;
- private readonly IoValve _Mfc4Valve;
- private readonly IoValve _Mfc5Valve;
- private readonly IoValve _Mfc6Valve;
- //private readonly IoValve _N2SupplyValve;
- private readonly IoCylinder _slitDoor1;
- private readonly IoCylinder _slitDoor2;
- private readonly IoCylinder _LiftPin1;
- private readonly IoCylinder _LiftPin2;
- private readonly IoCylinder _GuidePin1; // 3'
- private readonly IoCylinder _GuidePin2; // 4'
- private readonly RfPowerBase _Generator1;
- private readonly RfPowerBase _Generator2;
- private readonly RfPowerBase _GeneratorBias1;
- private readonly RfPowerBase _GeneratorBias2;
- private readonly RfMatchBase _Match1;
- private readonly RfMatchBase _Match2;
- private readonly PumpBase _MainPump;
- private readonly ChillerBase _Chiller1;
- private readonly ChillerBase _Chiller2;
- private readonly IoGasStick[] _gasLines;
- private bool[] _mfcValveStatus => new bool[] {
- _Mfc1Valve.Status,_Mfc2Valve.Status,_Mfc3Valve.Status,_Mfc4Valve.Status,_Mfc5Valve.Status,_Mfc6Valve.Status
- };
- private bool _isAllGasValveOff => _mfcValveStatus != null && _mfcValveStatus.Length > 0 && _mfcValveStatus.All(p => !p);
- private bool _isAnyWaterFlowOff => (_SensorWaterFlowOk1 != null && !_SensorWaterFlowOk1.Value) || (_SensorWaterFlowOk2 != null && !_SensorWaterFlowOk2.Value);
- private bool _isRFGasInterlockOff => _GBInterlock != null && !_GBInterlock.Value;
- private readonly R_TRIG _trigBasePressure = new R_TRIG();
- private readonly R_TRIG _trigBaseTemperature1 = new R_TRIG();
- private readonly R_TRIG _trigBaseTemperature2 = new R_TRIG();
- private readonly RD_TRIG _trigRfInterlock = new RD_TRIG();
- private readonly DeviceTimer _timerRFTurnOff = new DeviceTimer();
- private double BasePressure;
- private double BaseTemperature;
- private int _bigWafer = 0;
- private int _midWafer = 0;
- private int _smallWafer = 0;
- private int gasCount = 0;
- public bool _Chamber1Disabled;
- public bool _Chamber2Disabled;
- private bool _guidePinInstalled;
- public bool GuidePinInstalled
- {
- get { return _guidePinInstalled; }
- }
- public bool AlarmPro = false;
- // --------------------------Properties------------------------
- //
- public new ModuleName Module { get; }
- // 门的状态
- public bool IsSlitDoor1Closed => !_slitDoor1.ONFeedback && _slitDoor1.OFFFeedback;
- public bool IsSlitDoor2Closed => !_slitDoor2.ONFeedback && _slitDoor2.OFFFeedback;
- public bool IsTMRobotNotExtendToPM1 => _TMRobotNotExtendToPM1.Value;
- public bool IsTMRobotNotExtendToPM2 => _TMRobotNotExtendToPM2.Value;
- // 盖子的状态
- public bool IsLidClosed => _Lid.OFFFeedback;
- // 盖子的锁
- //public bool IsLidLocked => !_LidLocker.ONSetPoint && _LidLocker.OFFSetPoint;
- public MovementPosition LiftPinPosition
- {
- get
- {
- MovementPosition pos = MovementPosition.Unknown;
- if (_LiftPin1.ONFeedback && !_LiftPin1.OFFFeedback)
- {
- pos = MovementPosition.Up;
- }
- else if (!_LiftPin1.ONFeedback && _LiftPin1.OFFFeedback)
- {
- pos = MovementPosition.Down;
- }
- return pos;
- }
- }
- public MovementPosition GuidePin1Position
- {
- get
- {
- if (_midWafer == 0)
- return MovementPosition.Down;
- MovementPosition res = MovementPosition.Unknown;
- if (_GuidePin1.ONFeedback && !_GuidePin1.OFFFeedback)
- {
- res = MovementPosition.Up;
- }
- else if (_GuidePin1.OFFFeedback && !_GuidePin1.ONFeedback)
- {
- res = MovementPosition.Down;
- }
- return res;
- }
- }
- public MovementPosition GuidePin2Position
- {
- get
- {
- if (_midWafer == 0)
- return MovementPosition.Down;
- MovementPosition res = MovementPosition.Unknown;
- if (_GuidePin2.ONFeedback && !_GuidePin2.OFFFeedback)
- {
- res = MovementPosition.Up;
- }
- else if (_GuidePin2.OFFFeedback && !_GuidePin2.ONFeedback)
- {
- res = MovementPosition.Down;
- }
- return res;
- }
- }
- public bool Chamber1Disable => _Chamber1Disabled;
- public bool Chamber2Disable => _Chamber2Disabled;
- private bool _epdIsEnable;
- public bool EPDIsEnable => _epdIsEnable;
- private bool _biasRf1Enable;
- public bool BiasRf1Enable => _biasRf1Enable;
- private bool _biasRf2Enable;
- public bool BiasRf2Enable => _biasRf2Enable;
- private bool _chiller1Enable;
- public bool Chiller1Enable => _chiller1Enable;
- private bool _chiller2Enable;
- public bool Chiller2Enable => _chiller2Enable;
- public override bool IsError
- {
- get
- {
- bool IsGeneratorBias1Error = _biasRf1Enable && _GeneratorBias1.IsError;
- bool IsGeneratorBias2Error = _biasRf2Enable && _GeneratorBias2.IsError;
- return _MainPump.IsError || _Generator1.IsError || _Generator2.IsError || IsGeneratorBias1Error || IsGeneratorBias2Error;
- }
- }
- public override bool IsIdle { get; }
- // 腔体压力
- public bool IsPressureToleranceEnabled
- {
- get => _pressureController.EnableTolerance;
- set => _pressureController.EnableTolerance = value;
- }
- public override double ChamberPressure => _pressureController.ProcessGauge.Value;
- public override double ChamberPressurePressure => _pressureController.PressureGauge.Value;
- public double ForelinePressure => _pressureController.ForelineGauge.Value;
- public PressureCtrlMode PressureMode => _pressureController.ThrottleValve.PressureMode;
- public double TargetPressure => _pressureController.TargetPressure;
- // 压力信号
- public bool IsATM => _ATM_sw.Value;
- public bool IsVAC => _VAC_sw.Value;
- //public bool IsWLK => _WLK_sw.Value;
- public bool IsGeneratorInterlockOk => _GeneratorInterlock.Value;
- // 温度
- public float ChamberTempSP1 => _ChamberHeater1.ControlTcSetPoint;
- public float ChamberTempFB1 => _ChamberHeater1.ControlTcFeedback;
- public float CoolantInletTempFB1 => _ChamberHeater1.CoolantInletTcFeedback;
- public float CoolantOutletTempFB1 => _ChamberHeater1.CoolantOutletTcFeedback;
- public float ChamberTempSP2 => _HeaterChamber.ControlTcSetPoint;
- public float ChamberTempFB2 => _HeaterChamber.ControlTcFeedback;
- public float CoolantInletTempFB2 => _HeaterChamber.CoolantInletTcFeedback;
- public float CoolantOutletTempFB2 => _HeaterChamber.CoolantOutletTcFeedback;
- // LE温度
- public float LETempSP1 => _LEHeater1.ControlTcSetPoint;
- public float LETempFB1 => _LEHeater1.ControlTcFeedback;
- public string LETempFB1Name => _LEHeater1.Name;
- public float LECoolantInletTempFB1 => _LEHeater1.CoolantInletTcFeedback;
- public float LECoolantOutletTempFB1 => _LEHeater1.CoolantOutletTcFeedback;
- public float LETempSP2 => _LEHeater2.ControlTcSetPoint;
- public float LETempFB2 => _LEHeater2.ControlTcFeedback;
- public string LETempFB2Name => _LEHeater2.Name;
- public float LECoolantInletTempFB2 => _LEHeater2.CoolantInletTcFeedback;
- public float LECoolantOutletTempFB2 => _LEHeater2.CoolantOutletTcFeedback;
- public bool LETemp1ON => _LEHeater1.IsPowerOnFeedback;
- public bool LETemp2ON => _LEHeater2.IsPowerOnFeedback;
- // Pump 状态
- public bool IsPumpRunning => _MainPump.IsRunning;
- public bool IsFastPumpOpened => _FastPumpValve.Status;
- public bool IsSoftPumpOpened => _SoftPumpValve.Status;
- public bool IsMfc1ValveOpened => _Mfc1Valve.Status;
- public bool IsMfc2ValveOpened => _Mfc2Valve.Status;
- public bool IsMfc3ValveOpened => _Mfc3Valve.Status;
- public bool IsMfc4ValveOpened => _Mfc4Valve.Status;
- public bool IsMfc5ValveOpened => _Mfc5Valve.Status;
- public bool IsMfc6ValveOpened => _Mfc6Valve.Status;
- public bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
- //public bool IsCDA_OK => _CDAPressure.Value;
- public bool IsCoolantInletTC_OK1 => _CoolantInletTC1.Value;
- public bool IsCoolantInletTC_OK2 => _CoolantInletTC2.Value;
- public bool IsCoolantOutletTC_OK1 => _CoolantOutletTC1.Value;
- public bool IsCoolantOutletTC_OK2 => _CoolantOutletTC2.Value;
- // interlock
- public bool NotHasInterlock => AlarmPro ? _GBInterlock.Value : _GBInterlock.Value && _GeneratorInterlock.Value;
- public bool NotHasInterlockWithOutGeneratorInterlock => _GBInterlock.Value;
- // 蝶阀位置
- public float TVPosition => _pressureController.ThrottleValve.PositionFeedback;
- // 腔体压力.end
- // 射频1
- public float Generator1ForwardPower => _Generator1.ForwardPower;
- public bool IsGenerator1ON => _Generator1 != null && _Generator1.IsPowerOn;
- public float Generator1Setpoint => _Generator1.PowerSetPoint;
- // 射频 2
- public float Generator2ForwardPower => _Generator2.ForwardPower;
- public bool IsGenerator2ON => _Generator2 != null && _Generator2.IsPowerOn;
- public float Generator2Setpoint => _Generator2.PowerSetPoint;
- // Bias射频1
- public float ForwardPowerBias1 => _GeneratorBias1.ForwardPower;
- public bool IsGeneratorONBias1 => _GeneratorBias1 != null && _GeneratorBias1.IsPowerOn;
- public float GeneratorSetpointBias1 => _GeneratorBias1.PowerSetPoint;
- public float CTune1 => _GeneratorBias1.CTune;
- public float CLoad1 => _GeneratorBias1.CLoad;
- public int VPP1 => _GeneratorBias1.VPP;
- // Bias射频2
- public float ForwardPowerBias2 => _GeneratorBias2.ForwardPower;
- public bool IsGeneratorONBias2 => _GeneratorBias2 != null && _GeneratorBias2.IsPowerOn;
- public float GeneratorSetpointBias2 => _GeneratorBias2.PowerSetPoint;
- public float CTune2 => _GeneratorBias2.CTune;
- public float CLoad2 => _GeneratorBias2.CLoad;
- public int VPP2 => _GeneratorBias2.VPP;
- // 流气
- public double TotalGasSetpoint
- {
- get
- {
- double sum = 0;
- foreach (var gas in _gasLines)
- {
- sum += gas.FlowSP;
- }
- return sum;
- }
- }
- public bool HasGasOutOfRange
- {
- get
- {
- foreach (var gas in _gasLines)
- {
- if (!gas.IsOutOfRange)
- return false;
- }
- return true;
- }
- }
- // --------------------------Constructor-----------------------
- //
- public JetDualPM(ModuleName mod) : base(mod.ToString())
- {
- Module = mod;
- AlarmPro = SC.GetValue<bool>($"System.SetUp.AlarmPro.IsInstalled");
- _Chamber1Disabled = SC.GetValue<bool>($"System.SetUp.{Module}Chamber1Disabled.IsInstalled");
- _Chamber2Disabled = SC.GetValue<bool>($"System.SetUp.{Module}Chamber2Disabled.IsInstalled");
- _guidePinInstalled = SC.GetValueOrDefault<bool>($"{Module}.GuidePin.IsInstalled");
- _epdIsEnable = SC.GetValue<bool>($"{Module}.EPD.IsEnabled");
- _biasRf1Enable = SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF");
- _biasRf2Enable = SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF");
- _chiller1Enable = SC.GetValue<bool>($"{Module}.Chiller1.EnableChiller");
- _chiller2Enable = SC.GetValue<bool>($"{Module}.Chiller2.EnableChiller");
- BasePressure = SC.GetValue<double>($"{mod}.ChamberBasePressureThreshold");
- BaseTemperature = SC.GetValue<double>($"{mod}.ChamberBaseTemperatureThreshold");
- _smallWafer = SC.GetValue<int>($"System.SmallWafer");
- _midWafer = SC.GetValue<int>($"System.MidWafer");
- _bigWafer = SC.GetValue<int>($"System.BigWafer");
- for (int i = 1; i <= 6; i++)
- {
- if (SC.GetValue<bool>($"{Module}.MfcGas{i}.Enable")) gasCount++;
- }
- //_gasLines = new IoGasStick[gasCount];
- _gasLines = new IoGasStick[6];
- //for (int index = 0; index < gasCount; index++)
- //{
- // _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
- //}
- for (int index = 0; index < 6; index++)
- {
- _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
- }
- //_LidLocker = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LidLocker}");
- //_CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
- //_ArmNotExtend = DEVICE.GetDevice<IoSensor>($"{Module}.SensorArmNotExtend");
- //_RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
- #region CHECKDED
- _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VirgoDevice.Lid}");
- _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
- _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
- _CoolantInletTC1 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantInletTCOK1");
- _CoolantInletTC2 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantInletTCOK2");
- _CoolantOutletTC1 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantOutletTCOK1");
- _CoolantOutletTC2 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantOutletTCOK2");
- //_WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
- _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
- _LEOT1 = DEVICE.GetDevice<IoSensor>($"{Module}.LE_OT1");
- _LEOT2 = DEVICE.GetDevice<IoSensor>($"{Module}.LE_OT2");
- _GBInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.GB_Interlock");
- _TMRobotNotExtendToPM1 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorTMRobotNotExtendToPM1");
- _TMRobotNotExtendToPM2 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorTMRobotNotExtendToPM2");
- _TMInSafety = DEVICE.GetDevice<IoSensor>($"{Module}.SensorTMInSafety");
- _CHBOTSW = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCHBOTSW");
- _SourceFan = DEVICE.GetDevice<IoSensor>($"{Module}.SourceFan");
- _GeneratorInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
- _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VirgoDevice.PressureControl}");
- _ChamberHeater1 = DEVICE.GetDevice<IoHeater>($"{Module}.HeaterChamber1");
- _HeaterChamber = DEVICE.GetDevice<IoHeater>($"{Module}.HeaterChamber");
- _ForelineHeater = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
- _LEHeater1 = DEVICE.GetDevice<IoHeater>($"{Module}.LEHeater1");
- _LEHeater2 = DEVICE.GetDevice<IoHeater>($"{Module}.LEHeater2");
- _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveSoftPumping}");
- _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveFastPumping}");
- _ProcessValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveProcess}");
- _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveN2}");
- _FastVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveFastVent}");
- _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveChamberPurge}");
- _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc1}");
- _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc2}");
- _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc3}");
- _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc4}");
- _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc5}");
- _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc6}");
- _slitDoor1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.SlitDoor1}");
- _slitDoor2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.SlitDoor2}");
- _LiftPin1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LiftPin1}");
- _LiftPin2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LiftPin2}");
- _GuidePin1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.GuidePin1}");
- _GuidePin2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.GuidePin2}");
- _Messager = DEVICE.GetDevice<IoMessage>($"{Module}.Messager");
- _Generator1 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.Rf1}");
- _Generator2 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.Rf2}");
- _GeneratorBias1 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.BiasRf1}");
- _GeneratorBias2 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.BiasRf2}");
- _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VirgoDevice.MainPump}");
- _Chiller1 = DEVICE.GetDevice<ChillerBase>($"{Module}.{VirgoDevice.Chiller1}");
- _Chiller2 = DEVICE.GetDevice<ChillerBase>($"{Module}.{VirgoDevice.Chiller2}");
- _SensorWaterFlowOk1 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk1");
- _SensorWaterFlowOk2 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk2");
- #endregion
- // RS223 Generator
- if (SC.GetValue<int>($"{mod}.Rf1.CommunicationType") == (int)CommunicationType.RS232)
- {
- if (SC.GetValue<int>($"{mod}.Rf1.MFG") == (int)GeneratorMFG.AdTec)
- {
- _Generator1 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.Rf1}");
- }
- else if (SC.GetValue<int>($"{mod}.Rf1.MFG") == (int)GeneratorMFG.Wattsine)
- {
- _Generator1 = DEVICE.GetDevice<MicrowareRF>($"{Module}.{VirgoDevice.Rf1}");
- }
- }
- // RS223 Generator
- if (SC.GetValue<int>($"{mod}.Rf2.CommunicationType") == (int)CommunicationType.RS232)
- {
- if (SC.GetValue<int>($"{mod}.Rf2.MFG") == (int)GeneratorMFG.AdTec)
- {
- _Generator2 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.Rf2}");
- }
- else if (SC.GetValue<int>($"{mod}.Rf2.MFG") == (int)GeneratorMFG.Wattsine)
- {
- _Generator2 = DEVICE.GetDevice<MicrowareRF>($"{Module}.{VirgoDevice.Rf2}");
- }
- }
- // RS223 AdTec Generator Bias 1
- if (SC.GetValue<bool>($"{mod}.BiasRf1.EnableBiasRF") &&
- SC.GetValue<int>($"{mod}.BiasRf1.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.BiasRf1.MFG") == (int)GeneratorMFG.AdTec)
- {
- _GeneratorBias1 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.BiasRf1}");
- }
- // RS223 AdTec Generator Bias 2
- if (SC.GetValue<bool>($"{mod}.BiasRf2.EnableBiasRF") &&
- SC.GetValue<int>($"{mod}.BiasRf2.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.BiasRf2.MFG") == (int)GeneratorMFG.AdTec)
- {
- _GeneratorBias2 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.BiasRf2}");
- }
- // Ethernet Comet Generator Bias 1
- if (SC.GetValue<bool>($"{mod}.BiasRf1.EnableBiasRF") &&
- SC.GetValue<int>($"{mod}.BiasRf1.CommunicationType") == (int)CommunicationType.Ethernet &&
- SC.GetValue<int>($"{mod}.BiasRf1.MFG") == (int)GeneratorMFG.Comet)
- {
- _GeneratorBias1 = DEVICE.GetDevice<CometRF>($"{Module}.{VirgoDevice.BiasRf1}");
- }
- // Ethernet Comet Generator Bias 2
- if (SC.GetValue<bool>($"{mod}.BiasRf2.EnableBiasRF") &&
- SC.GetValue<int>($"{mod}.BiasRf2.CommunicationType") == (int)CommunicationType.Ethernet &&
- SC.GetValue<int>($"{mod}.BiasRf2.MFG") == (int)GeneratorMFG.Comet)
- {
- _GeneratorBias2 = DEVICE.GetDevice<CometRF>($"{Module}.{VirgoDevice.BiasRf2}");
- }
- // RS232 AdTec match
- if (SC.GetValue<int>($"{mod}.match1.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.match1.MFG") == (int)MatchMFG.AdTec)
- {
- _Match1 = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VirgoDevice.Match1}");
- }
- // RS232 AdTec match
- if (SC.GetValue<int>($"{mod}.match1.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.match1.MFG") == (int)MatchMFG.AdTec)
- {
- _Match2 = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VirgoDevice.Match2}");
- }
- // RS232 Dry pump, SKY
- if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
- {
- if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
- {
- _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VirgoDevice.MainPump}");
- }
- else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
- {
- _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VirgoDevice.MainPump}");
- }
- }
- if (SC.GetValue<bool>($"{mod}.Chiller1.EnableChiller") &&
- SC.GetValue<int>($"{mod}.Chiller1.CommunicationType") == (int)CommunicationType.RS232)
- {
- if (SC.GetValue<int>($"{mod}.Chiller1.MFG") == (int)ChillerMFG.SMC)
- {
- _Chiller1 = DEVICE.GetDevice<SMCChiller>($"{Module}.{VirgoDevice.Chiller1}");
- }
- else if (SC.GetValue<int>($"{mod}.Chiller1.MFG") == (int)ChillerMFG.AIRSYS)
- {
- _Chiller1 = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VirgoDevice.Chiller1}");
- }
- }
- if (SC.GetValue<bool>($"{mod}.Chiller2.EnableChiller") &&
- SC.GetValue<int>($"{mod}.Chiller2.CommunicationType") == (int)CommunicationType.RS232)
- {
- if (SC.GetValue<int>($"System.SetUp.ChillerSetupOp.IsInstalled") == (int)ChillerSetupOp.ShareSingleChiller)
- {
- _Chiller2 = _Chiller1;
- }
- else
- {
- if (SC.GetValue<int>($"{mod}.Chiller2.MFG") == (int)ChillerMFG.SMC)
- {
- _Chiller2 = DEVICE.GetDevice<SMCChiller>($"{Module}.{VirgoDevice.Chiller2}");
- }
- else if (SC.GetValue<int>($"{mod}.Chiller1.MFG") == (int)ChillerMFG.AIRSYS)
- {
- _Chiller2 = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VirgoDevice.Chiller2}");
- }
- }
- }
- System.Diagnostics.Debug.Assert(null != _Generator1);
- System.Diagnostics.Debug.Assert(null != _Generator2);
- System.Diagnostics.Debug.Assert(null != _MainPump);
- if (SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF"))
- {
- System.Diagnostics.Debug.Assert(null != _GeneratorBias1);
- }
- if (SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF"))
- {
- System.Diagnostics.Debug.Assert(null != _GeneratorBias2);
- }
- //WaferManager.Instance.SubscribeLocation(Module, 2);
- }
- public override bool Initialize()
- {
- DATA.Subscribe($"{Name}.IsAtm", () => { return CheckAtm(); });
- DATA.Subscribe($"{Name}.IsVacuum", () => { return CheckVacuum(); });
- DATA.Subscribe($"{Name}.IsCDAOK", () => { return CheckCDAOK(); });
- DATA.Subscribe($"{Name}.IsCoolantInletTCOK1", () => { return CheckCoolantInletTCOK1(); });
- DATA.Subscribe($"{Name}.IsCoolantOutletTCOK1", () => { return CheckCoolantOutletTCOK1(); });
- DATA.Subscribe($"{Name}.IsCoolantInletTCOK2", () => { return CheckCoolantInletTCOK2(); });
- DATA.Subscribe($"{Name}.IsCoolantOutletTCOK2", () => { return CheckCoolantOutletTCOK2(); });
- DATA.Subscribe($"{Name}.IsTMRbotNotExtendToPM1", () => { return CheckTMRobotCanExtendToPM1(); });
- DATA.Subscribe($"{Name}.IsTMRbotNotExtendToPM2", () => { return CheckTMRobotCanExtendToPM2(); });
- //DATA.Subscribe($"{Name}.IsWaterLeak", () => { return CheckWaterLeak(); });
- DATA.Subscribe($"{Name}.ChamberPressure", () => ChamberPressure);
- DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.Chamber1Temperature", () => ChamberTempFB1);
- DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.Chamber2Temperature", () => ChamberTempFB2);
- IsInstalled = SC.GetValue<bool>($"System.SetUp.{Name}.IsInstalled");
- return true;
- }
- // -----------------------------Method-------------------------
- //
- public override void Home()
- {
- // 与yp讨论过,PM 初始化不需要
- if (!_Chamber1Disabled)
- {
- SetLiftPin1(MovementPosition.Down, out _);
- if (IsSlitDoor1Closed)
- {
- SetSlitDoor1(false, out _);
- }
- else if (!IsSlitDoor1Closed)
- {
- SetSlitDoor1(false, out _);
- }
- else if (_slitDoor1.State == CylinderState.Error)
- {
- SetSlitDoor1(true, out _);
- }
- if (_biasRf1Enable)
- {
- _Messager.SetMessager(1); //Virgo B
- }
- else
- {
- _Messager.SetMessager(0); //Virgo A
- }
- }
- if (!_Chamber2Disabled)
- {
- SetLiftPin2(MovementPosition.Down, out _);
- //SetSlitDoor(false, out _);
- //SetGuidePin1(MovementPosition.Down);
- //SetGuidePin2(MovementPosition.Down);
- if (IsSlitDoor2Closed)
- {
- SetSlitDoor2(false, out _);
- }
- else if (!IsSlitDoor2Closed)
- {
- SetSlitDoor2(false, out _);
- }
- else if (_slitDoor2.State == CylinderState.Error)
- {
- SetSlitDoor2(true, out _);
- }
- if (_biasRf2Enable)
- {
- _Messager.SetMessager(1); //Virgo B
- }
- else
- {
- _Messager.SetMessager(0); //Virgo A
- }
- }
- }
- public bool SetSlitDoor1(bool open, out string reason)
- {
- reason = string.Empty;
- // [XIAHUAN]: 只在关门的时候检查arm not extend
- if (!open && !(IsTMRobotNotExtendToPM1/* || DEVICE.GetDevice<RorzeRobot751>($"TMRobot").LastRecordStation != $"{Module}1"*/))
- {
- reason = "TMRobot Not Extend To PM1 信号不满足";
- EV.PostAlarmLog(Module.ToString(), reason);
- return false;
- }
- return _slitDoor1.SetCylinder(open, out reason);
- }
- public bool SetSlitDoor2(bool open, out string reason)
- {
- reason = string.Empty;
- // [XIAHUAN]: 只在关门的时候检查arm not extend
- if (!open && !(IsTMRobotNotExtendToPM2 /*|| DEVICE.GetDevice<RorzeRobot751>($"TMRobot").LastRecordStation != $"{Module}2"*/))
- {
- reason = "TMRobot Not Extend To PM2 信号不满足";
- EV.PostAlarmLog(Module.ToString(), reason);
- return false;
- }
- return _slitDoor2.SetCylinder(open, out reason);
- }
- //public override bool CheckWaterLeak()
- //{
- // return _WLK_sw.Value;
- //}
- //public override bool CheckCDAOK()
- //{
- // return _CDAPressure.Value;
- //}
- public override bool CheckCoolantInletTCOK1()
- {
- return _CoolantInletTC1.Value;
- }
- public override bool CheckCoolantInletTCOK2()
- {
- return _CoolantInletTC2.Value;
- }
- public override bool CheckCoolantOutletTCOK1()
- {
- return _CoolantOutletTC1.Value;
- }
- public override bool CheckCoolantOutletTCOK2()
- {
- return _CoolantOutletTC2.Value;
- }
- public override bool CheckTMRobotCanExtendToPM1()
- {
- return _TMRobotNotExtendToPM1.Value;
- }
- public override bool CheckTMRobotCanExtendToPM2()
- {
- return _TMRobotNotExtendToPM2.Value;
- }
- public override bool CheckAtm()
- {
- return _ATM_sw.Value && ChamberPressurePressure > 700000;
- }
- public override bool CheckVacuum()
- {
- return _VAC_sw.Value && ChamberPressure < 100;
- }
- public bool CheckSlitDoor1Open()
- {
- return _slitDoor1.State == CylinderState.Open;
- }
- public bool CheckSlitDoor1Close()
- {
- return _slitDoor1.State == CylinderState.Close;
- }
- public bool CheckSlitDoor2Open()
- {
- return _slitDoor2.State == CylinderState.Open;
- }
- public bool CheckSlitDoor2Close()
- {
- return _slitDoor2.State == CylinderState.Close;
- }
- public bool CheckLift1Up()
- {
- return _LiftPin1.State == CylinderState.Open;
- }
- public bool CheckLift1Down()
- {
- return _LiftPin1.State == CylinderState.Close;
- }
- public bool CheckLift2Up()
- {
- return _LiftPin2.State == CylinderState.Open;
- }
- public bool CheckLift2Down()
- {
- return _LiftPin2.State == CylinderState.Close;
- }
- public void StartPump(bool on)
- {
- //_pressureController.StartPump(on);
- _MainPump?.SetPumpOnOff(on);
- }
- public void OpenValve(ValveType vlvType, bool on)
- {
- switch (vlvType)
- {
- case ValveType.PROCESS:
- _ProcessValve.TurnValve(on, out _);
- break;
- case ValveType.N2:
- _N2Valve.TurnValve(on, out _);
- break;
- case ValveType.FAST_PUMP:
- _FastPumpValve.TurnValve(on, out _);
- break;
- case ValveType.SOFT_PUMP:
- _SoftPumpValve.TurnValve(on, out _);
- break;
- case ValveType.FAST_VENT:
- _FastVentValve.TurnValve(on, out _);
- break;
- case ValveType.PURGE:
- _PurgeValve.TurnValve(on, out _);
- break;
- case ValveType.Mfc1:
- _Mfc1Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc2:
- _Mfc2Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc3:
- _Mfc3Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc4:
- _Mfc4Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc5:
- _Mfc5Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc6:
- _Mfc6Valve.TurnValve(on, out _);
- break;
- default:
- throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
- }
- }
- public bool CheckValveSwitchStatus(ValveType vlvType, bool on)
- {
- switch (vlvType)
- {
- case ValveType.PROCESS:
- return _ProcessValve.Status == on;
- case ValveType.N2:
- return _N2Valve.Status == on;
- case ValveType.FAST_PUMP:
- return _FastPumpValve.Status == on;
- case ValveType.SOFT_PUMP:
- return _SoftPumpValve.Status == on;
- case ValveType.FAST_VENT:
- return _FastVentValve.Status == on;
- case ValveType.PURGE:
- return _PurgeValve.Status == on;
- case ValveType.Mfc1:
- return _Mfc1Valve.Status == on;
- case ValveType.Mfc2:
- return _Mfc2Valve.Status == on;
- case ValveType.Mfc3:
- return _Mfc3Valve.Status == on;
- case ValveType.Mfc4:
- return _Mfc4Valve.Status == on;
- case ValveType.Mfc5:
- return _Mfc5Valve.Status == on;
- case ValveType.Mfc6:
- return _Mfc6Valve.Status == on;
- default:
- throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
- }
- }
- public void CheckPressureStability()
- {
- IsPressureToleranceEnabled = true;
- }
- public void CheckPressureDisable()
- {
- IsPressureToleranceEnabled = false;
- }
- public override void Monitor()
- {
- foreach (var gas in _gasLines)
- {
- gas.Monitor();
- }
- _trigBasePressure.CLK = ChamberPressurePressure >= BasePressure;
- if (_chiller1Enable)
- {
- _trigBaseTemperature1.CLK = CoolantOutletTempFB1 >= BaseTemperature;
- }
- else
- {
- _trigBaseTemperature1.CLK = LETempFB1 >= BaseTemperature;
- }
- if (_chiller2Enable)
- {
- _trigBaseTemperature2.CLK = CoolantOutletTempFB2 >= BaseTemperature;
- }
- else
- {
- _trigBaseTemperature2.CLK = LETempFB2 >= BaseTemperature;
- }
- if (_trigBasePressure.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} pressure out of tolerance");
- if (_trigBaseTemperature1.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} 1 temperature out of tolerance");
- if (_trigBaseTemperature2.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} 2 temperature out of tolerance");
- _trigRfInterlock.CLK = (IsGenerator1ON || IsGenerator2ON || IsGeneratorONBias1 || IsGeneratorONBias2) &&
- (_isAnyWaterFlowOff || _isRFGasInterlockOff || _isAllGasValveOff);
- if (_trigRfInterlock.R) _timerRFTurnOff.Start(3 * 1000);
- if (_trigRfInterlock.M && _timerRFTurnOff.IsTimeout())
- {
- _timerRFTurnOff.Stop();
- if (IsGenerator1ON || IsGenerator2ON)
- {
- //Generator1PowerOn(false);
- //Generator2PowerOn(false);
- LOG.Info($"{Module} {Name} Source RF cannot power on, gas or water or gas valve is off");
- }
- if (IsGeneratorONBias1 || IsGeneratorONBias2)
- {
- //GeneratorBias1PowerOn(false);
- //GeneratorBias2PowerOn(false);
- LOG.Info($"{Module} {Name} Bias RF cannot power on, gas or water or gas valve is off");
- }
- }
- if (_trigRfInterlock.T) _timerRFTurnOff.Stop();
- }
- public override void Terminate()
- {
- base.Terminate();
- if(IsGenerator1ON)
- Generator1PowerOn(false);
- if (IsGenerator2ON)
- Generator2PowerOn(false);
- if (IsGeneratorONBias1)
- GeneratorBias1PowerOn(false);
- if (IsGeneratorONBias2)
- GeneratorBias2PowerOn(false);
- var iovalves = new IoValve[] {
- _N2Valve,_SoftPumpValve,_FastPumpValve,_ProcessValve,_PurgeValve,
- _FastVentValve,_Mfc1Valve,_Mfc2Valve,_Mfc3Valve,_Mfc4Valve,_Mfc5Valve,_Mfc6Valve
- };
- if(iovalves.Any(p=> p.Status ))
- CloseValves();
- }
- public void CloseValves()
- {
- _N2Valve.TurnValve(false, out _);
- _SoftPumpValve.TurnValve(false, out _);
- _FastPumpValve.TurnValve(false, out _);
- _ProcessValve.TurnValve(false, out _);
- _PurgeValve.TurnValve(false, out _);
- _FastVentValve.TurnValve(false, out _);
- _PurgeValve.TurnValve(false, out _);
- _Mfc1Valve.TurnValve(false, out _);
- _Mfc2Valve.TurnValve(false, out _);
- _Mfc3Valve.TurnValve(false, out _);
- _Mfc4Valve.TurnValve(false, out _);
- _Mfc5Valve.TurnValve(false, out _);
- _Mfc6Valve.TurnValve(false, out _);
- foreach (var stick in _gasLines)
- {
- stick.Stop();
- }
- }
- public bool FlowGas(int gasNum, double val)
- {
- if (_gasLines.Length <= gasNum)
- return false;
- _gasLines[gasNum].Flow(val);
- return true;
- }
- public void StopAllGases()
- {
- foreach (var line in _gasLines)
- {
- line.Stop();
- }
- }
- public bool SetLiftPin1(MovementPosition dirt, out string reason)
- {
- reason = string.Empty;
- switch (dirt)
- {
- case MovementPosition.Down:
- return _LiftPin1.SetCylinder(false, out reason);
- case MovementPosition.Up:
- return _LiftPin1.SetCylinder(true, out reason);
- case MovementPosition.Left:
- case MovementPosition.Right:
- case MovementPosition.Middle:
- throw new ArgumentException("Movement argument error");
- }
- return true;
- }
- public bool SetLiftPin2(MovementPosition dirt, out string reason)
- {
- reason = string.Empty;
- switch (dirt)
- {
- case MovementPosition.Down:
- return _LiftPin2.SetCylinder(false, out reason);
- case MovementPosition.Up:
- return _LiftPin2.SetCylinder(true, out reason);
- case MovementPosition.Left:
- case MovementPosition.Right:
- case MovementPosition.Middle:
- throw new ArgumentException("Movement argument error");
- }
- return true;
- }
- public void SetGuidePin(WaferSize ws, MovementPosition dirt)
- {
- //if (ws == WaferSize.WS3)
- // SetGuidePinSmall(dirt);
- //else if (ws == WaferSize.WS4)
- // SetGuidePinMedium(dirt);
- }
- public void PrepareGuidePinForPlace(WaferSize ws)
- {
- //if (ws == WaferSize.WS3)
- //{
- // SetGuidePinSmall(MovementPosition.Up);
- // SetGuidePinMedium(MovementPosition.Down);
- //}
- //else if (ws == WaferSize.WS4)
- //{
- // SetGuidePinSmall(MovementPosition.Down);
- // SetGuidePinMedium(MovementPosition.Up);
- //}
- //else if (ws == WaferSize.WS6)
- //{
- // SetGuidePinSmall(MovementPosition.Down);
- // SetGuidePinMedium(MovementPosition.Down);
- //}
- }
- public void PrepareGuidePinForPlaceLeft(WaferSize ws)
- {
- //if (ws == WaferSize.WS3)
- //{
- // SetGuidePinSmall(MovementPosition.Up);
- // SetGuidePinMedium(MovementPosition.Down);
- //}
- //else if (ws == WaferSize.WS4)
- //{
- // SetGuidePinSmall(MovementPosition.Down);
- // SetGuidePinMedium(MovementPosition.Up);
- //}
- //else if (ws == WaferSize.WS6)
- //{
- // SetGuidePinSmall(MovementPosition.Down);
- // SetGuidePinMedium(MovementPosition.Down);
- //}
- string reason = string.Empty;
- if (ws == WaferSize.WS4)
- {
- _GuidePin1.SetCylinder(true, out reason);
- }
- else
- {
- _GuidePin1.SetCylinder(false, out reason);
- }
- }
- public void PrepareGuidePinForPlaceRight(WaferSize ws)
- {
- //if (ws == WaferSize.WS3)
- //{
- // SetGuidePinSmall(MovementPosition.Up);
- // SetGuidePinMedium(MovementPosition.Down);
- //}
- //else if (ws == WaferSize.WS4)
- //{
- // SetGuidePinSmall(MovementPosition.Down);
- // SetGuidePinMedium(MovementPosition.Up);
- //}
- //else if (ws == WaferSize.WS6)
- //{
- // SetGuidePinSmall(MovementPosition.Down);
- // SetGuidePinMedium(MovementPosition.Down);
- //}
- string reason = string.Empty;
- if (ws == WaferSize.WS4)
- {
- _GuidePin2.SetCylinder(true, out reason);
- }
- else
- {
- _GuidePin2.SetCylinder(false, out reason);
- }
- }
- public bool CheckGuidePinIsReadyForTransfer(EnumDualPM pos, WaferSize ws)
- {
- if (!GuidePinInstalled)
- {
- return true;
- }
- if (pos == EnumDualPM.Left)
- {
- return CheckGuidePinIsReadyForTransferLeft(ws);
- }
- else if (pos == EnumDualPM.Right)
- {
- return CheckGuidePinIsReadyForTransferRight(ws);
- }
- return false;
- }
- public bool CheckGuidePinIsReadyForTransferLeft(WaferSize ws)
- {
- if (ws == WaferSize.WS4)
- {
- return GuidePin1Position == MovementPosition.Up;
- }
- else if (ws == WaferSize.WS6 || ws == WaferSize.WS8 || ws == WaferSize.WS12)
- {
- return GuidePin1Position == MovementPosition.Down;
- }
- else
- return false;
- }
- public bool CheckGuidePinIsReadyForTransferRight(WaferSize ws)
- {
- if (ws == WaferSize.WS4)
- {
- return GuidePin2Position == MovementPosition.Up;
- }
- else if (ws == WaferSize.WS6 || ws == WaferSize.WS8 || ws == WaferSize.WS12)
- {
- return GuidePin2Position == MovementPosition.Down;
- }
- else
- return false;
- }
- private void SetGuidePin1(MovementPosition dirt)
- {
- EV.PostInfoLog(Module.ToString(), $"set small pin {dirt}, smallWafer={_smallWafer}");
- switch (dirt)
- {
- case MovementPosition.Down:
- if (_smallWafer != 0)
- _GuidePin1?.SetCylinder(false, out _);
- break;
- case MovementPosition.Up:
- if (_smallWafer != 0)
- _GuidePin1?.SetCylinder(true, out _);
- break;
- default:
- throw new ArgumentException("Movement argument error");
- }
- }
- private void SetGuidePin2(MovementPosition dirt)
- {
- EV.PostInfoLog(Module.ToString(), $"set medium pin {dirt}, midWafer={_midWafer}");
- switch (dirt)
- {
- case MovementPosition.Down:
- if (_midWafer != 0)
- _GuidePin2?.SetCylinder(false, out _);
- break;
- case MovementPosition.Up:
- if (_midWafer != 0)
- _GuidePin2?.SetCylinder(true, out _);
- break;
- default:
- throw new ArgumentException("Movement argument error");
- }
- }
- public void SetGenerator1CommunicationMode(int mode)
- {
- _Generator1?.SetCommunicationMode(mode);
- }
- public void SetGenerator2CommunicationMode(int mode)
- {
- _Generator2?.SetCommunicationMode(mode);
- }
- public bool Generator1PowerOn(bool on)
- {
- if (_Generator1 == null) return false;
- if (on && !NotHasInterlock)
- {
- EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
- return false;
- }
- return _Generator1.SetPowerOnOff(on, out _);
- }
- public bool Generator2PowerOn(bool on)
- {
- if (_Generator2 == null) return false;
- if (on && !NotHasInterlock)
- {
- EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
- return false;
- }
- return _Generator2.SetPowerOnOff(on, out _);
- }
- public bool Generator1Setpower(float val)
- {
- if (_Generator1 == null) return false;
- if (Math.Abs(val) > 0.01)
- _Generator1.SetPower((ushort)val);
- return true;
- }
- public bool Generator2Setpower(float val)
- {
- if (_Generator2 == null) return false;
- if (Math.Abs(val) > 0.01)
- _Generator2.SetPower((ushort)val);
- return true;
- }
- public bool GeneratorBias1PowerOn(bool on)
- {
- if (_GeneratorBias1 == null) return false;
- if (on && !NotHasInterlock)
- {
- EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足");
- return false;
- }
- return _GeneratorBias1.SetPowerOnOff(on, out _);
- }
- public bool GeneratorBias2PowerOn(bool on)
- {
- if (_GeneratorBias2 == null) return false;
- if (on && !NotHasInterlock)
- {
- EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足");
- return false;
- }
- return _GeneratorBias2.SetPowerOnOff(on, out _);
- }
- public bool GeneratorBias1Setpower(float val)
- {
- if (_GeneratorBias1 == null) return false;
- if (Math.Abs(val) > 0.01)
- _GeneratorBias1.SetPower((ushort)val);
- return true;
- }
- public bool GeneratorBias2Setpower(float val)
- {
- if (_GeneratorBias2 == null) return false;
- if (Math.Abs(val) > 0.01)
- _GeneratorBias2.SetPower((ushort)val);
- return true;
- }
- public bool GeneratorBias1SetMatchMode(bool val)
- {
- if (_GeneratorBias1 == null) return false;
- string reason = string.Empty;
- _GeneratorBias1.SetMatchingAutoMode(val, out reason);
- return true;
- }
- public bool GeneratorBias2SetMatchMode(bool val)
- {
- if (_GeneratorBias2 == null) return false;
- string reason = string.Empty;
- _GeneratorBias2.SetMatchingAutoMode(val, out reason);
- return true;
- }
- public bool SetMatch1Position(float c1, float c2)
- {
- if (_Match1 == null) return false;
- string reason = string.Empty;
- _Match1.SetMatchPosition(c1, c2, out reason);
- return true;
- }
- public bool SetMatch2Position(float c1, float c2)
- {
- if (_Match2 == null) return false;
- string reason = string.Empty;
- _Match2.SetMatchPosition(c1, c2, out reason);
- return true;
- }
- public bool SetBias1MatchPosition(float c1, float c2)
- {
- if (_GeneratorBias1 == null) return false;
- string reason = string.Empty;
- _GeneratorBias1.SetMatchPosition(c1, c2, out reason);
- return true;
- }
- public bool SetBias2MatchPosition(float c1, float c2)
- {
- if (_GeneratorBias2 == null) return false;
- string reason = string.Empty;
- _GeneratorBias2.SetMatchPosition(c1, c2, out reason);
- return true;
- }
- public void FullOpenTV()
- {
- _pressureController.FullOpenThrottleValve();
- }
- public void HeatChamber1(double val)
- {
- _ChamberHeater1?.RampTemp((float)val);
- _ChamberHeater1?.TurnOnOff(true);
- }
- public void HeatChamber2(double val)
- {
- _HeaterChamber?.RampTemp((float)val);
- _HeaterChamber?.TurnOnOff(true);
- }
- public void HeatChiller1(double value, double offset)
- {
- _Chiller1?.SetChillerTemp((float)value, (float)offset);
- _Chiller1?.SetChillerOnOff(true);
- }
- public void HeatChiller2(double value, double offset)
- {
- _Chiller2?.SetChillerTemp((float)value, (float)offset);
- _Chiller2?.SetChillerOnOff(true);
- }
- public void HeatForeline(double val)
- {
- _ForelineHeater?.RampTemp((float)val);
- }
- public void HeatLE1(double val)
- {
- _LEHeater1?.RampTemp((float)val);
- _LEHeater1?.TurnOnOff(true);
- }
- public void HeatLE2(double val)
- {
- _LEHeater2?.RampTemp((float)val);
- _LEHeater2?.TurnOnOff(true);
- }
- public override bool CheckEnableTransfer(EnumTransferType type, EnumDualPM pos)
- {
- if (type == EnumTransferType.Pick)
- {
- if (pos == EnumDualPM.Left)
- {
- return _slitDoor1.State == CylinderState.Open && _LiftPin1.State == CylinderState.Open;
- }
- else if (pos == EnumDualPM.Right)
- {
- return _slitDoor2.State == CylinderState.Open && _LiftPin2.State == CylinderState.Open;
- }
- }
- if (type == EnumTransferType.Place)
- {
- if (pos == EnumDualPM.Left)
- {
- return _slitDoor1.State == CylinderState.Open && _LiftPin1.State == CylinderState.Close;
- }
- else if (pos == EnumDualPM.Right)
- {
- return _slitDoor2.State == CylinderState.Open && _LiftPin2.State == CylinderState.Close;
- }
- }
- return false;
- }
- public bool CheckEnableTransfer(EnumTransferType type, EnumDualPM pos, WaferSize waferSize)
- {
- if (type == EnumTransferType.Pick)
- {
- return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (_slitDoor1.State == CylinderState.Open && _LiftPin1.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
- ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (_slitDoor2.State == CylinderState.Open && _LiftPin2.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
- }
- if (type == EnumTransferType.Place)
- {
- return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (_slitDoor1.State == CylinderState.Open && _LiftPin1.State == CylinderState.Close && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
- ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (_slitDoor2.State == CylinderState.Open && _LiftPin2.State == CylinderState.Close && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
- }
- return false;
- }
- public override void TransferHandoff(EnumTransferType type, EnumDualPM pos)
- {
- switch (type)
- {
- case EnumTransferType.Pick:
- if (pos == EnumDualPM.Left)
- {
- SetLiftPin1(MovementPosition.Up, out _);
- }
- else if (pos == EnumDualPM.Right)
- {
- SetLiftPin2(MovementPosition.Up, out _);
- }
- break;
- case EnumTransferType.Place:
- SetLiftPin1(MovementPosition.Down, out _);
- break;
- case EnumTransferType.Extend:
- break;
- case EnumTransferType.Retract:
- break;
- default:
- break;
- }
- }
- public override void Reset()
- {
- _trigBasePressure.RST = true;
- _trigBaseTemperature1.RST = true;
- }
- public bool CloseAllGenerator()
- {
- if (IsGenerator1ON) Generator1PowerOn(false);
- if (IsGenerator2ON) Generator2PowerOn(false);
- if (IsGeneratorONBias1) GeneratorBias1PowerOn(false);
- if (IsGeneratorONBias2) GeneratorBias2PowerOn(false);
- return true;
- }
- public bool CloseAllGasValve()
- {
- var iovalves = new IoValve[] {
- _N2Valve,_ProcessValve,_PurgeValve,_FastVentValve,_Mfc1Valve,_Mfc2Valve,_Mfc3Valve,_Mfc4Valve,_Mfc5Valve,_Mfc6Valve
- }.Where(p=>p.Status);
- Array.ForEach(iovalves.ToArray(), p => p.TurnValve(false, out _));
- return true;
- }
- }
- /// <summary>
- /// PM Action
- /// </summary>
- abstract class PmActionBase : ActionBase
- {
- protected internal JetDualPM _chamber;
- protected PmActionBase(ModuleName mod, JetDualPM dualPm) : base(mod)
- {
- _chamber = dualPm;
- }
- }
- class PinAction : PmActionBase
- {
- public MovementPosition Pos { get; }
- public bool IsWaferTransfered { get; }
- public PMModule PmModule { get; set; }
- private Hand _blade;
- public PinAction(ModuleName mod, JetDualPM dualPm, MovementPosition pos, bool isTransferWafer, Hand blade) : base(mod, dualPm)
- {
- this.Pos = pos;
- IsWaferTransfered = isTransferWafer;
- _blade = blade;
- }
- public override void Execute()
- {
- if (Module == ModuleName.PMA)
- PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMA];
- else if (Module == ModuleName.PMB)
- PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMB];
- if (PmModule != null)
- {
- PmModule.PostMsg(PMModule.MSG.MoveLiftPin1, Pos, ID);
- }
- }
- public override void OnPostWork(string data = null)
- {
- if (IsWaferTransfered)
- {
- if (Pos == MovementPosition.Up)
- {
- WaferManager.Instance.WaferMoved(ModuleName.EfemRobot, _blade == Hand.Blade1 ? 0 : 1, Module, 0);
- }
- else
- {
- WaferManager.Instance.WaferMoved(Module, 0, ModuleName.EfemRobot, _blade == Hand.Blade1 ? 0 : 1);
- }
- }
- }
- }
- abstract class ActionBase
- {
- private static ushort _id = 100;
- //---------------------------------Properties------------------------------------
- //
- public ushort ID { get; }
- public ModuleName Module { get; protected set; }
- public virtual ActionStatus Status { get; set; }
- public virtual bool IsReady { get; set; }
- public bool IsBackground { get; set; }
- //--------------------------------Constructor------------------------------------
- //
- protected ActionBase(ModuleName mod)
- {
- this.ID = _id++;
- this.Module = mod;
- this.Status = ActionStatus.Pending;
- }
- public virtual void Execute()
- {
- this.Status = ActionStatus.SendCmd;
- }
- protected virtual void OnPreWork() { }
- public virtual void OnPostWork(string data = null) { }
- }
- }
|