Browse Source

update galil axis

chenkui 1 week ago
parent
commit
fd18176c06

+ 4 - 0
CyberX8_MainPages/ViewModels/TopViewModel.cs

@@ -342,6 +342,10 @@ namespace CyberX8_MainPages.ViewModels
         {
             TimeTick = DateTime.Now.ToString();
             RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
+            if (RtDataValues == null)
+            {
+                return;
+            }
             if( RtDataValues != null )
             {
                 SignalTowerData = CommonFunction.GetValue<AITSignalTowerData>(RtDataValues, $"System.SignalTower.DeviceData");

+ 11 - 11
CyberX8_RT/Config/Layout/Layout.xml

@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ProcessLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-  <Item CellId="1" Name="Cell1" ModuleName="Rinse1" Width="30" Height="100" Left="1477" Top="185" Type="Cell" />
-  <Item CellId="2" Name="Cell2" ModuleName="Metal1" Width="30" Height="100" Left="1477" Top="185" Type="Cell" />
-  <Item CellId="3" Name="Cell3" ModuleName="Metal2" Width="30" Height="100" Left="1469" Top="185" Type="Cell" />
-  <Item CellId="4" Name="Cell4" ModuleName="Metal3" Width="30" Height="100" Left="1251" Top="185" Type="Cell" />
+  <Item CellId="1" Name="Cell1" ModuleName="Rinse1" Width="30" Height="100" Left="1727" Top="185" Type="Cell" />
+  <Item CellId="2" Name="Cell2" ModuleName="Metal1" Width="30" Height="100" Left="1647" Top="185" Type="Cell" />
+  <Item CellId="3" Name="Cell3" ModuleName="" Width="30" Height="100" Left="1469" Top="185" Type="Cell" />
+  <Item CellId="4" Name="Cell4" ModuleName="" Width="30" Height="100" Left="1251" Top="185" Type="Cell" />
   <Item CellId="5" Name="Cell5" ModuleName="" Width="30" Height="100" Left="1505" Top="185" Type="Cell" />
   <Item CellId="6" Name="Cell6" ModuleName="Rinse2" Width="30" Height="100" Left="1477" Top="185" Type="Cell" />
-  <Item CellId="7" Name="Cell7" ModuleName="Metal4" Width="30" Height="100" Left="1039" Top="185" Type="Cell" />
-  <Item CellId="8" Name="Cell8" ModuleName="Metal5" Width="30" Height="100" Left="1115" Top="185" Type="Cell" />
-  <Item CellId="9" Name="Cell9" ModuleName="Rinse3" Width="30" Height="100" Left="1335" Top="185" Type="Cell" />
-  <Item CellId="10" Name="Cell10" ModuleName="Rinse4" Width="30" Height="100" Left="1116" Top="185" Type="Cell" />
-  <Item CellId="11" Name="Cell11" ModuleName="Metal6" Width="30" Height="100" Left="974" Top="185" Type="Cell" />
-  <Item CellId="12" Name="Cell12" ModuleName="Metal7" Width="30" Height="100" Left="924" Top="185" Type="Cell" />
+  <Item CellId="7" Name="Cell7" ModuleName="Metal2" Width="30" Height="100" Left="1381" Top="185" Type="Cell" />
+  <Item CellId="8" Name="Cell8" ModuleName="" Width="30" Height="100" Left="1115" Top="185" Type="Cell" />
+  <Item CellId="9" Name="Cell9" ModuleName="Rinse3" Width="30" Height="100" Left="1305" Top="185" Type="Cell" />
+  <Item CellId="10" Name="Cell10" ModuleName="Metal3" Width="30" Height="100" Left="1116" Top="185" Type="Cell" />
+  <Item CellId="11" Name="Cell11" ModuleName="" Width="30" Height="100" Left="974" Top="185" Type="Cell" />
+  <Item CellId="12" Name="Cell12" ModuleName="Rinse4" Width="30" Height="100" Left="924" Top="185" Type="Cell" />
   <Item CellId="13" Name="Cell13" ModuleName="" Width="30" Height="100" Left="1241" Top="185" Type="Cell" />
-  <Item CellId="14" Name="Cell14" ModuleName="Rinse5" Width="30" Height="100" Left="764" Top="185" Type="Cell" />
+  <Item CellId="14" Name="Cell14" ModuleName="Metal4" Width="30" Height="100" Left="764" Top="185" Type="Cell" />
   <Item CellId="15" Name="Cell15" ModuleName="" Width="30" Height="100" Left="1102" Top="185" Type="Cell" />
   <Item CellId="16" Name="Cell16" ModuleName="" Width="30" Height="100" Left="931" Top="185" Type="Cell" />
   <Item CellId="17" Name="Cell17" ModuleName="" Width="30" Height="100" Left="879" Top="185" Type="Cell" />

+ 10 - 1
CyberX8_RT/Devices/AXIS/JetAxisBase.cs

@@ -872,6 +872,10 @@ namespace CyberX8_RT.Devices.AXIS
             if (variable == MOTOR_POSITION)
             {
                 CalculateCurrentStation(MotionData.MotorPosition);
+                if (SC.GetValue<bool>("System.IsSimulatorMode"))
+                {
+                    LOG.WriteLog(eEvent.INFO_AXIS, Module, $"Motor position is {value}");
+                }
             }
             if (variable == ACTUAL_TORQUE)
             {
@@ -1187,7 +1191,12 @@ namespace CyberX8_RT.Devices.AXIS
         /// <returns></returns>
         public bool WriteStartMotion()
         {
-            return GalilControllerCfgManager.Instance.SetAxisCommand(Module, Name, "BG", null);
+            bool result= GalilControllerCfgManager.Instance.SetAxisCommand(Module, Name, "BG", null);
+            if (result)
+            {
+                _runTime = DateTime.Now;
+            }
+            return result;
         }
         /// <summary>
         /// Home 电机

+ 1 - 1
CyberX8_RT/Devices/Loader/LoaderLoadRoutine.cs

@@ -436,7 +436,7 @@ namespace CyberX8_RT.Devices.Loader
             double shuttlePosition=_shuttleAxis.MotionData.MotorPosition;//校验shuttle位置是否再out位置
             if (!_shuttleAxis.CheckPositionIsInStation(shuttlePosition, $"OUT{_waferSize}"))
             {
-                NotifyError(eEvent.ERR_LOADER,  $"shuttle {shuttlePosition} not in $OUT{_waferSize}",-1);
+                NotifyError(eEvent.ERR_LOADER,  $"shuttle {shuttlePosition} not in OUT{_waferSize}",-1);
                 return false;
             }
             double tiltPosition = _tiltAxis.MotionData.MotorPosition;//校验tilt是否在hori位置

+ 3 - 2
CyberX8_RT/Modules/EFEM/EfemEntity.cs

@@ -650,7 +650,7 @@ namespace CyberX8_RT.Modules
         {
             _errorPreState = (STATE)fsm.State;
             string error = (param != null && param.Length != 0) ? param[0].ToString() : "";
-            if (Singleton<RouteManager>.Instance.IsAutoRunning)
+            if (Singleton<RouteManager>.Instance.IsAutoMode)
             {
                 int msg = 0;
                 if (_errorPreState == STATE.Picking)
@@ -659,7 +659,7 @@ namespace CyberX8_RT.Modules
                 }
                 else if (_errorPreState == STATE.Aligning)
                 {
-                    msg= (int)MSG.Align;
+                    msg = (int)MSG.Align;
                 }
                 else if (_errorPreState == STATE.Placing)
                 {
@@ -668,6 +668,7 @@ namespace CyberX8_RT.Modules
                 else
                 {
                     error = $"{error}\r\n Plase Home Robot back to idle state";
+                    return true;
                 }
                 AlarmList alarmList = new AlarmList(Module.ToString(), ((STATE)fsm.State).ToString(), msg,
                     error, 0, (int)AlarmType.Error);

+ 1 - 1
Framework/Common/Device/Galil/Galil21TcpDevice.cs

@@ -56,7 +56,7 @@ namespace MECF.Framework.Common.Device.Galil
             _module = module;
             _ip = ip;
             _port = port;
-            _periodicJob = new PeriodicJob(20, OnTimer, $"Galil {_module} timer", false, true);
+            _periodicJob = new PeriodicJob(50, OnTimer, $"Galil {_module} timer", false, true);
         }
         /// <summary>
         /// 定时器执行

+ 1 - 1
Framework/Common/Device/Galil/Galil40TcpDevice.cs

@@ -56,7 +56,7 @@ namespace MECF.Framework.Common.Device.Galil
             _module = module;
             _ip = ip;
             _port = port;
-            _periodicJob = new PeriodicJob(20, OnTimer, $"Galil {_module} timer", false, true);
+            _periodicJob = new PeriodicJob(50, OnTimer, $"Galil {_module} timer", false, true);
         }
         /// <summary>
         /// 定时器执行

+ 6 - 0
Framework/Common/Device/Galil/GalilControllerCfgManager.cs

@@ -6,6 +6,7 @@ using MECF.Framework.Common.Device.Festo;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.IOCore;
 using MECF.Framework.Common.Net;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
@@ -181,6 +182,11 @@ namespace MECF.Framework.Common.Device.Galil
                     continue;
                 }
                 GalilAxisData galilAxisData=controllerData.GalilAxisDatas[index];
+
+                //if (SC.GetValue<bool>("System.IsSimulatorMode"))
+                //{
+                //    LOG.WriteBackgroundLog(eEvent.INFO_AXIS, moduleName, JsonConvert.SerializeObject(galilAxisData));
+                //}
                 CheckAxisDataChanged(moduleName, galilAxisData);
             }
         }