|
|
|
@ -101,6 +101,13 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
diConfig.filterTime = 3;
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_SetDiConfig((short)Config.CardId, mc_pulse.MC_LIMIT_NEGATIVE, (short)Config.AxisId, ref diConfig);
|
|
|
|
|
}
|
|
|
|
|
if (Config.EnableInp == 1)
|
|
|
|
|
{
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_GetDiConfig((short)Config.CardId, mc_pulse.MC_ARRIVE, (short)Config.AxisId, out diConfig);
|
|
|
|
|
diConfig.active = 1;
|
|
|
|
|
diConfig.reverse = (short)Config.InpLogic;
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_SetDiConfig((short)Config.CardId, mc_pulse.MC_ARRIVE, (short)Config.AxisId, ref diConfig);
|
|
|
|
|
}
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_GetDiConfig((short)Config.CardId, mc_pulse.MC_HOME, (short)Config.AxisId, out diConfig);
|
|
|
|
|
diConfig.active = 1;
|
|
|
|
|
diConfig.reverse = (short)Config.HomeOrgLogic;
|
|
|
|
@ -933,18 +940,19 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.Ok;
|
|
|
|
|
}
|
|
|
|
|
#region 禁用到位信号判断
|
|
|
|
|
bool bINP = false;
|
|
|
|
|
err = GetInpStatus(out bINP);
|
|
|
|
|
if (err > ErrorCode.Ok)
|
|
|
|
|
if(Config.EnableInp==1)
|
|
|
|
|
{
|
|
|
|
|
return err;
|
|
|
|
|
}
|
|
|
|
|
if (!bINP)
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.Ok;
|
|
|
|
|
bool bINP = false;
|
|
|
|
|
err = GetInpStatus(out bINP);
|
|
|
|
|
if (err > ErrorCode.Ok)
|
|
|
|
|
{
|
|
|
|
|
return err;
|
|
|
|
|
}
|
|
|
|
|
if (!bINP)
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.Ok;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
double dfCurrentTorlance = 0.0;
|
|
|
|
|
double dfTorlance = Math.Abs(Config.Tolerance);
|
|
|
|
|
err = GetTolerance(out dfCurrentTorlance);
|
|
|
|
@ -1224,12 +1232,14 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.CardNotInit;
|
|
|
|
|
}
|
|
|
|
|
apiResult = mc_pulse.GT_GetSts((short)Config.CardId, (short)Config.AxisId, out int pSts, 1, out uint pClock);
|
|
|
|
|
//apiResult = mc_pulse.GT_GetSts((short)Config.CardId, (short)Config.AxisId, out int pSts, 1, out uint pClock);
|
|
|
|
|
apiResult = mc_pulse.GT_GetDi((short)Config.CardId, mc_pulse.MC_ARRIVE, out int pvalue);
|
|
|
|
|
if (apiResult != 0)
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.Fail;
|
|
|
|
|
}
|
|
|
|
|
bIsOn = ((pSts >> 11) & 0x01) == 1;
|
|
|
|
|
//bIsOn = ((pSts >> 11) & 0x01) == 1;
|
|
|
|
|
bIsOn = ((pvalue >> (short)Config.AxisId-1) & 0x01) == 1;
|
|
|
|
|
return ErrorCode.Ok;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|