Beispiel #1
0
 protected override void Reset(ClassErrorHandle err)
 {
     AxisTopAlignBottom.ServoOn = true;
     AxisTopAlignSide.ServoOn   = true;
     AxisTopAlignTop.ServoOn    = true;
     AxisTopAlignXSide.ServoOn  = true;
     AxisTopAlignZClamp.ServoOn = true;
     Cylinder[EnumCellIndex.左电芯].SetCylinderState(CYLIND_UP, 0, false);
     Cylinder[EnumCellIndex.中电芯].SetCylinderState(CYLIND_UP, 0, false);
     Cylinder[EnumCellIndex.右电芯].SetCylinderState(CYLIND_UP, 0, false);
     if (!Cylinder[EnumCellIndex.左电芯].WaitCylinderState(CYLIND_UP, ClassErrorHandle.TIMEOUT))
     {
         err.CollectErrInfo("左气缸无法上移");
     }
     if (!Cylinder[EnumCellIndex.中电芯].WaitCylinderState(CYLIND_UP, ClassErrorHandle.TIMEOUT))
     {
         err.CollectErrInfo("中气缸无法上移");
     }
     if (!Cylinder[EnumCellIndex.右电芯].WaitCylinderState(CYLIND_UP, ClassErrorHandle.TIMEOUT))
     {
         err.CollectErrInfo("右气缸无法上移");
     }
     if (err.NoError)
     {
         err.CollectErrInfo(AxisTopAlignZClamp.Home());
     }
     if (err.NoError)
     {
         AxisTopAlignTop.HomeFinish = true;
         AxisTopAlignTop.MoveTo(-10000);
     }
     if (err.NoError)
     {
         err.CollectErrInfo(AxisTopAlignTop.Home());
     }
     if (err.NoError)
     {
         err.CollectErrInfo(AxisTopAlignXSide.Home(EnumPointX.Idle.ToString()));
     }
     if (err.NoError)
     {
         err.CollectErrInfo(AxisTopAlignBottom.Home());
     }
     if (err.NoError)
     {
         err.CollectErrInfo(AxisTopAlignSide.Home());
     }
     for (int i = 0; i < CELLCOUNT; i++)
     {
         TopAlignDataStations[i].CellData = null;
     }
 }
Beispiel #2
0
        public override void ZoneInit()
        {
            base.ZoneInit();
            AssignHardware(typeof(EnumAxisName), typeof(EnumInportName), typeof(EnumOutportName));
            AxisTopAlignBottom = ThisAxis(EnumAxisName.TopAlignBottom); AxisTopAlignBottom.AddPoints(typeof(EnumPointAlign));
            AxisTopAlignSide   = ThisAxis(EnumAxisName.TopAlignSide); AxisTopAlignSide.AddPoints(typeof(EnumPointAlign));
            AxisTopAlignTop    = ThisAxis(EnumAxisName.TopAlignTop); AxisTopAlignTop.AddPoints(typeof(EnumPointAlign));
            AxisTopAlignXSide  = ThisAxis(EnumAxisName.TopAlignXSide); AxisTopAlignXSide.AddPoints(typeof(EnumPointX));
            AxisTopAlignZClamp = ThisAxis(EnumAxisName.TopAlignZClamp); AxisTopAlignZClamp.AddPoints(typeof(EnumPointAlign));

            Cylinder.Add(EnumCellIndex.左电芯, new CylinderControl(/*"左电芯压紧气缸", "下降", "上升",*/
                             ThisOutport(EnumOutportName.TopAlignCyLeftDown),
                             ThisOutport(EnumOutportName.TopAlignCyLeftUp),
                             ThisInport(EnumInportName.TopAlignCyLeftDown),
                             ThisInport(EnumInportName.TopAlignCyLeftUp)));
            Cylinder.Add(EnumCellIndex.中电芯, new CylinderControl(/*"中电芯压紧气缸", "下降", "上升",*/
                             ThisOutport(EnumOutportName.TopAlignCyMidDown),
                             ThisOutport(EnumOutportName.TopAlignCyMidUp),
                             ThisInport(EnumInportName.TopAlignCyMidDown),
                             ThisInport(EnumInportName.TopAlignCyMidUp)));
            Cylinder.Add(EnumCellIndex.右电芯, new CylinderControl(/*"右电芯压紧气缸", "下降", "上升",*/
                             ThisOutport(EnumOutportName.TopAlignCyRightDown),
                             ThisOutport(EnumOutportName.TopAlignCyRightUp),
                             ThisInport(EnumInportName.TopAlignCyRightDown),
                             ThisInport(EnumInportName.TopAlignCyRightUp)));
            TopAlignCellVacuums[EnumCellIndex.左电芯].Port = ThisOutport(EnumOutportName.TopAlignVacLeft);
            TopAlignCellVacuums[EnumCellIndex.中电芯].Port = ThisOutport(EnumOutportName.TopAlignVacMid);
            TopAlignCellVacuums[EnumCellIndex.右电芯].Port = ThisOutport(EnumOutportName.TopAlignVacRight);
            CellVacSensor[EnumCellIndex.左电芯].Port       = ThisInport(EnumInportName.TopAlignVacSensLeft);
            CellVacSensor[EnumCellIndex.中电芯].Port       = ThisInport(EnumInportName.TopAlignVacSensMid);
            CellVacSensor[EnumCellIndex.右电芯].Port       = ThisInport(EnumInportName.TopAlignVacSensRight);
            CellBlow.Port    = ThisOutport(EnumOutportName.TopAlignBlow);
            ZoneSettingPanel = new SettingPanelZone顶封边定位();
            ZoneManualPanel  = new ManualPanelZone顶封边定位();
            AxisTopAlignXSide.HomeLimitReturnDis = 10;
        }
Beispiel #3
0
        public ErrorInfoWithPause ActionRelease()
        {
            ErrorInfoWithPause res = null;

            //Z松开
            ThisOutport(EnumOutportName.TopAlignSoftCyLeft).SetOutput(false);
            ThisOutport(EnumOutportName.TopAlignSoftCyMid).SetOutput(false);
            ThisOutport(EnumOutportName.TopAlignSoftCyRight).SetOutput(false);
            while (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Release, false))
            //return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release);
            {
                res = DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release);
                if (res != null)
                {
                    return(res);
                }
            }
            //顶部松开
            while (!AxisTopAlignTop.MoveTo(EnumPointAlign.Release, false))
            //return DispMotionError(AxisTopAlignTop, EnumPointAlign.Release);
            {
                res = DispMotionError(AxisTopAlignTop, EnumPointAlign.Release);
                if (res != null)
                {
                    return(res);
                }
            }
            //底部松开
            while (!AxisTopAlignBottom.MoveTo(EnumPointAlign.Release, false))
            //return DispMotionError(AxisTopAlignBottom, EnumPointAlign.Release);
            {
                res = DispMotionError(AxisTopAlignBottom, EnumPointAlign.Release);
                if (res != null)
                {
                    return(res);
                }
            }
            //侧松开
            while (!AxisTopAlignSide.MoveTo(EnumPointAlign.Release, false))
            //return DispMotionError(AxisTopAlignSide, EnumPointAlign.Release);
            {
                res = DispMotionError(AxisTopAlignSide, EnumPointAlign.Release);
                if (res != null)
                {
                    return(res);
                }
            }
            TimeClass time = new TimeClass();

            time.StartAlarmClock(ClassErrorHandle.TIMEOUT);
            while (!ThisInport(EnumInportName.TopAlignSoftCySensLeft).status ||
                   !ThisInport(EnumInportName.TopAlignSoftCySensMid).status ||
                   !ThisInport(EnumInportName.TopAlignSoftCySensRight).status)
            {
                System.Threading.Thread.Sleep(1);
                if (time.TimeOut)
                //return new ErrorInfoWithPause("柔性气缸不动作。", ErrorLevel.Error);
                {
                    res = WaitAlarmPause("顶封边定位", "柔性气缸不动作");
                    if (res != null)
                    {
                        return(res);
                    }
                    time.StartAlarmClock(ClassErrorHandle.TIMEOUT);
                }
            }
            time.StopAlarmClock();
            //X走位
            AxisTopAlignZClamp.WaitStop(ClassErrorHandle.TIMEOUT);
            while (!AxisTopAlignXSide.MoveTo(EnumPointX.Idle, false, offset[0]))
            //return DispMotionError(AxisTopAlignXSide, EnumPointX.Idle);
            {
                res = DispMotionError(AxisTopAlignXSide, EnumPointX.Idle);
                if (res != null)
                {
                    return(res);
                }
            }
            //AxisTopAlignTop.WaitStop(ClassErrorInfo.TIMEOUT);
            //AxisTopAlignBottom.WaitStop(ClassErrorInfo.TIMEOUT);
            //AxisTopAlignSide.WaitStop(ClassErrorInfo.TIMEOUT);
            for (int i = 0; i < CELLCOUNT; i++)
            {
                TopAlignCellVacuums[i].SetOutPortStatus(false);
            }
            return(null);
        }
Beispiel #4
0
        public ErrorInfoWithPause ActionAlign()
        {
            ErrorInfoWithPause res = null;

            ThisOutport(EnumOutportName.TopAlignSoftCyLeft).SetOutput(true);
            ThisOutport(EnumOutportName.TopAlignSoftCyMid).SetOutput(true);
            ThisOutport(EnumOutportName.TopAlignSoftCyRight).SetOutput(true);
            //侧定位
            double offsetTemp = 0;
            double mainlenprod, mainlencali;

            offsetTemp  = ClassCommonSetting.SysParam.CurrentProductParam.CellDataSpec.CellWidth.Mean - ClassCommonSetting.SysParam.Products[CALIBPROD].CellDataSpec.CellWidth.Mean;
            offsetTemp /= 2;
            while (!AxisTopAlignSide.MoveTo(EnumPointAlign.Clamp, false, -offsetTemp))
            //return DispMotionError(AxisTopAlignSide, EnumPointAlign.Clamp);
            {
                res = DispMotionError(AxisTopAlignSide, EnumPointAlign.Clamp);
                if (res != null)
                {
                    return(res);
                }
            }
            //底部定位
            mainlenprod = ClassCommonSetting.SysParam.CurrentProductParam.CellDataSpec.CellLength.Mean - ClassCommonSetting.SysParam.CurrentProductParam.TopSealHeight;
            mainlencali = ClassCommonSetting.SysParam.Products[CALIBPROD].CellDataSpec.CellLength.Mean - ClassCommonSetting.SysParam.Products[CALIBPROD].TopSealHeight;
            offsetTemp  = -1 * (mainlenprod - mainlencali);
            while (!AxisTopAlignBottom.MoveTo(EnumPointAlign.Clamp, false, offsetTemp))
            //return DispMotionError(AxisTopAlignBottom, EnumPointAlign.Clamp);
            {
                res = DispMotionError(AxisTopAlignBottom, EnumPointAlign.Clamp);
                if (res != null)
                {
                    return(res);
                }
            }
            //Z松开
            while (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Release, false))
            //return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release);
            {
                res = DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release);
                if (res != null)
                {
                    return(res);
                }
            }
            //顶部定位
            if (!(ClassWorkFlow.Instance.IsGRR || ClassCommonSetting.SysParam.CurrentProductParam.ClampDisable))
            {
                while (!AxisTopAlignTop.MoveTo(EnumPointAlign.Clamp))
                //return DispMotionError(AxisTopAlignTop, EnumPointAlign.Clamp);
                {
                    res = DispMotionError(AxisTopAlignTop, EnumPointAlign.Clamp);
                    if (res != null)
                    {
                        return(res);
                    }
                }
            }
            //X走位
            while (!AxisTopAlignXSide.MoveTo(EnumPointX.Idle, true, offset[0]))
            //return DispMotionError(AxisTopAlignXSide, EnumPointX.Idle);
            {
                res = DispMotionError(AxisTopAlignXSide, EnumPointX.Idle);
                if (res != null)
                {
                    return(res);
                }
            }
            //double zoffset = 0;
            //if (ClassCommonSetting.SysParam.CurrentProductParam.BackSideUp)
            //    zoffset = ClassCommonSetting.SysParam.CurrentProductParam.TopHeight;
            //if (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Clamp, true, zoffset - 1))
            //    return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Clamp);
            AxisTopAlignBottom.WaitStop(ClassErrorHandle.TIMEOUT);
            if (ClassWorkFlow.Instance.WorkMode != EnumWorkMode.空跑)
            {
                for (int i = 0; i < CELLCOUNT; i++)
                {
                    if (TopAlignDataStations[i].CellData != null)
                    {
                        TopAlignCellVacuums[i].SetOutPortStatus(true);
                    }
                }
            }
            //Check vacuum
            //ErrorInfoWithPause temp;
            //temp = CheckVacuumStatus();
            //if (temp != null) return temp;
            return(null);
        }