From 8c3dcd9910a82411ce6670d1df97b5b658b2dbe6 Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Sat, 9 Mar 2024 11:12:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E4=BD=8D=E4=BF=A1=E5=8F=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.Motion/GugaoPulse/GugaoPulseAxis.cs | 34 +++++++++++++++++--------- Rs.Motion/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs index dc3713f..cff1bbb 100644 --- a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs +++ b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs @@ -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; } diff --git a/Rs.Motion/Properties/AssemblyInfo.cs b/Rs.Motion/Properties/AssemblyInfo.cs index 25a93ad..3ddef9b 100644 --- a/Rs.Motion/Properties/AssemblyInfo.cs +++ b/Rs.Motion/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.20.24.7")] +[assembly: AssemblyVersion("2.20.24.8")] //[assembly: AssemblyFileVersion("1.0.0.0")]