diff --git a/Rs.Motion/Base/IAxis.cs b/Rs.Motion/Base/IAxis.cs index bf2791e..ac568bf 100644 --- a/Rs.Motion/Base/IAxis.cs +++ b/Rs.Motion/Base/IAxis.cs @@ -165,6 +165,13 @@ namespace Rs.Motion.Base return ErrorCode.Ok; } + public virtual ErrorCode CompareStatus(out short _pStatus, out int _pCount) + { + _pStatus = 0; + _pCount = 0; + return ErrorCode.Ok; + } + public virtual ErrorCode ComparePulse(ushort channel) { return ErrorCode.Ok; diff --git a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs index f76d5a8..066feb4 100644 --- a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs +++ b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs @@ -1218,46 +1218,37 @@ namespace Rs.Motion.GugaoPulse { return ErrorCode.Ok; } - //if (!m_bIsInitialized) - //{ - // return ErrorCode.AXIS_NOT_INIT; - //} - //ErrorCode err = GetEmgStatus(out bool bEmg); - //if (err > ErrorCode.OK) - //{ - // return err; - //} - //if (bEmg) - //{ - // return ErrorCode.EMERGENCY; - //} - //err = GetAlarmStatus(out bool bAlarm); - //if (err > ErrorCode.OK) - //{ - // return err; - //} - //if (bAlarm) - //{ - // return ErrorCode.ALARM; - //} - //err = IsEnable(out bool bEnable); - //if (err > ErrorCode.OK) - //{ - // return err; - //} - //if (!bEnable) - //{ - // return ErrorCode.SERVO_OFF; - //} - //err = IsStop(out bool bStop); - //if (err > ErrorCode.OK) - //{ - // return err; - //} - //if (!bStop) - //{ - // return ErrorCode.NOT_STOP; - //} + if (!cardManager.IsInitialized) + { + return ErrorCode.CardNotInit; + } + ErrorCode err = GetAlarmStatus(out bool bAlarm); + if (err > ErrorCode.Ok) + { + return err; + } + if (bAlarm) + { + return ErrorCode.Alarm; + } + err = IsEnable(out bool bEnable); + if (err > ErrorCode.Ok) + { + return err; + } + if (!bEnable) + { + return ErrorCode.ServoOff; + } + err = IsStop(out bool bStop); + if (err > ErrorCode.Ok) + { + return err; + } + if (!bStop) + { + return ErrorCode.Moving; + } Thread t = t = new Thread(new ParameterizedThreadStart(DefaultHome)); HomeStatus = EHomeStatus.Start; t.Name = Config.AxisName + " homing thread"; @@ -1612,6 +1603,19 @@ namespace Rs.Motion.GugaoPulse { return ErrorCode.Fail; } + + return ErrorCode.Ok; + } + + public override ErrorCode CompareStatus(out short _pStatus,out int _pCount) + { + _pStatus = 0; + _pCount = 0; + apiResult = mc_pulse.GT_CompareStatus((short)Config.CardId, out _pStatus, out _pCount); + if(apiResult!= 0) + { + return ErrorCode.Fail; + } return ErrorCode.Ok; }