Ejemplo n.º 1
0
 /// <summary>
 /// 报警提示
 /// </summary>
 /// <param name="i"></param>
 public static void AlarmTips(int i)
 {
     if (i % 2 == 0)
     {
         if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯"))
         {
             IOMgr.GetInstace().WriteIoBit("红灯", true);
         }
         if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣"))
         {
             IOMgr.GetInstace().WriteIoBit("蜂鸣", true);
         }
     }
     else
     {
         if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯"))
         {
             IOMgr.GetInstace().WriteIoBit("红灯", false);
         }
         if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣"))
         {
             IOMgr.GetInstace().WriteIoBit("蜂鸣", false);
         }
     }
 }
Ejemplo n.º 2
0
 private void EvenAddHardware()
 {
     GlobalVariable.g_eventStationStateChanged += StationStateChangedHandler;
     alarmtimer.Elapsed += new System.Timers.ElapsedEventHandler((object senders, ElapsedEventArgs es) =>
     {
         //   if(!bStartAlarmTimer)
         {
             try
             {
                 if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣"))
                 {
                     IOMgr.GetInstace().WriteIoBit("蜂鸣", !IOMgr.GetInstace().ReadIoOutBit("蜂鸣"));
                 }
                 bStartAlarmTimer = true;
             }
             catch (Exception ex)
             {
                 return;
             }
         }
     });
     IOMgr.GetInstace().m_deltgateSystemSingl += ProcessSysIo;
     MotionMgr.GetInstace().m_eventAxisSingl  += ProcessSysIo;
     // 注册安全函数
     UserConfig.AddIoSafeOperate();
     UserConfig.AddAxisSafeOperate();
 }
Ejemplo n.º 3
0
 public void MotionBackRun(bool bRunDir = false)
 {
     if (nAxisOnLine != -1)
     {
         MotionMgr.GetInstace().JogMove(nAxisOnLine, !bOutMotorRunDirOnLine, 0, (double)SpeedType.High);
         return;
     }
     if (IOMotionDir == null || IOMotionDir == "")
     {
         if (BackMotorIo != null && BackMotorIo != "")
         {
             IOMgr.GetInstace().WriteIoBit(BackMotorIo, true);
         }
         if (ForwardMotorIo != null && ForwardMotorIo != "")
         {
             IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, false);
         }
     }
     else
     {
         if (ForwardMotorIo != null && ForwardMotorIo != "")
         {
             IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, true);
         }
         if (IOMotionDir != null && IOMotionDir != "")
         {
             IOMgr.GetInstace().WriteIoBit(IOMotionDir, bRunDir);
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 在启动/恢复程序前,检查安全门光栅
        /// </summary>
        /// <returns></returns>
        public bool IsSafeDoorAndGrating()
        {
            if (ParamSetMgr.GetInstance().GetBoolParam("启用安全门"))
            {
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("安全门") && !IOMgr.GetInstace().ReadIoInBit("安全门"))
                {
                    MessageBox.Show("安全门打开", "Warn", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    // WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("安全门打开", null, DlgWaranType.WaranOK);
                    return(false);
                }
            }
            if (IOMgr.GetInstace().GetOutputDic().ContainsKey("气源检测") && IOMgr.GetInstace().GetInputDic().ContainsKey("气源检测"))
            {
                if (!IOMgr.GetInstace().ReadIoInBit("气源检测"))
                {
                    MessageBox.Show("气源检测失败,请打开气源", "Warn", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    // WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("气源检测失败,请打开气源", null, DlgWaranType.WaranOK);
                    return(false);
                }
            }
            if (IOMgr.GetInstace().GetOutputDic().ContainsKey("真空气源检测") && IOMgr.GetInstace().GetInputDic().ContainsKey("真空气源检测"))
            {
                if (!IOMgr.GetInstace().ReadIoInBit("真空气源检测"))
                {
                    MessageBox.Show("真空气源检测失败,请打开真空气源", "Warn", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //  WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("真空气源检测失败,请打开真空气源", null, DlgWaranType.WaranOK);
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 5
0
        public void UpDataAllIo()
        {
            Dictionary <string, IOMgr.IoDefine> dicInput = IOMgr.GetInstace().GetInputDic();
            int indexIn = 0;

            foreach (var tem in dicInput)
            {
                m_labelControl_IoInput[indexIn++].State = IOMgr.GetInstace().ReadIoInBit(tem.Key);
            }

            Dictionary <string, IOMgr.IoDefine> dicOutput = IOMgr.GetInstace().GetOutputDic();
            int indexOut = 0;

            foreach (var tem in dicOutput)
            {
                if (!ParamSetMgr.GetInstance().GetBoolParam("是否用平行光管或中继镜气缸"))
                {
                    if (tem.Key == "平行光管升降气缸")
                    {
                        continue;
                    }
                }
                m_labelControl_IoOutput[indexOut++].State = IOMgr.GetInstace().ReadIoOutBit(tem.Key);
            }
        }
Ejemplo n.º 6
0
 public void MotionStop()
 {
     if (nAxisOnLine != -1)
     {
         MotionMgr.GetInstace().StopAxis(nAxisOnLine);
         return;
     }
     if (IOMotionDir == null || IOMotionDir == "")
     {
         if (BackMotorIo != null && BackMotorIo != "")
         {
             IOMgr.GetInstace().WriteIoBit(BackMotorIo, false);
         }
         if (ForwardMotorIo != null && ForwardMotorIo != "")
         {
             IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, false);
         }
     }
     else
     {
         if (ForwardMotorIo != null && ForwardMotorIo != "")
         {
             IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, false);
         }
         if (IOMotionDir != null && IOMotionDir != "")
         {
             IOMgr.GetInstace().WriteIoBit(IOMotionDir, false);
         }
     }
 }
Ejemplo n.º 7
0
 public static void CloseHardWork()
 {
     CameraMgr.GetInstance().Close();
     TcpMgr.GetInstance().CloseAllEth();
     MotionMgr.GetInstace().Close();
     IOMgr.GetInstace().Close();
 }
 public void CheckBuzzerPlaneAndUp(bool bManual = false)
 {
     if (IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器"))
     {
         Task task0 = new Task(() =>
         {
             ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", false);
             Info("装料步进运动");
             int pos = MotionMgr.GetInstace().GetAxisPos(AxisZ);
             pos     = pos + (int)(ParamSetMgr.GetInstance().GetDoubleParam("装料步长") * nResolutionZ);
             MoveSigleAxisPosWaitInpos(AxisZ, pos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, bManual ? null : this);
             ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true);
         });
         task0.Start();
     }
     else
     {
         Task task = new Task(() =>
         {
             Info("回到原始位置");
             double pos = GetStationPointDic()["装料原始位"].pointZ;
             MoveSigleAxisPosWaitInpos(AxisZ, pos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, this);
             //AlarmMgr.GetIntance().WarnWithDlg("右剥料工站 装料平台无料,请添加蜂鸣片", bManual ? null : this, CommonDlg.DlgWaranType.WaranOK);
             AlarmMgr.GetIntance().WarnWithDlg("右剥料工站 装料平台无料,请添加蜂鸣片,添加完成点击OK", this, CommonDlg.DlgWaranType.WaranOK);
             FindBuzzer(bManual);
             ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true);
         });
         task.Start();
         task.Wait();
     }
 }
Ejemplo n.º 9
0
 private APP()
 {
     MotionMgr      = MotionMgr.GetInstace();
     IOMgr          = IOMgr.GetInstace();
     AlarmMgr       = AlarmMgr.GetIntance();
     ConfigToolMgr  = ConfigToolMgr.GetInstance();
     StationMgr     = StationMgr.GetInstance();
     ParamSetMgr    = ParamSetMgr.GetInstance();
     ComMgr         = ComMgr.GetInstance();
     TcpMgr         = TcpMgr.GetInstance();
     SocketSeverMgr = SocketSeverMgr.GetInstace();
 }
Ejemplo n.º 10
0
 public void Parse()
 {
     if (strIoName != null && strIoName != "")
     {
         if (IOMgr.GetInstace().GetOutputDic().ContainsKey(strIoName))
         {
             nCardIndex = IOMgr.GetInstace().GetOutputDic()[strIoName]._CardIndex;
             nAxisNo    = IOMgr.GetInstace().GetOutputDic()[strIoName]._AxisIndex;
             nIoIndex   = IOMgr.GetInstace().GetOutputDic()[strIoName]._IoIndex;
         }
     }
 }
Ejemplo n.º 11
0
        private void button_start_Click(object sender, EventArgs e)
        {
            UserTest.RunLog.Write($"【点击启动】", LogType.Info, PathHelper.LogPathManual);
            //ProcessSysIo("启动", true);
            if (GlobalVariable.g_StationState == StationState.StationStateStop)
            {
                if (!IsSafeDoorAndGrating())
                {
                    return;
                }

                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("绿灯"))
                {
                    IOMgr.GetInstace().WriteIoBit("绿灯", false);
                }
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯"))
                {
                    IOMgr.GetInstace().WriteIoBit("红灯", false);
                }
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("黄灯"))
                {
                    IOMgr.GetInstace().WriteIoBit("黄灯", true);
                }
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣"))
                {
                    IOMgr.GetInstace().WriteIoBit("蜂鸣", false);
                }
                StationMgr.GetInstance().Run();
                // sys.g_StationState = StationState.StationStateRun;
            }
            else if (GlobalVariable.g_StationState == StationState.StationStateRun)
            {
                // sys.g_StationState = StationState.StationStatePause;
                //暂停
                StationMgr.GetInstance().Pause();
            }
            else if (GlobalVariable.g_StationState == StationState.StationStatePause)
            {
                if (!IsSafeDoorAndGrating())
                {
                    return;
                }
                IOMgr.GetInstace().WriteIoBit("绿灯", false);
                IOMgr.GetInstace().WriteIoBit("红灯", false);
                IOMgr.GetInstace().WriteIoBit("黄灯", true);
                IOMgr.GetInstace().WriteIoBit("蜂鸣", false);
                StationMgr.GetInstance().Resume();
            }
            else if (GlobalVariable.g_StationState == StationState.StationStateEmg)
            {
                MessageBox.Show("发生错误,请先复位", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
            }
        }
Ejemplo n.º 12
0
        private void button_start_Click(object sender, EventArgs e)
        {
            // ProcessSysIo("启动", true);
            if (GlobalVariable.g_StationState == StationState.StationStateStop)
            {
                if (!IsSafeDoorAndGrating())
                {
                    return;
                }

                ParamSetMgr.GetInstance().SetBoolParam("启动清料", false);
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("绿灯"))
                {
                    IOMgr.GetInstace().WriteIoBit("绿灯", false);
                }
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯"))
                {
                    IOMgr.GetInstace().WriteIoBit("红灯", false);
                }
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("黄灯"))
                {
                    IOMgr.GetInstace().WriteIoBit("黄灯", true);
                }
                if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣"))
                {
                    IOMgr.GetInstace().WriteIoBit("蜂鸣", false);
                }
                StationMgr.GetInstance().Run();
                // sys.g_StationState = StationState.StationStateRun;
            }
            else if (GlobalVariable.g_StationState == StationState.StationStateRun)
            {
                // sys.g_StationState = StationState.StationStatePause;
                //暂停
                StationMgr.GetInstance().Pause();
            }
            else if (GlobalVariable.g_StationState == StationState.StationStatePause)
            {
                if (!IsSafeDoorAndGrating())
                {
                    return;
                }
                IOMgr.GetInstace().WriteIoBit("绿灯", false);
                IOMgr.GetInstace().WriteIoBit("红灯", false);
                IOMgr.GetInstace().WriteIoBit("黄灯", true);
                IOMgr.GetInstace().WriteIoBit("蜂鸣", false);
                StationMgr.GetInstance().Resume();
            }
            else if (GlobalVariable.g_StationState == StationState.StationStateEmg)
            {
                MessageBox.Show("发生错误,请先复位", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 13
0
        public bool IsSafeWhenURun(string SoketName)
        {
            string Soket = SoketName;

            if (IOMgr.GetInstace().ReadIoInBit($"{Soket}治具盖上检测"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 初始化Epson 4轴机械手
 /// </summary>
 public static void InitEpson4Robot()
 {
     if (IsHaveEpson == false)
     {
         return;
     }
     Task.Run(() =>
     {
         IOMgr.GetInstace().WriteIoBit("机器人程序启动", true);
         Thread.Sleep(10000);
         ScaraRobot.GetInstance().Init(out string msg);
     });
 }
Ejemplo n.º 15
0
 public static void InitHandWareWithUI()
 {
     // IOMgr.GetInstace().WriteIoBit("点胶机", false);
     IOMgr.GetInstace().WriteIoBit("相机光源", false);
     IOMgr.GetInstace().WriteIoBit("平行光管升降气缸", false);
     IOMgr.GetInstace().WriteIoBit("OK指示绿灯", false);
     IOMgr.GetInstace().WriteIoBit("NG指示红灯", false);
     IOMgr.GetInstace().WriteIoBit("蜂鸣", false);
     IOMgr.GetInstace().WriteIoBit("红灯", false);
     IOMgr.GetInstace().WriteIoBit("黄灯", false);
     IOMgr.GetInstace().WriteIoBit("绿灯", false);
     IOMgr.GetInstace().WriteIoBit("黄灯", true);
     IOMgr.GetInstace().WriteIoBit("UV固化", false);
 }
Ejemplo n.º 16
0
 private void OnVisibleChanged(object sender, EventArgs e)
 {
     if (Visible == true)
     {
         UpDataAllIo();
         IOMgr.GetInstace().m_eventIoInputChanage  += ChangedIoInState;
         IOMgr.GetInstace().m_eventIoOutputChanage += ChangedIoOutState;
     }
     else
     {
         IOMgr.GetInstace().m_eventIoInputChanage  -= ChangedIoInState;
         IOMgr.GetInstace().m_eventIoOutputChanage -= ChangedIoOutState;
     }
 }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        public void PlaceToSocket(int index, bool bmanual = false)
        {
            WaranResult waranResult;
            string      name = index == 1 ? "A" : "B";
            string      strCloseSocketIoControlName = $"{name}Lens升降气缸";

retry_up:
            IOMgr.GetInstace().WriteIoBit(strCloseSocketIoControlName, true);
            Thread.Sleep(20);
            waranResult = CheckIobyName($"{name}Lens上升到位", true, $"手动取料时,{name}#Lens气缸上升失败 ", bmanual);
            if (waranResult == WaranResult.Retry)
            {
                goto retry_up;
            }
        }
Ejemplo n.º 19
0
 protected override bool InitStation()
 {
     ParamSetMgr.GetInstance().SetBoolParam("点胶工站初始化完成", false);
     //IOMgr.GetInstace().WriteIoBit("点胶机", false);
     IOMgr.GetInstace().WriteIoBit("相机光源", false);
     TableData.GetInstance().ResetStartCmd("A_UnLoadLoad");
     TableData.GetInstance().ResetStartCmd("B_UnLoadLoad");
     ClearAllStep();
     PushMultStep((int)StationStep.Step_Init);
     //  x = dispCalibParam.pointDispenseCalibs.Find(t => t.strPointName == "吐胶点").MachinePoint.x;
     //  y = dispCalibParam.pointDispenseCalibs.Find(t => t.strPointName == "吐胶点").MachinePoint.y;
     //  z = dispCalibParam.pointDispenseCalibs.Find(t => t.strPointName == "吐胶点").MachinePoint.z;
     Info("点胶站加载完成");
     return(true);
 }
Ejemplo n.º 20
0
        public bool IsLoadOK(string SoketName, bool bManual)
        {
            string Soket = SoketName;

            if (
                IOMgr.GetInstace().ReadIoInBit($"{Soket}治具盖上检测") &&
                IOMgr.GetInstace().ReadIoInBit($"{Soket}治具LENS检测")
                )
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 21
0
 /// <summary>
 /// 报警提示后 处理
 /// </summary>
 public static void AlarmAfterTips()
 {
     try
     {
         if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣"))
         {
             IOMgr.GetInstace().WriteIoBit("蜂鸣", false);
         }
         if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯"))
         {
             IOMgr.GetInstace().WriteIoBit("红灯", true);
         }
     }
     catch (Exception E)
     { }
 }
Ejemplo n.º 22
0
        public void UpDataAllIo()
        {
            Dictionary <string, IOMgr.IoDefine> dicInput = IOMgr.GetInstace().GetInputDic();
            int indexIn = 0;

            foreach (var tem in dicInput)
            {
                m_labelControl_IoInput[indexIn++].State = IOMgr.GetInstace().ReadIoInBit(tem.Key);
            }

            Dictionary <string, IOMgr.IoDefine> dicOutput = IOMgr.GetInstace().GetOutputDic();
            int indexOut = 0;

            foreach (var tem in dicOutput)
            {
                m_labelControl_IoOutput[indexOut++].State = IOMgr.GetInstace().ReadIoOutBit(tem.Key);
            }
        }
Ejemplo n.º 23
0
 public static void CloseHardWork()
 {
     //for (int i = 0; i < 6; i++)
     //    LightControl.GetInstance().CloseLight(i);
     ResetIO();
     AlarmMgr.GetIntance().StopAlarmBeet();
     CameraMgr.GetInstance().Close();
     TcpMgr.GetInstance().CloseAllEth();
     MotionMgr.GetInstace().Close();
     IOMgr.GetInstace().Close();
     if (ParamSetMgr.GetInstance().GetBoolParam("是否选择程控电源"))
     {
         OtherDevices.ckPower.SetVoltage(1, 0);
         OtherDevices.ckPower.SetVoltage(2, 0);
     }
     //  LightControl.GetInstance().Close();
     //  Weighing.GetInstance().Close();
 }
Ejemplo n.º 24
0
        public bool IsLoadOK(string SoketName, bool bManual)
        {
            string Soket = SoketName;

            if (
                IOMgr.GetInstace().ReadIoInBit($"{Soket}治具夹紧检测") &&
                (
                    sys.g_AppMode == AppMode.Run && IOMgr.GetInstace().ReadIoInBit($"{Soket}治具真空检测") ||
                    sys.g_AppMode == AppMode.AirRun) &&
                IOMgr.GetInstace().ReadIoInBit($"{Soket}治具LENS检测")
                )
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool CheckLineIO()
        {
            bool b = true;

            b = b & IOMgr.GetInstace().ReadIoInBit("上料位开SOCKET气缸原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("上料位夹紧SOCKET气缸原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("上料位电机升降气缸原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("下料位开SOCKET气缸原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("保压上下气缸原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("左蜂鸣器Z轴气缸1原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("左蜂鸣器Z轴气缸2原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("左蜂鸣器Z轴气缸3原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("左蜂鸣器Z轴气缸4原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("右蜂鸣器Z轴气缸1原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("右蜂鸣器Z轴气缸2原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("右蜂鸣器Z轴气缸3原位");
            b = b & IOMgr.GetInstace().ReadIoInBit("右蜂鸣器Z轴气缸4原位");
            return(b);
        }
Ejemplo n.º 26
0
        public static bool IsSafeWhenTableAxisMoveHandler(int nAxisNo, double currentpos, double dsstpos, MoveType moveType)
        {
            StationAA   stationAA      = (StationAA)StationMgr.GetInstance().GetStation("AA站");
            StationDisp stationDisp    = (StationDisp)StationMgr.GetInstance().GetStation("点胶站");
            double      SafeHeightAA   = stationAA.GetStationPointDic()["安全位置"].pointZ;
            double      SafeHeightDisp = stationDisp.GetStationPointDic()["安全位置"].pointZ;

            //  double SafeHeightDisp = stationDisp.GetStationPointDic()["安全位置"].pointZ;
            if (MotionMgr.GetInstace().GetAxisName(nAxisNo) == "U")
            {
                if (MotionMgr.GetInstace().GetHomeFinishFlag(stationAA.AxisZ) != AxisHomeFinishFlag.Homed || MotionMgr.GetInstace().GetAxisPos(stationAA.AxisZ) < SafeHeightAA - 0.5)
                {
                    if (GlobalVariable.g_StationState != StationState.StationStateRun)
                    {
                        MessageBox.Show("转盘运动前,检查AA站Z轴没有回原点或者低于安全高度", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    return(false);
                }

                if (MotionMgr.GetInstace().GetHomeFinishFlag(stationDisp.AxisZ) != AxisHomeFinishFlag.Homed || MotionMgr.GetInstace().GetAxisPos(stationDisp.AxisZ) < SafeHeightDisp - 1)
                {
                    if (GlobalVariable.g_StationState != StationState.StationStateRun)
                    {
                        MessageBox.Show("转盘运动前,检查点胶站Z轴没有回原点或者低于吐胶点高度", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    _logger.Error("转盘运动前,检查点胶站Z轴没有回原点或者低于吐胶点高度");
                    return(false);
                }

                if (ParamSetMgr.GetInstance().GetBoolParam("是否侧向UV") &&
                    (!IOMgr.GetInstace().ReadIoInBit("左侧UV原位") || !IOMgr.GetInstace().ReadIoInBit("左侧UV原位")))
                {
                    if (GlobalVariable.g_StationState != StationState.StationStateRun)
                    {
                        MessageBox.Show("转盘运动前,左右UV是否在原位", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    _logger.Error("转盘运动前,左右UV是否在原位");
                    return(false);
                }
            }
            return(true);
        }
        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));
        }
Ejemplo n.º 28
0
        public StationStep StepInitRun(bool bmanual = false)
        {
            StationStep step = StationStep.Step_Stop;

            // Form_Auto.ShowEventOnAutoScreen("回零", null);
            ParamSetMgr.GetInstance().SetBoolParam("点胶工站初始化完成", false);
            ParamSetMgr.GetInstance().SetBoolParam("重新上料", false);
            // IOMgr.GetInstace().WriteIoBit("点胶机", false);
            IOMgr.GetInstace().WriteIoBit("相机光源", false);
            IOMgr.GetInstace().WriteIoBit($"ALens升降气缸", true);
            IOMgr.GetInstace().WriteIoBit($"BLens升降气缸", true);
            if (!GoSanpHome(bmanual))
            {
                Err("点胶站 回零失败");
                throw new Exception("点胶轴回零失败!");
            }
            GoSanpReadySafe(bmanual);
            ParamSetMgr.GetInstance().SetBoolParam("点胶工站初始化完成", true);
            step = StationStep.Step_CheckIpos;
            return(step);
        }
Ejemplo n.º 29
0
        public void Load(string SoketName, bool bManual)
        {
            string      Soket = SoketName;
            WaranResult waranResult;

retry_close_checkVac:
            IOMgr.GetInstace().WriteIoBit($"{Soket}真空吸", true);
            waranResult = stationAAT.CheckIobyName($"{Soket}治具真空检测", true, $"{Soket}治具真空检测 失败,请检查 产品是否正常放置,气压", bManual);
            if (waranResult == WaranResult.Retry)
            {
                goto retry_close_checkVac;
            }
retry_close_cliyder:
            IOMgr.GetInstace().WriteIoBit($"{Soket}工位夹紧", true);
            waranResult = stationAAT.CheckIobyName($"{Soket}治具夹紧检测", true, $"{Soket}治具夹紧检测 失败,请检查气缸及感应器", bManual);
            if (waranResult == WaranResult.Retry)
            {
                goto retry_close_cliyder;
            }

            return;
        }
Ejemplo n.º 30
0
 public bool GoSanpHome(bool bmanual = false)
 {
     IOMgr.GetInstace().WriteIoBit($"相机光源", true);
     Info("点胶开始回零");
     ParamSetMgr.GetInstance().SetBoolParam("点胶回零完成", false);
     MotionMgr.GetInstace().ServoOn((short)AxisZ);
     MotionMgr.GetInstace().ServoOn((short)AxisX);
     MotionMgr.GetInstace().ServoOn((short)AxisY);
     if (bmanual || MotionMgr.GetInstace().GetHomeFinishFlag(AxisZ) != AxisHomeFinishFlag.Homed)
     {
         HomeSigleAxisPosWaitInpos(AxisZ, this, 120000, bmanual);
     }
     if (bmanual || MotionMgr.GetInstace().GetHomeFinishFlag(AxisX) != AxisHomeFinishFlag.Homed)
     {
         HomeSigleAxisPosWaitInpos(AxisX, this, 120000, bmanual);
     }
     if (bmanual || MotionMgr.GetInstace().GetHomeFinishFlag(AxisY) != AxisHomeFinishFlag.Homed)
     {
         HomeSigleAxisPosWaitInpos(AxisY, this, 120000, bmanual);
     }
     ParamSetMgr.GetInstance().SetBoolParam("点胶回零完成", true);
     Info("点胶回零完成");
     return(true);
 }