123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Aitex.Core.Common;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Device.Unit;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.IOCore;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Event;
- using MECF.Framework.Common.SubstrateTrackings;
- namespace EfemDualRT.Equipments.Devices
- {
- public class IOMonitorDevice : BaseDevice, IDevice
- {
- private R_TRIG bufferASmallWaferProtrusionAlarmTrig = new R_TRIG();
- private R_TRIG bufferABigWaferProtrusionAlarmTrig = new R_TRIG();
- private R_TRIG bufferBSmallWaferProtrusionAlarmTrig = new R_TRIG();
- private R_TRIG bufferBBigWaferProtrusionAlarmTrig = new R_TRIG();
- private R_TRIG waterFlowAlarmTrig = new R_TRIG();
- private R_TRIG IonizerAlarmTrig = new R_TRIG();
- private R_TRIG ffuAlarmTrig = new R_TRIG();
- public IOMonitorDevice() : base(" IOMonitor", " IOMonitor", " IOMonitor", " IOMonitor")
- {
- }
- public bool Initialize()
- {
- var WaterInletValve = DEVICE.GetDevice<IoValve>($"System.WaterInletValve");
- WaterInletValve.TurnValve(WaterInletValve.GVIsDefaultOpen, out _);
- return true;
- }
- public void Monitor()
- {
- IO.DO["PMA.DO_CDAPressureNormal"].Value = IO.DI["System.DI_CDAPressureSW"].Value;
- IO.DO["PMB.DO_CDAPressureNormal"].Value = IO.DI["System.DI_CDAPressureSW"].Value;
- bufferASmallWaferProtrusionAlarmTrig.CLK = IO.DI["System.DI_TMRBNotExtendBFA"].Value
- && IO.DI["System.DI_EFEMRBNotExtendBFA"].Value
- && IO.DI["System.DI_Buffer_ASmallWaferProtrusion"].Value
- && WaferManager.Instance.GetWafers(ModuleName.LLA).Any(x => !x.IsEmpty)
- && WaferManager.Instance.GetWafers(ModuleName.LLA).All(x => x.Size != WaferSize.WS12);
- if (bufferASmallWaferProtrusionAlarmTrig.Q)
- {
- EV.PostAlarmLog("TM", "Buffer_ASmallWaferProtrusion Sensor is on!");
- }
- bufferABigWaferProtrusionAlarmTrig.CLK = IO.DI["System.DI_TMRBNotExtendBFA"].Value
- && IO.DI["System.DI_EFEMRBNotExtendBFA"].Value
- && IO.DI["System.DI_Buffer_ABigWaferProtrusion"].Value
- && WaferManager.Instance.GetWafers(ModuleName.LLA).Any(x => !x.IsEmpty && x.Size == WaferSize.WS12);
- if (bufferABigWaferProtrusionAlarmTrig.Q)
- {
- EV.PostAlarmLog("TM", "Buffer_ABigWaferProtrusion Sensor is on!");
- }
- bufferBSmallWaferProtrusionAlarmTrig.CLK = IO.DI["System.DI_TMRBNotExtendBFB"].Value
- && IO.DI["System.DI_EFEMRBNotExtendBFB"].Value
- && IO.DI["System.DI_Buffer_BSmallWaferProtrusion"].Value
- && WaferManager.Instance.GetWafers(ModuleName.LLB).Any(x => !x.IsEmpty)
- && WaferManager.Instance.GetWafers(ModuleName.LLB).All(x => x.Size != WaferSize.WS12);
- if (bufferBSmallWaferProtrusionAlarmTrig.Q)
- {
- EV.PostAlarmLog("TM", "Buffer_BSmallWaferProtrusion Sensor is on!");
- }
- bufferBBigWaferProtrusionAlarmTrig.CLK = IO.DI["System.DI_TMRBNotExtendBFB"].Value
- && IO.DI["System.DI_EFEMRBNotExtendBFB"].Value
- && IO.DI["System.DI_Buffer_BBigWaferProtrusion"].Value
- && WaferManager.Instance.GetWafers(ModuleName.LLB).Any(x => !x.IsEmpty && x.Size == WaferSize.WS12);
- if (bufferBBigWaferProtrusionAlarmTrig.Q)
- {
- EV.PostAlarmLog("System", "Buffer_BBigWaferProtrusion Sensor is on!");
- }
- waterFlowAlarmTrig.CLK = !IO.DI["System.DI_WaterFlowSW"].Value && !SC.GetValueOrDefault<bool>("EFEM.IgnoreWaterFlowError");
- if (waterFlowAlarmTrig.Q)
- {
- EV.PostAlarmLog("System", "DI_WaterFlowSW Sensor is off !");
- }
- IonizerAlarmTrig.CLK = !IO.DI["System.DI_INONormal"].Value && !SC.GetValueOrDefault<bool>("EFEM.IgnoreIonizerError");
- if (IonizerAlarmTrig.Q)
- {
- EV.PostAlarmLog("System", "DI_INONormal Sensor is off !");
- }
- ffuAlarmTrig.CLK = !IO.DI["System.DI_TMFFUNormal"].Value && !SC.GetValueOrDefault<bool>("EFEM.IgnoreFFUError");
- if (ffuAlarmTrig.Q)
- {
- EV.PostAlarmLog("System", "DI_TMFFUNormal Sensor is off !");
- }
- }
- public void Reset()
- {
- }
- public void Terminate()
- {
- }
- }
- }
|