1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708 |
- 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.OperationCenter;
- 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.EquipmentLibrary.Unit;
- 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 _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 IoLiftPin _ioLiftPin1;
- private readonly IoLiftPin _ioLiftPin2;
- 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 RfMatchBase _BiasMatch1;
- private readonly RfMatchBase _BiasMatch2;
- private readonly PumpBase _MainPump;
- private readonly ChillerBase _Chiller1;
- private readonly ChillerBase _Chiller2;
- private readonly IoGasStick[] _gasLines;
- 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 double BasePressure;
- private double BaseTemperature;
- private bool EnableBiasRF1 = false;
- private bool EnableBiasRF2 = false;
- private int _bigWafer = 0;
- private int _midWafer = 0;
- private int _smallWafer = 0;
- private int gasCount = 0;
- private bool _IsPlus;
- public bool _Chamber1Disabled;
- public bool _Chamber2Disabled;
- private bool _guidePinInstalled;
- public bool GuidePinInstalled
- {
- get { return _guidePinInstalled; }
- }
- public bool IsPlus => _IsPlus;
- public bool AlarmPro = false;
- // --------------------------Properties------------------------
- //
- public new ModuleName Module { get; }
- // 门的状态
- public bool IsSlitDoor1Closed => !(bool)DATA.Poll($"TM.Left{Module}SlitDoorOpen");
- public bool IsSlitDoor2Closed => !(bool)DATA.Poll($"TM.Right{Module}SlitDoorOpen");
- 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 (_smallWafer == 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
- {
- get
- {
- return SC.GetValue<bool>($"System.SetUp.{Module}Chamber1Disabled.IsInstalled");
- }
- }
- public bool Chamber2Disable
- {
- get
- {
- return SC.GetValue<bool>($"System.SetUp.{Module}Chamber2Disabled.IsInstalled");
- }
- }
- public override bool IsError
- {
- get
- {
- bool IsGeneratorBias1Error = SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF") && _GeneratorBias1.IsError;
- bool IsGeneratorBias2Error = SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF") && _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.IsPowerOn;
- public float Generator1Setpoint => _Generator1.PowerSetPoint;
- // 射频 2
- public float Generator2ForwardPower => _Generator2.ForwardPower;
- public bool IsGenerator2ON => _Generator2.IsPowerOn;
- public float Generator2Setpoint => _Generator2.PowerSetPoint;
- // Bias射频1
- public float ForwardPowerBias1 => _GeneratorBias1.ForwardPower;
- public bool IsGeneratorONBias1 => _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.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");
- 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");
- EnableBiasRF1 = SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF");
- EnableBiasRF2 = SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF");
- 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}");
- _GuidePin1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.GuidePin1}");
- _GuidePin2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.GuidePin2}");
- _IsPlus = SC.GetValue<bool>($"{Module}.IsPlus");
- if (_IsPlus)
- {
- _ioLiftPin1 = DEVICE.GetDevice<IoLiftPin>($"{Module}.{VirgoDevice.LiftPin1}");
- _ioLiftPin2 = DEVICE.GetDevice<IoLiftPin>($"{Module}.{VirgoDevice.LiftPin2}");
- }
- else
- {
- _LiftPin1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LiftPin1}");
- _LiftPin2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LiftPin2}");
- }
- _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}");
- #endregion
- // RS223 AdTec Generator
- if (SC.GetValue<int>($"{mod}.Rf1.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.Rf1.MFG") == (int)GeneratorMFG.AdTec)
- {
- _Generator1 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.Rf1}");
- }
- // RS223 AdTec Generator
- if (SC.GetValue<int>($"{mod}.Rf2.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.Rf2.MFG") == (int)GeneratorMFG.AdTec)
- {
- _Generator2 = DEVICE.GetDevice<AdTecGenerator>($"{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}");
- }
- //=========================================================================================
- //srf1 match revtec
- if (SC.GetValue<bool>($"{mod}.match1.EnableMatch") &&
- SC.GetValue<int>($"{mod}.match1.CommunicationType") == (int)CommunicationType.Ethernet &&
- SC.GetValue<int>($"{mod}.match1.MFG") == (int)MatchMFG.RevTec)
- {
- _Match1 = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VirgoDevice.Match1}");
- }
- //srf2 match revtec
- if (SC.GetValue<bool>($"{mod}.match2.EnableMatch") &&
- SC.GetValue<int>($"{mod}.match2.CommunicationType") == (int)CommunicationType.Ethernet &&
- SC.GetValue<int>($"{mod}.match2.MFG") == (int)MatchMFG.RevTec)
- {
- _Match2 = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VirgoDevice.Match2}");
- }
- //brf1 match revtec
- if (SC.GetValue<bool>($"{mod}.BiasRf1Match.EnableMatch") &&
- SC.GetValue<int>($"{mod}.BiasRf1Match.CommunicationType") == (int)CommunicationType.Ethernet &&
- SC.GetValue<int>($"{mod}.BiasRf1Match.MFG") == (int)MatchMFG.RevTec)
- {
- _BiasMatch1 = DEVICE.GetDevice<RevtechMatch>($"{Module}.BiasRf1Match");
- }
- //brf2 match revtec
- if (SC.GetValue<bool>($"{mod}.BiasRf2Match.EnableMatch") &&
- SC.GetValue<int>($"{mod}.BiasRf2Match.CommunicationType") == (int)CommunicationType.Ethernet &&
- SC.GetValue<int>($"{mod}.BiasRf2Match.MFG") == (int)MatchMFG.RevTec)
- {
- _BiasMatch2 = DEVICE.GetDevice<RevtechMatch>($"{Module}.BiasRf2Match");
- }
- //=========================================================================================
- // 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 (SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF"))
- {
- _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 (SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF"))
- {
- _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;
- }
- OP.DoOperation($"TM.SetSlitDoor", Module, open);
- return true;
- }
- 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;
- }
- OP.DoOperation($"TM.SetSlitDoor", Module, open);
- return true;
- }
- //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()
- {
- //2024-03-14 15:26:34 TPS dkj lx 删除
- //return _ATM_sw.Value && ChamberPressurePressure > 700000;
- return _ATM_sw.Value;
- }
- public override bool CheckVacuum()
- {
- //2024-03-14 15:26:34 TPS dkj lx修改小于5000
- //return _VAC_sw.Value && ChamberPressure < 100;
- return _VAC_sw.Value && ChamberPressure < 5000;
- }
- public bool CheckSlitDoor1Open()
- {
- return !IsSlitDoor1Closed;
- }
- public bool CheckSlitDoor1Close()
- {
- return IsSlitDoor1Closed;
- }
- public bool CheckSlitDoor2Open()
- {
- return !IsSlitDoor2Closed;
- }
- public bool CheckSlitDoor2Close()
- {
- return IsSlitDoor2Closed;
- }
- public bool CheckLift1Up()
- {
- if (_IsPlus)
- return _ioLiftPin1.PinPosition == PositionType.Position4;
- else
- return _LiftPin1.State == CylinderState.Open;
- }
- public bool CheckLift1Down()
- {
- if (_IsPlus)
- return _ioLiftPin1.PinPosition == PositionType.Position1;
- else
- return _LiftPin1.State == CylinderState.Close;
- }
- public bool CheckLift2Up()
- {
- if (_IsPlus)
- return _ioLiftPin2.PinPosition == PositionType.Position4;
- else
- return _LiftPin2.State == CylinderState.Open;
- }
- public bool CheckLift2Down()
- {
- if (_IsPlus)
- return _ioLiftPin2.PinPosition == PositionType.Position1;
- else
- return _LiftPin2.State == CylinderState.Close;
- }
- public void SetGas2(double sp)
- {
- OP.DoOperation($"{Module}.MfcGas2",out string reason,0,sp);
- }
- 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 _);
- if (on)
- _SoftPumpValve.TurnValve(false, out _);
- break;
- case ValveType.SOFT_PUMP:
- _SoftPumpValve.TurnValve(on, out _);
- if(on)
- _FastPumpValve.TurnValve(false, 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 (SC.GetValue<bool>($"{Module}.Chiller1.EnableChiller"))
- {
- _trigBaseTemperature1.CLK = CoolantOutletTempFB1 >= BaseTemperature;
- }
- else
- {
- _trigBaseTemperature1.CLK = LETempFB1 >= BaseTemperature;
- }
- if (SC.GetValue<bool>($"{Module}.Chiller2.EnableChiller"))
- {
- _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");
- }
- 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 ResetPin()
- {
- if (_IsPlus)
- {
- _ioLiftPin1.Reset();
- _ioLiftPin2.Reset();
- }
- return true;
- }
- public bool CancelPin()
- {
- if (_IsPlus)
- {
- _ioLiftPin1.Cancelset();
- _ioLiftPin2.Cancelset();
- }
- return true;
- }
- public bool SearchPinOrigin()
- {
- if(_IsPlus)
- return _ioLiftPin1.GoPosition(PositionType.Origin) && _ioLiftPin2.GoPosition(PositionType.Origin);
- return true;
- }
- public bool HasPinOrigin()
- {
- if (_IsPlus)
- return _ioLiftPin1.HasOrigin && _ioLiftPin2.HasOrigin;
- return true;
- }
- public bool SetLiftPin1(MovementPosition dirt, out string reason)
- {
- reason = string.Empty;
- switch (dirt)
- {
- case MovementPosition.Down:
- if (_IsPlus)
- return _ioLiftPin1.GoPosition(PositionType.Position1);
- else
- return _LiftPin1.SetCylinder(false, out reason);
- case MovementPosition.Up:
- if (_IsPlus)
- return _ioLiftPin1.GoPosition(PositionType.Position4);
- else
- 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:
- if (_IsPlus)
- return _ioLiftPin2.GoPosition(PositionType.Position1);
- else
- return _LiftPin2.SetCylinder(false, out reason);
- case MovementPosition.Up:
- if (_IsPlus)
- return _ioLiftPin2.GoPosition(PositionType.Position4);
- else
- 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 (_BiasMatch1 != null)
- {
- _BiasMatch1.SetMatchMode(true ? EnumRfMatchTuneMode.Auto.ToString() : EnumRfMatchTuneMode.Manual.ToString(), out _);
- return true;
- }
- if (_GeneratorBias1 == null) return false;
- string reason = string.Empty;
- _GeneratorBias1.SetMatchingAutoMode(val, out reason);
- return true;
- }
- public bool GeneratorBias2SetMatchMode(bool val)
- {
- if (_BiasMatch2 != null)
- {
- _BiasMatch2.SetMatchMode(true ? EnumRfMatchTuneMode.Auto.ToString(): EnumRfMatchTuneMode.Manual.ToString(), out _);
- return true;
- }
- 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 (_BiasMatch1 != null)
- {
- _BiasMatch1.SetMatchPosition(c1,c2,out _);
- return true;
- }
- 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 (_BiasMatch2 != null)
- {
- _BiasMatch2.SetMatchPosition(c1, c2, out _);
- return true;
- }
- if (_GeneratorBias2 == null) return false;
- string reason = string.Empty;
- _GeneratorBias2.SetMatchPosition(c1, c2, out reason);
- return true;
- }
- public void FullOpenTV()
- {
- _pressureController.FullOpenThrottleValve();
- }
- public void PressureControl(int pressure)
- {
- _pressureController.setTVPressure(pressure);
- //_pressureController._setChamberPressure();
- }
- 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)
- {
- if (_IsPlus)
- return !IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position4;
- else
- return !IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Open;
- }
- else if (pos == EnumDualPM.Right)
- {
- if (_IsPlus)
- return !IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position4;
- else
- return !IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Open;
- }
- }
- if (type == EnumTransferType.Place)
- {
- if (pos == EnumDualPM.Left)
- {
- if (_IsPlus)
- return !IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position1;
- else
- return !IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Close;
- }
- else if (pos == EnumDualPM.Right)
- {
- if (_IsPlus)
- return !IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position1;
- else
- return !IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Close;
- }
- }
- return false;
- }
- public bool CheckEnableTransfer(EnumTransferType type, EnumDualPM pos, WaferSize waferSize)
- {
- if (type == EnumTransferType.Pick)
- {
- if (_IsPlus)
- return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position4 && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
- ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position4 && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
- else
- return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
- ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
- }
- if (type == EnumTransferType.Place)
- {
- if (_IsPlus)
- return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position1 && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
- ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position1 && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
- else
- return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Close && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
- ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _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;
- }
- }
- /// <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];
- else if (Module == ModuleName.PMC)
- PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMC];
- 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) { }
- }
- }
|