Browse Source

add dm reservoir initialized routine

chenzk 3 days ago
parent
commit
5602545842

+ 2 - 2
Framework/Common/Common.csproj

@@ -410,8 +410,8 @@
     <Compile Include="Net\JetTcpClient.cs" />
     <Compile Include="Net\JetTcpClient.cs" />
     <Compile Include="Net\NetStateObject.cs" />
     <Compile Include="Net\NetStateObject.cs" />
     <Compile Include="OperationCenter\IInterlockChecker.cs" />
     <Compile Include="OperationCenter\IInterlockChecker.cs" />
-    <Compile Include="Persistent\Metal\PlatingCellPersistentManager.cs" />
-    <Compile Include="Persistent\Metal\PlatingCellPersistentValue.cs" />
+    <Compile Include="Persistent\PlatingCell\PlatingCellPersistentManager.cs" />
+    <Compile Include="Persistent\PlatingCell\PlatingCellPersistentValue.cs" />
     <Compile Include="Persistent\PersistentManager.cs" />
     <Compile Include="Persistent\PersistentManager.cs" />
     <Compile Include="Persistent\Prewet\PrewetPersistentManager.cs" />
     <Compile Include="Persistent\Prewet\PrewetPersistentManager.cs" />
     <Compile Include="Persistent\Prewet\PrewetPersistentValue.cs" />
     <Compile Include="Persistent\Prewet\PrewetPersistentValue.cs" />

Framework/Common/Persistent/Metal/PlatingCellPersistentManager.cs → Framework/Common/Persistent/PlatingCell/PlatingCellPersistentManager.cs


Framework/Common/Persistent/Metal/PlatingCellPersistentValue.cs → Framework/Common/Persistent/PlatingCell/PlatingCellPersistentValue.cs


+ 1 - 1
PunkHPX8_MainPages/Views/DMReservoirView.xaml

@@ -270,7 +270,7 @@
                         <Ellipse Grid.Column="0" Width="16" Height="16" HorizontalAlignment="Right" Margin="0 0 70 0"  Fill="{Binding CommonSafetyData.Reservoir12CAPumpEdm,Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver"/>
                         <Ellipse Grid.Column="0" Width="16" Height="16" HorizontalAlignment="Right" Margin="0 0 70 0"  Fill="{Binding CommonSafetyData.Reservoir12CAPumpEdm,Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver"/>
                     </Grid>
                     </Grid>
                     <Grid Grid.Row="1" Grid.Column="1">
                     <Grid Grid.Row="1" Grid.Column="1">
-                        <Ellipse Grid.Column="0" Width="16" Height="16" HorizontalAlignment="Right" Margin="0 0 70 0"   Fill="{Binding CommonSafetyData.Reservoir1CALevelHigh,Converter={StaticResource boolToGreenRedColor}}" Stroke="Silver"/>
+                        <Ellipse Grid.Column="0" Width="16" Height="16" HorizontalAlignment="Right" Margin="0 0 70 0"   Fill="{Binding CommonSafetyData.Reservoir1CALevelHigh,Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver"/>
                     </Grid>
                     </Grid>
                     <Grid Grid.Row="2" Grid.Column="1">
                     <Grid Grid.Row="2" Grid.Column="1">
                         <Ellipse Grid.Column="0" Width="16" Height="16" HorizontalAlignment="Right" Margin="0 0 70 0"  Fill="{Binding CommonSafetyData.PlatingCell12LeakDetected,Converter={StaticResource boolToYellowColor}}"  Stroke="Silver"/>
                         <Ellipse Grid.Column="0" Width="16" Height="16" HorizontalAlignment="Right" Margin="0 0 70 0"  Fill="{Binding CommonSafetyData.PlatingCell12LeakDetected,Converter={StaticResource boolToYellowColor}}"  Stroke="Silver"/>

+ 4 - 4
PunkHPX8_MainPages/Views/SystemSafetyView.xaml

@@ -426,13 +426,13 @@
                         <RowDefinition Height="40"></RowDefinition>
                         <RowDefinition Height="40"></RowDefinition>
                     </Grid.RowDefinitions>
                     </Grid.RowDefinitions>
                     <Label Grid.Row="0" Grid.Column="0" Content="Reservoir 1 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
                     <Label Grid.Row="0" Grid.Column="0" Content="Reservoir 1 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
-                    <Ellipse Grid.Row="0" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir1CALevelHigh,Converter={StaticResource boolToGreenRedColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
+                    <Ellipse Grid.Row="0" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir1CALevelHigh,Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
                     <Label Grid.Row="1" Grid.Column="0" Content="Reservoir 2 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
                     <Label Grid.Row="1" Grid.Column="0" Content="Reservoir 2 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
-                    <Ellipse Grid.Row="1" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir2CALevelHigh,Converter={StaticResource boolToGreenRedColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
+                    <Ellipse Grid.Row="1" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir2CALevelHigh,Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
                     <Label Grid.Row="2" Grid.Column="0" Content="Reservoir 3 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
                     <Label Grid.Row="2" Grid.Column="0" Content="Reservoir 3 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
-                    <Ellipse Grid.Row="2" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir3CALevelHigh,Converter={StaticResource boolToGreenRedColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
+                    <Ellipse Grid.Row="2" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir3CALevelHigh,Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
                     <Label Grid.Row="3" Grid.Column="0" Content="Reservoir 4 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
                     <Label Grid.Row="3" Grid.Column="0" Content="Reservoir 4 CA" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center"/>
-                    <Ellipse Grid.Row="3" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir4CALevelHigh,Converter={StaticResource boolToGreenRedColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
+                    <Ellipse Grid.Row="3" Grid.Column="1"  Margin="0,0,-32,0" Width="16" Height="16"  Fill="{Binding CommonSafetyData.Reservoir4CALevelHigh,Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver" HorizontalAlignment="Right"/>
                 </Grid>
                 </Grid>
             </GroupBox>
             </GroupBox>
         </Grid>
         </Grid>

+ 17 - 9
PunkHPX8_RT/Config/System.sccfg

@@ -226,10 +226,10 @@
 			<config default="21.0" name="Warning_Min" nameView="Warning_Min" max="80.0" min="20.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
 			<config default="21.0" name="Warning_Min" nameView="Warning_Min" max="80.0" min="20.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
 		</configs>
 		</configs>
 		<configs name="DIWater_Pressure" nameView="DIWater_Pressure">
 		<configs name="DIWater_Pressure" nameView="DIWater_Pressure">
-			<config default="90.0" name="Error_Max" nameView="Error_Max" max="60.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
-			<config default="80.0" name="Warning_Max" nameView="Warning_Max" max="60.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
-			<config default="65.0" name="Error_Min" nameView="Error_Min" max="60.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Error state."/>
-			<config default="68.0" name="Warning_Min" nameView="Warning_Min" max="60.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
+			<config default="90.0" name="Error_Max" nameView="Error_Max" max="100.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
+			<config default="80.0" name="Warning_Max" nameView="Warning_Max" max="100.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
+			<config default="65.0" name="Error_Min" nameView="Error_Min" max="100.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Error state."/>
+			<config default="68.0" name="Warning_Min" nameView="Warning_Min" max="100.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
 		</configs>
 		</configs>
 		<configs name="HouseChilledWaterFlow" nameView="HouseChilledWaterFlow">
 		<configs name="HouseChilledWaterFlow" nameView="HouseChilledWaterFlow">
 			<config default="18.0" name="Error_Max" nameView="Error_Max" max="30.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
 			<config default="18.0" name="Error_Max" nameView="Error_Max" max="30.0" min="10.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
@@ -238,10 +238,10 @@
 			<config default="7.0" name="Warning_Min" nameView="Warning_Min" max="30.0" min="5.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
 			<config default="7.0" name="Warning_Min" nameView="Warning_Min" max="30.0" min="5.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
 		</configs>
 		</configs>
 		<configs name="CDA_External_Pressure" nameView="CDA_External_Pressure">
 		<configs name="CDA_External_Pressure" nameView="CDA_External_Pressure">
-			<config default="90.0" name="Error_Max" nameView="Error_Max" max="85.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
-			<config default="80.0" name="Warning_Max" nameView="Warning_Max" max="85.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
-			<config default="65.0" name="Error_Min" nameView="Error_Min" max="85.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Error state."/>
-			<config default="68.0" name="Warning_Min" nameView="Error_Max" max="85.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
+			<config default="90.0" name="Error_Max" nameView="Error_Max" max="100.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
+			<config default="80.0" name="Warning_Max" nameView="Warning_Max" max="100.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
+			<config default="65.0" name="Error_Min" nameView="Error_Min" max="100.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Error state."/>
+			<config default="68.0" name="Warning_Min" nameView="Error_Max" max="100.0" min="65.0" paramter="" tag="" unit="" type="Double"  description="This value defines the minimum pressure, in psi (pounds per square inch), below which this interlock will transition to an Warning state.  Note corresponding Error_Min/Error_Max testing supersedes this test."/>
 		</configs>
 		</configs>
 		<configs name="Vacuum_Pressure" nameView="Vacuum_Pressure">
 		<configs name="Vacuum_Pressure" nameView="Vacuum_Pressure">
 			<config default="-600.0" name="Error_Max" nameView="Error_Max" max="-600.0" min="-800.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
 			<config default="-600.0" name="Error_Max" nameView="Error_Max" max="-600.0" min="-800.0" paramter="" tag="" unit="" type="Double"  description="This value defines the maximum pressure, in psi (pounds per square inch), above which this interlock will transition to an Error state."/>
@@ -333,6 +333,11 @@
 	<configs name="Linmot" nameView="Linmot">
 	<configs name="Linmot" nameView="Linmot">
 		<config default="5000" name="LinmotHoldoffMilliseconds" nameView="LinmotHoldoffMilliseconds" description="Linmot Hold off Milliseconds" max="10000" min="1" paramter="" tag="" unit="ms" type="Integer"></config>
 		<config default="5000" name="LinmotHoldoffMilliseconds" nameView="LinmotHoldoffMilliseconds" description="Linmot Hold off Milliseconds" max="10000" min="1" paramter="" tag="" unit="ms" type="Integer"></config>
 	</configs>
 	</configs>
+	<configs name="PlatingCell" nameView="PlatingCell">
+		<config default="1000" name="FlowFaultHoldOffTime" nameView="FlowFaultHoldOffTime" description="Flow Fault HoldOff Time" max="100000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
+		<config default="3" name="CellFlowStartLowLimit" nameView="CellFlowStartLowLimit" description="Cell Flow StartLowLimit" max="20" min="0" paramter="" tag="" unit="L/min" type="Double"></config>
+		<config default="0.5" name="ANFlowStartLowLimit" nameView="ANFlowStartLowLimit" description="AN Flow StartLow Limit" max="20" min="0" paramter="" tag="" unit="L/min" type="Double"></config>
+	</configs>
 	<configs name="Reservoir" nameView="Reservoir">
 	<configs name="Reservoir" nameView="Reservoir">
 		<config default="5000" name="CADefaultPumpSpeed" nameView="CADefaultPumpSpeed" description="CA pump default speed" max="7200" min="0" paramter="" tag="" unit="" type="Double"></config>
 		<config default="5000" name="CADefaultPumpSpeed" nameView="CADefaultPumpSpeed" description="CA pump default speed" max="7200" min="0" paramter="" tag="" unit="" type="Double"></config>
 		<config default="7200" name="CAMaxPumpSpeed" nameView="CAMaxPumpSpeed" description="CA Max Pump Speed" max="10000" min="1" paramter="" tag="" unit="rpm" type="Double"></config>
 		<config default="7200" name="CAMaxPumpSpeed" nameView="CAMaxPumpSpeed" description="CA Max Pump Speed" max="10000" min="1" paramter="" tag="" unit="rpm" type="Double"></config>
@@ -343,7 +348,7 @@
 		<config default="20" name="LevelAvgSamples" nameView="LevelAvgSamples" description="Level average sample" max="100" min="0" paramter="" tag="" unit="" type="Integer"></config>
 		<config default="20" name="LevelAvgSamples" nameView="LevelAvgSamples" description="Level average sample" max="100" min="0" paramter="" tag="" unit="" type="Integer"></config>
 		<configs name="Reservoir1" nameView="Reservoir1">
 		<configs name="Reservoir1" nameView="Reservoir1">
 			<config default="5.0" name="CAMainFlowFaultLow" nameView="CAMainFlowFaultLow" description="CA Main Flow Fault Low" max="30" min="0" paramter="" tag="" unit="" type="Double"></config>
 			<config default="5.0" name="CAMainFlowFaultLow" nameView="CAMainFlowFaultLow" description="CA Main Flow Fault Low" max="30" min="0" paramter="" tag="" unit="" type="Double"></config>
-			<config default="10000" name="FlowFaultHoldOffTime" nameView="FlowFaultHoldOffTime" description="CA Flow Fault Hold Off Time" max="50000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
+			<config default="1000" name="FlowFaultHoldOffTime" nameView="FlowFaultHoldOffTime" description="CA Flow Fault Hold Off Time" max="50000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
 			<config default="0,0,1.5022,94.782" name="CALevelCurve" nameView="CALevelCurve" description="Level curve" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="0,0,1.5022,94.782" name="CALevelCurve" nameView="CALevelCurve" description="Level curve" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="95" name="CAHighLevel" nameView="CAHighLevel" description="CA High Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
 			<config default="95" name="CAHighLevel" nameView="CAHighLevel" description="CA High Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
 			<config default="10" name="CALowLevel" nameView="CALowLevel" description="CA Low Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
 			<config default="10" name="CALowLevel" nameView="CALowLevel" description="CA Low Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
@@ -383,4 +388,7 @@
 			<config default="24" name="DIValveMaxOnTimePeriod" nameView="DIValveMaxOnTimePeriod" description="DI Valve Max Time in period " max="48" min="0" paramter="" tag="" unit="hour" type="Double" />
 			<config default="24" name="DIValveMaxOnTimePeriod" nameView="DIValveMaxOnTimePeriod" description="DI Valve Max Time in period " max="48" min="0" paramter="" tag="" unit="hour" type="Double" />
 		</configs>
 		</configs>
 	</configs>
 	</configs>
+	
+
+	
 </root>
 </root>

+ 12 - 2
PunkHPX8_RT/Devices/Reservoir/ANPumpOnRoutine.cs

@@ -20,6 +20,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
         private enum ANPumpStep
         private enum ANPumpStep
         {
         {
             PumpSpeed,
             PumpSpeed,
+            PumpEnable,
             Delay,
             Delay,
             CheckFlow,
             CheckFlow,
             End
             End
@@ -66,7 +67,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
         /// <returns></returns>
         /// <returns></returns>
         public RState Monitor()
         public RState Monitor()
         {
         {
-            Runner.Run(ANPumpStep.PumpSpeed, () => { return ANPumpSpeed(_anPumpSpeed); }, _delay_1ms)
+            Runner.Run(ANPumpStep.PumpEnable,  () => { return ANPumpEnable(); }, _delay_1ms)
                 .Delay(ANPumpStep.Delay, _flowFaultHoldOffTime)
                 .Delay(ANPumpStep.Delay, _flowFaultHoldOffTime)
                 .Run(ANPumpStep.CheckFlow,CheckAllFlow,_delay_1ms)
                 .Run(ANPumpStep.CheckFlow,CheckAllFlow,_delay_1ms)
                 .End(ANPumpStep.End, NullFun, _delay_1ms);
                 .End(ANPumpStep.End, NullFun, _delay_1ms);
@@ -82,6 +83,16 @@ namespace PunkHPX8_RT.Devices.Reservoir
             return _device.AnPumpSpeed(speed);
             return _device.AnPumpSpeed(speed);
         }
         }
         /// <summary>
         /// <summary>
+        /// Pump enable
+        /// </summary>
+        /// <param name="speed"></param>
+        /// <returns></returns>
+        private bool ANPumpEnable()
+        {
+            return _device.AnPumpOnOperation("",null);
+        }
+
+        /// <summary>
         /// 检验所有流量
         /// 检验所有流量
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
@@ -109,7 +120,6 @@ namespace PunkHPX8_RT.Devices.Reservoir
         public RState Start(params object[] objs)
         public RState Start(params object[] objs)
         {
         {
             _device = DEVICE.GetDevice<DMReservoirDevice>(Module);
             _device = DEVICE.GetDevice<DMReservoirDevice>(Module);
-            _anPumpSpeed = SC.GetValue<double>("Reservoir.ANDefaultPumpSpeed");
             _flowFaultHoldOffTime = SC.GetValue<int>($"Reservoir.{Module}.FlowFaultHoldOffTime");
             _flowFaultHoldOffTime = SC.GetValue<int>($"Reservoir.{Module}.FlowFaultHoldOffTime");
             return Runner.Start(Module, "AN Pump On");
             return Runner.Start(Module, "AN Pump On");
         }
         }

+ 17 - 7
PunkHPX8_RT/Devices/Reservoir/CAPumpOnRoutine.cs

@@ -3,10 +3,12 @@ using Aitex.Core.RT.Log;
 using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.RT.SCCore;
 using MECF.Framework.Common.Beckhoff.ModuleIO;
 using MECF.Framework.Common.Beckhoff.ModuleIO;
+using MECF.Framework.Common.CommonData.Reservoir;
 using MECF.Framework.Common.Routine;
 using MECF.Framework.Common.Routine;
 using MECF.Framework.Common.ToolLayout;
 using MECF.Framework.Common.ToolLayout;
 using MECF.Framework.Common.TwinCat;
 using MECF.Framework.Common.TwinCat;
 using PunkHPX8_Core;
 using PunkHPX8_Core;
+using PunkHPX8_RT.Devices.Temperature;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
@@ -28,18 +30,16 @@ namespace PunkHPX8_RT.Devices.Reservoir
             End
             End
         }
         }
         #region 常量
         #region 常量
-        private const string CA_PUMP_SPEED = "CAPumpSpeed";
-        private const string CA_PUMP_RUNNING = "CAPumpRunning";
-        private const string CA_HED_FLOW = "CAHedFlow";
-        private const string CA_PUMP_ENABLE = "CAPumpEnable";
-        private const string CA_BY_PASS = "CAByPass";
+        private const string CA_PUMP_SPEED = "CaPumpSpeed";
+        private const string CA_PUMP_RUNNING = "CaPumpRunning";
+        private const string CA_HED_FLOW = "CaHedFlow";
+        private const string CA_PUMP_ENABLE = "CaPumpEnable";
         #endregion
         #endregion
 
 
         #region 内部变量
         #region 内部变量
         private double _caPumpSpeed = 5000;
         private double _caPumpSpeed = 5000;
         private int _flowFaultHoldOffTime = 10000;
         private int _flowFaultHoldOffTime = 10000;
         private double _caMainFlowFaultLow = 5.0;
         private double _caMainFlowFaultLow = 5.0;
-        private double _caHedFlowLowLimit = 3.0;
         private ReservoirDevice _device;
         private ReservoirDevice _device;
         private int _caOpenValveCount = 0;
         private int _caOpenValveCount = 0;
         #endregion
         #endregion
@@ -128,6 +128,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
             if(flow<=_caMainFlowFaultLow)
             if(flow<=_caMainFlowFaultLow)
             {
             {
                 CAPumpDisable();
                 CAPumpDisable();
+                DisableHed();
                 LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"total flow {flow} is not over {_caMainFlowFaultLow}");
                 LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"total flow {flow} is not over {_caMainFlowFaultLow}");
                 return false;
                 return false;
             }
             }
@@ -137,6 +138,15 @@ namespace PunkHPX8_RT.Devices.Reservoir
             }
             }
             return true;
             return true;
         }
         }
+        private void DisableHed()
+        {
+            ReservoirItem reservoirItem = ReservoirItemManager.Instance.GetReservoirItem(Module);
+            if (!string.IsNullOrEmpty(reservoirItem.TCID))
+            {
+                TemperatureController temperatureController = DEVICE.GetDevice<TemperatureController>(reservoirItem.TCID);
+                temperatureController.DisableOperation("",null);
+            }
+        }
         /// <summary>
         /// <summary>
         /// 启动
         /// 启动
         /// </summary>
         /// </summary>
@@ -144,11 +154,11 @@ namespace PunkHPX8_RT.Devices.Reservoir
         /// <returns></returns>
         /// <returns></returns>
         public RState Start(params object[] objs)
         public RState Start(params object[] objs)
         {
         {
+
             _device = DEVICE.GetDevice<ReservoirDevice>(Module);
             _device = DEVICE.GetDevice<ReservoirDevice>(Module);
             _caPumpSpeed = SC.GetValue<double>("Reservoir.CADefaultPumpSpeed");
             _caPumpSpeed = SC.GetValue<double>("Reservoir.CADefaultPumpSpeed");
             _flowFaultHoldOffTime = SC.GetValue<int>($"Reservoir.{Module}.FlowFaultHoldOffTime");
             _flowFaultHoldOffTime = SC.GetValue<int>($"Reservoir.{Module}.FlowFaultHoldOffTime");
             _caMainFlowFaultLow = SC.GetValue<double>($"Reservoir.{Module}.CAMainFlowFaultLow");
             _caMainFlowFaultLow = SC.GetValue<double>($"Reservoir.{Module}.CAMainFlowFaultLow");
-            _caHedFlowLowLimit = SC.GetValue<double>($"Reservoir.{Module}.HEDFlowLowLimit");
             _caOpenValveCount = 0;
             _caOpenValveCount = 0;
             return Runner.Start(Module, "CA Pump On");
             return Runner.Start(Module, "CA Pump On");
         }
         }

+ 1 - 1
PunkHPX8_RT/Devices/Reservoir/DMReservoirDevice.cs

@@ -112,7 +112,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
         /// <param name="cmd"></param>
         /// <param name="cmd"></param>
         /// <param name="args"></param>
         /// <param name="args"></param>
         /// <returns></returns>
         /// <returns></returns>
-        private bool AnPumpOnOperation(string cmd, object[] args)
+        public bool AnPumpOnOperation(string cmd, object[] args)
         {
         {
             double caPumpSpeed = SC.GetValue<double>("Reservoir.ANDefaultPumpSpeed");
             double caPumpSpeed = SC.GetValue<double>("Reservoir.ANDefaultPumpSpeed");
             bool result = AnPumpSpeed(caPumpSpeed);
             bool result = AnPumpSpeed(caPumpSpeed);

+ 101 - 39
PunkHPX8_RT/Modules/Reservoir/DMReservoirInitializeRoutine.cs

@@ -23,20 +23,17 @@ namespace PunkHPX8_RT.Modules.Reservoir
     {
     {
         private enum InitializeStep
         private enum InitializeStep
         {
         {
-            AutoDiReplen,
+            OpenIsolationValve,
             CAPump,
             CAPump,
             CAPumpWait,
             CAPumpWait,
             ANPump,
             ANPump,
             ANPumpWait,
             ANPumpWait,
-            ManualCellDisableHED,
+            CheckFlowWait,
+            CellManualCheckFlow,
+            CellAutoCheckFlow,
+            CheckDiReplen,
+            AutoDiReplen,
             AutoCellAutoEnableHED,
             AutoCellAutoEnableHED,
-            AutoCellAutoEnableHEDDelay,
-            AutoCellAutoEnableHEDCheck,
-            AutoCellAutoCheckPowerSupplier,
-            AutoCellAutoLinmotReset,
-            AutoCellAutoLinmotResetCheck,
-            CellWSUnclamp,
-            AutoCloseBypass,
             End
             End
         }
         }
         #region 常量 
         #region 常量 
@@ -53,6 +50,9 @@ namespace PunkHPX8_RT.Modules.Reservoir
         private TemperatureController _temperatureController;
         private TemperatureController _temperatureController;
         private double _hedFlowLowLimit;
         private double _hedFlowLowLimit;
         private int _autoHedDelay = 0;
         private int _autoHedDelay = 0;
+        private int _flowFaultHoldOffTime = 1000;
+        private double _cellFlowStartLowLimit = 3;
+        private double _anFlowStartLowLimit = 0.5;
         #endregion
         #endregion
         /// <summary>
         /// <summary>
         /// 构造函数
         /// 构造函数
@@ -76,27 +76,58 @@ namespace PunkHPX8_RT.Modules.Reservoir
         /// <returns></returns>
         /// <returns></returns>
         public RState Monitor()
         public RState Monitor()
         {
         {
-            Runner.RunIf(InitializeStep.AutoDiReplen, _recipe.DIReplenEnable || _recipe.ANDIReplenEnable, CheckFacilitiesDiReplenStatus, _delay_1ms)
-                .Run(InitializeStep.CAPump, () => { return _caPumpOnRoutine.Start() == RState.Running; }, _delay_1s)
-               .WaitWithStopCondition(InitializeStep.CAPumpWait, () => CommonFunction.CheckRoutineEndState(_caPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_caPumpOnRoutine))
-               .Run(InitializeStep.ANPump, () => { return _anPumpOnRoutine.Start() == RState.Running; }, _delay_1ms)
-               .WaitWithStopCondition(InitializeStep.ANPumpWait, () => CommonFunction.CheckRoutineEndState(_anPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_anPumpOnRoutine))
-                //Manual cell Bypass同时Enable HED
-                .Run(InitializeStep.AutoCellAutoEnableHED, AutoHedOn, _delay_1ms)
-                .Delay(InitializeStep.AutoCellAutoEnableHEDDelay, _autoHedDelay)
-                .Run(InitializeStep.AutoCellAutoEnableHEDCheck, AutoHedSuccess, _delay_1ms)
-                //检验PowerSupplier通信
-                .Run(InitializeStep.AutoCellAutoCheckPowerSupplier, AutoMetalsPowerSupplierCommuncationStatus, _delay_1ms)
-                //Cell Linmot Reset
-               
-                .WaitWithStopCondition(InitializeStep.AutoCellAutoLinmotResetCheck, CheckAutoMetalResetStatus, CheckAutoMetalResetStopStatus)
-                //Cell Unclamp
-                .Run(InitializeStep.CellWSUnclamp, MetalsWHUnclampOn, _delay_1ms)
-   
-                .End(InitializeStep.End, ClearAlarmDataError, _delay_1ms);
+            Runner.Run(InitializeStep.OpenIsolationValve, OpenIsolationValve,_delay_1ms)
+                  .Run(InitializeStep.CAPump, () => { return _caPumpOnRoutine.Start() == RState.Running; }, _delay_1s)
+                  .WaitWithStopCondition(InitializeStep.CAPumpWait, () => CommonFunction.CheckRoutineEndState(_caPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_caPumpOnRoutine))
+                  .Run(InitializeStep.ANPump, () => { return _anPumpOnRoutine.Start() == RState.Running; }, _delay_1ms)
+                  .WaitWithStopCondition(InitializeStep.ANPumpWait, () => CommonFunction.CheckRoutineEndState(_anPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_anPumpOnRoutine))
+                  .Delay(InitializeStep.CheckFlowWait, _flowFaultHoldOffTime)
+                  .RunIf(InitializeStep.CellManualCheckFlow,_dmReservoirDevice.OperationMode == MANUAL,ManualCheckFlow,_delay_1ms)
+                  .RunIf(InitializeStep.CellManualCheckFlow,_dmReservoirDevice.OperationMode == AUTO, AutoCheckFlow, _delay_1ms)
+                  .RunIf(InitializeStep.AutoDiReplen, _recipe.DIReplenEnable || _recipe.ANDIReplenEnable, CheckFacilitiesDiReplenStatus, _delay_1ms)
+                  .Run(InitializeStep.AutoCellAutoEnableHED, AutoHedOn, _delay_1ms)
+                  .End(InitializeStep.End, ClearAlarmDataError, _delay_1ms);
             return Runner.Status;
             return Runner.Status;
         }
         }
         /// <summary>
         /// <summary>
+        /// 打开Isolation valve
+        /// </summary>
+        /// <returns></returns>
+        private bool OpenIsolationValve()
+        {
+            return _dmReservoirDevice.ANIsolationOn() && _dmReservoirDevice.CAIsolationOn();
+        }
+        /// <summary>
+        /// 检查cell flow 和an flow是否大于配置项
+        /// </summary>
+        /// <returns></returns>
+        private bool ManualCheckFlow()
+        {
+            //cell flow 校验待完成
+
+            if(_dmReservoirDevice.ReservoirData.AnFlow < _anFlowStartLowLimit)
+            {
+                _dmReservoirDevice.AnPumpOff();
+                _dmReservoirDevice.ANIsolationOff();
+                return false;
+            }
+            return true;
+        }
+        /// <summary>
+        /// 检查cell flow 和an flow是否大于recipe的设定
+        /// </summary>
+        /// <returns></returns>
+        private bool AutoCheckFlow()
+        {
+            //cell flow 校验待完成
+
+            if (_dmReservoirDevice.ReservoirData.AnFlow < _recipe.ANFlowRateErrorLow)
+            {
+                return false;
+            }
+            return true;
+        }
+        /// <summary>
         /// 检验总Di有没有开
         /// 检验总Di有没有开
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
@@ -148,16 +179,15 @@ namespace PunkHPX8_RT.Modules.Reservoir
         /// <returns></returns>
         /// <returns></returns>
         private bool AutoHedOn()
         private bool AutoHedOn()
         {
         {
-            //double hedFlow = _dmReservoirDevice.ReservoirData.CAHedFlow;
-            //bool result = hedFlow > _hedFlowLowLimit;
-            //if (!result)
-            //{
-            //    LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"HED Flow {hedFlow} is less than {_hedFlowLowLimit}");
-            //    return false;
-            //}
-            //_autoHedDelay = _delay_2s;
-            //_temperatureController.EnableOperation("", null);
-            //_temperatureController.SetTargetTemperatureOperation("", new object[] { _recipe.TemperatureSetPoint });
+        
+            bool result = _dmReservoirDevice.ReservoirData.CaFlow < _cellFlowStartLowLimit;
+            if (result)
+            {
+                LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"CA Flow {_dmReservoirDevice.ReservoirData.CaFlow} is less than CellFlowStartLowLimit{_cellFlowStartLowLimit}");
+                return false;
+            }
+            _temperatureController.EnableOperation("", null);
+            _temperatureController.SetTargetTemperatureOperation("", new object[] { _recipe.TemperatureSetPoint });
             return true;
             return true;
         }
         }
         /// <summary>
         /// <summary>
@@ -331,8 +361,9 @@ namespace PunkHPX8_RT.Modules.Reservoir
             
             
             _temperatureController = (TemperatureController)objs[1];
             _temperatureController = (TemperatureController)objs[1];
             _recipe = _dmReservoirDevice.Recipe;
             _recipe = _dmReservoirDevice.Recipe;
-            _autoHedDelay = 0;
-            _hedFlowLowLimit = SC.GetValue<double>($"Reservoir.{Module}.HEDFlowLowLimit");
+            _flowFaultHoldOffTime = SC.GetValue<int>($"PlatingCell.FlowFaultHoldOffTime");
+            _cellFlowStartLowLimit = SC.GetValue<double>($"PlatingCell.CellFlowStartLowLimit");
+            _anFlowStartLowLimit = SC.GetValue<double>($"PlatingCell.ANFlowStartLowLimit");
             if (!CheckPreCondition())
             if (!CheckPreCondition())
             {
             {
                 return RState.Failed;
                 return RState.Failed;
@@ -356,6 +387,37 @@ namespace PunkHPX8_RT.Modules.Reservoir
                 LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "Temperature is not connected");
                 LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "Temperature is not connected");
                 return false;
                 return false;
             }
             }
+            if (!CheckFacility())
+            {
+                return false;
+            }
+            return true;
+        }
+        /// <summary>
+        /// 检验facility
+        /// </summary>
+        /// <returns></returns>
+        private bool CheckFacility()
+        {
+            SystemFacilities systemFacilities = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
+            if (systemFacilities == null)
+            {
+                if (systemFacilities.HouseChilledWaterEnable)
+                {
+                    LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "HouseChilledWaterEnable is false");
+                    return false;
+                }
+                if (systemFacilities.DIFillEnable)
+                {
+                    LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "DIFillEnable is false");
+                    return false;
+                }
+                if (systemFacilities.DIReplenEnable)
+                {
+                    LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "DIReplenEnable is false");
+                    return false;
+                }
+            }
             return true;
             return true;
         }
         }
     }
     }

+ 1 - 1
PunkHPX8_RT/Modules/Reservoir/ReservoirEntity.cs

@@ -318,7 +318,7 @@ namespace PunkHPX8_RT.Modules.Reservoir
             //}
             //}
             if (_reservoirItem.SubType == "DM")
             if (_reservoirItem.SubType == "DM")
             {
             {
-                return _dmInitializeRoutine.Start(_dmPlatingCellDevice, _powerSupplier, _temperatureController) == RState.Running;
+                return _dmInitializeRoutine.Start(_dmPlatingCellDevice,  _temperatureController) == RState.Running;
             }
             }
             else if(_reservoirItem.SubType == "HS")
             else if(_reservoirItem.SubType == "HS")
             {
             {

+ 7 - 0
PunkHPX8_RT/PunkHPX8_RT.csproj

@@ -228,6 +228,10 @@
     <Compile Include="Devices\LinMot\LinMotStartVAIPositionRoutine.cs" />
     <Compile Include="Devices\LinMot\LinMotStartVAIPositionRoutine.cs" />
     <Compile Include="Devices\LinMot\LinMotStopMotorRoutine.cs" />
     <Compile Include="Devices\LinMot\LinMotStopMotorRoutine.cs" />
     <Compile Include="Devices\LinMot\LinMotResetRoutine.cs" />
     <Compile Include="Devices\LinMot\LinMotResetRoutine.cs" />
+    <Compile Include="Devices\PlatingCell\DIPlatingCellDevice.cs" />
+    <Compile Include="Devices\PlatingCell\DMPlatingCellDevice.cs" />
+    <Compile Include="Devices\PlatingCell\HSPlatingCellDevice.cs" />
+    <Compile Include="Devices\PlatingCell\PlatingCellDevice.cs" />
     <Compile Include="Devices\PowerSupplier\CellPowerSupplier.cs" />
     <Compile Include="Devices\PowerSupplier\CellPowerSupplier.cs" />
     <Compile Include="Devices\PowerSupplier\PowerSupplierSetCurrentRoutine.cs" />
     <Compile Include="Devices\PowerSupplier\PowerSupplierSetCurrentRoutine.cs" />
     <Compile Include="Devices\PowerSupplier\PowerSupplierStartStepRoutine.cs" />
     <Compile Include="Devices\PowerSupplier\PowerSupplierStartStepRoutine.cs" />
@@ -293,6 +297,9 @@
     <Compile Include="Modules\LPs\LoadPortUnDockRoutine.cs" />
     <Compile Include="Modules\LPs\LoadPortUnDockRoutine.cs" />
     <Compile Include="Modules\ModuleHomeAllRoutine.cs" />
     <Compile Include="Modules\ModuleHomeAllRoutine.cs" />
     <Compile Include="Devices\Reservoir\CAPumpOnRoutine.cs" />
     <Compile Include="Devices\Reservoir\CAPumpOnRoutine.cs" />
+    <Compile Include="Modules\Reservoir\DIReservoirInitializeRoutine.cs" />
+    <Compile Include="Modules\Reservoir\DMReservoirInitializeRoutine.cs" />
+    <Compile Include="Modules\Reservoir\HSReservoirInitializeRoutine.cs" />
     <Compile Include="Modules\Reservoir\ReservoirEntity.cs" />
     <Compile Include="Modules\Reservoir\ReservoirEntity.cs" />
     <Compile Include="Modules\Reservoir\ReservoirMsg.cs" />
     <Compile Include="Modules\Reservoir\ReservoirMsg.cs" />
     <Compile Include="Modules\SRD\SRDAWCCycleRoutine.cs" />
     <Compile Include="Modules\SRD\SRDAWCCycleRoutine.cs" />

+ 2 - 2
PunkHPX8_Themes/UserControls/DMReservoirUIControl.xaml

@@ -307,8 +307,8 @@
         <ctrls:TextboxWithLabel  Canvas.Top="271" Canvas.Left="326" LabelValue="AN Flow"   TextBoxValue="{Binding ANFlow, StringFormat={}{0:F2} L/min,ElementName=self}" TextBoxColor="Black" HorizontalAlignment="Center" VerticalAlignment="Top" />
         <ctrls:TextboxWithLabel  Canvas.Top="271" Canvas.Left="326" LabelValue="AN Flow"   TextBoxValue="{Binding ANFlow, StringFormat={}{0:F2} L/min,ElementName=self}" TextBoxColor="Black" HorizontalAlignment="Center" VerticalAlignment="Top" />
         <ctrls:TextboxWithLabel  Canvas.Top="141" Canvas.Left="671" LabelValue="CA Flow"   TextBoxValue="{Binding CAFlow, StringFormat={}{0:F2} L/min,ElementName=self}" TextBoxColor="Black" HorizontalAlignment="Center" VerticalAlignment="Top" />
         <ctrls:TextboxWithLabel  Canvas.Top="141" Canvas.Left="671" LabelValue="CA Flow"   TextBoxValue="{Binding CAFlow, StringFormat={}{0:F2} L/min,ElementName=self}" TextBoxColor="Black" HorizontalAlignment="Center" VerticalAlignment="Top" />
 
 
-        <Ellipse Canvas.Left="256" Canvas.Top="100" Width="16" Height="16"  Fill="{Binding IsANLevelHigh, Converter={StaticResource boolToRedColor}}" Stroke="Silver"/>
-        <Ellipse Canvas.Left="256" Canvas.Top="160" Width="16" Height="16"  Fill="{Binding IsANLevelLow, Converter={StaticResource boolToRedColor}}" Stroke="Silver" HorizontalAlignment="Left" VerticalAlignment="Top"/>
+        <Ellipse Canvas.Left="256" Canvas.Top="100" Width="16" Height="16"  Fill="{Binding IsANLevelHigh,ElementName=self, Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver"/>
+        <Ellipse Canvas.Left="256" Canvas.Top="160" Width="16" Height="16"  Fill="{Binding IsANLevelLow, ElementName=self, Converter={StaticResource boolToRedGreenColor}}" Stroke="Silver" HorizontalAlignment="Left" VerticalAlignment="Top"/>
 
 
         <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding IsANPumpOpen,Mode=TwoWay,ElementName=self}" Height="8"  Width="120"  Canvas.Left="135"  Canvas.Top="198" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
         <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding IsANPumpOpen,Mode=TwoWay,ElementName=self}" Height="8"  Width="120"  Canvas.Left="135"  Canvas.Top="198" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
         <ctrls:FlowPipe IsFlowing="{Binding ElementName=self,Path=ANIsolationValve}" Height="8"  Width="95"  Canvas.Left="463"  Canvas.Top="224" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>
         <ctrls:FlowPipe IsFlowing="{Binding ElementName=self,Path=ANIsolationValve}" Height="8"  Width="95"  Canvas.Left="463"  Canvas.Top="224" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>

+ 41 - 23
PunkHPX8_Twincate/PunkHPX8/PlcTest/POUs/MAIN.TcPOU

@@ -125,13 +125,13 @@ VAR
 	//ExtFluidEnableEdm
 	//ExtFluidEnableEdm
 	Facility_SDI_4CHANNEL_EL1904_NS200_1 AT%I* :BOOL;
 	Facility_SDI_4CHANNEL_EL1904_NS200_1 AT%I* :BOOL;
 	//Reservoir1CALevelHigh
 	//Reservoir1CALevelHigh
-	RES1_2_SDI_4CHANNEL_EL1904_NS400_2 AT%I* :BOOL:=TRUE;
+	RES1_2_SDI_4CHANNEL_EL1904_NS400_2 AT%I* :BOOL;
 	//Reservoir2CALevelHigh
 	//Reservoir2CALevelHigh
-	RES1_2_SDI_4CHANNEL_EL1904_NS400_3 AT%I* :BOOL:=TRUE;
+	RES1_2_SDI_4CHANNEL_EL1904_NS400_3 AT%I* :BOOL;
 	//Reservoir3CALevelHigh
 	//Reservoir3CALevelHigh
-	RES3_4_SDI_4CHANNEL_EL1904_NS430_2 AT%I* :BOOL:=TRUE;
+	RES3_4_SDI_4CHANNEL_EL1904_NS430_2 AT%I* :BOOL;
 	//Reservoir4CALevelHigh
 	//Reservoir4CALevelHigh
-	RES3_4_SDI_4CHANNEL_EL1904_NS430_3 AT%I* :BOOL:=TRUE;
+	RES3_4_SDI_4CHANNEL_EL1904_NS430_3 AT%I* :BOOL;
 	//VpwCell1RotationStoEdm
 	//VpwCell1RotationStoEdm
 	VPW_SDI_4CHANNEL_EL1904_NS300_1 AT%I* :BOOL;
 	VPW_SDI_4CHANNEL_EL1904_NS300_1 AT%I* :BOOL;
 	//VpwCell2RotationStoEdm
 	//VpwCell2RotationStoEdm
@@ -182,29 +182,29 @@ VAR
 	//PH3
 	//PH3
 	Facility_AI_8CHANNEL_4_20mA_EL3058_N005_1 AT%I* :INT;
 	Facility_AI_8CHANNEL_4_20mA_EL3058_N005_1 AT%I* :INT;
 	//HouseChilledWaterFlow
 	//HouseChilledWaterFlow
-	Facility_AI_8CHANNEL_4_20mA_EL3058_N005_5 AT%I* :INT;
+	Facility_AI_8CHANNEL_4_20mA_EL3058_N005_5 AT%I* :INT:=10000;
 	//SystemExhaust1
 	//SystemExhaust1
-	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_1 AT%I* :INT;
+	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_1 AT%I* :INT:=12000;
 	//SystemExhaust2
 	//SystemExhaust2
-	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_2 AT%I* :INT;
+	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_2 AT%I* :INT:=12000;
 	//DiWaterPressure
 	//DiWaterPressure
-	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_5 AT%I* :INT;
+	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_5 AT%I* :INT:=25000;
 	//Nitrogen1BPressure
 	//Nitrogen1BPressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_1 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_1 AT%I* :INT:=5700;
 	//Nitrogen1APressure
 	//Nitrogen1APressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_2 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_2 AT%I* :INT:=8000;
 	//Nitrogen2BPressure
 	//Nitrogen2BPressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_3 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_3 AT%I* :INT:=5700;
 	//Nitrogen2APressure
 	//Nitrogen2APressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_4 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_4 AT%I* :INT:=8000;
 	//CDA2Pressure
 	//CDA2Pressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_5 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_5 AT%I* :INT:=10000;
 	//CDA1Pressure
 	//CDA1Pressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_6 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_6 AT%I* :INT:=10000;
 	//ExternalCDAPressure
 	//ExternalCDAPressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_7 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_7 AT%I* :INT:=10000;
 	//VacuumPressure
 	//VacuumPressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_8 AT%I* :INT;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_8 AT%I* :INT:=4000;
 	//N2BlanketPressure
 	//N2BlanketPressure
 	Facility_AI_8CHANNEL_0_10V_EL3068_N008_1 AT%I* :INT;
 	Facility_AI_8CHANNEL_0_10V_EL3068_N008_1 AT%I* :INT;
 	//N2OverFlowPressure
 	//N2OverFlowPressure
@@ -358,19 +358,19 @@ VAR
 	//Reservoir1 AnTowerLow
 	//Reservoir1 AnTowerLow
 	RES1_2_DI_8CHANNEL_EL1008_N200_4 AT%I* :BOOL;
 	RES1_2_DI_8CHANNEL_EL1008_N200_4 AT%I* :BOOL;
 	//Reservoir1 AnFlow
 	//Reservoir1 AnFlow
-	RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_1 AT%I* :DINT;
+	RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_1 AT%I* :DINT:=10000;
 	//Reservoir1 CaFlow
 	//Reservoir1 CaFlow
-	RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_3 AT%I* :DINT;
+	RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_3 AT%I* :DINT:=10000;
 	//Reservoir1 CaWaterLevel
 	//Reservoir1 CaWaterLevel
-	RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_5 AT%I* :DINT;
+	RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_5 AT%I* :DINT:=10000;
 	
 	
 	
 	
 	//Reservoir1 AnPumpEnable
 	//Reservoir1 AnPumpEnable
-	RES1_DO_16CHANNEL_EL2809_N201_1 AT%Q* :BOOL;
+	RES1_2_DO_16CHANNEL_EL2809_N201_1 AT%Q* :BOOL;
 	//Reservoir1 CaPumpEnable
 	//Reservoir1 CaPumpEnable
-	RES1_DO_16CHANNEL_EL2809_N201_3 AT%Q* :BOOL;
+	RES1_2_DO_16CHANNEL_EL2809_N201_3 AT%Q* :BOOL;
 	//Reservoir1 ReturnValveEnable
 	//Reservoir1 ReturnValveEnable
-	RES1_DO_16CHANNEL_EL2809_N201_5 AT%Q* :BOOL;
+	RES1_2_DO_16CHANNEL_EL2809_N201_5 AT%Q* :BOOL;
 	//Reservoir1 AnPumpSpeed
 	//Reservoir1 AnPumpSpeed
 	RES1_2_AO_8CHANNEL_0_10V_EL4008_N204_1  AT%Q* :DINT;
 	RES1_2_AO_8CHANNEL_0_10V_EL4008_N204_1  AT%Q* :DINT;
 	//Reservoir1 CaPumpSpeed
 	//Reservoir1 CaPumpSpeed
@@ -569,7 +569,18 @@ IF MAIN_IO_RELAY_4CHANNEL_EL2624_N106_1=TRUE AND VPW_PNEU_SMC_EX260_BYTE1.4=TRUE
 	VPW_AI_8CHANNEL_0_10V_EL3068_N105_2:=25000;
 	VPW_AI_8CHANNEL_0_10V_EL3068_N105_2:=25000;
 ELSE
 ELSE
 	VPW_AI_8CHANNEL_0_10V_EL3068_N105_2:=29500;
 	VPW_AI_8CHANNEL_0_10V_EL3068_N105_2:=29500;
-END_IF]]></ST>
+END_IF
+
+
+//reservoir
+
+//ca pump
+IF  RES1_2_DO_16CHANNEL_EL2809_N201_3=TRUE THEN
+	RES1_2_DI_8CHANNEL_EL1008_N200_1:=TRUE;
+ELSE
+	RES1_2_DI_8CHANNEL_EL1008_N200_1:=FALSE;
+END_IF
+]]></ST>
     </Implementation>
     </Implementation>
     <LineIds Name="MAIN">
     <LineIds Name="MAIN">
       <LineId Id="52" Count="5" />
       <LineId Id="52" Count="5" />
@@ -626,6 +637,13 @@ END_IF]]></ST>
       <LineId Id="943" Count="0" />
       <LineId Id="943" Count="0" />
       <LineId Id="947" Count="4" />
       <LineId Id="947" Count="4" />
       <LineId Id="946" Count="0" />
       <LineId Id="946" Count="0" />
+      <LineId Id="1340" Count="2" />
+      <LineId Id="1345" Count="0" />
+      <LineId Id="1344" Count="0" />
+      <LineId Id="1346" Count="0" />
+      <LineId Id="1343" Count="0" />
+      <LineId Id="1347" Count="2" />
+      <LineId Id="1339" Count="0" />
     </LineIds>
     </LineIds>
   </POU>
   </POU>
 </TcPlcObject>
 </TcPlcObject>