连接控制器功能

  //连接控制器
        public static int wether_link = 0;
        private void link_button_Click(object sender, EventArgs e)
        {

            if (wether_link == 0)
            {
                short res = LTSMC.smc_board_init(CardNum, 2, "192.168.5.11", 115200);//    1:串口连接类型;2: 网口连接类型
                if (res != 0)
                {
                    MessageBox.Show(string.Format("连接控制器失败,错误代码:{0}", res), "错误");
                }
                else
                {
                    wether_link = 1;
                    link_button.Text = "关闭设备";
                    timer1.Start();
                    timer2.Start();
                    //timer3.Start();
                    for (int i = 0; i < 3; i = i + 1)
                    {
                        LTSMC.smc_set_pulse_outmode(CardNum, axis_all[i], 6);
              

你可能感兴趣的:(机器人软件开发与算法,mysql,python,物联网,linux,java)