|
@@ -0,0 +1,101 @@
|
|
|
+using System;
|
|
|
+using System.Xml;
|
|
|
+using Aitex.Core.Common.DeviceData;
|
|
|
+using Aitex.Core.RT.Device;
|
|
|
+using Aitex.Core.RT.Event;
|
|
|
+using Aitex.Core.RT.IOCore;
|
|
|
+using Aitex.Core.RT.OperationCenter;
|
|
|
+using Aitex.Core.RT.SCCore;
|
|
|
+using Aitex.Core.RT.Tolerance;
|
|
|
+using Aitex.Core.Util;
|
|
|
+using Venus_RT.Devices.IODevices;
|
|
|
+using Aitex.Core.RT.Log;
|
|
|
+
|
|
|
+namespace Venus_RT.Devices
|
|
|
+{
|
|
|
+ class IoTMPressureCtrl : BaseDevice, IDevice
|
|
|
+ {
|
|
|
+ public readonly IoPressureMeter TMPressureGauge;
|
|
|
+ public readonly IoPressureMeter LLAPressureGauge;
|
|
|
+ public readonly IoPressureMeter LLBPressureGauge;
|
|
|
+ public readonly IoPressureMeter MFForelineGauge;
|
|
|
+ public readonly IoPressureMeter LLForelineGauge;
|
|
|
+
|
|
|
+
|
|
|
+ private readonly ToleranceChecker _tolerance = new ToleranceChecker();
|
|
|
+
|
|
|
+ private readonly R_TRIG _trigTMPressureGauge = new R_TRIG();
|
|
|
+ private readonly R_TRIG _trigLLAPressureGauge = new R_TRIG();
|
|
|
+ private readonly R_TRIG _trigLLBPressureGauge = new R_TRIG();
|
|
|
+ private readonly R_TRIG _trigMFForelineGauge = new R_TRIG();
|
|
|
+ private readonly R_TRIG _trigLLForelineGauge = new R_TRIG();
|
|
|
+
|
|
|
+ private readonly AOAccessor _aoMFPressureSP;
|
|
|
+
|
|
|
+ // Properties
|
|
|
+ //
|
|
|
+ public double TargetPressure { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+ private string PressureOutOfTolerance = "PressureOutOfTolerance";
|
|
|
+
|
|
|
+ // Constructor
|
|
|
+ //
|
|
|
+ public IoTMPressureCtrl(string module, XmlElement node, string ioModule = "")
|
|
|
+ {
|
|
|
+ base.Module = module;
|
|
|
+ base.Name = node.GetAttribute("id");
|
|
|
+ base.Display = node.GetAttribute("display");
|
|
|
+ base.DeviceID = node.GetAttribute("schematicId");
|
|
|
+
|
|
|
+ TMPressureGauge = ParseDeviceNode<IoPressureMeter>(Module, "MFPressureMeter", node);
|
|
|
+ LLAPressureGauge = ParseDeviceNode<IoPressureMeter>(Module, "LLAPressureMeter", node);
|
|
|
+ LLBPressureGauge = ParseDeviceNode<IoPressureMeter>(Module, "LLBPressureMeter", node);
|
|
|
+ MFForelineGauge = ParseDeviceNode<IoPressureMeter>(Module, "MFForelineMeter", node);
|
|
|
+ LLForelineGauge = ParseDeviceNode<IoPressureMeter>(Module, "LLForelineMeter", node);
|
|
|
+
|
|
|
+ _aoMFPressureSP = ParseAoNode("aoMFPressure", node, ioModule);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public bool Initialize()
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void SetTMPressure(float pressure)
|
|
|
+ {
|
|
|
+ _SetRealFloat(_aoMFPressureSP, pressure);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void Terminate()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ public void Monitor()
|
|
|
+ {
|
|
|
+ _trigTMPressureGauge.CLK = TMPressureGauge.GaugeAlarm;
|
|
|
+ if (_trigTMPressureGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "MF pressure gauge Alarm");
|
|
|
+ _trigLLAPressureGauge.CLK = LLAPressureGauge.GaugeAlarm;
|
|
|
+ if (_trigLLAPressureGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Chamber pressure gauge Alarm");
|
|
|
+ _trigLLBPressureGauge.CLK = LLBPressureGauge.GaugeAlarm;
|
|
|
+ if (_trigLLBPressureGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Foreline pressure gauge Alarm");
|
|
|
+
|
|
|
+ _trigMFForelineGauge.CLK = MFForelineGauge.GaugeAlarm;
|
|
|
+ if (_trigMFForelineGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Process High Gauge Alarm");
|
|
|
+
|
|
|
+ _trigLLForelineGauge.CLK = LLForelineGauge.GaugeAlarm;
|
|
|
+ if (_trigLLForelineGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Process Low Gauge Alarm");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void Reset()
|
|
|
+ {
|
|
|
+ _trigTMPressureGauge.RST = true;
|
|
|
+ _trigLLAPressureGauge.RST = true;
|
|
|
+ _trigLLBPressureGauge.RST = true;
|
|
|
+ _trigMFForelineGauge.RST = true;
|
|
|
+ _trigLLForelineGauge.RST = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|