C#之雷赛控制板卡-单轴绝对运动
·
C#之雷赛控制板卡-单轴绝对运动

/// <summary>
/// 运行
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
// 1.获取参数
// 1.1 选择的轴
ushort axis = Axises[comboBox1.SelectedIndex];
// 1.2 移动的距离
int distance = Convert.ToInt32(tbxMoveLocation.Text.Trim());
// 1.3 设置为相对运动,0为相对运动,1为绝对运动
ushort mode = 1;
// 2.设置运动参数
SetParas();
// 3.运动
if (IsInitFlag) {
short res = LTDMC.dmc_pmove(CardNum,axis, distance,mode);
if (res != 0)
{
MessageBox.Show("运动失败!");
return;
}
}
}
更多推荐

所有评论(0)