Browse Source

Add LoaderWSPresentSensor simulator; Revise WagoSimulator;

niuyx 3 weeks ago
parent
commit
cb57cb5e5e

+ 35 - 35
CyberX8_RT/Config/Devices/GalilControllerCfg-Simulator.xml

@@ -13,13 +13,13 @@
 			<DI Name="DI8"  Address="8" Invert="false"/>
 			<DI Name="DI9"  Address="9" Invert="false"/>
 		</Dig_In>
-		<GalilAxisConfig Name="Flip" Index="0" Type="Galil"  CNType="-1">
+		<GalilAxisConfig Name="Flip" Index="0" Type="Galil" CNType="-1">
 			<Speed>1000000</Speed>
 			<Acceleration>2000000</Acceleration>
 			<Deceleration>2000000</Deceleration>
 			<HomingSpeed>16000</HomingSpeed>
-			<HomingOffset>495</HomingOffset>
-			<HomingTimeOut>20000</HomingTimeOut>
+			<HomingOffset>13000</HomingOffset>
+			<HomingTimeOut>60000</HomingTimeOut>
 			<HomingAcceleration>2000000</HomingAcceleration>
 			<HomingDeceleration>2000000</HomingDeceleration>
 			<ReverseSoftwareLimit>0</ReverseSoftwareLimit>
@@ -27,13 +27,13 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="Rotation" Index="1" Type="Galil"  CNType="-1">
+		<GalilAxisConfig Name="Rotation" Index="1" Type="Galil" CNType="-1">
 			<Speed>500000</Speed>
 			<Acceleration>500000</Acceleration>
 			<Deceleration>250000</Deceleration>
 			<HomingSpeed>8000</HomingSpeed>
 			<HomingOffset>0</HomingOffset>
-			<HomingTimeOut>20000</HomingTimeOut>
+			<HomingTimeOut>60000</HomingTimeOut>
 			<HomingAcceleration>500000</HomingAcceleration>
 			<HomingDeceleration>250000</HomingDeceleration>
 			<ReverseSoftwareLimit>0</ReverseSoftwareLimit>
@@ -42,7 +42,7 @@
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
 	</GalilDeviceConfig>
-	<GalilDeviceConfig Module="Loader1" IpAddress="127.0.0.2" Port="58679" SendTimeout="2000" RecvTimeout="2000"  GalilType="Galil21">
+	<GalilDeviceConfig Module="Loader1" IpAddress="127.0.0.1" Port="58679" SendTimeout="2000" RecvTimeout="2000" GalilType="Galil21">
 		<Dig_In>
 			<DI Name="DI0" Address="0" Invert="false"/>
 			<DI Name="DI1"  Address="1" Invert="false"/>
@@ -55,7 +55,7 @@
 			<DI Name="DI8"  Address="8" Invert="false"/>
 			<DI Name="DI9"  Address="9" Invert="false"/>
 		</Dig_In>
-		<GalilAxisConfig Name="LSA" Index="4" Type="GalilLipsel"  CNType="-1">
+		<GalilAxisConfig Name="LSA" Index="4" Type="GalilLipsel" CNType="-1">
 			<Speed>150000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
@@ -69,7 +69,7 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="TiltA" Index="5" Type="Galil"  CNType="-1">
+		<GalilAxisConfig Name="TiltA" Index="5" Type="Galil" CNType="-1">
 			<Speed>150000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
@@ -83,7 +83,7 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="ShuttleA" Index="6" Type="Galil"  CNType="-1">
+		<GalilAxisConfig Name="ShuttleA" Index="6" Type="Galil" CNType="-1">
 			<Speed>200000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
@@ -92,12 +92,12 @@
 			<HomingTimeOut>60000</HomingTimeOut>
 			<HomingAcceleration>200000</HomingAcceleration>
 			<HomingDeceleration>10000000</HomingDeceleration>
-			<ReverseSoftwareLimit>-25000</ReverseSoftwareLimit>
+			<ReverseSoftwareLimit>-160000</ReverseSoftwareLimit>
 			<ForwardSoftwareLimit>270000</ForwardSoftwareLimit>
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="Rotation" Index="3" Type="Galil"  CNType="-1">
+		<GalilAxisConfig Name="Rotation" Index="3" Type="Galil" CNType="-1">
 			<Speed>100000</Speed>
 			<Acceleration>50000</Acceleration>
 			<Deceleration>50000</Deceleration>
@@ -111,7 +111,7 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="LSB" Index="0" Type="GalilLipsel"  CNType="-1">
+		<GalilAxisConfig Name="LSB" Index="0" Type="GalilLipsel" CNType="-1">
 			<Speed>150000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
@@ -125,7 +125,7 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="TiltB" Index="1" Type="Galil"  CNType="-1">
+		<GalilAxisConfig Name="TiltB" Index="1" Type="Galil" CNType="-1">
 			<Speed>150000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
@@ -139,7 +139,7 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="ShuttleB" Index="2" Type="Galil"  CNType="-1">
+		<GalilAxisConfig Name="ShuttleB" Index="2" Type="Galil" CNType="-1">
 			<Speed>200000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
@@ -148,19 +148,19 @@
 			<HomingTimeOut>60000</HomingTimeOut>
 			<HomingAcceleration>200000</HomingAcceleration>
 			<HomingDeceleration>10000000</HomingDeceleration>
-			<ReverseSoftwareLimit>-25000</ReverseSoftwareLimit>
+			<ReverseSoftwareLimit>-160000</ReverseSoftwareLimit>
 			<ForwardSoftwareLimit>270000</ForwardSoftwareLimit>
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
 	</GalilDeviceConfig>
-	<GalilDeviceConfig Module="Transporter1" IpAddress="127.0.0.3" Port="58680" SendTimeout="2000" RecvTimeout="2000" GalilType="Galil21">
+	<GalilDeviceConfig Module="Transporter1" IpAddress="127.0.0.1" Port="58680" SendTimeout="2000" RecvTimeout="2000" GalilType="Galil21">
 		<Dig_In>
-			<DI Name="DI0" Address="0" Invert="false"/>
+			<DI Name="r_TRANSPORT1_WS_HOLD_PRESENT"  Address="0" Invert="true" Bit="4"/>
 			<DI Name="DI1"  Address="1" Invert="false"/>
 			<DI Name="DI2"  Address="2" Invert="false"/>
 			<DI Name="DI3"  Address="3" Invert="false"/>
-			<DI Name="r_TRANSPORT1_WS_HOLD_PRESENT"  Address="4" Invert="false"/>
+			<DI Name="DI4"  Address="4" Invert="false"/>
 			<DI Name="DI5"  Address="5" Invert="false"/>
 			<DI Name="DI6"  Address="6" Invert="false"/>
 			<DI Name="DI7"  Address="7" Invert="false"/>
@@ -171,7 +171,7 @@
 			<Speed>200000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
-			<HomingSpeed>50000</HomingSpeed>
+			<HomingSpeed>10000</HomingSpeed>
 			<HomingOffset>0</HomingOffset>
 			<HomingTimeOut>60000</HomingTimeOut>
 			<HomingAcceleration>200000</HomingAcceleration>
@@ -183,26 +183,26 @@
 		</GalilAxisConfig>
 		<GalilAxisConfig Name="Gantry" Index="1" Type="Galil" CNType="1">
 			<Speed>400000</Speed>
-			<Acceleration>4000000</Acceleration>
-			<Deceleration>4000000</Deceleration>
-			<HomingSpeed>100000</HomingSpeed>
-			<HomingOffset>0</HomingOffset>
+			<Acceleration>400000</Acceleration>
+			<Deceleration>400000</Deceleration>
+			<HomingSpeed>10000</HomingSpeed>
+			<HomingOffset>1448437</HomingOffset>
 			<HomingTimeOut>60000</HomingTimeOut>
-			<HomingAcceleration>4000000</HomingAcceleration>
-			<HomingDeceleration>8000000</HomingDeceleration>
+			<HomingAcceleration>400000</HomingAcceleration>
+			<HomingDeceleration>800000</HomingDeceleration>
 			<ReverseSoftwareLimit>0</ReverseSoftwareLimit>
 			<ForwardSoftwareLimit>0</ForwardSoftwareLimit>
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
 	</GalilDeviceConfig>
-	<GalilDeviceConfig Module="Transporter2" IpAddress="127.0.0.4" Port="58681" SendTimeout="2000" RecvTimeout="2000" GalilType="Galil21">
+	<GalilDeviceConfig Module="Transporter2" IpAddress="127.0.0.1" Port="58681" SendTimeout="2000" RecvTimeout="2000" GalilType="Galil21">
 		<Dig_In>
-			<DI Name="DI0" Address="0" Invert="false"/>
+			<DI Name="r_TRANSPORT2_WS_HOLD_PRESENT"  Address="0" Invert="true" Bit="4"/>
 			<DI Name="DI1"  Address="1" Invert="false"/>
 			<DI Name="DI2"  Address="2" Invert="false"/>
 			<DI Name="DI3"  Address="3" Invert="false"/>
-			<DI Name="r_TRANSPORT2_WS_HOLD_PRESENT"  Address="4" Invert="false"/>
+			<DI Name="D14"  Address="4" Invert="false"/>
 			<DI Name="DI5"  Address="5" Invert="false"/>
 			<DI Name="DI6"  Address="6" Invert="false"/>
 			<DI Name="DI7"  Address="7" Invert="false"/>
@@ -213,7 +213,7 @@
 			<Speed>200000</Speed>
 			<Acceleration>200000</Acceleration>
 			<Deceleration>200000</Deceleration>
-			<HomingSpeed>50000</HomingSpeed>
+			<HomingSpeed>10000</HomingSpeed>
 			<HomingOffset>0</HomingOffset>
 			<HomingTimeOut>60000</HomingTimeOut>
 			<HomingAcceleration>200000</HomingAcceleration>
@@ -223,15 +223,15 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</GalilAxisConfig>
-		<GalilAxisConfig Name="Gantry" Index="1" Type="Galil" CNType="1">
+		<GalilAxisConfig Name="Gantry" Index="1" Type="Galil" CNType="-1">
 			<Speed>400000</Speed>
-			<Acceleration>4000000</Acceleration>
-			<Deceleration>4000000</Deceleration>
-			<HomingSpeed>100000</HomingSpeed>
+			<Acceleration>400000</Acceleration>
+			<Deceleration>400000</Deceleration>
+			<HomingSpeed>10000</HomingSpeed>
 			<HomingOffset>0</HomingOffset>
 			<HomingTimeOut>60000</HomingTimeOut>
-			<HomingAcceleration>4000000</HomingAcceleration>
-			<HomingDeceleration>8000000</HomingDeceleration>
+			<HomingAcceleration>400000</HomingAcceleration>
+			<HomingDeceleration>800000</HomingDeceleration>
 			<ReverseSoftwareLimit>0</ReverseSoftwareLimit>
 			<ForwardSoftwareLimit>0</ForwardSoftwareLimit>
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>

+ 3 - 3
CyberX8_Simulator/Devices/FestoSocketSimulator.cs

@@ -28,13 +28,13 @@ namespace CyberX8_Simulator.Devices
         /// </summary>
         private short[] _festoOutputDataDic = new short[FESTO_REGISTER_COUNT];
         /// <summary>
-        /// 数据(DOName - index)
+        /// 数据(DOName - FestoDO)
         /// </summary>
         public Dictionary<string, FestoDO> FestoNameIndexDic = new Dictionary<string, FestoDO>();
         /// <summary>
         /// 数据字典(DOName - value)
         /// </summary>
-        public Dictionary<string, bool> FestoNameValueDic = new Dictionary<string, bool>();//***********
+        public Dictionary<string, bool> FestoNameValueDic = new Dictionary<string, bool>();
         /// <summary>
         /// do 索引对象字典(key-地址索引-bit,value--do名称)
         /// </summary>
@@ -87,7 +87,7 @@ namespace CyberX8_Simulator.Devices
                     var result = DecodeDOData(startAddress, value, out changeFlag);
                     if (changeFlag)
                     {                      
-                        SimulatorCommManager.Instance.CheckDataChanged(result.Item1, result.Item2);
+                        SimulatorCommManager.Instance.CheckDataChanged(result.Item1, result.Item2, FestoNameIndexDic[result.Item1].Invert);
                     }                    
                     //modbus起始地址n为数据,n+1为诊断数据,取地址n下的数据
                     _festoOutputDataDic[(startAddress - FESTO_DO_START_ADDRESS) * 2] = value;

+ 7 - 3
CyberX8_Simulator/Devices/GalilSocketSimulator.cs

@@ -223,10 +223,14 @@ namespace CyberX8_Simulator.Devices
                                 _axisNameIndexDic[$"{config.Module}.{item.Name}"] = item.Index;
                                 _nameAxisList[item.Index] = $"{config.Module}.{item.Name}";
                             }
-                            foreach(var items in config.GalilDigIn.DIs)
+                            if (config.GalilDigIn != null && config.GalilDigIn.DIs.Count != 0)
                             {
-                                _inputDataNameDIDic[items.Name] = items;
+                                foreach (var items in config.GalilDigIn.DIs)
+                                {
+                                    _inputDataNameDIDic[items.Name] = items;
+                                }
                             }
+                            
                         }
                     }
                 }               
@@ -582,7 +586,7 @@ namespace CyberX8_Simulator.Devices
         /// </summary>
         private void UpdateInputData(string module, string VariableName, bool value) 
         {
-            if(_moduleName == module)
+            if(_moduleName == module && _inputDataNameDIDic.ContainsKey(VariableName))
             {
                 int tmp = _inputDataNameDIDic[VariableName].Invert ? (!value ? 1 : 0) : (value ? 1 : 0);
                 _galilControlData.Inputs[_inputDataNameDIDic[VariableName].Address] = (byte)(tmp << _inputDataNameDIDic[VariableName].Bit);

+ 14 - 8
CyberX8_Simulator/Devices/WagoSocketSimulator.cs

@@ -2,8 +2,10 @@
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Log;
 using Aitex.Core.Util;
+using MECF.Framework.Common.Device.Festo;
 using MECF.Framework.Common.Device.Wago;
 using MECF.Framework.Common.Net;
+using MECF.Framework.Common.Simulator;
 using MECF.Framework.Simulator.Core.Driver;
 using System;
 using System.Collections.Generic;
@@ -48,22 +50,24 @@ namespace CyberX8_Simulator.Devices
         public WagoSocketSimulator(int port):base(port) 
         {
             SimulatorCommManager.Instance.OnUpdateVariableValueChanged += UpdataDataCausedByOtherModule;
+            MotorSimulator.Instance.OnUpdateWagoDatasChanged += UpdataDataCausedByOtherModule;
             InitializeData(port);    
         }  
         
-        private void UpdataDataCausedByOtherModule(string name,bool value)
+        private void UpdataDataCausedByOtherModule(string name, bool value, bool invert)
         {
+            value = invert ? !value : value;
             if (AINameIndexDic.ContainsKey(name))
             {
                 switch (name)
                 {
                     case "r_LoaderA_LS_Vacuum_anlg":
                     case "r_LoaderB_LS_Vacuum_anlg":
-                        AIShorts[AINameIndexDic[name]] = value ? (short)0x2AF8 : (short)0x32C8;
+                        AIShorts[AINameIndexDic[name]] = value ? (short)0x32C8 : (short)0x2AF8;
                         break;
                     case "r_DPUF_A_CHUCK_A_VAC":
                     case "r_DPUF_A_CHUCK_B_VAC":
-                        AIShorts[AINameIndexDic[name]] = !value ? (short)0x0C80 : (short)0x32C8;
+                        AIShorts[AINameIndexDic[name]] = value ? (short)0x0C80 : (short)0x32C8;
                         break;
                     case "r_LOADERA_BERNOULLI_PRESSURE":
                     case "r_LOADERB_BERNOULLI_PRESSURE":
@@ -75,10 +79,11 @@ namespace CyberX8_Simulator.Devices
                         break;
                     default:
                         break;
-
                 }
            
             }
+            //DI
+            UpdataDIBytes(name, value ? 1 : 0);
         }
         /// <summary>
         /// 触发Wago对应数据更新
@@ -164,11 +169,12 @@ namespace CyberX8_Simulator.Devices
             {
                 LOG.WriteLog(eEvent.ERR_WAGO, "Wago", "Load wago WagoControllerCfg-Simulator.xml failed");
             }
-
-            //设置IO变量默认值
-            if(AINameIndexDic.ContainsKey("r_LoaderA_LS_Vacuum_anlg")) AIShorts[AINameIndexDic["r_LoaderA_LS_Vacuum_anlg"]] = 0x32C8;
-            if(AINameIndexDic.ContainsKey("r_LoaderB_LS_Vacuum_anlg")) AIShorts[AINameIndexDic["r_LoaderB_LS_Vacuum_anlg"]] = 0x32C8;
             
+            //设置IO变量默认值
+            if (AINameIndexDic.ContainsKey("r_LoaderA_LS_Vacuum_anlg")) AIShorts[AINameIndexDic["r_LoaderA_LS_Vacuum_anlg"]] = 0x32C8;
+            if (AINameIndexDic.ContainsKey("r_LoaderB_LS_Vacuum_anlg")) AIShorts[AINameIndexDic["r_LoaderB_LS_Vacuum_anlg"]] = 0x32C8;
+            if (AINameIndexDic.ContainsKey("r_DPUF_A_CHUCK_A_VAC")) AIShorts[AINameIndexDic["r_DPUF_A_CHUCK_A_VAC"]] = 0x32C8;
+            if (AINameIndexDic.ContainsKey("r_DPUF_A_CHUCK_B_VAC")) AIShorts[AINameIndexDic["r_DPUF_A_CHUCK_B_VAC"]] = 0x32C8;
         }
         #region 公共方法
         public void UpdataDOBytes(string name,int value)

+ 5 - 5
Framework/Common/Device/Common/SimulatorCommManager.cs

@@ -19,7 +19,7 @@ namespace Aitex.Core.RT.Device
 
         //delegate
         #region Delegate
-        public delegate void UpdateVariableValueChanged(string name,bool value);
+        public delegate void UpdateVariableValueChanged(string name, bool value, bool revert);
         #endregion
 
         #region 事件
@@ -45,11 +45,11 @@ namespace Aitex.Core.RT.Device
         /// 通知受关联模块变化的变量以及变化的值
         /// </summary>
         /// <param name="data"></param>
-        private void UpdateVariableValue(string name, bool value)
+        private void UpdateVariableValue(string name, bool value, bool invert)
         {
             if (OnUpdateVariableValueChanged != null)
             {
-                OnUpdateVariableValueChanged(name, value);
+                OnUpdateVariableValueChanged(name, value, invert);
             }
         }
 
@@ -59,11 +59,11 @@ namespace Aitex.Core.RT.Device
         /// <param name="name"></param>
         /// <param name="value"></param>
         /// <returns></returns>
-        public void CheckDataChanged(string name, bool value)
+        public void CheckDataChanged(string name, bool value, bool invert)
         {
             if (_relatedDictionary.ContainsKey(name))
             {
-                UpdateVariableValue(_relatedDictionary[name], value);
+                UpdateVariableValue(_relatedDictionary[name], value, invert);
             }
             
         }

+ 43 - 13
Framework/Common/Simulator/MotorSimulator.cs

@@ -84,6 +84,7 @@ namespace MECF.Framework.Common.Simulator
         #region Delegate
         public delegate void UpdateVariableValueMotionDatasChanged(Dictionary<string, SimulatorMotionData> datasDic);
         public delegate void UpdateVariableValueInputDatasChanged(string module, string VariableName, bool value);
+        public delegate void UpdateVariableValueWagoDatasChanged(string name, bool value, bool invert);
         #endregion
 
         #region 事件
@@ -95,6 +96,10 @@ namespace MECF.Framework.Common.Simulator
         /// InputDatas变更事件
         /// </summary>
         public event UpdateVariableValueInputDatasChanged OnUpdateInputDatasChanged;
+        /// <summary>
+        /// WagoDatas变更事件
+        /// </summary>
+        public event UpdateVariableValueWagoDatasChanged OnUpdateWagoDatasChanged;
         #endregion
         /// <summary>
         /// 初始化
@@ -154,6 +159,7 @@ namespace MECF.Framework.Common.Simulator
                         _motorNameMinStepDic[item.Name] = (int)((value < 100) ? 100 : value);                        
                     }
                 }
+                
             }
             catch
             {
@@ -173,14 +179,11 @@ namespace MECF.Framework.Common.Simulator
                         {
                             foreach (BeckhoffStationAxis item in config.Axises)
                             {
-                                _toleranceDic[item.Name] = item.ToleranceDefault;
-                                if (item.Name.Contains("Elevator"))
+                                _toleranceDic[item.Name] = item.ToleranceDefault;                               
+                                foreach(var subItem in item.Stations)
                                 {
-                                    foreach(var subItem in item.Stations)
-                                    {
-                                        _stationPositionDic[subItem.Name.ToLower()] = double.Parse(subItem.Position);
-                                    }                                   
-                                }
+                                    _stationPositionDic[subItem.Name.ToLower()] = double.Parse(subItem.Position);
+                                }                                                                   
                             }
                         }                        
                     }
@@ -212,7 +215,7 @@ namespace MECF.Framework.Common.Simulator
                 //更新InputDatas
                 UpdateInputDatas(motorItem);                              
             }
-            
+            UpdateDatasByMutiAxisDatas();
             return true;
         }
         /// <summary>
@@ -233,12 +236,18 @@ namespace MECF.Framework.Common.Simulator
         /// <param name="value"></param>
         private void UpdateInputDatas(KeyValuePair<string, SimulatorMotionData> motorItem)
         {         
-            if (OnUpdateInputDatasChanged != null && CheckMotionData(motorItem, out string VariableName, out bool value))
+            if (OnUpdateInputDatasChanged != null && CheckMotionData(motorItem, out string variableName, out bool value))
             {
-                OnUpdateInputDatasChanged(motorItem.Value.ModuleName, VariableName, value);
+                OnUpdateInputDatasChanged(motorItem.Value.ModuleName, variableName, value);
+            }
+        }
+        private void UpdateDatasByMutiAxisDatas()
+        {
+            if (OnUpdateWagoDatasChanged != null && CheckMutiMotionData(out string variableName, out bool value))
+            {
+                OnUpdateWagoDatasChanged(variableName, value, false);
             }
         }
-
         /// <summary>
         /// 设置电机数据
         /// </summary>
@@ -408,7 +417,7 @@ namespace MECF.Framework.Common.Simulator
             return speed;
         }
         /// <summary>
-        /// 检查电机数据
+        /// 检查单一电机数据
         /// </summary>
         /// <returns></returns>
         private bool CheckMotionData(KeyValuePair<string, SimulatorMotionData> motor, out string name,out bool value)
@@ -434,11 +443,32 @@ namespace MECF.Framework.Common.Simulator
             return result;
         }
         /// <summary>
+        /// 检查多个电机数据
+        /// </summary>
+        /// <returns></returns>
+        private bool CheckMutiMotionData(out string variableName, out bool value)
+        {
+            bool result = false;
+            variableName = "";
+            value = false;  
+            //Loader WS Present Sensor
+            if (CheckAtStation("Transporter2.Elevator", _motorNameDataDic["Transporter2.Elevator"], "Loader")
+                && CheckAtStation("Transporter2.Gantry", _motorNameDataDic["Transporter2.Gantry"], "Loader"))
+            {
+                value = !_otherModuleDataDic[FESTO_DATABUFFER_TRANSPORT2_LOCK] ? true : false;
+                variableName = "r_Cathode_Present";
+                result = true;
+            }
+            
+            return result;
+
+        }
+        /// <summary>
         /// 更新其他模块数据
         /// </summary>
         /// <param name="name"></param>
         /// <param name="value"></param>
-        private void UpdataDataCausedByOtherModule(string name, bool value)
+        private void UpdataDataCausedByOtherModule(string name, bool value, bool revert)
         {
             if (_otherModuleDataDic.ContainsKey(name))
             {