Browse Source

Wafer transfer routine done.

sangwq 2 years ago
parent
commit
630c7b7548

+ 3 - 0
Venus/Venus_Core/EventDefine.cs

@@ -14,6 +14,8 @@ namespace Aitex.Core.RT.Log{
 		ERR_SIGNAL_TOWER_UNDEFINE = 13,
 		ERR_SIGNAL_TOWER_INVALID_CFG = 14,
 		ERR_PLC_HEARTBEAT_FAIL = 15,
+		EV_DEVICE_INFO = 16,
+		ERR_DEVICE_INFO = 17,
 		INFO_DEVICE_IO_HEATER = 1000,
 		WARN_DEVICE_IO_HEATER = 1001,
 		ERR_DEVICE_IO_HEATER = 1002,
@@ -21,5 +23,6 @@ namespace Aitex.Core.RT.Log{
 		ERR_PENDULUM_VALVE = 1004,
 		ERR_ESC_HV = 1005,
 		ERR_TURBO_PUMP = 1006,
+		ERR_RF = 1007,
 	}
 }

+ 4 - 0
Venus/Venus_Core/RtState.cs

@@ -61,6 +61,10 @@ namespace Venus_Core
         LoadLockLeakCheck,
         MoveLift,
         Purge,
+
+        // transfer
+        LLPlacing,
+        LLPicking,
         Transfer,
         Error,
         PrepareTransfer,

BIN
Venus/Venus_RT/Config/DeviceModelVenus.xml


+ 27 - 0
Venus/Venus_RT/Config/LogDefine.json

@@ -117,6 +117,24 @@
     "Note": "Invalid config"
   },
   {
+    "Id": 16,
+    "Level": "Info",
+    "LogEnum": "EV_DEVICE_INFO",
+    "GlobalDescription_zh": "Device Info: {0}",
+    "GlobalDescription_en": "Device Info: {0}",
+    "Module": "System",
+    "Note": "Device Info"
+  },
+  {
+    "Id": 17,
+    "Level": "Error",
+    "LogEnum": "ERR_DEVICE_INFO",
+    "GlobalDescription_zh": "Device Error: {0}",
+    "GlobalDescription_en": "Device Error: {0}",
+    "Module": "System",
+    "Note": "Device Error"
+  },
+  {
     "Id": 1000,
     "Level": "Info",
     "LogEnum": "INFO_DEVICE_IO_HEATER",
@@ -178,5 +196,14 @@
     "GlobalDescription_en": "Turbo Pump alarm: {0}",
     "Module": "PM",
     "Note": "Turbo Pump Alarm"
+  },
+  {
+    "Id": 1007,
+    "Level": "Error",
+    "LogEnum": "ERR_RF",
+    "GlobalDescription_zh": "RF error: {0}",
+    "GlobalDescription_en": "RF error: {0}",
+    "Module": "PM",
+    "Note": "RF Alarm"
   }
 ]

+ 1 - 0
Venus/Venus_RT/Config/System.sccfg

@@ -105,6 +105,7 @@
 	<!--PMA-->
 	<configs name="PMA" nameView="PMA" >
 		<config default="120" name="PrepareTransferTimeout" nameView="Prepare Transfer Timeout" description="prepare transfer time out" max="99999" min="1" paramter="" tag="" unit="s" type="Integer" />
+		<config default="120" name="TransferWaferTimeout" nameView="Transfer Wafer Timeout" description="Transfer Wafer Timeout" max="99999" min="1" paramter="" tag="" unit="s" type="Integer" />
 		<config default="1" name="OpenGasValveTimeout" nameView="Open Gas Valve Timeout" description="开阀超时" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="1" name="TimeLimitOfCloseGasValve" nameView="Time Limit Of Close Gas Valve" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="1" name="OpenCloseSlitValveTimeout" nameView="Open Close Slit Valve Timeout" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />

+ 14 - 14
Venus/Venus_RT/Devices/AdTecRF.cs

@@ -251,7 +251,7 @@ namespace Venus_RT.Devices
             else
             {
                 this.ConnectedStatus = false;
-                EV.PostAlarmLog(this.Module, "AD TEC 射频发生器串口无法打开");
+                LOG.Write(eEvent.ERR_RF, Module, "AD TEC 射频发生器串口无法打开");
                 return false;
             }
 
@@ -316,7 +316,7 @@ namespace Venus_RT.Devices
                         _recipeAlarmChecker.Monitor(ForwardPower, PowerSetPoint - Math.Abs(_recipeAlarmRange / 100.0 * PowerSetPoint), PowerSetPoint + Math.Abs(_recipeAlarmRange / 100.0 * PowerSetPoint), _scPowerAlarmTime);
                         if (_recipeAlarmChecker.Trig)
                         {
-                            EV.PostAlarmLog(Module, Display + $" out of tolerance in {_scPowerAlarmTime:0} seconds");
+                            LOG.Write(eEvent.ERR_RF, Module, Display + $" out of tolerance in {_scPowerAlarmTime:0} seconds");
 
                             SetPowerOnOff(false, out _);
                         }
@@ -327,7 +327,7 @@ namespace Venus_RT.Devices
                     _alarmChecker.Monitor(ForwardPower, PowerSetPoint - Math.Abs(_scPowerAlarmRange), PowerSetPoint + Math.Abs(_scPowerAlarmRange), _scPowerAlarmTime);
                     if (_alarmChecker.Trig)
                     {
-                        EV.PostAlarmLog(Module, Display + $" out of tolerance in {_scPowerAlarmTime:0} seconds");
+                        LOG.Write(eEvent.ERR_RF, Module, Display + $" out of tolerance in {_scPowerAlarmTime:0} seconds");
                     }
                 }
 
@@ -359,7 +359,7 @@ namespace Venus_RT.Devices
 
                 if (_checkerReflectPower.Trig)
                 {
-                    EV.PostAlarmLog($"{Module}",
+                    LOG.Write(eEvent.ERR_RF, Module,
                         $"{Display} Reflect power {ReflectPower:0} out of range[0,{_scReflectPowerAlarmRange:0}] in {_scReflectPowerAlarmTime:0} seconds");
 
                     SetPowerOnOff(false, out _);
@@ -374,7 +374,7 @@ namespace Venus_RT.Devices
                 {
                     if (EnableAlarm)
                     {
-                        EV.PostAlarmLog($"{Module}", "rf on time value larger than setting interval days");
+                        LOG.Write(eEvent.ERR_RF, Module, "rf on time value larger than setting interval days");
                     }
                 }
             }
@@ -408,7 +408,7 @@ namespace Venus_RT.Devices
                 {
                     if (!IsPowerOn)
                     {
-                        EV.PostAlarmLog($"{Module}", "RF Turn On Failed");
+                        LOG.Write(eEvent.ERR_RF, Module, "RF Turn On Failed");
                         _timerRFTurnOn.Stop();
                     }
                 }
@@ -500,7 +500,7 @@ namespace Venus_RT.Devices
         {
             if (string.IsNullOrEmpty(str))
             {
-                EV.PostAlarmLog(Module, "AdTec RFG 无数据反馈");
+                LOG.Write(eEvent.ERR_RF, Module, "AdTec RFG 无数据反馈");
                 return;
             }
 
@@ -598,9 +598,9 @@ namespace Venus_RT.Devices
                 if (!string.IsNullOrEmpty(code))
                 {
                     if (errCode == 99)
-                        EV.PostInfoLog(Module, "Source Generator " + code);
+                        LOG.Write(eEvent.EV_DEVICE_INFO, Module, "Source Generator " + code);
                     else
-                        EV.PostAlarmLog(Module, "Source Generator " + code);
+                        LOG.Write(eEvent.ERR_RF, Module, "Source Generator " + code);
                 }
             }
 
@@ -614,14 +614,14 @@ namespace Venus_RT.Devices
         private void SerialPortErrorOccurred(string obj)
         {
             Status = GeneratorStatus.ERROR;
-            EV.PostAlarmLog(Module, $"AdTec RFG 串口出错, [{obj}]");
+            LOG.Write(eEvent.ERR_RF, Module, $"AdTec RFG 串口出错, [{obj}]");
         }
 
         private bool SendCmd(string str)
         {
             if (str != AdTecRfMessage.QUERY)
             {
-                EV.PostInfoLog(Module, $"Generator send [{str}]");
+                LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Generator send [{str}]");
             }
             return _serial.Write(str + "\r");
         }
@@ -708,7 +708,7 @@ namespace Venus_RT.Devices
             }
             else
             {
-                EV.PostAlarmLog(Module, "Match 串口无法打开");
+                LOG.Write(eEvent.ERR_RF, Module, "Match 串口无法打开");
                 return false;
             }
 
@@ -808,7 +808,7 @@ namespace Venus_RT.Devices
         {
             if (string.IsNullOrWhiteSpace(strOrg))
             {
-                EV.PostAlarmLog(Module, "收到 Match 数据为空");
+                LOG.Write(eEvent.ERR_RF, Module, "收到 Match 数据为空");
                 return;
             }
 
@@ -849,7 +849,7 @@ namespace Venus_RT.Devices
 
         private void SerialPortErrorOccurred(string str)
         {
-            EV.PostAlarmLog(Module, $"AdTec Match error [{str}]");
+            LOG.Write(eEvent.ERR_RF, Module, $"AdTec Match error [{str}]");
         }
 
         private void SendCmd(string str)

+ 2 - 2
Venus/Venus_RT/Devices/AdixenTurboPump.cs

@@ -193,7 +193,7 @@ namespace Venus_RT.Devices
         {
             if (!_serial.Open())
             {
-                EV.PostAlarmLog(this.Module, "Adixen Turbo Pump 串口无法打开");
+                LOG.Write(eEvent.ERR_TURBO_PUMP, Module, "Adixen Turbo Pump 串口无法打开");
                 return false;
             }
 
@@ -277,7 +277,7 @@ namespace Venus_RT.Devices
 
                 if(_lastCommand == Operation.Invalid)
                 {
-                    EV.PostWarningLog(Module, $"Adixen Turbo Pump unexpected communication data: {obj}");
+                    LOG.Write(eEvent.ERR_TURBO_PUMP, Module, $"Adixen Turbo Pump unexpected communication data: {obj}");
                     return;
                 }
 

+ 6 - 6
Venus/Venus_RT/Devices/CometRF.cs

@@ -835,7 +835,7 @@ namespace Venus_RT.Devices
 
                 if (_checkerPower.Trig)
                 {
-                    EV.PostAlarmLog($"{Module}",
+                    LOG.Write(eEvent.ERR_RF, Module,
                         $"{Display} Forward power {ForwardPower:0} out of range[{PowerSetPoint - _scPowerAlarmRange.DoubleValue:0},{PowerSetPoint + _scPowerAlarmRange.DoubleValue:0}] in {_scPowerAlarmTime.DoubleValue:0} seconds");
 
                     SetPowerOnOff(false, out _);
@@ -845,7 +845,7 @@ namespace Venus_RT.Devices
 
                 if (_checkerReflectPower.Trig)
                 {
-                    EV.PostAlarmLog($"{Module}",
+                    LOG.Write(eEvent.ERR_RF, Module,
                         $"{Display} Reflect power {ReflectPower:0} out of range[0,{_scReflectPowerAlarmRange.DoubleValue:0}] in {_scReflectPowerAlarmTime.DoubleValue:0} seconds");
 
                     SetPowerOnOff(false, out _);
@@ -860,7 +860,7 @@ namespace Venus_RT.Devices
                 {
                     if (EnableAlarm)
                     {
-                        EV.PostAlarmLog($"{Module}", "rf on time value larger than setting interval days");
+                        LOG.Write(eEvent.ERR_RF, Module, "rf on time value larger than setting interval days");
                     }
                 }
             }
@@ -929,15 +929,15 @@ namespace Venus_RT.Devices
         {
             if (command == CometRFCommand.Command && argument == 0)
             {
-                EV.PostInfoLog(Module, $"Bias Generator send RF off");
+                LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Bias Generator send RF off");
             }
             else if (command == CometRFCommand.Command && argument == 1)
             {
-                EV.PostInfoLog(Module, $"Bias Generator send RF on");
+                LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Bias Generator send RF on");
             }
             if (command == CometRFCommand.PowerSetPoint)
             {
-                EV.PostInfoLog(Module, $"Bias Generator send [{argument / 1000}W]");
+                LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Bias Generator send [{argument / 1000}W]");
             }
             _currentCommandNumber = command;
             _sendData = BuildMessage(mode, command, argument);

+ 6 - 6
Venus/Venus_RT/Devices/EdwardsPump.cs

@@ -272,16 +272,16 @@ namespace Venus_RT.Devices
                     case EdwardsPumpMessage.RESET:
                         break;
                     case EdwardsPumpMessage.COMMAND_Take_Control:
-                        EV.PostInfoLog(Module, $"Take Control Edwards Pump {QueryCmdReply(cmd)}");
+                        LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Take Control Edwards Pump {QueryCmdReply(cmd)}");
                         break;
                     case EdwardsPumpMessage.COMMAND_Release_Control:
-                        EV.PostInfoLog(Module, $"Release Control Edwards Pump {QueryCmdReply(cmd)}");
+                        LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Release Control Edwards Pump {QueryCmdReply(cmd)}");
                         break;
                     case EdwardsPumpMessage.COMMAND_Switch_on_Pump:
-                        EV.PostInfoLog(Module, $"Switch on Edwards Pump {QueryCmdReply(cmd)}");
+                        LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Switch on Edwards Pump {QueryCmdReply(cmd)}");
                         break;
                     case EdwardsPumpMessage.COMMAND_Switch_off_Pump_Fast_shut_down:
-                        EV.PostInfoLog(Module, $"Switch off Edwards Pump {QueryCmdReply(cmd)}");
+                        LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Switch off Edwards Pump {QueryCmdReply(cmd)}");
                         break;
                     case EdwardsPumpMessage.QUERY_Pump_Status:
                         if (cmd == "0")
@@ -294,7 +294,7 @@ namespace Venus_RT.Devices
                             }
                             if (_trigPumpOff.Q)
                             {
-                                EV.PostInfoLog(Module, $"Edwards Pump关闭");
+                                LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Edwards Pump关闭");
                             }
                             _trigPumpOff.RST = true;
                         }
@@ -308,7 +308,7 @@ namespace Venus_RT.Devices
                             }
                             if (_trigPumpOn.Q)
                             {
-                                EV.PostInfoLog(Module, $"Edwards Pump打开");
+                                LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Edwards Pump打开");
                             }
                             _trigPumpOn.RST = true;
                         }

+ 9 - 9
Venus/Venus_RT/Devices/IODevices/IoCylinder.cs

@@ -162,13 +162,13 @@ namespace Venus_RT.Devices
             {
                 if (isOpen && State == CylinderState.Open)
                 {
-                    EV.PostInfoLog(Module, $"检查到气缸 {Name} 已经开");
+                    LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"检查到气缸 {Name} 已经开");
                     return true;
                 }
 
                 if (!isOpen && State == CylinderState.Close)
                 {
-                    EV.PostInfoLog(Module, $"检查到气缸 {Name} 已经关");
+                    LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"检查到气缸 {Name} 已经关");
                     return true;
                 }
             }
@@ -181,7 +181,7 @@ namespace Venus_RT.Devices
             reason += _error;
 
             _operation = isOpen ? CylinderState.Open : CylinderState.Close;
-            EV.PostInfoLog(Module, $"{(isOpen ? "打开" : "关闭")} 气缸 {Name}");
+            LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(isOpen ? "打开" : "关闭")} 气缸 {Name}");
 
             if (Name == "LoadLockArm")
                 _timer.Start(10 * 1000);
@@ -206,16 +206,16 @@ namespace Venus_RT.Devices
                         if (_operation == CylinderState.Open)
                         {
                             if (!_doON.Check(true, out var reason))
-                                EV.PostAlarmLog(Module, "气缸信号无法打开, interlock, " + reason);
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "气缸信号无法打开, interlock, " + reason);
                             else
-                                EV.PostAlarmLog(Module, "气缸信号仍然关闭");
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "气缸信号仍然关闭");
                         }
                         else
                         {
                             if (!_doON.Check(false, out var reason))
-                                EV.PostAlarmLog(Module, "气缸信号无法关闭, interlock, " + reason);
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "气缸信号无法关闭, interlock, " + reason);
                             else
-                                EV.PostAlarmLog(Module, "气缸信号仍然打开");
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "气缸信号仍然打开");
                         }
                     }
                     _operation = (CylinderState)SetPoint;
@@ -227,13 +227,13 @@ namespace Venus_RT.Devices
                     {
                         if (_operation == CylinderState.Open)
                         {
-                            EV.PostAlarmLog(Module,!_doON.Check(true, out var reason)
+                            LOG.Write(eEvent.ERR_DEVICE_INFO, Module,!_doON.Check(true, out var reason)
                                     ? $"气缸信号 {Display} was Close,Reason:{reason}"
                                     : $"气缸信号 {Display} was Close,Reason PLC kept");
                         }
                         else
                         {
-                            EV.PostAlarmLog(Module, !_doON.Check(false, out var reason)
+                            LOG.Write(eEvent.ERR_DEVICE_INFO, Module, !_doON.Check(false, out var reason)
                                     ? $"气缸信号 {Display} was Open,Reason:{reason}"
                                     : $"气缸信号 {Display} was Open,Reason PLC Kept");
                         }

+ 7 - 7
Venus/Venus_RT/Devices/IODevices/IoLid.cs

@@ -146,7 +146,7 @@ namespace Venus_RT.Devices.IODevices
                 return false;
             }
 
-            EV.PostInfoLog(Module, $"Open cylinder {Module}.{Name}");
+            LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Open cylinder {Module}.{Name}");
 
             return true;
         }
@@ -159,7 +159,7 @@ namespace Venus_RT.Devices.IODevices
                 return false;
             }
 
-            EV.PostInfoLog(Module, $"Close cylinder {Module}.{Name}");
+            LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Close cylinder {Module}.{Name}");
 
             return true;
         }
@@ -196,16 +196,16 @@ namespace Venus_RT.Devices.IODevices
                         if (_operation == CylinderState.Open)
                         {
                             if (!_doON.Check(true, out var reason))
-                                EV.PostAlarmLog(Module, "Open Cylinder Failed for interlock, " + reason);
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Open Cylinder Failed for interlock, " + reason);
                             else
-                                EV.PostAlarmLog(Module, "Cylinder hold close status");
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Cylinder hold close status");
                         }
                         else
                         {
                             if (!_doON.Check(false, out var reason))
-                                EV.PostAlarmLog(Module, "Close Cylinder Failed for interlock, " + reason);
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Close Cylinder Failed for interlock, " + reason);
                             else
-                                EV.PostAlarmLog(Module, "Cylinder hold open status");
+                                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Cylinder hold open status");
                         }
                     }
                     _operation = (CylinderState)SetPoint;
@@ -218,7 +218,7 @@ namespace Venus_RT.Devices.IODevices
                 _trigError.CLK = State == CylinderState.Error;
                 if (_trigError.Q)
                 {
-                    EV.PostAlarmLog(Module, "Cylinder in error status");
+                    LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Cylinder in error status");
                 }
 
                 if ((SetPoint == (int)State) && (SetPoint == (int)CylinderState.Open || SetPoint == (int)CylinderState.Close))

+ 5 - 4
Venus/Venus_RT/Devices/IODevices/IoMfc.cs

@@ -12,6 +12,7 @@ using Aitex.Core.RT.Tolerance;
 using Aitex.Core.Util;
 using MECF.Framework.Common.DBCore;
 using Venus_RT.Modules;
+using Aitex.Core.RT.Log;
 
 namespace Venus_RT.Devices.IODevices
 {
@@ -449,7 +450,7 @@ namespace Venus_RT.Devices.IODevices
                 target = Math.Max(target, 0);
 
                 Ramp(target, 0);
-                EV.PostInfoLog(Module, $"Ramp to {target}{Unit}");
+                LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Ramp to {target}{Unit}");
                 return true;
             });
 
@@ -493,13 +494,13 @@ namespace Venus_RT.Devices.IODevices
                 _trigOffline.CLK = IsOffline;
                 if (_trigOffline.Q)
                 {
-                    EV.PostAlarmLog(Module, string.Format("{0} is offline", DisplayName));
+                    LOG.Write(eEvent.ERR_DEVICE_INFO, Module, string.Format("{0} is offline", DisplayName));
                     _bMfcAlarm = true;
                 }
 
                 _trigPressureAlarm.CLK = PressureAlarm == false;
                 if (_trigPressureAlarm.Q)
-                    EV.PostAlarmLog(Module, $"{Name}, {DisplayName} Pressure Alarm");
+                    LOG.Write(eEvent.ERR_DEVICE_INFO, Module, $"{Name}, {DisplayName} Pressure Alarm");
                 if (PressureAlarm)
                 {
                     _trigPressureAlarm.RST = true;
@@ -563,7 +564,7 @@ namespace Venus_RT.Devices.IODevices
 
             if (_toleranceChecker.Trig)
             {
-                EV.PostAlarmLog(Module, Display + $" 越界 in {AlarmTime:0} seconds");
+                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, Display + $" 越界 in {AlarmTime:0} seconds");
 
                 EV.Notify(GasFlowOutOfTolerance);
             }

+ 6 - 5
Venus/Venus_RT/Devices/IODevices/IoPressureControl.cs

@@ -9,6 +9,7 @@ using Aitex.Core.RT.SCCore;
 using Aitex.Core.RT.Tolerance;
 using Aitex.Core.Util;
 using Venus_RT.Devices.IODevices;
+using Aitex.Core.RT.Log;
 
 namespace Venus_RT.Devices
 {
@@ -26,7 +27,7 @@ namespace Venus_RT.Devices
             {
                 if (_enableTolerance != value)
                 {
-                    EV.PostInfoLog(Module, value ? "Start monitor pressure stability" : "Stop monitor pressure stability");
+                    LOG.Write(eEvent.EV_DEVICE_INFO, Module, value ? "Start monitor pressure stability" : "Stop monitor pressure stability");
 
                     if (value)
                     {
@@ -174,11 +175,11 @@ namespace Venus_RT.Devices
         {
             CheckTolerance();
             _trigProcessGauge.CLK = ProcessGauge.GaugeAlarm;
-            if (_trigProcessGauge.Q) EV.PostAlarmLog(Module, "Process pressure gauge Alarm");
+            if (_trigProcessGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Process pressure gauge Alarm");
             _trigPressureGauge.CLK = PressureGauge.GaugeAlarm;
-            if (_trigPressureGauge.Q) EV.PostAlarmLog(Module, "Chamber pressure gauge Alarm");
+            if (_trigPressureGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Chamber pressure gauge Alarm");
             _trigForelineGauge.CLK = ForelineGauge.GaugeAlarm;
-            if (_trigForelineGauge.Q) EV.PostAlarmLog(Module, "Foreline pressure gauge Alarm");
+            if (_trigForelineGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Foreline pressure gauge Alarm");
         }
 
         public void CheckTolerance()
@@ -197,7 +198,7 @@ namespace Venus_RT.Devices
             {
                 EV.Notify(PressureOutOfTolerance);
 
-                EV.PostAlarmLog(Module, $"Gas Flow Pressure Alarm Out of range in {_scAlarmTime.Value:0} seconds");
+                LOG.Write(eEvent.ERR_DEVICE_INFO, Module, $"Gas Flow Pressure Alarm Out of range in {_scAlarmTime.Value:0} seconds");
             }
         }
 

+ 35 - 1
Venus/Venus_RT/Devices/JetPM.cs

@@ -2,7 +2,7 @@
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Device.Unit;
 using Aitex.Core.RT.Event;
-using Aitex.Core.RT.OperationCenter;
+using Aitex.Core.Common.DeviceData;
 using Aitex.Core.RT.SCCore;
 using MECF.Framework.Common.Device.Bases;
 using MECF.Framework.Common.Equipment;
@@ -134,6 +134,7 @@ namespace Venus_RT.Devices
         // 压力信号
         public bool IsATM => _ATM_sw.Value;
         public bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
+        public bool IsVACLoadLock => LoadlockPressure <= 1000;
         public bool IsVAC => _VAC_sw.Value;
         public bool IsWLK => _WLK_sw.Value;
 
@@ -144,6 +145,13 @@ namespace Venus_RT.Devices
         public double LoadlockPressure => _pressureController.LoadLockGauge.Value;
         public double ESCHePressure => _pressureController.ESCHeGauge.Value;
 
+        //Loadlock_Arm
+        public bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
+        public bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
+        //Loadlock_Arm DO
+        public bool LoadlockArmRetract => _LoadLockArm.OFFSetPoint;
+        public bool LoadlockArmExtend => _LoadLockArm.ONSetPoint;
+
         public new ModuleName Module { get; }
 
         public MovementPosition LiftPinPosition
@@ -167,7 +175,25 @@ namespace Venus_RT.Devices
         {
             return _ATM_sw.Value && ChamberPressure > 700000;
         }
+        public bool CheckSlitDoorOpen()
+        {
+            return _slitDoor.State == CylinderState.Open;
+        }
+
+        public bool CheckSlitDoorClose()
+        {
+            return _slitDoor.State == CylinderState.Close;
+        }
 
+        public bool CheckLiftUp()
+        {
+            return _LiftPin.State == CylinderState.Open;
+        }
+
+        public bool CheckLiftDown()
+        {
+            return _LiftPin.State == CylinderState.Close;
+        }
         public double TotalGasSetpoint
         {
             get
@@ -482,6 +508,14 @@ namespace Venus_RT.Devices
             _slitDoor.SetCylinder(open, out reason);
         }
 
+        public bool RetractWafer()
+        {
+            return _LoadLockArm.SetCylinder(false, out _);
+        }
+        public bool ExtendWafer()
+        {
+            return _LoadLockArm.SetCylinder(true, out _);
+        }
         public bool FlowGas(int gasNum, double val)
         {
             if (_gasLines.Length <= gasNum)

+ 4 - 4
Venus/Venus_RT/Devices/SkyPump.cs

@@ -255,7 +255,7 @@ namespace Venus_RT.Devices
             if (!_serial.Open())
             {
                 StatusDry = SkyPumpState.Disconnected;
-                EV.PostAlarmLog(this.Module, "Sky Pump串口无法打开");
+                LOG.Write(eEvent.ERR_DRY_PUMP, Module, "Sky Pump串口无法打开");
                 return false;
             }
 
@@ -439,7 +439,7 @@ namespace Venus_RT.Devices
                     StatusDry = SkyPumpState.ON;
                     if (_trigPumpOn.Q)
                     {
-                        EV.PostInfoLog(this.Module, $"Dry Pump打开");
+                        LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Dry Pump打开");
                     }
                     if (_trigPumpOff.Q && _timerPumpOff.IsTimeout())
                     {
@@ -481,7 +481,7 @@ namespace Venus_RT.Devices
                     }
                     if (_trigPumpOff.Q)
                     {
-                        EV.PostInfoLog(this.Module, $"Dry Pump关闭");
+                        LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Dry Pump关闭");
                     }
                     _trigPumpOff.RST = true;
                     return "干泵关, ";
@@ -643,7 +643,7 @@ namespace Venus_RT.Devices
                     {
                         if (EnableAlarm)
                         {
-                            EV.PostAlarmLog(Module, "pump on time value larger than setting interval days");
+                            LOG.Write(eEvent.ERR_DRY_PUMP, Module, "pump on time value larger than setting interval days");
                         }
                     }
                 }

+ 126 - 0
Venus/Venus_RT/Modules/PMs/LLPickRoutine.cs

@@ -0,0 +1,126 @@
+using Aitex.Core.RT.Routine;
+using Aitex.Core.RT.SCCore;
+using Venus_RT.Devices;
+using MECF.Framework.Common.Routine;
+using Venus_Core;
+
+namespace Venus_RT.Modules.PMs
+{
+    class LLPickRoutine : PMRoutineBase, IRoutine
+    {
+        private enum LLPickStep
+        {
+            kPrepareTransfer,
+            kExtend,
+            kPinUp,
+            kRetract,
+            kPostTransfer,
+            kVentLoadLock,
+        }
+
+        private readonly LoadLockVentRoutine _loadLockVentRoutine;
+        private int _prepareTransferTimeout = 120;
+        private int _transferWaferTimeout = 120;
+        private bool _isATMMode = false;
+        public LLPickRoutine(JetPM chamber, LoadLockVentRoutine ventRoutine) : base(chamber)
+        {
+            Name = "PickWafer";
+            _loadLockVentRoutine = ventRoutine;
+        }
+
+        public RState Start(params object[] objs)
+        {
+            _prepareTransferTimeout = SC.GetValue<int>($"{Module}.PrepareTransferTimeout");
+            _transferWaferTimeout = SC.GetValue<int>($"{Module}.TransferWaferTimeout");
+            _isATMMode = SC.GetValue<bool>("System.IsATMMode");
+
+            if (_isATMMode)
+            {
+                if (!_chamber.IsATM || !_chamber.IsATMLoadlock)
+                {
+                    Stop("腔体非大气状态,请先执行充气动作");
+                    return RState.Failed;
+                }
+            }
+            else
+            {
+                if (!_chamber.IsVAC || !_chamber.IsVACLoadLock)
+                {
+                    Stop("腔体非真空状态,请先执行抽真空动作");
+                    return RState.Failed;
+                }
+            }
+
+            _chamber.OpenValve(ValveType.FastPump, false);
+            _chamber.OpenValve(ValveType.LoadlockPumping, false);
+
+            Reset();
+            return Runner.Start(Module, Name);
+        }
+        public RState Monitor()
+        {
+            Runner.Run((int)LLPickStep.kPrepareTransfer,    PrepareTransfer,        IsPrepareReady,                                     _prepareTransferTimeout * 1000)
+                .Run((int)LLPickStep.kExtend,               _chamber.ExtendWafer,   () => { return _chamber.IsLoadlockArmExtend; },     _transferWaferTimeout * 1000)
+                .Run((int)LLPickStep.kPinUp,                SetLiftPinDown,         () => { return _chamber.CheckLiftDown(); })
+                .Run((int)LLPickStep.kRetract,              _chamber.RetractWafer,  () => { return _chamber.IsLoadlockArmRetract; },    _transferWaferTimeout * 1000)
+                .Run((int)LLPickStep.kPostTransfer,         PostTransfer,           IsPostTransferReady,                                _prepareTransferTimeout * 1000)
+                .End((int)LLPickStep.kVentLoadLock,         VentLoadLock,           IsVentDone);
+
+            return Runner.Status;
+        }
+
+        private bool PrepareTransfer()
+        {
+            _chamber.SetLiftPin(MovementPosition.Up, out _);
+            _chamber.SetSlitDoor(true, out _);
+            return true;
+        }
+
+        private bool IsPrepareReady()
+        {
+            return _chamber.CheckLiftUp() && _chamber.CheckSlitDoorOpen();
+        }
+
+        private bool PostTransfer()
+        {
+            _chamber.SetSlitDoor(false, out _);
+            return true;
+        }
+
+        private bool IsPostTransferReady()
+        {
+            return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorClose();
+        }
+
+        private bool SetLiftPinDown()
+        {
+            return _chamber.SetLiftPin(MovementPosition.Down, out _);
+        }
+
+        private bool VentLoadLock()
+        {
+            if (!_isATMMode)
+            {
+                return _loadLockVentRoutine.Start() == RState.Running;
+            }
+            else
+                return true;
+        }
+
+        private bool IsVentDone()
+        {
+            RState ret = _loadLockVentRoutine.Monitor();
+            if (ret == RState.Failed || ret == RState.Timeout)
+            {
+                Runner.Stop("Vent Failed");
+                return false;
+            }
+
+            return ret == RState.End;
+        }
+
+        public void Abort()
+        {
+        }
+    }
+}

+ 112 - 0
Venus/Venus_RT/Modules/PMs/LLPlaceRoutine.cs

@@ -0,0 +1,112 @@
+using Aitex.Core.RT.Routine;
+using Aitex.Core.RT.SCCore;
+using Venus_RT.Devices;
+using MECF.Framework.Common.Routine;
+using System.Diagnostics;
+using System.Collections.Generic;
+using Venus_Core;
+namespace Venus_RT.Modules.PMs
+{
+    class LLPlaceRoutine : PMRoutineBase, IRoutine
+    {
+        private enum LLPlaceStep
+        {
+            kPrepareTransfer,
+            kExtend,
+            kPinUp,
+            kRetract,
+            kPostTransfer,
+            kOpenFastPump,
+        }
+
+        private int _prepareTransferTimeout = 120;
+        private int _transferWaferTimeout = 120;
+        private bool _isATMMode = false;
+        public LLPlaceRoutine(JetPM chamber) : base(chamber)
+        {
+            Name = "PlaceWafer";
+        }
+
+        public RState Start(params object[] objs)
+        {
+            _prepareTransferTimeout = SC.GetValue<int>($"{Module}.PrepareTransferTimeout");
+            _transferWaferTimeout = SC.GetValue<int>($"{Module}.TransferWaferTimeout");
+            _isATMMode = SC.GetValue<bool>("System.IsATMMode");
+
+            if(_isATMMode)
+            {
+                if(!_chamber.IsATM || !_chamber.IsATMLoadlock)
+                {
+                    Stop("腔体非大气状态,请先执行充气动作");
+                    return RState.Failed;
+                }
+            }
+            else
+            {
+                if(!_chamber.IsVAC || !_chamber.IsVACLoadLock)
+                {
+                    Stop("腔体非真空状态,请先执行抽真空动作");
+                    return RState.Failed;
+                }
+            }
+
+            _chamber.OpenValve(ValveType.FastPump, false);
+            _chamber.OpenValve(ValveType.LoadlockPumping, false);
+
+            Reset();
+            return Runner.Start(Module, Name);
+        }
+        public RState Monitor()
+        {
+            Runner.Run((int)LLPlaceStep.kPrepareTransfer,   PrepareTransfer,        IsPrepareReady,                                     _prepareTransferTimeout * 1000)
+                .Run((int)LLPlaceStep.kExtend,              _chamber.ExtendWafer,   () => { return _chamber.IsLoadlockArmExtend; },     _transferWaferTimeout * 1000)
+                .Run((int)LLPlaceStep.kPinUp,               SetLiftPinUp,           () => { return _chamber.CheckLiftUp(); })
+                .Run((int)LLPlaceStep.kRetract,             _chamber.RetractWafer,  () => { return _chamber.IsLoadlockArmRetract; },    _transferWaferTimeout * 1000)
+                .Run((int)LLPlaceStep.kPostTransfer,        PostTransfer,           IsPostTransferReady,                                _prepareTransferTimeout * 1000)
+                .End((int)LLPlaceStep.kOpenFastPump,        OpenFastPump,           _delay_50ms);
+
+            return Runner.Status;
+        }
+
+        private bool PrepareTransfer()
+        {
+            _chamber.SetLiftPin(MovementPosition.Down, out _);
+            _chamber.SetSlitDoor(true, out _);
+            return true;
+        }
+
+        private bool IsPrepareReady()
+        {
+            return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorOpen();
+        }
+
+        private bool PostTransfer()
+        {
+            _chamber.SetLiftPin(MovementPosition.Down, out _);
+            _chamber.SetSlitDoor(false, out _);
+            return true;
+        }
+
+        private bool IsPostTransferReady()
+        {
+            return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorClose();
+        }
+
+        private bool SetLiftPinUp()
+        {
+            return _chamber.SetLiftPin(MovementPosition.Up, out _);
+        }
+
+        private bool OpenFastPump()
+        {
+            if (!_isATMMode)
+                _chamber.OpenValve(ValveType.FastPump, true);
+
+            return true;
+        }
+
+        public void Abort()
+        {
+        }
+    }
+}

+ 72 - 0
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -77,6 +77,9 @@ namespace Venus_RT.Modules.PMs
             MoveLiftPin,
             MoveGuidePin,
 
+            LLPlace,
+            LLPick,
+
             Process,
             RunRecipe,
             PostProcess,
@@ -116,6 +119,8 @@ namespace Venus_RT.Modules.PMs
         private readonly PMGaslinePurgeRoutine      _gaslinePurgeRoutine;
         private readonly PMLeakCheckRoutine         _leakCheckRoutine;
         private readonly GasBoxLeakCheckRoutine     _gasBoxLeakCheckRoutine;
+        private readonly LLPlaceRoutine             _llPlaceRoutine;
+        private readonly LLPickRoutine              _llPickRoutine;
 
         public bool IsIdle
         {
@@ -194,6 +199,8 @@ namespace Venus_RT.Modules.PMs
             _gaslinePurgeRoutine    = new PMGaslinePurgeRoutine(_chamber);
             _leakCheckRoutine       = new PMLeakCheckRoutine(_chamber);
             _gasBoxLeakCheckRoutine = new GasBoxLeakCheckRoutine(_chamber);
+            _llPlaceRoutine         = new LLPlaceRoutine(_chamber);
+            _llPickRoutine          = new LLPickRoutine(_chamber, _ventLoadLockRoutine);
 
             fsm                     = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 100);
 
@@ -280,6 +287,17 @@ namespace Venus_RT.Modules.PMs
             Transition(PMState.GasBoxLeakCheck,     FSM_MSG.TIMER,      FnGasBoxLeakCheckTimeout,   PMState.Idle);
             Transition(PMState.GasBoxLeakCheck,     MSG.Abort,          FnAbortGasBoxLeakCheck,     PMState.Idle);
 
+
+            // PlaceWafer from LoadLock Arm sequence
+            Transition(PMState.Idle,            MSG.LLPlace,        FnStartLLPlace,             PMState.LLPlacing);
+            Transition(PMState.LLPlacing,       FSM_MSG.TIMER,      FnLLPlaceTimeout,           PMState.Idle);
+            Transition(PMState.LLPlacing,       MSG.Abort,          FnAbortLLPlace,             PMState.Idle);
+
+            // PickWafer to LoadLock Arm sequence
+            Transition(PMState.Idle,            MSG.LLPick,         FnStartLLPick,              PMState.LLPicking);
+            Transition(PMState.LLPicking,       FSM_MSG.TIMER,      FnLLPickTimeout,            PMState.Idle);
+            Transition(PMState.LLPicking,       MSG.Abort,          FnAbortLLPick,              PMState.Idle);
+
             Running = true;
         }
 
@@ -642,6 +660,52 @@ namespace Venus_RT.Modules.PMs
             return true;
         }
 
+        private bool FnStartLLPlace(object[] param)
+        {
+            return _llPlaceRoutine.Start() == RState.Running;
+        }
+
+        private bool FnLLPlaceTimeout(object[] param)
+        {
+            RState ret = _llPlaceRoutine.Monitor();
+            if (ret == RState.Failed || ret == RState.Timeout)
+            {
+                PostMsg(MSG.Error);
+                return false;
+            }
+
+            return ret == RState.End;
+        }
+
+        private bool FnAbortLLPlace(object[] param)
+        {
+            _llPlaceRoutine.Abort();
+            return true;
+        }
+
+        private bool FnStartLLPick(object[] param)
+        {
+            return _llPickRoutine.Start() == RState.Running;
+        }
+
+        private bool FnLLPickTimeout(object[] param)
+        {
+            RState ret = _llPickRoutine.Monitor();
+            if (ret == RState.Failed || ret == RState.Timeout)
+            {
+                PostMsg(MSG.Error);
+                return false;
+            }
+
+            return ret == RState.End;
+        }
+
+        private bool FnAbortLLPick(object[] param)
+        {
+            _llPickRoutine.Abort();
+            return true;
+        }
+
         private void _debugRoutine()
         {
             int flag = 0;
@@ -698,6 +762,14 @@ namespace Venus_RT.Modules.PMs
             {
                 PostMsg(MSG.GasLeakCheck);
             }
+            else if(flag == 14)
+            {
+                PostMsg(MSG.LLPlace);
+            }
+            else if(flag == 15)
+            {
+                PostMsg(MSG.LLPick);
+            }
         }
     }
 }

+ 2 - 0
Venus/Venus_RT/Venus_RT.csproj

@@ -133,6 +133,8 @@
     <Compile Include="Instances\RtInstance.cs" />
     <Compile Include="Instances\ToolLoader.cs" />
     <Compile Include="Modules\PMs\GasBoxLeakCheckRoutine.cs" />
+    <Compile Include="Modules\PMs\LLPickRoutine.cs" />
+    <Compile Include="Modules\PMs\LLPlaceRoutine.cs" />
     <Compile Include="Modules\PMs\LoadLockLeakCheckRoutine.cs" />
     <Compile Include="Modules\PMs\LoadLockPumpRoutine.cs" />
     <Compile Include="Modules\PMs\LoadLockPurgeRoutine.cs" />

+ 41 - 25
Venus/Venus_Simulator/Instances/SimulatorSystem.cs

@@ -7,6 +7,7 @@ using MECF.Framework.Simulator.Core.Driver;
 using System;
 using System.Collections.Generic;
 using Venus_Simulator.Devices;
+using System.Threading;
 
 namespace Venus_Simulator.Instances
 {
@@ -19,6 +20,10 @@ namespace Venus_Simulator.Instances
         private RD_TRIG _trigATM = new RD_TRIG();
         private RD_TRIG _trigVAC = new RD_TRIG();
 
+        private R_TRIG _trigLLExtend = new R_TRIG();
+        private R_TRIG _trigLLRetract = new R_TRIG();
+        private static int count = 0;
+
         private readonly float ATM_THRESHOLD = 750000;
         private readonly float ATM_PRESSURE = 760000;
         private readonly float ATM_LoadLock_PRESSURE = 760000;
@@ -160,6 +165,7 @@ namespace Venus_Simulator.Instances
                 MonitorSlitDoor(ModuleName.PMA);
                 MonitorPin(ModuleName.PMA);
                 MonitorPressure(ModuleName.PMA);
+                MonitorExtendAndRetract(ModuleName.PMA);
                 //MonitorTemperature(ModuleName.PMA);
                 //MonitorGas(ModuleName.PMA);
                 //MonitorRF(ModuleName.PMA);
@@ -221,34 +227,44 @@ namespace Venus_Simulator.Instances
                 IO.DI[$"{mod}.DI_Lift_Pin_Up_POS"].Value = IO.DO[$"{mod}.DO_Lift_Pin_Up"].Value;
                 IO.DI[$"{mod}.DI_Lift_Pin_Down_POS"].Value = IO.DO[$"{mod}.DO_Lift_Pin_Down"].Value;
             }
+        }
 
-            //// upper guide pin up
-            //if (IO.DO[$"{mod}.DO_Guide_Pin_Small_Lifter_Up"].Value)
-            //{
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Small_Lifter_Up_Pos"].Value = true;
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Small_Lifter_Down_Pos"].Value = false;
-            //}
-
-            //// upper guide pin down
-            //if (IO.DO[$"{mod}.DO_Guide_Pin_Small_Lifter_Down"].Value)
-            //{
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Small_Lifter_Up_Pos"].Value = false;
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Small_Lifter_Down_Pos"].Value = true;
-            //}
+        void MonitorExtendAndRetract(ModuleName mod)
+        {
+            // Extend
+            _trigLLExtend.CLK = IO.DO[$"{mod}.DO_Loadlock_Arm_Extend"].Value;
+            if (_trigLLExtend.Q)
+            {
+                _trigLLRetract.RST = true;
+                Thread.Sleep(500);
+                IO.DI[$"{mod}.DI_Loadlock_Arm_Extend_POS"].Value = true;
+                IO.DI[$"{mod}.DI_Loadlock_Arm_Retract_POS"].Value = false;
+                IO.DI[$"{mod}.DI_Small_Wafer_In_POS"].Value = false;
+                IO.DI[$"{mod}.DI_Big_Wafer_In_POS"].Value = false;
+            }
 
-            //// lower guide pin up
-            //if (IO.DO[$"{mod}.DO_Guide_Pin_Medium_Lifter_Up"].Value)
-            //{
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Medium_Lifter_Up_Pos"].Value = true;
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Medium_Lifter_Down_Pos"].Value = false;
-            //}
+            // Retract
+            _trigLLRetract.CLK = IO.DO[$"{mod}.DO_Loadlock_Arm_Retract"].Value;
+            if (_trigLLRetract.Q)
+            {
+                count++;
+                _trigLLExtend.RST = true;
+                Thread.Sleep(500);
+                IO.DI[$"{mod}.DI_Loadlock_Arm_Extend_POS"].Value = false;
+                IO.DI[$"{mod}.DI_Loadlock_Arm_Retract_POS"].Value = true;
+                if (count == 1)
+                {
+                    IO.DI[$"{mod}.DI_Small_Wafer_In_POS"].Value = false;
+                    IO.DI[$"{mod}.DI_Big_Wafer_In_POS"].Value = false;
+                }
+                else if (count == 2)
+                {
+                    count = 0;
+                    IO.DI[$"{mod}.DI_Small_Wafer_In_POS"].Value = true;
+                    IO.DI[$"{mod}.DI_Big_Wafer_In_POS"].Value = false;
+                }
+            }
 
-            //// lower guide pin down
-            //if (IO.DO[$"{mod}.DO_Guide_Pin_Medium_Lifter_Down"].Value)
-            //{
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Medium_Lifter_Up_Pos"].Value = false;
-            //    IO.DI[$"{mod}.DI_Guide_Pin_Medium_Lifter_Down_Pos"].Value = true;
-            //}
         }
 
         void MonitorPressure(ModuleName mod)