Browse Source

update robot aligner vacuum

chenkui 2 weeks ago
parent
commit
fc844d450d

+ 1 - 1
CyberX8_RT/Devices/EFEM/SunWayRobot.cs

@@ -607,7 +607,7 @@ namespace CyberX8_RT.Devices.EFEM
             string cmd = "";
             if (ModuleName.Aligner1 == mod)
             {
-                 cmd = $"ALIGN VAC {strVacuum}\r";
+                 cmd = $"ALIGNER VAC {strVacuum}\r";
             }
             else
             {

+ 10 - 10
CyberX8_RT/Devices/Loader/LoaderSideVacuumLevelCheckRoutine.cs

@@ -78,11 +78,11 @@ namespace CyberX8_RT.Devices.AXIS.CANOpen
                         NotifyError(Aitex.Core.RT.Log.eEvent.INFO_LOADER, $"vacuum value {_loaderSide.SideData.CRSVacuumValue} is over or equal {_crsVacuumHighLimit}", 0);
                         return false;
                     }
-                    if (_loaderSide.SideData.CRSVacuumValue >= 0)
-                    {
-                        NotifyError(Aitex.Core.RT.Log.eEvent.INFO_LOADER, $"vacuum value {_loaderSide.SideData.CRSVacuumValue} is over or equal 0", 0);
-                        return false;
-                    }
+                    //if (_loaderSide.SideData.CRSVacuumValue >= 0)
+                    //{
+                    //    NotifyError(Aitex.Core.RT.Log.eEvent.INFO_LOADER, $"vacuum value {_loaderSide.SideData.CRSVacuumValue} is over or equal 0", 0);
+                    //    return false;
+                    //}
                 }
             }
             else
@@ -93,11 +93,11 @@ namespace CyberX8_RT.Devices.AXIS.CANOpen
                     NotifyError(Aitex.Core.RT.Log.eEvent.INFO_LOADER, $"vacuum value {_loaderSide.SideData.CRSVacuumValue} is less or equal {_crsVacuumLowLimit}", 0);
                     return false;
                 }
-                if (_loaderSide.SideData.CRSVacuumValue >= 0)
-                {
-                    NotifyError(Aitex.Core.RT.Log.eEvent.INFO_LOADER, $"vacuum value {_loaderSide.SideData.CRSVacuumValue} is over or equal 0", 0);
-                    return false;
-                }
+                //if (_loaderSide.SideData.CRSVacuumValue >= 0)
+                //{
+                //    NotifyError(Aitex.Core.RT.Log.eEvent.INFO_LOADER, $"vacuum value {_loaderSide.SideData.CRSVacuumValue} is over or equal 0", 0);
+                //    return false;
+                //}
             }
             
             return result;

+ 9 - 4
CyberX8_RT/Dispatch/JobProcesser.cs

@@ -189,15 +189,20 @@ namespace CyberX8_RT.Dispatch
                     LOG.WriteLog(eEvent.WARN_ROUTER, ModuleName.System.ToString(), reason);
                     return false;
                 }
-
-                if (WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), i).ProcessState != EnumWaferProcessStatus.Idle)
+                WaferInfo waferInfo = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), i);
+                if (waferInfo.Status != WaferStatus.Normal)
                 {
-                    reason = $"job wafer: {module} slot {i + 1} process status is {WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), i).ProcessState}";
+                    reason = $"job wafer: {module} slot {i + 1} status is {waferInfo.Status}";
+                    LOG.WriteLog(eEvent.WARN_ROUTER, ModuleName.System.ToString(), reason);
+                    return false;
+                }
+                if (waferInfo.ProcessState != EnumWaferProcessStatus.Idle)
+                {
+                    reason = $"job wafer: {module} slot {i + 1} process status is {waferInfo.ProcessState}";
                     LOG.WriteLog(eEvent.WARN_ROUTER, ModuleName.System.ToString(), reason);
                     return false;
                 }
                 //--- 2024-03-21 增加了waferinfo 相应的lotId信息 start---
-                WaferInfo waferInfo = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), i);
                 cj.LotWafers.Add(waferInfo);
                 waferInfo.SequenceName = slotSequence[i];
                 waferInfo.LotId = lotId;

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

@@ -342,7 +342,7 @@ namespace CyberX8_RT.Modules
             AnyStateTransition(MSG.TurnOffBuzzer,           fnTurnOffBuzzer,    FSM_STATE.SAME);
             AnyStateTransition(MSG.Error,                   fnError,            STATE.Error);
             AnyStateTransition(MSG.Online,                  fnOnline,           FSM_STATE.SAME);
-            //AnyStateTransition(MSG.Abort,                   fnAbortRobot,       FSM_STATE.SAME);
+            AnyStateTransition(MSG.Abort,                   fnAbortRobot,       FSM_STATE.SAME);
             AnyStateTransition(MSG.ToInit,                  fnToInit,           STATE.Init);
             AnyStateTransition(MSG.BackroundCmd,            fnBackroundCommand, FSM_STATE.SAME);
             AnyStateTransition(MSG.CloseBuzzer,          fnCloseBuzzer, FSM_STATE.SAME);
@@ -663,6 +663,7 @@ namespace CyberX8_RT.Modules
         private bool fnAbortRobot(object[] param)
         {
             //_efem.ExecuteAction();
+            _efem.Halt();
             return true;
         }
 

+ 10 - 0
CyberX8_RT/Modules/EFEM/EfemPickRoutine.cs

@@ -23,6 +23,7 @@ using CyberX8_RT.Modules.Transporter;
 using MECF.Framework.Common.WaferHolder;
 using System;
 using Aitex.Core.UI.ControlDataContext;
+using Aitex.Core.Common;
 
 namespace CyberX8_RT.Modules.EFEM
 {
@@ -159,6 +160,15 @@ namespace CyberX8_RT.Modules.EFEM
                 }
                 return false;
             }
+            else
+            {
+                WaferInfo waferInfo = WaferManager.Instance.GetWafer(_targetModule, _targetSlot);
+                if(waferInfo.Status!=WaferStatus.Normal)
+                {
+                    NotifyError(eEvent.ERR_EFEM_ROBOT, $"The target slot: {_targetModule}.{_targetSlot + 1} wafer status is {waferInfo.Status}, cannot do the pick action", -1);
+                    return false;
+                }
+            }
 
 
 

+ 34 - 16
Framework/Common/Device/ResistivityProbe/ThorntonSerialDevice.cs

@@ -16,7 +16,7 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
     public class ThorntonSerialDevice
     {
         #region Delegate
-        public delegate void ThorntonDataChanged(string name,List<string> lstContent);
+        public delegate void ThorntonDataChanged(string name, List<string> lstContent);
         #endregion
         #region 常量
         private const string CONSTANT_COMMAND = "D00Z\r";
@@ -48,6 +48,10 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
         /// </summary>
         private string _errmsg = "";
         /// <summary>
+        /// warning信息
+        /// </summary>
+        private string _warnMsg = "";
+        /// <summary>
         /// 重连
         /// </summary>
         private bool _reconnected;
@@ -56,6 +60,10 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
         /// </summary>
         private DateTime _offlineDateTime;
         /// <summary>
+        /// 首次连接成功
+        /// </summary>
+        private bool _isFirstConnected = false;
+        /// <summary>
         /// 锁
         /// </summary>
         private object _locker = new object();
@@ -84,7 +92,7 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
         /// <param name="stopBits"></param>
         /// <param name="dataBits"></param>
         /// <param name="parity"></param>
-        public ThorntonSerialDevice(string name, string portName, int baudRate = 9600, StopBits stopBits = StopBits.One, int dataBits = 8, Parity parity = Parity.None, bool reconnected = false,int receiveTimeout=2000)
+        public ThorntonSerialDevice(string name, string portName, int baudRate = 9600, StopBits stopBits = StopBits.One, int dataBits = 8, Parity parity = Parity.None, bool reconnected = false, int receiveTimeout = 2000)
         {
             _serialPort = new SerialPort();
             _serialPort.BaudRate = baudRate;
@@ -121,10 +129,9 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
                         if (!_serialPort.IsOpen)
                         {
                             _serialPort.Open();
+                            LOG.WriteLog(eEvent.INFO_RESISTIVITY, _name, $"connect port[{_serialPort.PortName}] success");
                         }
                         _connected = true;
-
-                        LOG.WriteLog(eEvent.INFO_RESISTIVITY, _name, $"connect port[{_serialPort.PortName}] success");
                     }
                     catch (Exception ex)
                     {
@@ -189,19 +196,19 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
         /// </summary>
         public void ReadData()
         {
+            string str = "";
             try
             {
                 _serialPort.WriteLine(CONSTANT_COMMAND);
                 DateTime dt = DateTime.Now;
-                string str = "";
-                while(DateTime.Now.Subtract(dt).TotalMilliseconds<=_receiveTimeout)
+                while (DateTime.Now.Subtract(dt).TotalMilliseconds <= _receiveTimeout)
                 {
                     if (_serialPort.BytesToRead > 0)
                     {
                         string tmp = _serialPort.ReadLine();
-                        if(!string.IsNullOrEmpty(tmp))
+                        if (!string.IsNullOrEmpty(tmp))
                         {
-                            WriteInfoMsg(0,tmp);
+                            WriteInfoMsg(0, tmp);
                         }
                         if (tmp != CONSTANT_COMMAND)
                         {
@@ -217,25 +224,24 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
                 if (!string.IsNullOrEmpty(str))
                 {
                     string[] strAry = str.Split(SPLIT_CHARACTER);
-                    if(strAry.Length>=4)
+                    if (strAry.Length >= 4)
                     {
                         List<string> lst = new List<string>();
-                        int length=strAry.Length%2==0?strAry.Length:strAry.Length-1;
-                        for(int i=2;i<length; i+=2)
+                        for (int i = 2; i < strAry.Length; i += 2)
                         {
                             lst.Add(strAry[i]);
                         }
-                        if(OnDataChanged!=null)
+                        if (OnDataChanged != null)
                         {
-                            OnDataChanged(_name,lst);
+                            OnDataChanged(_name, lst);
                         }
                     }
                 }
                 _errmsg = "";
-            } 
-            catch(Exception ex)
+            }
+            catch (Exception ex)
             {
-                WriteErrorMsg(ex.Message);
+                WriteWarnMsg($"read exception{ex.Message}--{str}");
             }
         }
 
@@ -257,6 +263,18 @@ namespace MECF.Framework.Common.Device.ResistivityProbe
             }
         }
         /// <summary>
+        /// 记录错误信息
+        /// </summary>
+        /// <param name="msg"></param>
+        private void WriteWarnMsg(string msg)
+        {
+            if (_warnMsg != msg)
+            {
+                _warnMsg = msg;
+                LOG.WriteLog(eEvent.WARN_RESISTIVITY, _name, msg);
+            }
+        }
+        /// <summary>
         /// 写日志
         /// </summary>
         /// <param name="bytes"></param>