增加移动命令前,电机状态的检查; 关闭窗体,关闭服务
This commit is contained in:
+14
-14
@@ -19,7 +19,7 @@ namespace HexcalMC
|
||||
private const int MaxUiLimitCnt = 8;
|
||||
private const int MaxUiIoCnt = 8;
|
||||
private readonly Api _acs;
|
||||
private readonly int _motionTimeout = 5000; //延时时间
|
||||
private readonly int _motionTimeout = 50000; //延时时间
|
||||
|
||||
|
||||
private readonly Axis[] UseAxis = MainFrom.UseAxis; //获取激活的轴
|
||||
@@ -223,6 +223,8 @@ namespace HexcalMC
|
||||
|
||||
#region 初始化
|
||||
|
||||
|
||||
|
||||
InitMotion();
|
||||
|
||||
#endregion
|
||||
@@ -242,15 +244,7 @@ namespace HexcalMC
|
||||
string strTemp;
|
||||
int i;
|
||||
|
||||
//判断通讯对象是否存在
|
||||
if (_acs == null || !_acs.IsConnected)
|
||||
{
|
||||
DebugDfn.AddLogText("未建立通讯,请在主界面先建立通讯");
|
||||
|
||||
// 在合适的位置调用 MessageBox.Show() 方法
|
||||
MessageBox.Show("未建立通讯,请在主界面先建立通讯", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_mBConnected = _acs.IsConnected;
|
||||
// Get Total number of axes
|
||||
@@ -913,11 +907,15 @@ namespace HexcalMC
|
||||
}
|
||||
|
||||
// Add log to ListBox
|
||||
Invoke((MethodInvoker)delegate
|
||||
if (lstLog.IsHandleCreated)
|
||||
{
|
||||
lstLog.Items.Add(string.Format(" - Axis {0}, Stoppped", axisNo));
|
||||
lstLog.SelectedIndex = lstLog.Items.Count - 1;
|
||||
});
|
||||
Invoke((MethodInvoker)delegate
|
||||
{
|
||||
lstLog.Items.Add(string.Format(" - Axis {0}, Stoppped", axisNo));
|
||||
lstLog.SelectedIndex = lstLog.Items.Count - 1;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnEventProgramEnd_Click(object sender, EventArgs e)
|
||||
@@ -1056,6 +1054,8 @@ namespace HexcalMC
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
//执行运动指令
|
||||
_acs.ToPointM(MotionFlags.ACSC_NONE, UseAxis, pointsArray); //多轴运动到指定位置
|
||||
|
||||
|
||||
Reference in New Issue
Block a user