예제 #1
0
        public void ManHoming(ushort nodeid, ushort home_mode)
        {
            ResetAlarm(nodeid);
            CPCI_DMC.CS_DMC_01_speed_continue(CardNo[0], nodeid, 0, (ushort)1);
            int   speed  = GetPara(nodeid).HomeSpeed;
            int   StrVel = speed / 10;
            Int32 dist   = (int)(GetPara(nodeid).MotorScale *0.005);//pulse

            if (dist < 5)
            {
                dist = 5;
            }
            //if (home_mode ==2)
            //{
            StepMove(nodeid, -10);
            WaitAxisStop(nodeid);
            CPCI_DMC.CS_DMC_01_speed_continue(CardNo[0], nodeid, 0, (ushort)0);
            do
            {
                ResetAlarm(nodeid);
                CPCI_DMC.CS_DMC_01_start_tr_move(CardNo[0], nodeid, 0, dist, StrVel, speed, 0.2, 0.2);
                WaitAxisStop(nodeid);
            } while (NEL(nodeid));
            //}
            //else
            //{
            //     StepMove(nodeid, 10);
            //     WaitAxisStop(nodeid);
            //     CPCI_DMC.CS_DMC_01_speed_continue(CardNo[0], nodeid, 0, (ushort)1);
            //     do
            //     {
            //         ResetAlarm(nodeid);
            //         CPCI_DMC.CS_DMC_01_start_tr_move(CardNo[0], nodeid, 0, -dist, StrVel, speed, 0.2, 0.2);
            //         WaitAxisStop(nodeid);
            //     } while (PEL(nodeid));
            //}
        }