private void MakeProcess() { FAExtendECPart.ECResult ecResult = new FAExtendECPart.ECResult(); var seq = Process; seq.OnStart += delegate { RetryBarcodeScan.ClearCount(); RetryBarcodeDecoding.ClearCount(); }; seq.Steps.Add("ConfirmScanCompleted", new StepInfo()); seq.Steps.Add("ConfirmLotChange", new StepInfo()); seq.Steps.Add("PreStopperDown", new StepInfo()); seq.Steps.Add("RetryScan", new StepInfo()); seq.AddItem( delegate(object obj) { SSDBoxInletUnit.ConveyorMotor.Run.Execute(this); ProductInfo.VT5070ProductInfo.LastProductInfoInstance.TrackOutCompleted = false; }); seq.Steps["ConfirmScanCompleted"].StepIndex = seq.AddItem( delegate(FASequence actor, TimeSpan time) { if (Equipment.RunMode == FAFramework.Equipment.RunModeTypes.DRY_RUN) actor.NextStep(); else if (string.IsNullOrEmpty(SSDBoxInletUnit.Scanner.Barcode.Barcode) == false) { SSDBoxInletUnit.Scanner.TriggerOff(actor); ProductInfo.VT5070ProductInfo.TurnkeyBoxBarcode = SSDBoxInletUnit.Scanner.Barcode.Barcode; WriteTraceLog(string.Format("T/K Box Scan Success : {0}", ProductInfo.VT5070ProductInfo.TurnkeyBoxBarcode)); actor.NextStep(); } else if (TimeBarcodeScanTimeout.Time < time) { if (RetryBarcodeScan.IncreaseCount() == false) RaiseAlarm(actor, AlarmBarcodeScanFail); actor.NextStep("RetryScan"); } }); seq.AddItem( delegate(FASequence actor, TimeSpan time) { if (Equipment.RunMode == FAFramework.Equipment.RunModeTypes.HOT_RUN) actor.NextStep(); else { actor.NextStep("ConfirmLotChange"); } }); seq.AddItem( delegate(object obj) { FAECInfo.PACKING_MASTER_INFO_REQ command = new FAECInfo.PACKING_MASTER_INFO_REQ(); command.SERIAL = ProductInfo.VT5070ProductInfo.TurnkeyBoxBarcode; ecResult.Clear(); InterfaceUnit.ECPart.AddCommand(command, ecResult); }); seq.AddItem( delegate(FASequence actor, TimeSpan time) { if (ecResult.ReceiveOk) { if (ecResult.ParsingSuccess) { if (ecResult.ECInfo.PackingMasterInfo.RESULT == FAECInfo.FAECResult.PASS) { ecResult.ECInfo.PackingMasterInfo.CopyTo(ProductInfo.ECInfo.PackingMasterInfo); actor.NextStep(); } else { RaiseAlarm(actor, ecResult.LastAlarmNo, string.Format("EC MSG : {0}\nFail Message : {1}", ecResult.ECInfo.PackingMasterInfo.MSG, ecResult.ParsingFailMessage)); actor.NextStep("RetryScan"); } } else { RaiseAlarm(actor, ecResult.LastAlarmNo, string.Format("EC MSG : {0}\nFail Message : {1}", ecResult.ECInfo.PackingMasterInfo.MSG, ecResult.ParsingFailMessage)); actor.NextStep("RetryScan"); } } else if (ecResult.LastAlarmNo != 0) { RaiseAlarm(actor, ecResult.LastAlarmNo, string.Format("EC MSG : {0}\nFail Message : {1}", ecResult.ECInfo.PackingMasterInfo.MSG, ecResult.ParsingFailMessage)); actor.NextStep("RetryScan"); } }); seq.Steps["ConfirmLotChange"].StepIndex = seq.AddItem( delegate(FASequence actor, TimeSpan time) { bool changedLot = false; bool duplicateSerial = false; bool differentLot = false; if (AddLoadingCount(ProductInfo.ECInfo.PackingMasterInfo, ProductInfo.VT5070ProductInfo.TurnkeyBoxBarcode, out changedLot, out differentLot, out duplicateSerial) == true) { if (changedLot) { CurrentLastProductInfo = new VT5070ProductInfo.LastProductInfo(); FARobotControlModule.RobotWork work = new FARobotControlModule.RobotWork(); RobotControlModule.AddWork(ProductInfo.ECInfo.PackingMasterInfo, ProductInfo); Equipment.ProductOutput.TrackInLot(DateTime.Now, ProductInfo.ECInfo.PackingMasterInfo.LOT_ID); WriteTraceLog(string.Format("TRACK IN LOT : {0}", ProductInfo.ECInfo.PackingMasterInfo.LOT_ID)); } ProductInfo.VT5070ProductInfo.LastProductInfoInstance = CurrentLastProductInfo; Equipment.ProductOutput.AddProduct(DateTime.Now, ProductInfo.ECInfo.PackingMasterInfo.LOT_ID); WriteTraceLog(string.Format("Add T/K Box : {0}", ProductInfo.VT5070ProductInfo.TurnkeyBoxBarcode)); actor.NextStep(); } else { if (differentLot) RaiseAlarm(actor, AlarmDifferentLotInput); else if (duplicateSerial) { if (RetryBarcodeDecoding.IncreaseCount() == false) RaiseAlarm(actor, AlarmDuplicationSerialInput); } actor.NextStep("RetryScan"); } }); seq.Steps["PreStopperDown"].StepIndex = seq.AddItem( delegate(FASequence actor, TimeSpan time) { if (SelectedStackerNo == StackerNo.Stacker2) { if (SSDStackerModule1.SafetyForMoving) actor.NextStep(); } else actor.NextStep(); }); seq.AddTerminate(); seq.Steps["RetryScan"].StepIndex = seq.AddItem(SSDBoxInletUnit.Scanner.TriggerOff); seq.AddItem(new FATime(FATimeType.millisecond, 300)); seq.AddItem((object obj) => SSDBoxInletUnit.Scanner.Barcode.Clear()); seq.AddItem(SSDBoxInletUnit.Scanner.TriggerOn); seq.AddItem("ConfirmScanCompleted"); }
private void MakeAfterUnloading() { var seq = AfterUnloading; seq.AddItem(SSDBoxInletUnit.PreInletStopPositionStopper.Up.Sequence, SSDBoxInletUnit.SideGuideServo.MoveGuidePos.Sequence); seq.AddItem( delegate(object obj) { if (CurrentLotInfo.LOT_QTY == LoadingCount) { Equipment.ProductOutput.TrackOutLot(DateTime.Now, ProductInfo.ECInfo.PackingMasterInfo.LOT_ID); ProductInfo.VT5070ProductInfo.IsLastProduct = true; ProductInfo.VT5070ProductInfo.LastProductInfoInstance.TrackOutCompleted = false; ProductInfo.VT5070ProductInfo.LastProductInfoInstance.TrackOutStandby = true; PreviousLotInfo.LotID = CurrentLotInfo.LOT_ID; PreviousLotInfo.LotQty = CurrentLotInfo.LOT_QTY; CurrentLastProductInfo = new VT5070ProductInfo.LastProductInfo(); ClearProductInfoWithoutPreviousLotInfo(); } else { ProductInfo.VT5070ProductInfo.IsLastProduct = false; } }); seq.AddItem( delegate(object obj) { var VT5070Equipment = Equipment as VT5070.SubEquipment; if (VT5070Equipment.GlobalConfigModule.UseGEMCommunication) { GEM.GEMFuncWrapper.TKBoxStack(Equipment.Name, ProductInfo.ECInfo.PackingMasterInfo.LOT_ID, ProductInfo.ECInfo.PackingMasterInfo.LOT_QTY, ProductInfo.ECInfo.PackingMasterInfo.PART_ID, StackCount, DateTime.Now); } }); }