Ejemplo n.º 1
0
        private void btGoClick(object sender, EventArgs e)
        {
            //Button Bt = sender as Button;
            //uint uPstnNo = (uint)Bt.Tag;
            if (!ML.MT_GetStop(m_uMotrId))
            {
                ML.MT_Stop(m_uMotrId);
            }

            int  iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint uPstnNo = (uint)iBtnTag;

            bool bRet = true;

            if (Log.ShowMessageModal("Confirm", "Do you want to Part Move?") != DialogResult.Yes)
            {
                return;
            }
            //if (MessageBox.Show(new Form{TopMost = true},"Part를 이동하시겠습니까?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;

            if (CheckSafe != null)
            {
                if (!CheckSafe((mi)m_uMotrId, (pv)uPstnNo))
                {
                    bRet = false;
                }
            }
            //if(m_uMotrId == (int)mi.IDX_X) bRet = SEQ.IDX.CheckSafe((mi)m_uMotrId, uPstnNo);

            if (!bRet)
            {
                return;
            }
            ML.MT_GoAbsRun(m_uMotrId, PM.GetValue(m_uMotrId, uPstnNo), PM.GetValueSpdPer(m_uMotrId, uPstnNo));
        }
Ejemplo n.º 2
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            string sTemp;;

            tmUpdate.Enabled = false;

            lbStat1.ForeColor = ML.MT_GetNLimSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat2.ForeColor = ML.MT_GetHomeSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat3.ForeColor = ML.MT_GetPLimSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat4.ForeColor = ML.MT_GetHomeDone(m_eId) ? Color.Red : Color.Silver;
            lbStat5.ForeColor = ML.MT_GetAlarmSgnl(m_eId) ? Color.Red : Color.Silver;
            lbStat6.ForeColor = ML.MT_GetStop(m_eId) ? Color.Red : Color.Silver;
            lbStat7.ForeColor = ML.MT_GetInPosSgnl(m_eId) ? Color.Red : Color.Silver;
            lbStat8.ForeColor = ML.MT_GetServo(m_eId) ? Color.Red : Color.Silver;

            sTemp         = string.Format("{0:0.0000}", ML.MT_GetCmdPos(m_eId));
            lbCmdPos.Text = sTemp;

            if (!this.Visible)
            {
                tmUpdate.Enabled = false;
                return;
            }
            tmUpdate.Enabled = true;
        }
Ejemplo n.º 3
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            LbStat1.BackColor = ML.MT_GetNLimSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat2.BackColor = ML.MT_GetHomeSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat3.BackColor = ML.MT_GetPLimSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat4.BackColor = ML.MT_GetAlarmSgnl(m_eId) ? Color.Lime : Color.Silver;
            LbStat5.BackColor = ML.MT_GetServo(m_eId) ? Color.Lime : Color.Silver;
            LbStat6.BackColor = ML.MT_GetStop(m_eId) ? Color.Lime : Color.Silver;
            LbStat7.BackColor = ML.MT_GetHomeDone(m_eId) ? Color.Lime : Color.Silver;

            LbCmdPos.Text = ML.MT_GetCmdPos(m_eId).ToString();
            LbEncPos.Text = ML.MT_GetEncPos(m_eId).ToString();

            if (SEQ._bRun)
            {
                btNeg.Enabled = false;
                btPos.Enabled = false;
            }

            else
            {
                btNeg.Enabled = true;
                btPos.Enabled = true;
            }

            if (!this.Visible)
            {
                tmUpdate.Enabled = false;
                return;
            }
            tmUpdate.Enabled = true;
        }
Ejemplo n.º 4
0
        public static bool  InspectMotor()
        {
            //Local Var.
            bool isOk = true;

            for (mi i = 0; i < mi.MAX_MOTR; i++)
            {
                if (ML.MT_GetAlarmSgnl(i))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(i)); isOk = false;
                }
                if (ML.MT_GetHomeDone(i))
                {
                    if (ML.MT_GetNLimSnsr(i))
                    {
                        ML.ER_SetErr(ei.MTR_NegLim, ML.MT_GetName(i)); isOk = false;
                    }
                    if (ML.MT_GetPLimSnsr(i))
                    {
                        ML.ER_SetErr(ei.MTR_PosLim, ML.MT_GetName(i)); isOk = false;
                    }
                }
            }

            //스텝모터 체크
            bool bCheck  = false;
            bool bCheck1 = ML.MT_GetStop(mi.OUT_TRelB);
            bool bCheck2 = ML.MT_GetStop(mi.OUT_TRelT);
            bool bCheck3 = ML.MT_GetStop(mi.OUT_YGuid);

            if (!OM.CmnOptn.bRewindMode)
            {
                if (m_tmMotor1.OnDelay(!bCheck1, 10000))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(mi.OUT_TRelB) + " 과부하 정지"); bCheck = true;
                }
                if (m_tmMotor2.OnDelay(!bCheck2, 10000))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(mi.OUT_TRelT) + " 과부하 정지"); bCheck = true;
                }
                if (m_tmMotor3.OnDelay(!bCheck3, 10000))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(mi.OUT_YGuid) + " 과부하 정지"); bCheck = true;
                }
            }

            if (bCheck)
            {
                ML.MT_Stop(mi.OUT_TRelB);
                ML.MT_Stop(mi.OUT_TRelT);
                ML.MT_Stop(mi.OUT_YGuid);
            }

            //Ok.
            return(isOk);
        }
Ejemplo n.º 5
0
        //Manual Processing.
        public static bool SetManCycle(mc _iNo)
        {
            m_iCrntManNo = m_iManNo;

            if (_iNo < 0)
            {
                Log.ShowMessage("ERROR", "Wrong Manual No"); return(false);
            }
            if (_iNo >= mc.MAX_MANUAL_CYCLE)
            {
                Log.ShowMessage("ERROR", "Wrong Manual No"); return(false);
            }
            if (m_iManNo != mc.NoneCycle)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle"); return(false);
            }
            if (SEQ._bRun && _iNo != mc.LODR_ManLotSupply)
            {
                Log.ShowMessage("ERROR", "Autorunning"); return(false);
            }
            if (_iNo > mc.AllHome && !SEQ.InspectHomeDone())
            {
                return(false);
            }

            //LOL if (!SML.IO.GetX((int)xi.ETC_MainAir)            ) { Log.ShowMessage("ERROR", "Main Air is Not Supply"); return false; }

            //Check Alarm.
            //LOL if (SML.ER.IsErr()) { Init(); return false; } //아 밑에 처리 하는 애 때문에 잠시 이렇게 함.          //test

            //    if(!IO_GetX(xETC_MainPower) ) {FM_MsgOk("ERR","Power On Plz");      return false ;} //test
            //if (!ML.IO.GetX((int)EN_INPUT_ID.xETC_MainAirChk)) { MessageBox.Show("Check Main Air!", "ERROR"); return false; } //test
            //   mcLDR_RHome
            m_bManSetting = true; //SetManCycle함수는 화면 쓰레드. 업데이트 함수에서 다른쓰레드로 들어와서 갱신하기에 플레그 걸어 막아둠.    //   mcIDX_Home
            m_iManNo      = _iNo;

            //   mcLTL_Home
            //   mcRTL_Home

            //ML.ER.SetDisp(true);jinseop

            bool bRet = true;                                                                                                                //   mcSTG_Home

            //   mcULD_Home
            /********************/
            /********************/
            if (m_iManNo == mc.NoneCycle)
            {
                bRet = false;
            }
            else if (m_iManNo == mc.AllHome)
            {
            }
            else if (m_iManNo == mc.LODR_Home)
            {
            }
            else if (m_iManNo == mc.TTBL_Home)
            {
            }
            else if (m_iManNo == mc.VISN_Home)
            {
            }
            else if (m_iManNo == mc.MARK_Home)
            {
            }
            else if (m_iManNo == mc.ULDR_Home)
            {
            }
            else if (m_iManNo == mc.REJM_Home)
            {
            }
            else if (m_iManNo == mc.REJV_Home)
            {
            }

            else if (m_iManNo == mc.LODR_CycleHold)
            {
            }
            else if (m_iManNo == mc.LODR_CyclePush)
            {
            }
            else if (m_iManNo == mc.LODR_CyclePick)
            {
            }
            else if (m_iManNo == mc.LODR_ManLotSupply)
            {
            }


            else if (m_iManNo == mc.TTBL_CycleMove)
            {
            }
            else if (m_iManNo == mc.TTBL_CLAllFwd)
            {
                if (!ML.MT_GetStop(mi.TBLE_TTble))
                {
                    bRet = false;
                }
            }
            else if (m_iManNo == mc.TTBL_CLAllBwd)
            {
                if (!ML.MT_GetStop(mi.TBLE_TTble))
                {
                    bRet = false;
                }
            }

            else if (m_iManNo == mc.VISN_CycleWork)
            {
            }

            else if (m_iManNo == mc.MARK_CycleWork)
            {
            }
            else if (m_iManNo == mc.MARK_CycleManChage)
            {
            }

            else if (m_iManNo == mc.ULDR_CycleMove)
            {
            }
            else if (m_iManNo == mc.ULDR_CycleDlvr)
            {
            }
            else if (m_iManNo == mc.ULDR_CyclePick)
            {
            }
            else if (m_iManNo == mc.ULDR_CyclePlce)
            {
            }
            else if (m_iManNo == mc.ULDR_CyclePaint)
            {
            }

            else if (m_iManNo == mc.RJEM_CycleWork)
            {
            }

            else if (m_iManNo == mc.RJEV_CycleWork)
            {
            }

            if (!bRet)
            {
                Init();
            }

            /********************/
            /* 처리..           */
            /********************/

            if (m_iManNo == mc.NoneCycle)
            {
            }
            else if (m_iManNo == mc.AllHome)
            {
                ML.MT_SetServoAll(true);
                SEQ.LODR.InitHomeStep();
                SEQ.TTBL.InitHomeStep();
                SEQ.VISN.InitHomeStep();
                SEQ.MARK.InitHomeStep();
                SEQ.ULDR.InitHomeStep();
                SEQ.REJM.InitHomeStep();
                SEQ.REJV.InitHomeStep();
            }
            else if (m_iManNo == mc.LODR_Home)
            {
                ML.MT_SetServoAll(true); SEQ.LODR.InitHomeStep();
            }
            else if (m_iManNo == mc.TTBL_Home)
            {
                ML.MT_SetServoAll(true); SEQ.TTBL.InitHomeStep();
            }
            else if (m_iManNo == mc.VISN_Home)
            {
                ML.MT_SetServoAll(true); SEQ.VISN.InitHomeStep();
            }
            else if (m_iManNo == mc.MARK_Home)
            {
                ML.MT_SetServoAll(true); SEQ.MARK.InitHomeStep();
            }
            else if (m_iManNo == mc.ULDR_Home)
            {
                ML.MT_SetServoAll(true); SEQ.ULDR.InitHomeStep();
            }
            else if (m_iManNo == mc.REJM_Home)
            {
                ML.MT_SetServoAll(true); SEQ.REJM.InitHomeStep();
            }
            else if (m_iManNo == mc.REJV_Home)
            {
                ML.MT_SetServoAll(true); SEQ.REJV.InitHomeStep();
            }

            else if (m_iManNo == mc.LODR_CycleHold)
            {
                SEQ.LODR.InitCycleStep();
            }
            else if (m_iManNo == mc.LODR_CyclePush)
            {
                SEQ.LODR.InitCycleStep();
            }
            else if (m_iManNo == mc.LODR_CyclePick)
            {
                SEQ.PLDR.InitCycleStep();
            }
            else if (m_iManNo == mc.LODR_ManLotSupply)
            {
                SEQ.LODR.InitCycleStep();
            }

            else if (m_iManNo == mc.TTBL_CycleMove)
            {
                SEQ.TTBL.InitCycleStep();
            }
            else if (m_iManNo == mc.TTBL_CLAllFwd)
            {
                ML.CL_Move(ci.TBLE_Grpr1FwBw, fb.Fwd);
                ML.CL_Move(ci.TBLE_Grpr2FwBw, fb.Fwd);
                ML.CL_Move(ci.TBLE_Grpr3FwBw, fb.Fwd);
                ML.CL_Move(ci.TBLE_Grpr4FwBw, fb.Fwd);
                ML.CL_Move(ci.TBLE_Grpr5FwBw, fb.Fwd);
                ML.CL_Move(ci.TBLE_Grpr6FwBw, fb.Fwd);
                m_iManNo = mc.NoneCycle;
            }
            else if (m_iManNo == mc.TTBL_CLAllBwd)
            {
                ML.CL_Move(ci.TBLE_Grpr1FwBw, fb.Bwd);
                ML.CL_Move(ci.TBLE_Grpr2FwBw, fb.Bwd);
                ML.CL_Move(ci.TBLE_Grpr3FwBw, fb.Bwd);
                ML.CL_Move(ci.TBLE_Grpr4FwBw, fb.Bwd);
                ML.CL_Move(ci.TBLE_Grpr5FwBw, fb.Bwd);
                ML.CL_Move(ci.TBLE_Grpr6FwBw, fb.Bwd);
                m_iManNo = mc.NoneCycle;
            }

            else if (m_iManNo == mc.VISN_CycleWork)
            {
                SEQ.VISN.InitCycleStep();
            }

            else if (m_iManNo == mc.MARK_CycleWork)
            {
                SEQ.MARK.InitCycleStep();
            }
            else if (m_iManNo == mc.MARK_CycleManChage)
            {
                SEQ.MARK.InitCycleStep();
            }

            else if (m_iManNo == mc.ULDR_CycleMove)
            {
                SEQ.ULDR.InitCycleStep();
            }
            else if (m_iManNo == mc.ULDR_CycleDlvr)
            {
                SEQ.PULD.InitCycleStep();
            }
            else if (m_iManNo == mc.ULDR_CyclePick)
            {
                SEQ.ULDR.InitCycleStep();
            }
            else if (m_iManNo == mc.ULDR_CyclePlce)
            {
                SEQ.ULDR.InitCycleStep();
            }
            else if (m_iManNo == mc.ULDR_CyclePaint)
            {
                SEQ.ULDR.InitCycleStep();
            }

            else if (m_iManNo == mc.RJEM_CycleWork)
            {
                SEQ.REJM.InitCycleStep();
            }

            else if (m_iManNo == mc.RJEV_CycleWork)
            {
                SEQ.REJV.InitCycleStep();
            }

            m_bManSetting = false; //m_bManSetting 중요함 리턴전에 꼭 펄스 시켜야함. 쓰레드가 달라서. ::Update에서 m_iManNo=0이 되므로 주의.
            return(true);
        }