Bladeren bron

1. 增加Read R轴位置指令
2. 增加R轴在原点位后的Load不再执行R轴缩回

zhouhr 2 maanden geleden
bovenliggende
commit
89e1ee7aa7

+ 6 - 0
Mars/EfemDualSimulator/Views/Simu_HongHuVceView.xaml.cs

@@ -117,6 +117,12 @@ namespace EfemDualSimulator.Views
                         Thread.Sleep(2000);
                         OnWriteMessage("_RDY" + EOF);
                         return;
+                    case "00,R,POSM,ABS,R":
+                        OnWriteMessage("00,X,POSM,ABS,R,00000" + EOF);
+                        //OnWriteMessage("00,X,MI,0000000000,0000000000,XXXXX?????,??????????" + EOF);
+                        Thread.Sleep(2000);
+                        OnWriteMessage("_RDY" + EOF);
+                        return;
                     default:
                         return;
                 }

+ 26 - 1
Mars/JetMainframe/Devices/HongHuVCE.cs

@@ -31,6 +31,7 @@ namespace JetMainframe.Devices
         RPI,
         RPO,
         CheckCassette,
+        CheckRPosition,
         Load,
         UnLoad,
         Map,
@@ -67,6 +68,7 @@ namespace JetMainframe.Devices
             {VceCommand.ReadMap,        "MI"    },
             {VceCommand.CheckStatus,    "OS"    },
             {VceCommand.CheckCassette,  "W2"    },
+            {VceCommand.CheckRPosition, "POSM,ABS,R"},
             //Set
             {VceCommand.ClearError, "ER" },
             {VceCommand.EndCassetteInterlock,"INTLCK,CASS,PRESENT,DIS" },
@@ -104,6 +106,8 @@ namespace JetMainframe.Devices
         public bool LeftCassetteArrive => _LeftCassetteArrive;
         public bool RightCassetteArrive => _RightCassetteArrive;
 
+        public int RPosition => _RPosition;
+
         #region 私有变量
         private AsyncSerialPort _serialport;
         private string _portname;
@@ -115,6 +119,7 @@ namespace JetMainframe.Devices
         private Regex _match_ReadMsg = new Regex(@"\d\d,X,MI,.*");
         private Regex _match_StatusMsg = new Regex(@"\d\d,X,OS,.*");
         private Regex _match_CassetteMsg = new Regex(@"\d\d,X,W2.*");
+        private Regex _match_ReadRMsg = new Regex(@"\d\d,X,POSM.*");
         private Regex _matchErrorCode = new Regex(@"(?<=_BKGERR )(.*)");
         private ModuleName _moduleName;
         private RState _status;
@@ -123,6 +128,8 @@ namespace JetMainframe.Devices
         private bool _HasReceiveMsg;
         private bool _isPlus;
 
+        private int _RPosition = 0;
+
         private bool _LeftDoorIsClose = true;
         private bool _RightDoorIsClose = true;
         private int _LeftCount = 0;
@@ -457,7 +464,7 @@ namespace JetMainframe.Devices
                                 //处理wafer 信息为map数据
                                 case VceCommand.ReadMap:
                                     //EV.PostAlarmLog(_moduleName.ToString(), $"Left Cassette Slot {slotnum + 1}:Crossed wafer.");
-                                    EV.PostInfoLog(_moduleName.ToString(),$"MappingData:  {msg}");
+                                    EV.PostInfoLog(_moduleName.ToString(), $"MappingData:  {msg}");
                                     ReadMapData(msg);
                                     break;
                             }
@@ -484,6 +491,14 @@ namespace JetMainframe.Devices
                                     break;
                             }
                         }
+                        else if (_match_ReadRMsg.IsMatch(msg))
+                        {
+                            _HasReceiveMsg = true;
+                            if (_currentVceMessage.Command == VceCommand.CheckRPosition)
+                            {
+                                _RPosition = Convert.ToInt32(msg.Split(',')[5]);
+                            }
+                        }
                         //_RDY查询结束
                         else
                         {
@@ -919,6 +934,16 @@ namespace JetMainframe.Devices
             return _serialport.Write(_currentMsg);
         }
 
+        public bool ReadR()
+        {
+            if (!CheckVceStatus())
+                return false;
+            _currentVceMessage = new VceMessage { Head = VceMessageHead.Read, Command = VceCommand.CheckRPosition };
+            _currentMsg = _currentVceMessage.toString() + _newline;
+            _status = RState.Running;
+            return _serialport.Write(_currentMsg);
+        }
+
         protected bool CheckVceStatus()
         {
 

+ 10 - 1
Mars/JetMainframe/VCEs/LoadRoutine.cs

@@ -21,6 +21,7 @@ namespace JetMainframe.VCEs
         private enum LoadStep
         {
             WaitCassette,
+            ReadR,
             RHandPI,
             CloseOutDoor,
             CheckCassette,
@@ -86,6 +87,7 @@ namespace JetMainframe.VCEs
 
             Runner
                   .Delay(LoadStep.WaitCassette, _waitCassette)
+                  .Run(LoadStep.ReadR,   ReadR, CheckVceIdle,_timeout)
                   .Run(LoadStep.RHandPI, RHandPushIn, CheckVceIdle,_timeout)
                   .Run(LoadStep.CloseOutDoor, CloseOutDoor, CheckVceIdle, _timeout)
                   .Run(LoadStep.CheckCassette, _vce.ReadCassette, CheckHasCassette,_timeout)
@@ -133,10 +135,17 @@ namespace JetMainframe.VCEs
         }
 
         //private bool 
+        private bool ReadR()
+        {
+            if (SC.GetValue<bool>($"{Module}.IsPlus"))
+                return _vce.ReadR();
+
+            return true;
+        }
 
         private bool RHandPushIn()
         {
-            if(SC.GetValue<bool>($"{Module}.IsPlus"))
+            if(SC.GetValue<bool>($"{Module}.IsPlus") && _vce.RPosition != 0)
                 return _vce.RaxisPI();
 
             return true;