|
|
@ -231,7 +231,7 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
/// 停止运动
|
|
|
|
/// 停止运动
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public override ErrorCode Stop()
|
|
|
|
public override ErrorCode Stop(bool smoothStop=true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!cardManager.IsInitialized)
|
|
|
|
if (!cardManager.IsInitialized)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -239,7 +239,15 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//int axes = 1 << m_axis_config.AxisId;
|
|
|
|
//int axes = 1 << m_axis_config.AxisId;
|
|
|
|
//int option = 1 << m_axis_config.AxisId;
|
|
|
|
//int option = 1 << m_axis_config.AxisId;
|
|
|
|
|
|
|
|
if(smoothStop)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
apiResult = mc_pulse.GT_Stop((short)Config.CardId, 1 << Config.AxisId - 1, 0 << Config.AxisId - 1);//option 对应位1表示紧急停止 0 为平滑停止
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
apiResult = mc_pulse.GT_Stop((short)Config.CardId, 1 << Config.AxisId - 1, 1 << Config.AxisId - 1);//option 对应位1表示紧急停止 0 为平滑停止
|
|
|
|
apiResult = mc_pulse.GT_Stop((short)Config.CardId, 1 << Config.AxisId - 1, 1 << Config.AxisId - 1);//option 对应位1表示紧急停止 0 为平滑停止
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (apiResult != 0)
|
|
|
|
if (apiResult != 0)
|
|
|
|
return ErrorCode.Fail;
|
|
|
|
return ErrorCode.Fail;
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -376,6 +384,12 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
trapPrm.acc = fAcc;
|
|
|
|
trapPrm.acc = fAcc;
|
|
|
|
trapPrm.dec = fDec;
|
|
|
|
trapPrm.dec = fDec;
|
|
|
|
trapPrm.velStart = fStart;
|
|
|
|
trapPrm.velStart = fStart;
|
|
|
|
|
|
|
|
short smoothtime = (short)(Config.STime * 1000);
|
|
|
|
|
|
|
|
if(smoothtime>50)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
smoothtime=50;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
trapPrm.smoothTime = smoothtime;
|
|
|
|
apiResult = mc_pulse.GT_SetTrapPrm((short)Config.CardId, (short)Config.AxisId, ref trapPrm);//设置点位运动参数
|
|
|
|
apiResult = mc_pulse.GT_SetTrapPrm((short)Config.CardId, (short)Config.AxisId, ref trapPrm);//设置点位运动参数
|
|
|
|
if (apiResult != 0)
|
|
|
|
if (apiResult != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|