protected override int ResetLoop() { //load cfg CfgSettings = Machine.Ins.Settings; //clear vio VioTransInp.SetVio(this, false); VioBarcodeFinish.SetVio(this, false); VioTransFinish.SetVio(this, false); VioMeasureFinish.SetVio(this, false); //load axis pos Platform.AssertPosTeached("Wait", this); Platform.AssertPosTeached("GtWork1", this); Platform.AssertPosTeached("GtWork2", this); Platform.AssertPosTeached($"Barcode{Project.TypeId}", this); PosGtWork1 = Platform["GtWork1"] as PosXYZ; PosGtWork2 = Platform["GtWork2"] as PosXYZ; if (!DoGTCylinder.SetDo(this, false, ignoreOrWaringOrError: true)) { ThrowException($"GT Cylinder Reset Fail!"); } //connect gt controller and barcode controller try { if (BarcodeController.IsOpen) { BarcodeController.Close(); } BarcodeController.Open(BarcodeCOM); } catch (Exception e) { ThrowException($"Barcode Open Fail:{e.Message}"); } //home platform Platform.EnterAuto(this).Servo(); Platform.EnterAuto(this).Home(new[] { 1, 1, 0 }, -1); Platform.EnterAuto(this).MoveAbs("Wait", checkLimit: false); //move gt cylinder push pos if (!DoGTCylinder.SetDo(this, true, ignoreOrWaringOrError: true)) { //show alarm ThrowException($"GT Cylinder Set Fail!"); } return(0); }
protected override int ResetLoop() { CfgSettings = Machine.Ins.Settings; //clear vio VioTransFinish.SetVio(this, false); VioMeasureFinish.SetVio(this, false); Platform.AssertPosTeached("Wait", this); Platform.AssertPosTeached("GtWork", this); Platform.EnterAuto(this).Servo(); Platform.EnterAuto(this).Home(new[] { 1, 1, 0 }, -1); Platform.EnterAuto(this).MoveAbs("Wait", checkLimit: false); return(0); }
protected override int ResetLoop() { Clamper = new XyClamper() { Task = this, CyX = DoClampCylinderX, CyY = DoClampCylinderY, }; Platform.AssertPosTeached("Wait", this); Platform.AssertPosTeached("Work", this); CfgSettings = Machine.Ins.Settings; if (!Project.CheckIfNormal()) { ThrowException($"Project Error: {Project.ProductName}"); } Thermo1GeometryCalculator = Thermo1CalculatorMgr.Ins.New(Project.ProductName); if (Thermo1GeometryCalculator == null || !Thermo1GeometryCalculator.CheckIfNormal()) { ThrowException($"Station {Name} Load Thermo1GeometryCalculator for {Project.ProductName} Fail"); } try { Product = new Thermo1Product(); Product.ProductType = Project.ThermoProductType.ToString(); Product.Description = string.Join("-", new[] { Station.Name, Project.ProductName, CfgSettings.Version }); Product.SPCItems = Project.SPCItems; TestProcessControl.OnTestStartEvent(Product); //upload data if (CfgSettings.Uploader.Enable) { //init uploader UploadHelper = DataUploadFactory.Ins.Create(CfgSettings.Uploader.UploaderName, CfgSettings.Uploader); if (UploadHelper == null) { Log($"创建上传模块失败: {CfgSettings.Uploader.UploaderName} 不存在", LogLevel.Error); } else { UploadData(); } } } catch (Exception ex) { Log($"连接FTP ERROR: {ex.Message}", LogLevel.Error); } DOBtnLight1.SetDo(false); DOBtnLight2.SetDo(false); Thread.Sleep(500); DOBtnLight1.SetDo(); DOBtnLight2.SetDo(); //reset vio VioTransInp.SetVio(this, false); VioBarcodeFinish.SetVio(this, false); VioTransFinishUp.SetVio(this, false); VioTransFinishDown.SetVio(this, false); //start resetting process //check air pressure //if (!DIAirPressure1.GetDiSts(MotionWrapper)) //{ // return -1; //} //check gt controller try { if (GtController == null) { ThrowException("GT Controller not Created"); } if (GtController.Connected) { GtController.Close(); GtController = new KeyenceGT(); } GtController.Connect(GtAddress, GtPort); } catch (Exception e) { ThrowException($"GT Controller Connected Fail:{e.Message}"); } //wait measure task WaitTaskDown.AssertNoNull(this); WaitTaskDown.WaitResetFinish(this); WaitTaskUp.AssertNoNull(this); WaitTaskUp.WaitResetFinish(this); WaitTaskUp.GtController = GtController; WaitTaskDown.GtController = GtController; DOBrakeZPress.SetDo(); Clamp(true); //home platform Platform.EnterAuto(this).Servo(); Platform.EnterAuto(this).Home(); Platform.EnterAuto(this).MoveAbs("Wait", checkLimit: false); //cy clamp Clamper.Release(); //check sensor //while (!DISensorCheck1.GetDiSts( false) || !DISensorCheck2.GetDiSts( false)) //{ // MessageBox.Show("product found"); //} DOBtnLight1.SetDo(false); DOBtnLight2.SetDo(false); RunningState = RunningState.WaitRun; GtController.RunGtService(this); return(0); }