chenkui дней назад: 6
Родитель
Сommit
a627dc6488

+ 13 - 0
Framework/Common/CommonData/Vpw/VpwMainCommonData.cs

@@ -50,6 +50,16 @@ namespace MECF.Framework.Common.CommonData.Vpw
         /// </summary>
         public bool BoosterPumpSpeedAuto { get { return _boosterPumpSpeedAuto; } set { _boosterPumpSpeedAuto = value; InvokePropertyChanged(nameof(BoosterPumpSpeedAuto)); } }
 
+        /// <summary>
+        /// 目标压力
+        /// </summary>
+        public double PressureTarget { get { return _pressureTarget; } set { _pressureTarget = value; InvokePropertyChanged(nameof(PressureTarget)); } }
+        /// <summary>
+        /// Pump pressure数据
+        /// </summary>
+        public CommonLimitData BoosterPumpPressureData { get { return _boosterPumpPressureData; } set { _boosterPumpPressureData = value; InvokePropertyChanged(nameof(BoosterPumpPressureData)); } }
+
+
         public bool DiwEnable { get { return _diwEnable; } set { _diwEnable = value;InvokePropertyChanged(nameof(DiwEnable)); } }
 
         public bool DiwProcess { get { return _diwProcess; } set { _diwProcess = value;InvokePropertyChanged(nameof(DiwProcess)); } }
@@ -85,6 +95,9 @@ namespace MECF.Framework.Common.CommonData.Vpw
         private string _boosterPumpStatusContent;
         private string _boosterPumpModel;
         private double _boosterPumpCurrent;
+
+        private double _pressureTarget;
+        private CommonLimitData _boosterPumpPressureData;
         private bool _boosterPumpEnable;
         private bool _boosterPumpStatus;
         private bool _diwEnable;

+ 0 - 6
PunkHPX8_RT/Config/System.sccfg

@@ -236,12 +236,6 @@
 		<config default="7300" name="MaxPumpSpeed" nameView="MaxPumpSpeed" description="Max Pump Speed" max="32768" min="0" paramter="" tag="" unit="" type="Integer"/>
 		<config default="300" name="MinPumpSpeed" nameView="MinPumpSpeed" description="Min Pump Speed" max="32768" min="0" paramter="" tag="" unit="" type="Integer"/>
 		<config default="0.5" name="PrewetTargetLimit" nameView="PrewetTargetLimit" description="Prewet pressure in PrewetTarget Limit,device stop adjust speed" max="60" min="0" paramter="" tag="" unit="" type="Double"/>
-		<configs name="PumpFlow" nameView="PumpFlow">
-			<config default="60.0" name="Error_Max" nameView="Error_Max" max="100.0" min="0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum flow, in liters per minute, above which this interlock will transition to an Error state."/>
-			<config default="50.0" name="Warning_Max" nameView="Warning_Max" max="100.0" min="0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum flow, in liters per minute, above which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
-			<config default="5.0" name="Error_Min" nameView="Error_Min" max="100.0" min="0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum flow, in liters per minute, below which this interlock will transition to an Error state."/>
-			<config default="10.0" name="Warning_Min" nameView="Warning_Min" max="100.0" min="0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum flow, in liters per minute, below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
-		</configs>
 		<configs name="PumpPressure" nameView="PumpPressure">
 			<config default="50.0" name="Error_Max" nameView="Error_Max" max="100.0" min="0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum flow, in liters per minute, above which this interlock will transition to an Error state."/>
 			<config default="40.0" name="Warning_Max" nameView="Warning_Max" max="100.0" min="0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum flow, in liters per minute, above which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>

+ 1 - 1
PunkHPX8_RT/Devices/DeviceManager.cs

@@ -123,7 +123,7 @@ namespace PunkHPX8_RT.Instances
                 }
             }
 
-            VpwCellDeviceTimer vpwDeviceTimer = new VpwCellDeviceTimer();
+            VpDeviceTimer vpwDeviceTimer = new VpDeviceTimer();
             AddCustomDevice(vpwDeviceTimer);
         }
         /// <summary>

+ 16 - 1
PunkHPX8_RT/Devices/VpwCell/VpwCellDevice.cs

@@ -7,6 +7,7 @@ using MECF.Framework.Common.CommonData.Prewet;
 using MECF.Framework.Common.CommonData.Vpw;
 using MECF.Framework.Common.IOCore;
 using MECF.Framework.Common.Persistent.SRD;
+using PunkHPX8_RT.Devices.AXIS;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -39,6 +40,10 @@ namespace PunkHPX8_RT.Devices.VpwCell
         /// 数据
         /// </summary>
         private VpwCellCommonData _commonData=new VpwCellCommonData();
+        /// <summary>
+        /// 水平电机
+        /// </summary>
+        private JetAxisBase _rotationAxis;
         #endregion
 
         #region 属性
@@ -75,6 +80,7 @@ namespace PunkHPX8_RT.Devices.VpwCell
         /// </summary>
         private void InitializeParameter()
         {
+            _rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Rotation");
         }
         /// <summary>
         /// 初始化Routine
@@ -154,7 +160,6 @@ namespace PunkHPX8_RT.Devices.VpwCell
 
         #region Action
 
-
         #region Flow
         /// <summary>
         /// Flow Drip on
@@ -272,6 +277,16 @@ namespace PunkHPX8_RT.Devices.VpwCell
         #endregion
 
         /// <summary>
+        /// 定时器
+        /// </summary>
+        /// <returns></returns>
+        public bool OnTimer()
+        {
+            _rotationAxis.OnTimer();
+            return true;
+        }
+
+        /// <summary>
         /// 监控
         /// </summary>
         public void Monitor()

+ 24 - 19
PunkHPX8_RT/Devices/VpwCell/VpwCellDeviceTimer.cs

@@ -1,17 +1,19 @@
 using Aitex.Core.RT.Device;
 using Aitex.Core.Util;
 using MECF.Framework.Common.Equipment;
+using MECF.Framework.Common.ToolLayout;
 using PunkHPX8_RT.Devices.AXIS;
 using PunkHPX8_RT.Devices.SRD;
+using PunkHPX8_RT.Devices.VpwCell;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace PunkHPX8_RT.Devices.VpwCell
+namespace PunkHPX8_RT.Devices.VpwMain
 {
-    public class VpwCellDeviceTimer : BaseDevice, IDevice
+    public class VpDeviceTimer : BaseDevice, IDevice
     {
         #region 常量
         private const string VPW = "Vpw";
@@ -19,14 +21,14 @@ namespace PunkHPX8_RT.Devices.VpwCell
 
         #region 内部变量
         private PeriodicJob _periodicJob;
-        private JetAxisBase _vpw1RotationAxis;
-        private JetAxisBase _vpw2RotationAxis;
+        private VpwMainDevice _vpwMainDevice;
+        private VpwCellDevice[] _vpwCellDevices;
 
         #endregion
         /// <summary>
         /// 构造函数
         /// </summary>
-        public VpwCellDeviceTimer() : base(VPW, VPW, VPW, VPW)
+        public VpDeviceTimer() : base(VPW, VPW, VPW, VPW)
         {
             _periodicJob = new PeriodicJob(20, OnTimer, $"{VPW}.OnTimer", false);
         }
@@ -36,11 +38,16 @@ namespace PunkHPX8_RT.Devices.VpwCell
         /// <returns></returns>
         public bool Initialize()
         {
-  
-            _vpw1RotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.VPW1}.Rotation");
-   
-            _vpw2RotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.VPW2}.Rotation");
-
+            if (ModuleHelper.IsInstalled(ModuleName.VPWMain1))
+            {
+                _vpwMainDevice=DEVICE.GetDevice<VpwMainDevice>(ModuleName.VPWMain1.ToString());
+            }
+            List<string> installedCells = VpwCellItemManager.Instance.InstalledModules;
+            _vpwCellDevices=new VpwCellDevice[installedCells.Count];
+            for (int i=0;i<_vpwCellDevices.Length;i++)
+            {
+                _vpwCellDevices[i] = DEVICE.GetDevice<VpwCellDevice>(installedCells[i]);
+            }
             _periodicJob.Start();
             return true;
         }
@@ -62,16 +69,14 @@ namespace PunkHPX8_RT.Devices.VpwCell
         /// </summary>
         /// <returns></returns>
         private bool OnTimer()
-        {
-           
-            if (_vpw1RotationAxis != null)
-            {
-                _vpw1RotationAxis.OnTimer();
+        {           
+            if (_vpwMainDevice != null)
+            {
+                _vpwMainDevice.OnTimer();
             }
-            
-            if (_vpw2RotationAxis != null)
-            {
-                _vpw2RotationAxis.OnTimer();
+            foreach(var item in _vpwCellDevices)
+            {
+                item.OnTimer();
             }
             return true;
         }

+ 27 - 1
PunkHPX8_RT/Devices/VpwMain/VpwMainDevice.cs

@@ -2,6 +2,7 @@
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Log;
 using Aitex.Core.RT.OperationCenter;
+using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
 using MECF.Framework.Common.Beckhoff.ModuleIO;
 using MECF.Framework.Common.CommonData.Prewet;
@@ -64,6 +65,10 @@ namespace PunkHPX8_RT.Devices.VpwMain
         /// 上一次Booster泵速
         /// </summary>
         private short _lastBoosterPumpSpeed = 0;
+        /// <summary>
+        /// 定时器任务
+        /// </summary>
+        private PeriodicJob _periodicJob;
         #endregion
 
         #region 属性
@@ -78,7 +83,6 @@ namespace PunkHPX8_RT.Devices.VpwMain
         /// <param name="moduleName"></param>
         public VpwMainDevice(string moduleName) : base(moduleName, moduleName, moduleName, moduleName)
         {
-
         }
 
         #region 初始化
@@ -109,6 +113,7 @@ namespace PunkHPX8_RT.Devices.VpwMain
             {
                 LOG.WriteLog(eEvent.ERR_PREWET, Module, "Persistent Value Object is not exist");
             }
+            _commonData.BoosterPumpPressureData = new MECF.Framework.Common.CommonData.CommonLimitData();
         }
         /// <summary>
         /// 初始化Routine
@@ -183,6 +188,12 @@ namespace PunkHPX8_RT.Devices.VpwMain
                     string statusContent = _commonData.BoosterPumpStatus ? "On" : "Off";
                     _commonData.BoosterPumpStatusContent = $"{_commonData.BoosterPumpModel}: {statusContent}";
                     break;
+                case DIW_PRESSURE:
+                    if (double.TryParse(value.ToString(), out var pressure))
+                    {
+                        _commonData.BoosterPumpPressureData.Value = pressure;
+                    }
+                    break;
             }
         }
         /// <summary>
@@ -446,10 +457,25 @@ namespace PunkHPX8_RT.Devices.VpwMain
         #endregion
 
         /// <summary>
+        /// 定时器
+        /// </summary>
+        /// <returns></returns>
+        public bool OnTimer()
+        {
+            _commonData.BoosterPumpPressureData.MinError = SC.GetValue<double>($"VPWMain.PumpPressure.Error_Min");
+            _commonData.BoosterPumpPressureData.MinWarning = SC.GetValue<double>($"VPWMain.PumpPressure.Warning_Min");
+            _commonData.BoosterPumpPressureData.MaxError = SC.GetValue<double>($"VPWMain.PumpPressure.Error_Max");
+            _commonData.BoosterPumpPressureData.MaxWarning = SC.GetValue<double>($"VPWMain.PumpPressure.Warning_Max");
+            _commonData.PressureTarget = SC.GetValue<double>($"VPWMain.PressureTarget");
+            return true;
+        }
+
+        /// <summary>
         /// 监控
         /// </summary>
         public void Monitor()
         {
+
         }
 
         public void Reset()