Beispiel #1
0
        public int setMode(AX12Mode modeAX)
        {
            byte len, error = 1;
            byte outID;

            m_mode = modeAX;
            if (m_mode == AX12Mode.joint)
            {
                int    CW        = 0;
                int    CCW       = 1023;
                byte[] limitsCW  = { 0x06, (byte)CW, (byte)(CW >> 8) };
                byte[] limitsCCW = { 0x08, (byte)CCW, (byte)(CCW >> 8) };
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCW);
                getReponse(out outID, out len, out error, null);
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCCW);
                getReponse(out outID, out len, out error, null);
            }

            else if (m_mode == AX12Mode.wheel)
            {
                int    CW        = 0;
                int    CCW       = 0;
                byte[] limitsCW  = { 0x06, (byte)CW, (byte)(CW >> 8) };
                byte[] limitsCCW = { 0x08, (byte)CCW, (byte)(CCW >> 8) };
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCW);
                getReponse(out outID, out len, out error, null);
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCCW);
                getReponse(out outID, out len, out error, null);
            }
            return((int)error);
        }
Beispiel #2
0
        public int setMode(AX12Mode modeAX)
        {
            byte len, error = 1;

            m_mode = modeAX;
            if (m_mode == AX12Mode.joint)
            {
                int    CW        = 0;
                int    CCW       = 1023;
                byte[] limitsCW  = { (byte)Address.AX_CW_ANGLE_LIMIT_LOW, (byte)CW, (byte)(CW >> 8) };
                byte[] limitsCCW = { (byte)Address.AX_CCW_ANGLE_LIMIT_LOW, (byte)CCW, (byte)(CCW >> 8) };
                sendCommand(Instruction.AX_WRITE_DATA, limitsCW);
                getReponse(out len, out error, null);
                sendCommand(Instruction.AX_WRITE_DATA, limitsCCW);
                getReponse(out len, out error, null);
            }

            else if (m_mode == AX12Mode.wheel)
            {
                int    CW        = 0;
                int    CCW       = 0;
                byte[] limitsCW  = { (byte)Address.AX_CW_ANGLE_LIMIT_LOW, (byte)CW, (byte)(CW >> 8) };
                byte[] limitsCCW = { (byte)Address.AX_CCW_ANGLE_LIMIT_LOW, (byte)CCW, (byte)(CCW >> 8) };
                sendCommand(Instruction.AX_WRITE_DATA, limitsCW);
                getReponse(out len, out error, null);
                sendCommand(Instruction.AX_WRITE_DATA, limitsCCW);
                getReponse(out len, out error, null);
            }
            return((int)error);
        }
Beispiel #3
0
        public int setMode(AX12Mode modeAX)
        {
            m_mode = modeAX;
            if (m_mode == AX12Mode.joint)
            {
                int    CW        = 0;
                int    CCW       = 1023;
                byte[] limitsCW  = { 0x06, (byte)CW, (byte)(CW >> 8) };
                byte[] limitsCCW = { 0x08, (byte)CCW, (byte)(CCW >> 8) };
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCW);
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCCW);
            }

            else if (m_mode == AX12Mode.wheel)
            {
                int    CW        = 0;
                int    CCW       = 0;
                byte[] limitsCW  = { 0x06, (byte)CW, (byte)(CW >> 8) };
                byte[] limitsCCW = { 0x08, (byte)CCW, (byte)(CCW >> 8) };
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCW);
                sendCommand(m_ID, Instruction.AX_WRITE_DATA, limitsCCW);
            }
            return(-1);
        }