| 
															
																@@ -24,6 +24,7 @@ namespace FurnaceRT.Equipments.WaferRobots 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             RobotRequestWaferPresent,
 
															 | 
															
															 | 
															
																             RobotRequestWaferPresent,
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             CheckWaferInfoByRobotSensor,
 
															 | 
															
															 | 
															
																             CheckWaferInfoByRobotSensor,
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             CheckBeforePlace,
 
															 | 
															
															 | 
															
																             CheckBeforePlace,
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            SetRobotActionCommand,
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         }
 
															 | 
															
															 | 
															
																         }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
 
															 | 
															
															 | 
															
																 
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         private ModuleName _destination;
 
															 | 
															
															 | 
															
																         private ModuleName _destination;
 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -279,6 +280,7 @@ namespace FurnaceRT.Equipments.WaferRobots 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
 
															 | 
															
															 | 
															
																 
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         public void Abort()
 
															 | 
															
															 | 
															
																         public void Abort()
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         {
 
															 | 
															
															 | 
															
																         {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            _waferRobotModule.ResetRobotActionCommand();
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             _waferRobotModule.Stop();
 
															 | 
															
															 | 
															
																             _waferRobotModule.Stop();
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_waferRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
 
															 | 
															
															 | 
															
																             (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_waferRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         }
 
															 | 
															
															 | 
															
																         }
 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -293,6 +295,9 @@ namespace FurnaceRT.Equipments.WaferRobots 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
 
															 | 
															
															 | 
															
																 
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 CheckBeforePlace((int)RoutineStep.CheckBeforePlace, _destination, _destinationSlot, _blade);
 
															 | 
															
															 | 
															
																                 CheckBeforePlace((int)RoutineStep.CheckBeforePlace, _destination, _destinationSlot, _blade);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
 
															 | 
															
															 | 
															
																 
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (_waferRobotModule.TrigActionCommand != null)
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    SetRobotActionCommand((int)RoutineStep.SetRobotActionCommand, _destination, _timeout);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 Place((int)RoutineStep.Place, _destination, _destinationSlot, _blade, _timeout);
 
															 | 
															
															 | 
															
																                 Place((int)RoutineStep.Place, _destination, _destinationSlot, _blade, _timeout);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
 
															 | 
															
															 | 
															
																 
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 //RobotRequestWaferPresent((int)RoutineStep.RobotRequestWaferPresent, _blade, _timeout);
 
															 | 
															
															 | 
															
																                 //RobotRequestWaferPresent((int)RoutineStep.RobotRequestWaferPresent, _blade, _timeout);
 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -305,10 +310,12 @@ namespace FurnaceRT.Equipments.WaferRobots 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             }
 
															 | 
															
															 | 
															
																             }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             catch (RoutineFaildException ex)
 
															 | 
															
															 | 
															
																             catch (RoutineFaildException ex)
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             {
 
															 | 
															
															 | 
															
																             {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                _waferRobotModule.ResetRobotActionCommand();
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_waferRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
 
															 | 
															
															 | 
															
																                 (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_waferRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return Result.FAIL;
 
															 | 
															
															 | 
															
																                 return Result.FAIL;
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             }
 
															 | 
															
															 | 
															
																             }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
 
															 | 
															
															 | 
															
																 
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            _waferRobotModule.ResetRobotActionCommand();
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_waferRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
 
															 | 
															
															 | 
															
																             (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_waferRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
 
															 | 
															
															 | 
															
																 
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             Notify("Finished");
 
															 | 
															
															 | 
															
																             Notify("Finished");
 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -596,5 +603,36 @@ namespace FurnaceRT.Equipments.WaferRobots 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     throw (new RoutineBreakException());
 
															 | 
															
															 | 
															
																                     throw (new RoutineBreakException());
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             }
 
															 | 
															
															 | 
															
																             }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         }
 
															 | 
															
															 | 
															
																         }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        private void SetRobotActionCommand(int id, ModuleName source, int timeout)
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            _routineStep = (RoutineStep)Enum.Parse(typeof(RoutineStep), id.ToString());
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                Notify($"Set robot action command target position {source}");
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                _waferRobotModule.SetRobotActionCommand(source, EnumTransferType.Place);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                return true;
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            }, () =>
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                return _waferRobotModule.CheckRobotActionCommand(source, EnumTransferType.Place);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            }, timeout * 1000);
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (ret.Item1)
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (ret.Item2 == Result.FAIL)
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    _waferRobotModule.PlaceWaferFailAlarm.Set($"place to {source} failed for robot action command interlock");
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    throw (new RoutineFaildException());
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                else if (ret.Item2 == Result.TIMEOUT) //timeout
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                {
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    _waferRobotModule.PlaceWaferTimeoutAlarm.Set($"timeout over {timeout} seconds");
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    throw (new RoutineFaildException());
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                else
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    throw (new RoutineBreakException());
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     }
 
															 | 
															
															 | 
															
																     }
 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 }
 
															 | 
															
															 | 
															
																 }
 
															 |