|
@@ -111,20 +111,22 @@ namespace Venus_RT.Modules
|
|
private readonly EfemPickRoutine _pickRoutine;
|
|
private readonly EfemPickRoutine _pickRoutine;
|
|
private readonly EfemPlaceRoutine _placeRoutine;
|
|
private readonly EfemPlaceRoutine _placeRoutine;
|
|
private readonly EfemSwapRoutine _swapRoutine;
|
|
private readonly EfemSwapRoutine _swapRoutine;
|
|
|
|
+ private readonly EfemHomeRoutine _homeRoutine;
|
|
|
|
|
|
// Constructor
|
|
// Constructor
|
|
//
|
|
//
|
|
public EfemEntity()
|
|
public EfemEntity()
|
|
{
|
|
{
|
|
- _smallWafer = SC.GetValue<int>($"System.SmallWafer");
|
|
|
|
- _midWafer = SC.GetValue<int>($"System.MidWafer");
|
|
|
|
- _bigWafer = SC.GetValue<int>($"System.BigWafer");
|
|
|
|
|
|
+ //_smallWafer = SC.GetValue<int>($"System.SmallWafer");
|
|
|
|
+ //_midWafer = SC.GetValue<int>($"System.MidWafer");
|
|
|
|
+ //_bigWafer = SC.GetValue<int>($"System.BigWafer");
|
|
_efemType = (EfemType)SC.GetValue<int>($"EFEM.EfemType");
|
|
_efemType = (EfemType)SC.GetValue<int>($"EFEM.EfemType");
|
|
|
|
|
|
_efem = new JetEfem();
|
|
_efem = new JetEfem();
|
|
|
|
|
|
Name = ModuleName.EFEM.ToString();
|
|
Name = ModuleName.EFEM.ToString();
|
|
|
|
|
|
|
|
+ _homeRoutine = new EfemHomeRoutine(_efem);
|
|
_pickRoutine = new EfemPickRoutine(_efem);
|
|
_pickRoutine = new EfemPickRoutine(_efem);
|
|
_placeRoutine = new EfemPlaceRoutine(_efem);
|
|
_placeRoutine = new EfemPlaceRoutine(_efem);
|
|
_swapRoutine = new EfemSwapRoutine(_efem);
|
|
_swapRoutine = new EfemSwapRoutine(_efem);
|
|
@@ -150,18 +152,18 @@ namespace Venus_RT.Modules
|
|
_lpms[0].Initialize();
|
|
_lpms[0].Initialize();
|
|
_lpms[1].Initialize();
|
|
_lpms[1].Initialize();
|
|
|
|
|
|
- OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAll); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.ClearError}", (cmd, args) => { PostMsg(MSG.Recover); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.TurnOffBuzzer}", (cmd, args) => { PostMsg(MSG.TurnOffBuzzer); return true; });
|
|
|
|
|
|
+ OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAll); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.ClearError}", (cmd, args) => { PostMsg(MSG.Recover); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.TurnOffBuzzer}", (cmd, args) => { PostMsg(MSG.TurnOffBuzzer); return true; });
|
|
//OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.SwitchOnBuzzerAndRed}", (cmd, args) => { PostMsg(MSG.SwitchOnBuzzerAndRed); return true; });
|
|
//OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.SwitchOnBuzzerAndRed}", (cmd, args) => { PostMsg(MSG.SwitchOnBuzzerAndRed); return true; });
|
|
- OP.Subscribe($"{ModuleName.EFEM}.Online", (cmd, args) => { PostMsg(MSG.Online); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Pick}", (cmd, args) => { PostMsg(MSG.Pick, args[0], args[1], args[3], args[2]); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Place}", (cmd, args) => { PostMsg(MSG.Place, args[0], args[1], args[3], args[2]); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Extend}", (cmd, args) => { PostMsg(MSG.Extend, args[0], args[1], args[2]); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Retract}", (cmd, args) => { PostMsg(MSG.Retract, args[0], args[1]); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Abort}", (cmd, args) => { PostMsg(MSG.Abort); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeRB); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", (cmd, args) =>
|
|
|
|
|
|
+ OP.Subscribe($"{ModuleName.EFEM}.Online", (cmd, args) => { PostMsg(MSG.Online); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Pick}", (cmd, args) => { PostMsg(MSG.Pick, args[0], args[1], args[3], args[2]); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Place}", (cmd, args) => { PostMsg(MSG.Place, args[0], args[1], args[3], args[2]); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Extend}", (cmd, args) => { PostMsg(MSG.Extend, args[0], args[1], args[2]); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Retract}", (cmd, args) => { PostMsg(MSG.Retract, args[0], args[1]); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Abort}", (cmd, args) => { PostMsg(MSG.Abort); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeRB); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", (cmd, args) =>
|
|
{
|
|
{
|
|
bool isGrip = ((string)args[0]).ToLower() == "on";
|
|
bool isGrip = ((string)args[0]).ToLower() == "on";
|
|
|
|
|
|
@@ -174,23 +176,23 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Aligner1); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Aligner1); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Aligner2); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Aligner2); return true; });
|
|
- OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Cooling1); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Cooling2); return true; });
|
|
|
|
|
|
+ OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Cooling1); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Home}", (cmd, args) => { PostMsg(MSG.HomeAL, ModuleName.Cooling2); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Aligner1, args[0]); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Aligner1, args[0]); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Aligner2, args[0]); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Aligner2, args[0]); return true; });
|
|
- OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Cooling1, args[0]); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Cooling2, args[0]); return true; });
|
|
|
|
|
|
+ OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Cooling1, args[0]); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Align}", (cmd, args) => { PostMsg(MSG.Align, ModuleName.Cooling2, args[0]); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Aligner1); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Aligner1); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Aligner2); return true; });
|
|
OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Aligner2); return true; });
|
|
- OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Cooling1); return true; });
|
|
|
|
- OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Cooling2); return true; });
|
|
|
|
|
|
+ OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Cooling1); return true; });
|
|
|
|
+ OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Lift}", (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Cooling2); return true; });
|
|
|
|
|
|
- DATA.Subscribe($"{Name}.FsmState", () => ((STATE)fsm.State).ToString());
|
|
|
|
- DATA.Subscribe($"{Name}.FsmPrevState", () => ((STATE)fsm.PrevState).ToString());
|
|
|
|
- DATA.Subscribe($"{Name}.FsmLastMessage", GetFsmLastMessage);
|
|
|
|
- DATA.Subscribe($"{Name}.SmallWafer", () => _smallWafer);
|
|
|
|
- DATA.Subscribe($"{Name}.BigWafer", () => _bigWafer);
|
|
|
|
- DATA.Subscribe($"{Name}.MidWafer", () => _midWafer);
|
|
|
|
|
|
+ DATA.Subscribe($"{Name}.FsmState", () => ((STATE)fsm.State).ToString());
|
|
|
|
+ DATA.Subscribe($"{Name}.FsmPrevState", () => ((STATE)fsm.PrevState).ToString());
|
|
|
|
+ DATA.Subscribe($"{Name}.FsmLastMessage", GetFsmLastMessage);
|
|
|
|
+ DATA.Subscribe($"{Name}.SmallWafer", () => _smallWafer);
|
|
|
|
+ DATA.Subscribe($"{Name}.BigWafer", () => _bigWafer);
|
|
|
|
+ DATA.Subscribe($"{Name}.MidWafer", () => _midWafer);
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -200,7 +202,7 @@ namespace Venus_RT.Modules
|
|
fsm = new StateMachine<EfemEntity>("EFEM", (int)STATE.Unknown, 50);
|
|
fsm = new StateMachine<EfemEntity>("EFEM", (int)STATE.Unknown, 50);
|
|
fsm.EnableRepeatedMsg(true);
|
|
fsm.EnableRepeatedMsg(true);
|
|
|
|
|
|
- AnyStateTransition(FSM_MSG.TIMER, fnMonitor, FSM_STATE.SAME);
|
|
|
|
|
|
+ //AnyStateTransition(FSM_MSG.TIMER, fnMonitor, FSM_STATE.SAME);
|
|
AnyStateTransition(MSG.TurnOffBuzzer, fnTurnOffBuzzer, FSM_STATE.SAME);
|
|
AnyStateTransition(MSG.TurnOffBuzzer, fnTurnOffBuzzer, FSM_STATE.SAME);
|
|
AnyStateTransition(MSG.Recover, fnRecover, STATE.Idle);
|
|
AnyStateTransition(MSG.Recover, fnRecover, STATE.Idle);
|
|
AnyStateTransition(MSG.Error, fnError, STATE.Error);
|
|
AnyStateTransition(MSG.Error, fnError, STATE.Error);
|
|
@@ -209,12 +211,18 @@ namespace Venus_RT.Modules
|
|
AnyStateTransition(MSG.ToInit, fnToInit, STATE.Init);
|
|
AnyStateTransition(MSG.ToInit, fnToInit, STATE.Init);
|
|
|
|
|
|
|
|
|
|
- Transition(STATE.Unknown, MSG.CommReady, null, STATE.Init);
|
|
|
|
|
|
+ AnyStateTransition(MSG.CommReady, fnCommReady, STATE.Init);
|
|
|
|
+
|
|
|
|
+ Transition(STATE.Init, FSM_MSG.TIMER, fnMonitor, STATE.Init);
|
|
|
|
+ Transition(STATE.Idle, FSM_MSG.TIMER, fnMonitor, STATE.Idle);
|
|
|
|
+ Transition(STATE.Error, FSM_MSG.TIMER, fnMonitor, STATE.Error);
|
|
|
|
|
|
// Home
|
|
// Home
|
|
Transition(STATE.Init, MSG.HomeAll, fnHomeAll, STATE.Initializing);
|
|
Transition(STATE.Init, MSG.HomeAll, fnHomeAll, STATE.Initializing);
|
|
Transition(STATE.Idle, MSG.HomeAll, fnHomeAll, STATE.Initializing); // 暂时加,出错的时候做 HOME
|
|
Transition(STATE.Idle, MSG.HomeAll, fnHomeAll, STATE.Initializing); // 暂时加,出错的时候做 HOME
|
|
- Transition(STATE.Initializing, MSG.ActionDone, null, STATE. Orgshing);
|
|
|
|
|
|
+ Transition(STATE.Error, MSG.HomeAll, fnHomeAll, STATE.Initializing);
|
|
|
|
+ Transition(STATE.Initializing, FSM_MSG.TIMER, fnHomingTimeout, STATE.Idle);
|
|
|
|
+
|
|
Transition(STATE.Orgshing, MSG.ActionDone, fnActionDone, STATE.Idle);
|
|
Transition(STATE.Orgshing, MSG.ActionDone, fnActionDone, STATE.Idle);
|
|
Transition(STATE.Idle, MSG.HomeRB, fnHomeRobot, STATE.InitingRB);
|
|
Transition(STATE.Idle, MSG.HomeRB, fnHomeRobot, STATE.InitingRB);
|
|
Transition(STATE.InitingRB, MSG.ActionDone, null, STATE.Idle);
|
|
Transition(STATE.InitingRB, MSG.ActionDone, null, STATE.Idle);
|
|
@@ -263,13 +271,30 @@ namespace Venus_RT.Modules
|
|
EnumLoop<STATE>.ForEach((item) => { fsm.MapState((int)item, item.ToString()); });
|
|
EnumLoop<STATE>.ForEach((item) => { fsm.MapState((int)item, item.ToString()); });
|
|
|
|
|
|
EnumLoop<MSG>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
|
|
EnumLoop<MSG>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
|
|
|
|
+
|
|
|
|
+ Running = true;
|
|
}
|
|
}
|
|
|
|
|
|
- private bool fnHomeAll(object[] param)
|
|
|
|
|
|
+ private bool fnCommReady(object[] param)
|
|
{
|
|
{
|
|
- _efem.HomeAll();
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
+ private bool fnHomeAll(object[] param)
|
|
|
|
+ {
|
|
|
|
+ return _homeRoutine.Start(ModuleName.EFEM) == RState.Running;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private bool fnHomingTimeout(object[] param)
|
|
|
|
+ {
|
|
|
|
+ RState ret = _homeRoutine.Monitor();
|
|
|
|
+ if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
|
+ {
|
|
|
|
+ PostMsg(MSG.Error);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ret == RState.End;
|
|
|
|
+ }
|
|
|
|
|
|
private bool fnHomeRobot(object[] param)
|
|
private bool fnHomeRobot(object[] param)
|
|
{
|
|
{
|
|
@@ -292,16 +317,6 @@ namespace Venus_RT.Modules
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
- private bool fnEnterExecute(object[] param)
|
|
|
|
- {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private bool fnExitExecute(object[] param)
|
|
|
|
- {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private bool fnActionDone(object[] param)
|
|
private bool fnActionDone(object[] param)
|
|
{
|
|
{
|
|
return false;
|
|
return false;
|
|
@@ -323,29 +338,8 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
private bool fnMonitor(object[] param)
|
|
private bool fnMonitor(object[] param)
|
|
{
|
|
{
|
|
- STATE curSt = (STATE)fsm.State;
|
|
|
|
- if (curSt == STATE.Initializing || curSt == STATE.Mapping || curSt == STATE.Picking || curSt == STATE.Placing
|
|
|
|
- || curSt == STATE.Orgshing || curSt == STATE.Lifting || curSt == STATE.Extending || curSt == STATE.Retracting
|
|
|
|
- || curSt == STATE.InitingAL || curSt == STATE.InitingRB)
|
|
|
|
- {
|
|
|
|
- int time = SC.GetValue<int>("EFEM.MotionTimeout");
|
|
|
|
-
|
|
|
|
- if (fsm.ElapsedTime > time * 1000)
|
|
|
|
- {
|
|
|
|
- EV.PostAlarmLog("EFEM", $"Can not complete motion {curSt} in {time} seconds. ");
|
|
|
|
- PostMsg(MSG.Error);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (curSt == STATE.Aligning)
|
|
|
|
- {
|
|
|
|
- if (fsm.ElapsedTime > 10 * 1000)
|
|
|
|
- {
|
|
|
|
- EV.PostAlarmLog(ModuleName.Aligner.ToString(), "Align timeout");
|
|
|
|
- PostMsg(MSG.ActionDone, "alignment timeout");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ _efem.Monitor();
|
|
|
|
+ _debugRoutine();
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -534,9 +528,6 @@ namespace Venus_RT.Modules
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -761,6 +752,31 @@ namespace Venus_RT.Modules
|
|
{
|
|
{
|
|
//_efem[module].NoteJobComplete();
|
|
//_efem[module].NoteJobComplete();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void _debugRoutine()
|
|
|
|
+ {
|
|
|
|
+ int flag = 0;
|
|
|
|
+ // Test Home routine
|
|
|
|
+ if (flag == 1)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ PostMsg(MSG.HomeAll);
|
|
|
|
+ }
|
|
|
|
+ else if (flag == 2)
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+ else if (flag == 3)
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+ else if (flag == 4)
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+ else if (flag == 5)
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+ else if (flag == 6)
|
|
|
|
+ { }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|