From 5208f6f255e7ad45b04f6c79594e9795a01fde24 Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Mon, 4 Mar 2024 11:13:56 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E5=99=A8160=E6=8A=A5=E8=AD=A6=E5=8F=AF=E4=BB=A5=E5=9C=A8?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=B8=8A=E6=B8=85=E9=99=A4=202=E3=80=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC=E5=8F=B72.20.24.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.Motion/GugaoPulse/GugaoPulseAxis.cs | 31 ++++++++++++++++++++++++-- Rs.Motion/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs index d321ca6..d99771c 100644 --- a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs +++ b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs @@ -1682,12 +1682,39 @@ namespace Rs.Motion.GugaoPulse public override ErrorCode ClearAlarm() { + mc_pulse_cfg.GT_GetDoConfig((short)Config.CardId, mc_pulse.MC_CLEAR, (short)Config.AxisId, out mc_pulse_cfg.TDoConfig oConfig); + oConfig.reverse = 0; + oConfig.axis = -1; + apiResult = mc_pulse_cfg.GT_SetDoConfig((short)Config.CardId, mc_pulse.MC_CLEAR, (short)Config.AxisId, ref oConfig); + if (apiResult != 0) + { + LogHelper.Debug($"apiResult = mc_pulse_cfg.GT_SetDoConfig({(short)Config.CardId},{mc_pulse.MC_CLEAR}, {(short)Config.AxisId}, ref oConfig);"); + } + apiResult = mc_pulse.GT_SetDoBit((short)Config.CardId, mc_pulse.MC_CLEAR, (short)Config.AxisId, 1); + if (apiResult != 0) + { + LogHelper.Debug($"mc_pulse.GT_SetDoBit({(short)Config.CardId}, {mc_pulse.MC_CLEAR}, {(short)Config.AxisId}, 1);"); + } + Thread.Sleep(3000); + oConfig.axis = (short)Config.AxisId; + oConfig.reverse = 0; + + mc_pulse_cfg.GT_SetDoConfig((short)Config.CardId, mc_pulse.MC_CLEAR, (short)Config.AxisId, ref oConfig); + LogHelper.Debug($" mc_pulse_cfg.GT_SetDoConfig({(short)Config.CardId}, {mc_pulse.MC_CLEAR}, {(short)Config.AxisId}, ref oConfig);"); + LogHelper.Debug($"active={oConfig.active},axis={oConfig.axis},axisitem={oConfig.axisItem},reverse={oConfig.reverse}"); + //apiResult = mc_pulse.GT_SetDoBit((short)Config.CardId, mc_pulse.MC_CLEAR, (short)Config.AxisId, 0); + //if (apiResult != 0) + //{ + // LogHelper.Debug($" mc_pulse.GT_SetDoBit({(short)Config.CardId}, {mc_pulse.MC_CLEAR}, {(short)Config.AxisId}, 1); {apiResult}"); + // return ErrorCode.Fail; + //} apiResult = mc_pulse.GT_ClrSts((short)Config.CardId, (short)Config.AxisId, 1);//清除轴状态 - if(apiResult != 0) + if (apiResult != 0) { + LogHelper.Debug($"GT_ClrSts fail {apiResult}"); return ErrorCode.Fail; } - apiResult = mc_pulse.GT_SetDoBit((short)Config.CardId, mc_pulse.MC_ALARM, (short)Config.AxisId, 0); + return ErrorCode.Ok; } diff --git a/Rs.Motion/Properties/AssemblyInfo.cs b/Rs.Motion/Properties/AssemblyInfo.cs index e5711a2..da95b6b 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.3")] +[assembly: AssemblyVersion("2.20.24.5")] //[assembly: AssemblyFileVersion("1.0.0.0")]