Exemplo n.º 1
0
        public bool Init()
        {
            short nRet;

            if (!MotionNMC2.CModule.OpenDevice(out m_nDevId))
            {
                return(false);
            }

            // DIO 입/출력 개수 정보 가져오기 ========================
            short nMotionType, nIOType, nExtIo, nMDio;

            nRet = NMC2.nmc_GetDeviceInfo(m_nDevId, out nMotionType, out nIOType, out nExtIo, out nMDio);
            //nIOType은 IO Controller 사용시.
            //switch (nIOType)
            //{
            //    case  1: m_iMaxIn = 16; m_iMaxOut = 16; break;
            //    case  2: m_iMaxIn = 32; m_iMaxOut = 32; break;
            //    case  3: m_iMaxIn = 48; m_iMaxOut = 48; break;
            //    case  4: m_iMaxIn = 64; m_iMaxOut = 64; break;
            //    default: m_iMaxIn = 0 ; m_iMaxOut = 0 ; break;
            //}
            //기본 Motion Controller 사용시는 NMDio사용.
            switch (nMDio)
            {
            case  1: m_iMaxIn = 8; m_iMaxOut = 8; break;

            default: m_iMaxIn = 0; m_iMaxOut = 0; break;
            }

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 초기화 함수.
        /// </summary>
        /// <returns>초기화 성공여부</returns>
        public bool Init()
        {
            if (m_bInit == false)
            {
                m_bInit = true;
                //통합 보드 초기화 부분.
                if (!MotionNMC2.CModule.OpenDevice(out m_nDevId))
                {
                    return(false);
                }


                //Motor 개수 정보 가져오기 ========================
                short nRet;
                short nMotionType, nIOType, nExtIo, nMDio;
                nRet        = NMC2.nmc_GetDeviceInfo(m_nDevId, out nMotionType, out nIOType, out nExtIo, out nMDio);
                m_iMaxMotor = nMotionType;
            }

            return(true);
        }