//连接控制器
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);
连接控制器功能
最新推荐文章于 2021-07-30 20:58:28 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)