Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            byte    commandAddr = (byte)((comboBox1.Text == "X轴") ? 0x00 : 0x01);
            CmdInit ci          = new CmdInit();

            addrc             = ci.GetAxisValueCmd(commandAddr);
            richTextBox1.Text = DataChange.byteToHexStr(addrc);
        }
Esempio n. 2
0
        public void GetAxisValueCmdTest()
        {
            //AA 05 01 A7 00 A3
            CmdInit cf = new CmdInit();

            byte[] ret = cf.GetAxisValueCmd(0x00);
            Assert.AreEqual(ret.Count(), 6);
            Assert.AreEqual(ret[5], 0xA3);
            Assert.AreEqual(ret[0], 0xAA);
            Assert.AreEqual(ret[1], 0x05);
            Assert.AreEqual(ret[2], 0x01);
            Assert.AreEqual(ret[3], 0xA7);
        }