From 2e04ae084a482d859d9c438dbc782c2b4fe20643 Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 22 Sep 2023 10:11:18 +0900 Subject: [PATCH] =?UTF-8?q?ZTM=E8=BF=90=E5=8A=A8=E5=BA=93=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=9D=E5=A7=8B=E5=8C=96=E7=9A=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.Motion/Ztm/ZtmAxis.cs | 26 ++++++++++++++------------ Rs.Motion/Ztm/ZtmCard.cs | 1 + Rs.Motion/Ztm/ZtmCardManager.cs | 3 +++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Rs.Motion/Ztm/ZtmAxis.cs b/Rs.Motion/Ztm/ZtmAxis.cs index acc7d6b..9ac649a 100644 --- a/Rs.Motion/Ztm/ZtmAxis.cs +++ b/Rs.Motion/Ztm/ZtmAxis.cs @@ -36,81 +36,83 @@ namespace Rs.Motion.GugaoEcat /// public override ErrorCode Init() { + LogHelper.Debug($"axis {Config.AxisName} init"); if (!cardManager.IsInitialized) { + LogHelper.Debug($"axis {Config.AxisName}'s card IsInitialized"); return ErrorCode.CardNotInit; } HomeStatus = EHomeStatus.NotStart; m_apiResult = ZTM.ZT_SetPOTOn(Config.CardMc, (short)Config.AxisId, (short)((Config.EnableEL&0x01))); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetPOTOn ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetPOTOn ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetNOTOn(Config.CardMc, (short)Config.AxisId, (short)((Config.EnableEL>>1)&0x01)); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetNOTOn ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetNOTOn ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetPOTPol(Config.CardMc, (short)Config.AxisId, (short)Config.ElLogic); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetPOTPol ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetPOTPol ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetNOTPol(Config.CardMc, (short)Config.AxisId, (short)Config.ElLogic); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetNOTPol ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetNOTPol ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetAlarmOn(Config.CardMc, (short)Config.AxisId, (short)(Config.EnableAlarm)); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetAlarmOn ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetAlarmOn ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetAlarmPol(Config.CardMc, (short)Config.AxisId, (short)Config.AlarmLogic); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetAlarmPol ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetAlarmPol ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetHomePol(Config.CardMc, (short)Config.AxisId, (short)Config.HomeOrgLogic); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetHomePol ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetHomePol ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetPulseRatio(Config.CardMc, (short)Config.AxisId, 1U, 1U); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetPulseRatio ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetPulseRatio ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetGearRatio(Config.CardMc, (short)Config.AxisId, 1U, 1U); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetGearRatio ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetGearRatio ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetEncoderOn(Config.CardMc, (short)Config.AxisId, (short)(Config.EnableEncoder)); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetEncoderOn ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetEncoderOn ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetPulseMode(Config.CardMc, (short)Config.AxisId, (short)Config.PulseOutMode, 0, 0); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetPulseMode ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetPulseMode ret={m_apiResult}"); return ErrorCode.Fail; } m_apiResult = ZTM.ZT_SetEncoderPol(Config.CardMc, (short)Config.AxisId, Config.PulseOutDir); if (m_apiResult != 0) { - LogHelper.MoveLog($"axis {Config.AxisName} ZT_SetEncoderPol ret={m_apiResult}"); + LogHelper.Debug($"axis {Config.AxisName} ZT_SetEncoderPol ret={m_apiResult}"); return ErrorCode.Fail; } //m_LastErrorCode = ZTM.ZT_SetEncoderIndexPol(m_axis_config.CardMc, m_axis_config.AxisNum, m_axis_config.encoder_config.pulse_outindexdirection); diff --git a/Rs.Motion/Ztm/ZtmCard.cs b/Rs.Motion/Ztm/ZtmCard.cs index 42160fc..79647e7 100644 --- a/Rs.Motion/Ztm/ZtmCard.cs +++ b/Rs.Motion/Ztm/ZtmCard.cs @@ -112,6 +112,7 @@ namespace Rs.Motion.GugaoEcat for(int i=0; i