public ErrorInfoWithPause ActionCylinderTest() { ErrorInfoWithPause res = null; isCylinderTest = !isCylinderTest; for (int i = 0; i < CELLCOUNT; i++) { if (TopAlignDataStations[i].CellData == null) { TopAlignDataStations[i].CellData = ClassDataInfo.NewCellData(); } } double zoffset = 0; if (ClassCommonSetting.SysParam.CurrentProductParam.BackSideUp) { zoffset = ClassCommonSetting.SysParam.CurrentProductParam.TopHeight; } if (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Clamp, true, zoffset)) { while (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Clamp)) //return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Clamp); { res = DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Clamp); if (res != null) { return(res); } } } while (isCylinderTest) { res = AllCyDown(); if (res != null) { isCylinderTest = false; break; } if (!isCylinderTest) { break; } TimeClass.Delay(ClassCommonSetting.SysParam.ThicknessMeasDelayTime); if (!isCylinderTest) { break; } res = AllCyUp(); if (res != null) { isCylinderTest = false; break; } if (!isCylinderTest) { break; } TimeClass.Delay(ClassCommonSetting.SysParam.ThicknessMeasDelayTime); if (!isCylinderTest) { break; } } while (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Release)) //return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release); { res = DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release); if (res != null) { return(res); } } return(res); }
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); }
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); }
public ErrorInfoWithPause ActionStartClamp() { if (ClassWorkFlow.Instance.IsGRR || ClassCommonSetting.SysParam.CurrentProductParam.ClampDisable) { return(null); } string err = ""; ErrorInfoWithPause res = null; //Z松开 //if (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Release)) // return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release); for (int i = 0; i < offset.Length; i++) { //X走位 while (!AxisTopAlignXSide.MoveTo(EnumPointX.Idle, true, offset[i])) //return DispMotionError(AxisTopAlignXSide, "移到第" + (i + 1).ToString() + "次夹紧位置"); { res = DispMotionError(AxisTopAlignXSide, "移到第" + (i + 1).ToString() + "次夹紧位置"); if (res != null) { return(res); } } //Z夹紧 double zoffset = 0; if (ClassCommonSetting.SysParam.CurrentProductParam.BackSideUp) { zoffset = ClassCommonSetting.SysParam.CurrentProductParam.TopHeight; } while (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Clamp, true, zoffset)) //return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Clamp); { res = DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Clamp); if (res != null) { return(res); } } //气缸下 while (true) { err = ""; for (int k = 0; k < CELLCOUNT; k++) { if (TopAlignDataStations[k].CellData != null) { Cylinder[k].SetCylinderState(CYLIND_DOWN, 0, false); } } if (TopAlignDataStations[EnumCellIndex.左电芯].CellData != null) { if (!Cylinder[EnumCellIndex.左电芯].WaitCylinderState(CYLIND_DOWN, ClassErrorHandle.TIMEOUT)) { err += " 左气缸"; } } if (TopAlignDataStations[EnumCellIndex.中电芯].CellData != null) { if (!Cylinder[EnumCellIndex.中电芯].WaitCylinderState(CYLIND_DOWN, ClassErrorHandle.TIMEOUT)) { err += " 中气缸"; } } if (TopAlignDataStations[EnumCellIndex.右电芯].CellData != null) { if (!Cylinder[EnumCellIndex.右电芯].WaitCylinderState(CYLIND_DOWN, ClassErrorHandle.TIMEOUT)) { err += " 右气缸"; } } if (err != "") //return new ErrorInfoWithPause("顶封位气缸下移错误:" + err, ErrorLevel.Error); { res = WaitAlarmPause("顶封边定位", "顶封位气缸下移超时错: " + err); if (res != null) { return(res); } } else { break; } } //TimeClass.Delay(100); //气缸上 while (true) { err = ""; for (int k = 0; k < CELLCOUNT; k++) { if (TopAlignDataStations[k].CellData != null) { Cylinder[k].SetCylinderState(CYLIND_UP, 0, false); } } System.Threading.Thread.Sleep(100); while (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Clamp, true, zoffset - 1)) //return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release); { res = DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release); if (res != null) { return(res); } } if (TopAlignDataStations[EnumCellIndex.左电芯].CellData != null) { if (!Cylinder[EnumCellIndex.左电芯].WaitCylinderState(CYLIND_UP, ClassErrorHandle.TIMEOUT)) { err += " 左气缸"; } } if (TopAlignDataStations[EnumCellIndex.中电芯].CellData != null) { if (!Cylinder[EnumCellIndex.中电芯].WaitCylinderState(CYLIND_UP, ClassErrorHandle.TIMEOUT)) { err += " 中气缸"; } } if (TopAlignDataStations[EnumCellIndex.右电芯].CellData != null) { if (!Cylinder[EnumCellIndex.右电芯].WaitCylinderState(CYLIND_UP, ClassErrorHandle.TIMEOUT)) { err += " 右气缸"; } } if (err != "") //return new ErrorInfoWithPause("顶封位气缸上移错误:" + err, ErrorLevel.Error); { res = WaitAlarmPause("顶封边定位", "顶封位气缸上移超时错: " + err); if (res != null) { return(res); } } else { break; } } //Z松开 } //Z松开 ThisOutport(EnumOutportName.TopAlignSoftCyLeft).SetOutput(false); ThisOutport(EnumOutportName.TopAlignSoftCyMid).SetOutput(false); ThisOutport(EnumOutportName.TopAlignSoftCyRight).SetOutput(false); //if (!AxisTopAlignZClamp.MoveTo(EnumPointAlign.Release, false)) return DispMotionError(AxisTopAlignZClamp, EnumPointAlign.Release); return(null); }