Ejemplo n.º 1
0
        //동기구동, 버그 있는듯. 갠트리로 대신 쓴다.
        //현재 동기구동 상태인지 확인하기 위해 uint로 리턴한다.
        //AXT_RT_SUCCESS 반환하면 동기구동상태
        public bool SetLinkEnable(int _iSlvMotrNo)
        {
            //GantryEnable 실행하고 확인하면 가끔 확인 안될때가 있어서 먼저 확인하고 실행하는 것으로 바꾼다.
            uint   uiHomeMathod = 0;
            double dOffset      = .0;
            double dOfsRange    = .0;
            uint   uiGantryOn   = 0;

            CAXM.AxmGantryGetEnable(Para.iPhysicalNo, ref uiHomeMathod, ref dOffset, ref dOfsRange, ref uiGantryOn);
            if (uiGantryOn != 0)
            {
                return(true);
            }

            uint uiRet = CAXM.AxmGantrySetEnable(Para.iPhysicalNo, _iSlvMotrNo, 0, 0, 999999);

            //System.Threading.Thread.Sleep(100);
            //uint    uiHomeMathod =  0;
            //double  dOffset      = .0;
            //double  dOfsRange    = .0;
            //uint    uiGantryOn   =  0;
            //CAXM.AxmGantryGetEnable(Para.iPhysicalNo, ref uiHomeMathod ,ref dOffset, ref dOfsRange ,ref uiGantryOn);
            //if (uiGantryOn != 0)
            //{
            //    return true;
            //}
            return(false);
        }
Ejemplo n.º 2
0
        //2축 제어 겐트리.
        public void SetGantryEnable()
        {
            uint   uiHomeMathod = 0;
            double dOffset      = .0;
            double dOfsRange    = .0;
            uint   uiGantryOn   = 0;

            CAXM.AxmGantryGetEnable(Para.iPhysicalNo, ref uiHomeMathod, ref dOffset, ref dOfsRange, ref uiGantryOn);

            if (uiGantryOn != 0)
            {
                SetGantryDisable();
            }

            if (Para.bGantryEnable)
            {
                uint uiRet = CAXM.AxmGantrySetEnable(Para.iPhysicalNo,
                                                     Para.iGantrySubAdd,
                                                     (uint)Para.eGantryMathod,
                                                     Para.dGantryOffset * m_dPulsePerUnit,
                                                     Para.dGantryOfsRange * m_dPulsePerUnit);
            }
            //프로그램 켜고 가끔 개별 홈 잡으면 서브축이 서보온이 안된상태일 경우가 있어서 야매로 이렇게 한다.
            //const int iServoOnBit = 0 ;
            //Servo On/Off.
            //iRet = AxmSignalWriteOutputBit(_iSlaveAxis, iServoOnBit, true);
        }
Ejemplo n.º 3
0
        public bool GetLinkMode()
        {
            uint   uiHomeMathod = 0;
            double dOffset      = .0;
            double dOfsRange    = .0;
            uint   uiGantryOn   = 0;

            CAXM.AxmGantryGetEnable(Para.iPhysicalNo, ref uiHomeMathod, ref dOffset, ref dOfsRange, ref uiGantryOn);
            if (uiGantryOn != 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
        public bool GantryGetStatus()
        {
            try
            {
                uint   slaveHomeUse = 0U, isGantryOn = 0U;
                double slaveOffset = 0.0, slaveOffsetRange = 0.0;

                uint res = CAXM.AxmGantryGetEnable(GantryMasterAxis, ref slaveHomeUse, ref slaveOffset, ref slaveOffsetRange, ref isGantryOn);
                if (isGantryOn == 0U)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception E)
            {
                LogFile.LogExceptionErr(E.ToString());
                throw E;
            }
        }