示例#1
0
 public void ClampVC()
 {
     CyY.SetDo(Task, true, 100, null);
     CyY.SetDo(Task, false, 150, null);
     CyX.SetDo(Task, true, 200, null);
     CyX.SetDo(Task, false, 100, null);
     CyY.SetDo(Task, true, 100, null);
 }
示例#2
0
        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);
        }
示例#3
0
        protected override int RunLoop()
        {
            //in case of manual operations
            Platform.AssertAutoMode(this);


            //wait start
            while ((!DIStart1.GetDiSts() || !DIStart2.GetDiSts()))
            {
                Thread.Sleep(100);
                JoinIfPause();
                AbortIfCancel("cancel trans wait start");
                if (Station.Id == 1 && Machine.Ins.Settings.Common.LeftAutoTryRun)
                {
                    break;
                }

                if (Station.Id == 2 && Machine.Ins.Settings.Common.RightAutoTryRun)
                {
                    break;
                }
            }

            Log(string.Empty, LogLevel.None);


            if ((Station.Id == 1 && Machine.Ins.Settings.Common.LeftSensorCheck) ||
                (Station.Id == 2 && Machine.Ins.Settings.Common.RightSensorCheck))
            {
                //检查定位传感器
                if (!DISensorCheck1.GetDiSts() || !DISensorCheck2.GetDiSts())
                {
                    Station.Machine.Beep();
                    Log($"{Station.Name} - {Name} 定位传感器检测异常", LogLevel.Warning);
                    return(0);
                }
            }

            if ((Station.Id == 1 && Machine.Ins.Settings.Common.LeftFinSensorCheck) ||
                (Station.Id == 2 && Machine.Ins.Settings.Common.RightFinSensorCheck))
            {
                //检查fin传感器
                if (!CheckProductFin())
                {
                    //return to wait start
                    return(0);
                }
            }

            //new product
            Product = new Thermo1Product()
            {
                ProductType = Project.ThermoProductType.ToString(),
                Description = Station.Name + "-" + Project.ProductName + "-" + CfgSettings.Version,
                SPCItems    = Project.SPCItems,
            };
            Product.ClearSpc();
            //push data to measure tasks
            WaitTaskDown.Product = Product;
            WaitTaskUp.Product   = Product;
            TestProcessControl.OnTestStartEvent(Product);
            TestProcessControl.OnTestingEvent(Product);

            DOBtnLight1.SetDo();
            DOBtnLight2.SetDo();

            //cy clamp
            if (Project.ProjectName.Contains("HeightCalib"))
            {
                DoClampCylinderY.SetDo(this, true, 100, ignoreOrWaringOrError: null);
            }
            else if (Project.ThermoProductType == ThermoProductType.FullModule)
            {
                Clamper.ClampModule();
            }
            else if (Project.ThermoProductType == ThermoProductType.VaporChamber)
            {
                Clamper.ClampVC();
            }
            else
            {
                Clamp(true);
            }


            //move work
            Platform.MoveAbs(0, "Work");
            {
                VioTransInp.SetVio(this);

                //start waiting
                Log("Measure Start......\n-----------------------------------------------", LogLevel.Info);
                //set measure start
                VioTransFinishUp.SetVio(this);
                VioTransFinishDown.SetVio(this);
                {
                    //wait barcode finish update barcode
                    VioBarcodeFinish.WaitVioAndClear(this);
                    TestProcessControl.OnTestingEvent(Product);
                }
                //wait measure finish
                VioMeasureFinishUp.WaitVioAndClear(this);
                VioMeasureFinishDown.WaitVioAndClear(this);
                Log("Measure Finish......\n-----------------------------------------------", LogLevel.Info);
            }
            //move wait pos
            Platform.MoveAbs(0, "Wait");

            //update results
            //calc flatness
            if (Thermo1GeometryCalculator != null)
            {
                //transform raw data to same coord
                GTTransform.TransformRawData(Station.Name, CfgSettings.Calibration, Product);
                var data = Thermo1GeometryCalculator.Calculate(Product);
                Log($"Flatness Calc: {data.ToString()}");
            }

            SaveProductData();

            Clamper.Release();
            DOBtnLight1.SetDo(false);
            DOBtnLight2.SetDo(false);

            return(0);
        }