public StationStep StepInitRun(bool bmanual = false) { StationStep step = StationStep.Step_Stop; ParamSetMgr.GetInstance().SetBoolParam("转盘站初始化完成", false); Info("转盘站 等待其他工位回零"); WaranResult waranResult = doWhileWaitInit.doSomething(this, doWhileWaitInit, false, null); if (waranResult == WaranResult.TimeOut) { AlarmMgr.GetIntance().WarnWithDlg("转盘站回原点前,点胶工站或者AA工站复位时间过长,请检查,程序将会停止", this, CommonDlg.DlgWaranType.WaranOK, doWhileWaitInit, false); ClearAllStep(); GlobalVariable.g_StationState = StationState.StationStateStop; return(step); } Info("转盘站 开始回零"); if (!GoTableHome(bmanual)) { Err("转盘站 回零失败"); throw new Exception("转盘轴回零失败!"); } GoTableReadySafe(bmanual); ParamSetMgr.GetInstance().SetBoolParam("转盘站初始化完成", true); step = StationStep.Step_WaitAllStationFinsh; TableData.GetInstance().SetAllSationResultFalse(); TableData.GetInstance().SetALLStartCmd();//到位启动 return(step); }
public bool Init(bool bmanual) { MotionMgr.GetInstace().ServoOn(11); bFirist = true; ResetAllLineState(); Config(); lineSenor.feedMode = FeedMode.前进料; lineLock.bOutMotorRunDir = true; WaranResult waranResult = HomeSigleAxisPosWaitInpos(lineUpDown.nAxisNo, this, 2000000, bmanual); return(waranResult == WaranResult.Run); }
public override void AlarmDeal() { WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg(strAlarmmsg, lineObj.sb, new string[] { "重试", "已经人工拿走" }); if (waranResult == WaranResult.Custom1) { lineObj.LeaveTimer.ResetStartTimer(); lineObj.LeaveDelayTimer.Stop(); } if (waranResult == WaranResult.Custom2) { lineObj.LineSegState = LineSegementState.None; } }
public void ULoad(string SoketName, bool bManual) { string Soket = SoketName; retry_open_cliyder: IOMgr.GetInstace().WriteIoBit($"{Soket}工位夹紧", false); WaranResult waranResult = stationAAT.CheckIobyName($"{Soket}治具松开检测", true, $"{Soket}治具松开检测 失败,请检查气缸及感应器", bManual); if (waranResult == WaranResult.Retry) { goto retry_open_cliyder; } retry_close_checkVac: IOMgr.GetInstace().WriteIoBit($"{Soket}真空吸", false); }
public override void AlarmDeal() { WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg(strAlarmmsg, null, new string[] { "重试", "已经人工拿走" }); if (waranResult == WaranResult.Custom1) { lineObj.OutTimer.ResetStartTimer(); } if (waranResult == WaranResult.Custom2) { lineObj.LineSegState = LineSegementState.None; } //waranResult = AlarmMgr.GetIntance().WarnWithDlg($"{LineName} :离开段超时,可能料被拿走 或者卡住", null, new string[] { "重试", "已经人工拿走" }, CommonDlg.DlgWaranType.Waran_Custom1, null, bmaual); //if (waranResult == WaranResult.Custom1) // OutTimer.ResetStartTimer(); //if (waranResult == WaranResult.Custom2) // LineSegState= LineSegementState.None; }
public WaranResult CheckIobyName(string ioName, bool val = true, string excptionmsg = "", bool bmanual = false, int nTimeout = 3000) { DoWhile doWhile = new DoWhile((time, dowhile, bmanual2, obj) => { if (IOMgr.GetInstace().ReadIoInBit(ioName) == val) { return(WaranResult.Run); } else if (time > nTimeout) { WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg(string.Format("《{0}》 信号异常:{1} ", ioName, excptionmsg), bmanual2?null: this, CommonDlg.DlgWaranType.WaranInorge_Stop_Pause_Retry, dowhile); return(waranResult); } else { return(WaranResult.CheckAgain); } }, 100000); return(doWhile.doSomething(this, doWhile, bmanual, null)); }
protected override void StationWork(int step) { if (ParamSetMgr.GetInstance().GetIntParam("右剥料屏蔽") == 1) { ParamSetMgr.GetInstance().SetBoolParam("右剥料完成", true); return; } WaranResult waranResult; bool bfind = ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功"); bool bgooripos = ParamSetMgr.GetInstance().GetBoolParam("右剥料归位"); PlaneState planeState = PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState; NozzleState nozzleState = NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState; if (ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功") && ParamSetMgr.GetInstance().GetBoolParam("右剥料归位") && PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState == PlaneState.None && NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState == NozzleState.Have && GlobalVariable.g_StationState == StationState.StationStateRun) { Info(string.Format("右装料平台有无感应器{0},右搜寻蜂鸣器成功{1},右拨料平台状态{2},右剥料吸嘴状态{3} 右剥料归位{4}", IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器"), ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功"), PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState, NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState, ParamSetMgr.GetInstance().GetBoolParam("右剥料归位"))); ///loadState = LoadState.exceing; Carray(); // loadState = LoadState.None; } switch (step) { case (int)StationStep.step_init: Init(); retry_FindBuzzer: waranResult = FindBuzzer(); if (waranResult == WaranResult.Retry) { goto retry_FindBuzzer; } if (ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功")) { retry_go_蜂鸣器顶位: if (sys.g_AppMode == AppMode.AirRun) { ParamSetMgr.GetInstance().SetIntParam("右蜂鸣器顶位", (int)GetStationPointDic()["装料原始位"].pointZ); } WaranResult waranResult1 = MoveSigleAxisPosWaitInpos(AxisZ, ParamSetMgr.GetInstance().GetIntParam("右蜂鸣器顶位"), (int)MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, false, this, 60000); if (waranResult1 == WaranResult.Retry) { goto retry_go_蜂鸣器顶位; } } MoveSigleAxisPosWaitInpos(AxisY, GetStationPointDic()["剥料准备位"].pointY, (double)SpeedType.High, 20, false, this, 60000); PushMultStep((int)StationStep.step_Separate); ParamSetMgr.GetInstance().SetBoolParam("右剥料归位", true); ParamSetMgr.GetInstance().SetIntParam("右剥料次数", 0); DelCurrentStep(); break; case (int)StationStep.step_Separate: ParamSetMgr.GetInstance().SetBoolParam("右剥料完成", false); if (PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState == PlaneState.None) { break; } int Count = ParamSetMgr.GetInstance().GetIntParam("右剥料次数"); if (Count > 6) { PushMultStep((int)StationStep.step_Separate); DelCurrentStep(); break; } Separate(Count); Count = ParamSetMgr.GetInstance().GetIntParam("右剥料次数"); if (Count >= 2 && Count <= 6) { ParamSetMgr.GetInstance().SetBoolParam("右剥料完成", true); PushMultStep((int)StationStep.step_WaitGetFinish); DelCurrentStep(); } else if (Count > 6) { ParamSetMgr.GetInstance().SetBoolParam("右剥料完成", false); PushMultStep((int)StationStep.step_Separate); DelCurrentStep(); break; } else { PushMultStep((int)StationStep.step_Separate); DelCurrentStep(); } break; case (int)StationStep.step_WaitGetFinish: if (ParamSetMgr.GetInstance().GetBoolParam("右剥料取料完成")) { ParamSetMgr.GetInstance().SetBoolParam("右剥料取料完成", false); PushMultStep((int)StationStep.step_Separate); DelCurrentStep(); } break; } }
private void LoadWortk(bool bManual = false) { try { if (!ParamSetMgr.GetInstance().GetBoolParam("右剥料回原点成功")) { return; } if (!IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器") && !ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功") && loadState != LoadState.exceing && sys.g_AppMode == AppMode.AirRun && GlobalVariable.g_StationState == StationState.StationStateRun) { Info(string.Format("右装料平台有无感应器{0},右搜寻蜂鸣器成功{1},右拨料平台状态{2},右剥料吸嘴状态{3} 右剥料归位{4}", IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器"), ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功"), PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState, NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState, ParamSetMgr.GetInstance().GetBoolParam("右剥料归位"))); retry_find: loadState = LoadState.exceing; WaranResult waranResult = FindBuzzer(); if (waranResult == WaranResult.Retry) { goto retry_find; } loadState = LoadState.None; } if (ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功") && ParamSetMgr.GetInstance().GetBoolParam("右装料平台上升到位") && NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState == NozzleState.None && loadState != LoadState.exceing && GlobalVariable.g_StationState == StationState.StationStateRun) { Info(string.Format("右装料平台有无感应器{0},右搜寻蜂鸣器成功{1},右拨料平台状态{2},右剥料吸嘴状态{3} 右剥料归位{4}", IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器"), ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功"), PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState, NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState, ParamSetMgr.GetInstance().GetBoolParam("右剥料归位"))); loadState = LoadState.exceing; Pick(); loadState = LoadState.None; } if (ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功") && !ParamSetMgr.GetInstance().GetBoolParam("右装料平台上升到位") && GlobalVariable.g_StationState == StationState.StationStateRun) { Info("装料步进运动"); int pos = MotionMgr.GetInstace().GetAxisPos(AxisZ); double steplen = ParamSetMgr.GetInstance().GetDoubleParam("装料步长"); pos = pos + (int)(steplen * nResolutionZ); MoveSigleAxisPosWaitInpos(AxisZ, pos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, this); ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true); } } catch (Exception e) { loadState = LoadState.None; Warn("异常发生" + e.Message); return; } }
public bool Carray(bool bmanul = false) { Info("右剥料工站:搬运气缸开始搬运物料"); WaranResult waranResult; // CheckAndUp(bmanul); retry_carry_up: ParamSetMgr.GetInstance().SetBoolParam("右剥料完成", false); Info("右装料Z轴气缸电磁阀 上升"); IOMgr.GetInstace().WriteIoBit("右装料Z轴气缸电磁阀", false); waranResult = CheckIobyName("右装料Z轴气缸原位", true, "右剥料工站:右装料Z轴气缸电磁阀 上升失败,请检查气缸和感应器 线路 ", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carry_up; } StationRightPackage stationLeftPackage = (StationRightPackage)StationMgr.GetInstance().GetStation("右贴装站"); int AxisYNooFPageBack = stationLeftPackage.AxisY; int AxiXYNooFPageBack = stationLeftPackage.AxisX; retry_carryMoving: if (MotionMgr.GetInstace().GetHomeFinishFlag(AxisY) == AxisHomeFinishFlag.Homed && MotionMgr.GetInstace().GetAxisPos(AxisY) > GetStationPointDic()["剥料准备位"].pointY - 50 && MotionMgr.GetInstace().GetHomeFinishFlag(AxisYNooFPageBack) == AxisHomeFinishFlag.Homed && MotionMgr.GetInstace().GetAxisPos(AxisYNooFPageBack) < stationLeftPackage.GetStationPointDic()["搬料安全位"].pointY - 50 ) { #if false IOMgr.GetInstace().WriteIoBit("右剥料前推压紧气缸电磁阀", true); waranResult = CheckIobyName("右剥料前推压紧气缸到位", true, "右剥料工站:右剥料前推压紧气缸到位失败,请检查气缸和感应器 线路 ", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carryMoving; } IOMgr.GetInstace().WriteIoBit("右剥料压紧气缸电磁阀", true); waranResult = CheckIobyName("右剥料压紧气缸到位", true, "右剥料工站:右剥料压紧气缸到位失败,请检查气缸和感应器 线路 ", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carryMoving; } #endif Info("右装料搬运气缸电磁阀 移动搬料"); IOMgr.GetInstace().WriteIoBit("右装料搬运气缸电磁阀", true); waranResult = CheckIobyName("右装料搬运气缸到位", true, "右剥料工站:右装料搬运气缸到位失败,物料可能掉落,请检查气缸和感应器 线路 ", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carryMoving; } // CheckBuzzerPlaneAndUp(); retry_carry_down: Info("右装料Z轴气缸电磁阀 下降"); IOMgr.GetInstace().WriteIoBit("右装料Z轴气缸电磁阀", true); waranResult = CheckIobyName("右装料Z轴气缸到位", true, "右剥料工站:右装料Z轴气缸原下降失败,物料可能掉落,请检查气缸和感应器 线路 ", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carry_down; } Info("右装料真空吸电磁阀 关闭"); Info("右装料破真空电磁阀 打开"); Info("右剥料真空吸电磁阀 打开"); IOMgr.GetInstace().WriteIoBit("右装料破真空电磁阀", true); IOMgr.GetInstace().WriteIoBit("右装料真空吸电磁阀", false); IOMgr.GetInstace().WriteIoBit("右剥料真空吸电磁阀", true); Thread.Sleep(ParamSetMgr.GetInstance().GetIntParam("吸真空延时")); IOMgr.GetInstace().WriteIoBit("右装料破真空电磁阀", false); retry_carry_up2: Info("右装料Z轴气缸电磁阀 上升"); IOMgr.GetInstace().WriteIoBit("右装料Z轴气缸电磁阀", false); waranResult = CheckIobyName("右装料Z轴气缸原位", true, "右剥料工站:右装料Z轴气缸电磁阀 上升 失败,请检查气缸和感应器 线路 ", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carry_up2; } waranResult = CheckIobyName("右剥料真空检测", true, "右剥料工站:Carray:蜂鸣器片 在剥料平台未吸紧", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carry_down; } Info("右装料真空吸电磁阀 复检 检查料是否脱落"); IOMgr.GetInstace().WriteIoBit("右装料破真空电磁阀", false); IOMgr.GetInstace().WriteIoBit("右装料真空吸电磁阀", true); waranResult = CheckIobyName("右装料真空检测", false, "右剥料工站 :Carray:蜂鸣器片 在装料抓手上未脱离", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carry_down; } IOMgr.GetInstace().WriteIoBit("右装料真空吸电磁阀", false); retry_carryMovingback: Info("右装料搬运气缸电磁阀 移动搬料"); IOMgr.GetInstace().WriteIoBit("右装料搬运气缸电磁阀", false); waranResult = CheckIobyName("右装料搬运气缸原位", true, "右剥料工站:Carray:搬运气缸回到原位", bmanul); if (waranResult == WaranResult.Retry) { goto retry_carryMovingback; } IOMgr.GetInstace().WriteIoBit("右装料真空吸电磁阀", false); IOMgr.GetInstace().WriteIoBit("右装料破真空电磁阀", false); IOMgr.GetInstace().WriteIoBit("右剥料真空吸电磁阀", false); IOMgr.GetInstace().WriteIoBit("右剥料后压紧气缸电磁阀", false); ParamSetMgr.GetInstance().SetIntParam("右剥料次数", 0); NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState = NozzleState.None; PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState = PlaneState.Have; return(true); } else { Info("Y轴 在剥料准备位前 不能移动 请挪开 或者 右剥料平台Y轴 没有回原点"); return(false); WaranResult waranResult2 = AlarmMgr.GetIntance().WarnWithDlg("Y轴 在剥料准备位前 不能移动 请挪开 或者 右剥料平台Y轴 没有回原点", bmanul ? null : this, CommonDlg.DlgWaranType.WaranInorge_Stop_Pause_Retry); if (waranResult2 == WaranResult.Retry) { goto retry_carryMoving; } } }
public WaranResult FindBuzzer(bool bManual = false) { if (sys.g_AppMode == AppMode.AirRun) { Info("右剥料站:空跑搜寻蜂鸣器成功"); ParamSetMgr.GetInstance().SetBoolParam("右搜寻蜂鸣器成功", true); ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true); return(WaranResult.Run); } if (!IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器")) { double pos = GetStationPointDic()["装料原始位"].pointZ; MoveSigleAxisPosWaitInpos(AxisZ, pos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, this); MotionMgr.GetInstace().StopAxis(AxisZ); Info("右剥离工站:装料平台无料"); WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("右剥料:装料平台无料,请装料,装料完成点击<<重试>>按钮", bManual ? null : this, CommonDlg.DlgWaranType.WaranInorge_Stop_Pause_Retry); //if( WaranResult == WaranResult.) return(waranResult); } else { Info("右剥料工站:装料平台寻料"); // MotionMgr.GetInstace().ResetAxis() DoWhile doWhile = new DoWhile((time, dowhile, bmanual, obj) => { int pos = MotionMgr.GetInstace().GetAxisPos(AxisZ); if (this.GetStationPointDic().ContainsKey("装料最高位")) { if (pos > this.GetStationPointDic()["装料最高位"].pointZ) { Warn("右剥料工站:右装料平台寻找蜂鸣器, 已经到达最高位"); Info("右剥离工站:搜寻蜂鸣器失败"); ParamSetMgr.GetInstance().SetBoolParam("右搜寻蜂鸣器成功", false); MotionMgr.GetInstace().StopAxis(AxisZ); return(AlarmMgr.GetIntance().WarnWithDlg("右剥料:装料平台Z轴升至最高点 仍然没有检查到物料 请检查最高位设置,感应器之后,装料完成点击<<重试>>按钮", bManual ? null : this, CommonDlg.DlgWaranType.WaranInorge_Stop_Pause_Retry)); } if (MotionMgr.GetInstace().IsAxisNormalStop(AxisZ) > AxisState.NormalStop) { Warn("右剥料工站:电机报警"); ParamSetMgr.GetInstance().SetBoolParam("右搜寻蜂鸣器成功", false); return(AlarmMgr.GetIntance().WarnWithDlg("右剥料:装料平台Z轴电机报警 请检查电机及驱动器,装料完成点击<<重试>>按钮", this, CommonDlg.DlgWaranType.WaranInorge_Stop_Pause_Retry)); } if (IOMgr.GetInstace().ReadIoInBit("右装料Z轴上升到位感应器")) { MotionMgr.GetInstace().StopAxis(AxisZ); double currentzaxisPos = MotionMgr.GetInstace().GetAxisPos(AxisZ); currentzaxisPos = currentzaxisPos + ParamSetMgr.GetInstance().GetDoubleParam("装料抬升距离") * nResolutionZ; if (currentzaxisPos > GetStationPointDic()["装料最高位"].pointZ) { currentzaxisPos = GetStationPointDic()["装料最高位"].pointZ - 10; } MoveSigleAxisPosWaitInpos(AxisZ, currentzaxisPos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, this); Info("右剥离工站:搜寻蜂鸣器成功"); ParamSetMgr.GetInstance().SetBoolParam("右搜寻蜂鸣器成功", true); ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true); ParamSetMgr.GetInstance().SetIntParam("右蜂鸣器顶位", MotionMgr.GetInstace().GetAxisPos(AxisZ)); return(WaranResult.Run); } else { MotionMgr.GetInstace().JogMove(AxisZ, true, 0, (int)MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelM); return(WaranResult.CheckAgain); } } else { double position = GetStationPointDic()["装料原始位"].pointZ; MoveSigleAxisPosWaitInpos(AxisZ, position, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, bManual ? null : this); MotionMgr.GetInstace().StopAxis(AxisZ); Info("右剥离工站:装料平台无料"); WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("右剥料:装料平台无料,请装料,装料完成点击<<重试>>按钮", bManual ? null : this, CommonDlg.DlgWaranType.WaranInorge_Stop_Pause_Retry); return(waranResult); } }, int.MaxValue); return(doWhile.doSomething(this, doWhile, bManual, null)); } }
public override void DealException(string strExcptionName, WaranResult BitOpreatBtn, AlarmItem alarmItem) { base.DealException(strExcptionName, BitOpreatBtn, alarmItem); }
public StationStep StepGoSnap(VisionControl visionControl, bool bmanual = false) { StationStep step = StationStep.Step_Stop; //拍照识别是否有料,计算偏差(6月后做) ParamSetMgr.GetInstance().SetBoolParam("启动点胶", true); //开始点胶(优先实现画轨迹) //获取当前夹取位置是A工位还是B工位 int StationIndex = TableData.GetInstance().GetSocketNum(1, 0.5) - 1; PathHelper.Disp_ID = StationIndex; string stationAAName = StationIndex == 0 ? "A" : "B"; ParamSetMgr.GetInstance().SetBoolParam($"{stationAAName}工位点胶", true); double CenterX = ParamSetMgr.GetInstance().GetDoubleParam("产品点胶X轴半径"); double CenterY = ParamSetMgr.GetInstance().GetDoubleParam("产品点胶Y轴半径"); double DelZ = ParamSetMgr.GetInstance().GetDoubleParam("点胶Z轴上升高度偏差"); int DispDelay = ParamSetMgr.GetInstance().GetIntParam("出胶延迟"); double DispRunAngle = ParamSetMgr.GetInstance().GetDoubleParam("画胶角度"); double DispEndAngle = ParamSetMgr.GetInstance().GetDoubleParam("收胶角度"); bool DispEnable = ParamSetMgr.GetInstance().GetBoolParam("屏蔽点胶"); bool DispPhoto = ParamSetMgr.GetInstance().GetBoolParam("点胶相机拍照定位"); double SafeZ = GetStationPointDic()[$"安全位置"].pointZ; double X = 0; double Y = 0; double DispPhotoX = GetStationPointDic()[$"{stationAAName}工位拍照位"].pointX; double DispPhotoY = GetStationPointDic()[$"{stationAAName}工位拍照位"].pointY; double DispPhotoZ = GetStationPointDic()[$"{stationAAName}工位拍照位"].pointZ; double DispPosX = GetStationPointDic()[$"{stationAAName}工位点胶位"].pointX; double DispPosY = GetStationPointDic()[$"{stationAAName}工位点胶位"].pointY; double DispPosZ = GetStationPointDic()[$"{stationAAName}工位点胶位"].pointZ; double x1 = GetStationPointDic()["安全位置"].pointX; CameraBase cam = null; if (!ParamSetMgr.GetInstance().GetBoolParam("屏蔽上相机")) { cam = CameraMgr.GetInstance().GetCamera("Top"); cam.BindWindow(visionControl); Task.Run(() => { cam.StopGrap(); cam.SetTriggerMode(CameraModeType.Software); cam.SetGain(ParamSetMgr.GetInstance().GetIntParam("点胶相机增益")); cam.SetExposureTime(ParamSetMgr.GetInstance().GetIntParam("点胶相机曝光")); cam.StartGrab(); }); } IOMgr.GetInstace().WriteIoBit($"相机光源", true); retry_uplens: IOMgr.GetInstace().WriteIoBit($"{stationAAName}Lens升降气缸", true); WaranResult waranResult1 = CheckIobyName($"{stationAAName}Lens上升到位", true, $"{stationAAName}Lens上升到位", bmanual); if (waranResult1 == WaranResult.Retry) { goto retry_uplens; } MoveSigleAxisPosWaitInpos(AxisZ, SafeZ, (double)SpeedType.High, 0.005, bmanual, this); MoveY(DispPhotoY, SpeedType.High); MoveMulitAxisPosWaitInpos(new int[] { AxisX, AxisZ }, new double[] { DispPhotoX, DispPhotoZ }, new double[] { (double)SpeedType.High, (double)SpeedType.High }, 0.005, bmanual, this); HObject img = null; if (!ParamSetMgr.GetInstance().GetBoolParam("屏蔽上相机")) { img = cam.GetImage(); if (img == null || !img.IsInitialized()) { img = cam.GetImage(); } else { ImageHelper.Instance.SaveImage($"{PathHelper.ImagePathDisp}{DateTime.Now.ToString("HHmmssfff")}.bmp", "bmp", img.Clone()); } } IOMgr.GetInstace().WriteIoBit($"相机光源", false); //去画胶 Task.Run(() => { if (ParamSetMgr.GetInstance().GetBoolParam("是否选择程控电源")) { double valueVoltage = ParamSetMgr.GetInstance().GetDoubleParam("程控电源电压"); OtherDevices.ckPower.SetVoltage(StationIndex + 1, valueVoltage); double valueCurrent = ParamSetMgr.GetInstance().GetDoubleParam("程控电源电流"); OtherDevices.ckPower.SetCurrent(StationIndex + 1, valueCurrent); } IOMgr.GetInstace().WriteIoBit($"{stationAAName}模组上电", true); IOMgr.GetInstace().WriteIoBit($"12V开启", ParamSetMgr.GetInstance().GetBoolParam("是否开启非程控12V")); }); if (DispEnable) { step = StationStep.Step_CheckIpos; MoveSigleAxisPosWaitInpos(AxisZ, SafeZ, (double)SpeedType.High, 0.005, bmanual, this); TableData.GetInstance().SetStationResult("A_UnLoadLoad", true); TableData.GetInstance().SetStationResult("B_UnLoadLoad", true); return(step); } if (DispPhoto) { ////MoveY(DispPhotoY, SpeedType.High); ////MoveMulitAxisPosWaitInpos(new int[] { AxisX, AxisZ }, new double[] { DispPhotoX, DispPhotoZ }, new double[] { (double)SpeedType.High, (double)SpeedType.High }, 0.005, bmanual, this); //拍照计算 +半径 double CenterdelX = 0; double CenterdelY = 0; X = CenterX + CenterdelX; Y = CenterdelY; DispPosX = DispPhotoX - X; DispPosY = DispPhotoY + CenterdelY; } else { X = CenterX; Y = 0; } // IOMgr.GetInstace().WriteIoBit("点胶机", false); bool brtnExc = true; MotionMgr.GetInstace().AddAxisToGroup("点胶群组", 2, new int[] { AxisX, AxisY }); MoveY(DispPosY, SpeedType.High); MoveMulitAxisPosWaitInpos(new int[] { AxisX, AxisZ }, new double[] { DispPosX, DispPosZ + DelZ + 10 }, new double[] { (double)SpeedType.High, (double)SpeedType.High }, 0.005, bmanual, this); // MoveMulitAxisPosWaitInpos(new int[] { AxisX }, new double[] { DispPosX }, new double[] { (double)SpeedType.High }, 0.005, bmanual, this); IOMgr.GetInstace().WriteIoBit("点胶机", false); MoveMulitAxisPosWaitInpos(new int[] { AxisZ }, new double[] { DispPosZ + DelZ }, new double[] { (double)SpeedType.High }, 0.005, bmanual, this); if (ParamSetMgr.GetInstance().GetStringParam("点胶轨迹") == "Circle") { DateTime dateTime = DateTime.Now; if (DispDelay >= 0) { IOMgr.GetInstace().WriteIoBit("点胶机", true); Thread.Sleep(DispDelay); } else { Task.Run(() => { while (true) { if ((DateTime.Now - dateTime).TotalSeconds > Math.Abs(DispDelay) / 1000.0) { IOMgr.GetInstace().WriteIoBit("点胶机", true); break; } Thread.Sleep(10); } }); } //走 brtnExc &= MotionMgr.GetInstace().ClearBufMove("点胶群组"); brtnExc &= MotionMgr.GetInstace().RestGpErr("点胶群组"); // GpState gps = MotionMgr.GetInstace().GetGpState("点胶群组"); brtnExc &= MotionMgr.GetInstace().AddBufMove("点胶群组", BufMotionType.buf_Arc2dAbsAngleCW, 1, 2, (double)SpeedType.Mid, (double)SpeedType.Mid, new double[2] { X, Y }, new double[2] { DispPosZ, 0 }); brtnExc &= MotionMgr.GetInstace().BufTrans("点胶群组");//M314没有buf运动,所以放在这里star brtnExc &= MotionMgr.GetInstace().BufStart("点胶群组"); Thread.Sleep(400); if (!WaitXY(DispPosX, DispPosY)) { IOMgr.GetInstace().WriteIoBit("点胶机", false); return(step); } IOMgr.GetInstace().WriteIoBit("点胶机", false); } else { IOMgr.GetInstace().WriteIoBit("点胶机", true); Thread.Sleep(DispDelay); MoveY(DispPosY + CenterY * 10, SpeedType.Mid); MoveMulitAxisPosWaitInpos(new int[] { AxisX }, new double[] { DispPosX + CenterX * 2 }, new double[] { (double)SpeedType.Mid }, 0.005, bmanual, this); MoveY(DispPosY - CenterY * 10, SpeedType.Mid); MoveMulitAxisPosWaitInpos(new int[] { AxisX }, new double[] { DispPosX }, new double[] { (double)SpeedType.Mid }, 0.005, bmanual, this); MoveY(DispPosY, SpeedType.Mid); IOMgr.GetInstace().WriteIoBit("点胶机", false); } IOMgr.GetInstace().WriteIoBit($"相机光源", true); MoveMulitAxisPosWaitInpos(new int[] { AxisZ }, new double[] { DispPosZ + 3 }, new double[] { (double)SpeedType.Mid }, 0.005, bmanual, this); MoveMulitAxisPosWaitInpos(new int[] { AxisZ }, new double[] { DispPosZ + 10 }, new double[] { (double)SpeedType.High }, 0.005, bmanual, this); if (!ParamSetMgr.GetInstance().GetBoolParam("屏蔽上相机")) { MoveMulitAxisPosWaitInpos(new int[] { AxisX, AxisZ }, new double[] { DispPhotoX, DispPhotoZ }, new double[] { (double)SpeedType.High, (double)SpeedType.High }, 0.005, bmanual, this); // MoveSigleAxisPosWaitInpos(AxisX, DispPhotoX, (double)SpeedType.High, 0.005, bmanual, this); MoveY(DispPhotoY, SpeedType.High); HObject img2 = cam.GetImage(); if (img2 == null || !img2.IsInitialized()) { img2 = cam.GetImage(); } else { ImageHelper.Instance.SaveImage($"{PathHelper.ImagePathDisp}{DateTime.Now.ToString("HHmmssfff")}.bmp", "bmp", img2.Clone()); } } IOMgr.GetInstace().WriteIoBit($"相机光源", false); MoveMulitAxisPosWaitInpos(new int[] { AxisZ }, new double[] { SafeZ }, new double[] { (double)SpeedType.High }, 0.005, bmanual, this); MoveSigleAxisPosWaitInpos(AxisX, x1, (double)SpeedType.High, 0.005, bmanual, this); step = StationStep.Step_CheckIpos; //if (DialogResult.OK!= MessageBox.Show("请确定点胶效果是否OK,OK按确定", "Info", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)) //{ // ParamSetMgr.GetInstance().SetBoolParam("重新上料", true); // return step; //} ParamSetMgr.GetInstance().SetBoolParam("重新上料", false); SocketMgr.GetInstance().SetSocketState(SocketNumOfUnloadLoad, SocketState.Have); TableData.GetInstance().SetStationResult("A_UnLoadLoad", true); TableData.GetInstance().SetStationResult("B_UnLoadLoad", true); ParamSetMgr.GetInstance().SetBoolParam("点胶完成", true); return(step); }
public StationStep StepCheckIpos(bool bmanual = false) { StationStep step = StationStep.Step_CheckIpos; bool dEnableA = ParamSetMgr.GetInstance().GetBoolParam("屏蔽A工位"); bool dEnableB = ParamSetMgr.GetInstance().GetBoolParam("屏蔽B工位"); bool bA_UnLoadLoadStart = TableData.GetInstance().GetStationStartCmd("A_UnLoadLoad") && !dEnableA; bool bB_UnLoadLoadStart = TableData.GetInstance().GetStationStartCmd("B_UnLoadLoad") && !dEnableB; if (bA_UnLoadLoadStart || bB_UnLoadLoadStart || ParamSetMgr.GetInstance().GetBoolParam("重新上料")) { ParamSetMgr.GetInstance().SetBoolParam("重新上料", false); TableData.GetInstance().ResetStartCmd("A_UnLoadLoad"); TableData.GetInstance().ResetStartCmd("B_UnLoadLoad"); strStationName = TableData.GetInstance().GetStationName(); if (strStationName == "A_Pick" || strStationName == "B_Pick") { TableData.GetInstance().SetStationResult("A_UnLoadLoad", true); TableData.GetInstance().SetStationResult("B_UnLoadLoad", true); return(step); } SocketNumOfUnloadLoad = TableData.GetInstance().GetSocketNum(1, 0.5) - 1; if (SocketNumOfUnloadLoad == 0 && dEnableA) { TableData.GetInstance().SetStationResult("A_UnLoadLoad", true); TableData.GetInstance().SetStationResult("B_UnLoadLoad", true); return(step); } if (SocketNumOfUnloadLoad == 1 && dEnableB) { TableData.GetInstance().SetStationResult("A_UnLoadLoad", true); TableData.GetInstance().SetStationResult("B_UnLoadLoad", true); return(step); } IOMgr.GetInstace().WriteIoBit("NG指示红灯", false); IOMgr.GetInstace().WriteIoBit("OK指示绿灯", true); Info("开始上下料,安全光栅开始屏蔽"); ParamSetMgr.GetInstance().SetBoolParam("启用安全光栅", false); ParamSetMgr.GetInstance().SetBoolParam("可以上下料", true); SocketState state = SocketMgr.GetInstance().socketArr[SocketNumOfUnloadLoad].socketState; if (state == SocketState.HaveOK || state == SocketState.HaveNG) { string lightColor = state == SocketState.HaveOK ? "OK指示绿灯" : "NG指示红灯"; string fp = state == SocketState.HaveOK ? "P" : "F"; UserTest.TestResultAB[SocketNumOfUnloadLoad].SocketerNumber = SocketNumOfUnloadLoad == 0 ? "A" : "B"; #region 计算CT赋值 if (UserTest.ProductCount.CountCTAll == 0) { UserTest.ProductCount.StarCTTime = DateTime.Now; UserTest.ProductCount.EndCTTime = DateTime.Now; UserTest.ProductCount.CountCTTime = 0; } else { UserTest.ProductCount.CountCTTime += (DateTime.Now - UserTest.ProductCount.EndCTTime).TotalSeconds; UserTest.ProductCount.EndCTTime = DateTime.Now; if ((DateTime.Now - UserTest.ProductCount.StarCTTime).TotalMinutes > ParamSetMgr.GetInstance().GetDoubleParam("UPH计算时长")) { if (UserTest.ProductCount.CountCTAll > ParamSetMgr.GetInstance().GetDoubleParam("UPH计算时长范围内最少个数")) { UserTest.ProductCount.UPH = (UserTest.ProductCount.CountCTAll) * 3600 / UserTest.ProductCount.CountCTTime; } //清除 UserTest.ProductCount.CountCTAll = -1; } } UserTest.ProductCount.CountCTAll++; if (SocketNumOfUnloadLoad == 0) { if (fp == "P") { UserTest.ProductCount.OKA++; } else { UserTest.ProductCount.NGA++; if (!UserTest.FailResultAB.Play) { UserTest.ProductCount.PlayFailA++; UserTest.FailResultAB.OC = true; UserTest.FailResultAB.SFR = true; UserTest.FailResultAB.Tilt = true; } if (!UserTest.FailResultAB.OC) { UserTest.ProductCount.OCFailA++; UserTest.FailResultAB.Play = true; UserTest.FailResultAB.SFR = true; UserTest.FailResultAB.Tilt = true; } if (!UserTest.FailResultAB.Tilt) { UserTest.ProductCount.TiltFailA++; UserTest.FailResultAB.OC = true; UserTest.FailResultAB.SFR = true; UserTest.FailResultAB.Play = true; } if (!UserTest.FailResultAB.SFR) { UserTest.ProductCount.SFRFailA++; UserTest.FailResultAB.OC = true; UserTest.FailResultAB.Play = true; UserTest.FailResultAB.Tilt = true; } if (UserTest.FailResultAB.Play && UserTest.FailResultAB.OC && UserTest.FailResultAB.Tilt && UserTest.FailResultAB.SFR) { UserTest.ProductCount.OtherFailA++; } } } else { if (fp == "P") { UserTest.ProductCount.OKB++; } else { UserTest.ProductCount.NGB++; if (!UserTest.FailResultAB.Play) { UserTest.ProductCount.PlayFailB++; UserTest.FailResultAB.OC = true; UserTest.FailResultAB.SFR = true; UserTest.FailResultAB.Tilt = true; } if (!UserTest.FailResultAB.OC) { UserTest.ProductCount.OCFailB++; UserTest.FailResultAB.Play = true; UserTest.FailResultAB.SFR = true; UserTest.FailResultAB.Tilt = true; } if (!UserTest.FailResultAB.Tilt) { UserTest.ProductCount.TiltFailB++; UserTest.FailResultAB.OC = true; UserTest.FailResultAB.SFR = true; UserTest.FailResultAB.Play = true; } if (!UserTest.FailResultAB.SFR) { UserTest.ProductCount.SFRFailB++; UserTest.FailResultAB.OC = true; UserTest.FailResultAB.Play = true; UserTest.FailResultAB.Tilt = true; } if (UserTest.FailResultAB.Play && UserTest.FailResultAB.OC && UserTest.FailResultAB.Tilt && UserTest.FailResultAB.SFR) { UserTest.ProductCount.OtherFailB++; } } } #endregion Form_Auto.EvenShowCT(SocketNumOfUnloadLoad + 1); UserTest.TestResultAB[SocketNumOfUnloadLoad].Result = fp == "P" ? true : false; if (fp == "P") { UserTest.TestResultAB[SocketNumOfUnloadLoad].FailStep = "Pass"; } UserTest.TestResultAB[SocketNumOfUnloadLoad].EndTime = DateTime.Now; UserTest.TestResultAB[SocketNumOfUnloadLoad].TestTime = (UserTest.TestResultAB[SocketNumOfUnloadLoad].EndTime - UserTest.TestResultAB[SocketNumOfUnloadLoad].StarTime).TotalSeconds; string errCsv = CSVHelper.Instance.SaveToCSVPath(PathHelper.TestResultCsvPath, UserTest.TestResultAB[SocketNumOfUnloadLoad]); IOMgr.GetInstace().WriteIoBit("OK指示绿灯", false); IOMgr.GetInstace().WriteIoBit("NG指示红灯", false); IOMgr.GetInstace().WriteIoBit(lightColor, true); Info($"保存OK结果:cvs={errCsv}."); if (SocketNumOfUnloadLoad == 0) { IOMgr.GetInstace().WriteIoBit($"ALens升降气缸", true); } else { IOMgr.GetInstace().WriteIoBit($"BLens升降气缸", true); } //PlaceToSocket(SocketNumOfUnloadLoad); UserTest.CTTestAB[SocketNumOfUnloadLoad].Star = false; UserTest.CTTestAB[SocketNumOfUnloadLoad].End = false; UserTest.CTTestAB[SocketNumOfUnloadLoad].Show = true; } //同意下料接口 SysFunConfig.LodUnloadPatten.ULoad(SocketNumOfUnloadLoad == 0? "A":"B", bmanual); retry_check_Start: ParamSetMgr.GetInstance().SetBoolParam("启用安全光栅", false); WaranResult waranResult = doWhileCheckStartSignal.doSomething(this, doWhileCheckStartSignal, false, new object[] { this }); if (waranResult == WaranResult.Retry) { goto retry_check_Start; } IOMgr.GetInstace().WriteIoBit($"相机光源", true); IOMgr.GetInstace().WriteIoBit("启动按钮灯", false); IOMgr.GetInstace().WriteIoBit("OK指示绿灯", false); IOMgr.GetInstace().WriteIoBit("NG指示红灯", false); if (!IOMgr.GetInstace().ReadIoInBit($"点胶液位感应") && ParamSetMgr.GetInstance().GetBoolParam("点胶液位检测")) { MessageBox.Show($"点胶液位感应有信号,胶水已经用完!请更换,或者屏蔽[点胶液位检测]。", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); goto retry_check_Start; } Form_Auto.EvenGetSN(SocketNumOfUnloadLoad); if (UserTest.TestResultAB[SocketNumOfUnloadLoad].SerialNumber == "NOSN") { MessageBox.Show("请输入SN 或者屏蔽SN,重新启动", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); goto retry_check_Start; } if (SocketNumOfUnloadLoad == 0) { UserTest.ProductCount.CompeteA++; } else { UserTest.ProductCount.CompeteB++; } ParamSetMgr.GetInstance().SetBoolParam("启用安全光栅", true); ParamSetMgr.GetInstance().SetBoolParam("可以上下料", false); ParamSetMgr.GetInstance().SetBoolParam("AA完成", false); ParamSetMgr.GetInstance().SetBoolParam("点胶完成", false); ParamSetMgr.GetInstance().SetBoolParam("启动AA", false); ParamSetMgr.GetInstance().SetBoolParam("启动点胶", false); Info("开始上下料,安全光栅开始启用"); ParamSetMgr.GetInstance().SetBoolParam("启用安全光栅", true); UserTest.CTTestAB[SocketNumOfUnloadLoad].Star = true; UserTest.CTTestAB[SocketNumOfUnloadLoad].End = false; UserTest.CTTestAB[SocketNumOfUnloadLoad].Show = false; step = StationStep.Step_GoSnap; } return(step); }
public static WaranResult JumpInPos(this ScaraRobot scaraRobot, Coordinate coordinate, HandDirection direction, bool bCheckHandleSys = false, bool bmauanl = false, int nTimeout = 20000) { logger.Info($"JumpInPos start pos{coordinate.X},{coordinate.Y},{coordinate.Z},{coordinate.U}"); try { WaranResult waran = WaranResult.Failture; bool bcmd = ScaraRobot.GetInstance().Jump(coordinate, direction, getLimit(coordinate)); DoWhile doWhile = new DoWhile((nTimeed, doWhile2, bmanual, objs) => { double dfine = 0.05; bool bInPosX = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.X - coordinate.X) < dfine; bool bInPosY = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.Y - coordinate.Y) < dfine; // bool bInPosZ = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.Z - coordinate.Z) < dfine; bool bInPosU = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.U - coordinate.U) < 0.1; bool bInPos = bInPosX && bInPosY && true && bInPosU; if (!bmanual) { if (GlobalVariable.g_StationState == StationState.StationStatePause) { logger.Info($"JumpInPos 程序状态: {GlobalVariable.g_StationState }"); ScaraRobot.GetInstance().SetStopActionFlag(); return(WaranResult.CheckAgain); } else if (GlobalVariable.g_StationState == StationState.StationStateRun) { Thread.Sleep(50); bInPosX = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.X - coordinate.X) < dfine; bInPosY = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.Y - coordinate.Y) < dfine; // bInPosZ = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.Z - coordinate.Z) < dfine; bInPosU = Math.Abs(ScaraRobot.GetInstance().CurrentPosition.U - coordinate.U) < 0.1; bInPos = bInPosX && bInPosY && true && bInPosU; if (!bInPos) { Coordinate coordinatetemp = ScaraRobot.GetInstance().GetCurrentImmediately(); bInPosX = Math.Abs(coordinatetemp.X - coordinate.X) < dfine; bInPosY = Math.Abs(coordinatetemp.Y - coordinate.Y) < dfine; // bInPosZ = Math.Abs(coordinatetemp.Z - coordinate.Z) < dfine; bInPosU = Math.Abs(coordinatetemp.U - coordinate.U) < 0.1; bInPos = bInPosX && bInPosY && true && bInPosU; } logger.Info($"JumpInPos 程序状态:{GlobalVariable.g_StationState} bInPos {bInPos}, 目标位置 {coordinate.X},{coordinate.Y},{coordinate.Z},{coordinate.U}" + $"实际位置: {ScaraRobot.GetInstance().CurrentPosition.X},{ScaraRobot.GetInstance().CurrentPosition.Y},{ScaraRobot.GetInstance().CurrentPosition.Z},{ScaraRobot.GetInstance().CurrentPosition.U}"); if (bInPos) { return(WaranResult.Run); } else if (ScaraRobot.GetInstance().InPos&& !bInPos) { ScaraRobot.GetInstance().ReasetStopActionFlag(); ScaraRobot.GetInstance().Jump(coordinate, direction, getLimit(coordinate)); return(WaranResult.CheckAgain); } } } if (nTimeed > nTimeout) { logger.Info($"JumpInPos 程序状态:{GlobalVariable.g_StationState} bInPos {bInPos}, 超时, 目标位置 {coordinate.X},{coordinate.Y},{coordinate.Z},{coordinate.U}" + $"实际位置: {ScaraRobot.GetInstance().CurrentPosition.X},{ScaraRobot.GetInstance().CurrentPosition.Y},{ScaraRobot.GetInstance().CurrentPosition.Z},{ScaraRobot.GetInstance().CurrentPosition.U}"); ScaraRobot.GetInstance().SetStopActionFlag(); ScaraRobot.GetInstance().SetStopActionFlag(); ScaraRobot.GetInstance().ReasetStopActionFlag(); logger.Info($"JumpInPos 程序状态:{GlobalVariable.g_StationState} bInPos {bInPos}, 复位, 目标位置 {coordinate.X},{coordinate.Y},{coordinate.Z},{coordinate.U}" + $"实际位置: {ScaraRobot.GetInstance().CurrentPosition.X},{ScaraRobot.GetInstance().CurrentPosition.Y},{ScaraRobot.GetInstance().CurrentPosition.Z},{ScaraRobot.GetInstance().CurrentPosition.U}"); return(WaranResult.TimeOut); } if (ScaraRobot.GetInstance().InPos&& bInPos) { return(WaranResult.Run); } else { return(WaranResult.CheckAgain); } } , 30000); return(doWhile.doSomething2(null, doWhile, bmauanl, null)); } catch (Exception ex) { ScaraRobot.GetInstance().SetStopActionFlag(); ScaraRobot.GetInstance().SetStopActionFlag(); ScaraRobot.GetInstance().ReasetStopActionFlag(); throw ex; } }