Browse Source

update axis jog

chenkui 1 month ago
parent
commit
86ae0745d1

+ 8 - 3
CyberX8_RT/Devices/AXIS/JetAxisBase.cs

@@ -977,7 +977,7 @@ namespace CyberX8_RT.Devices.AXIS
         public bool JogUpPosition(string cmd, object[] args)
         {
             double jog=(double)args[1];
-            double currentPosition=(double)args[2];
+            double currentPosition=MotionData.MotorPosition;
             if(_jogLimit!=0)
             {
                 if(jog>_jogLimit)
@@ -1002,7 +1002,7 @@ namespace CyberX8_RT.Devices.AXIS
         public bool JogDownPosition(string cmd, object[] args)
         {
             double jog = (double)args[1];
-            double currentPosition = (double)args[2];
+            double currentPosition = MotionData.MotorPosition;
             if (_jogLimit != 0)
             {
                 if (jog > _jogLimit)
@@ -1038,7 +1038,12 @@ namespace CyberX8_RT.Devices.AXIS
                 LOG.WriteLog(eEvent.ERR_AXIS, Module, $"target position {_targetPosition} is less reverse limit");
                 return false;
             }
-            return ProfilePosition(targetPosition, _profileVelocity, _profileAcceleration, _profileDeceleration);
+            bool result= ProfilePosition(targetPosition, _profileVelocity, _profileAcceleration, _profileDeceleration);
+            if (result)
+            {
+                MotionData.TargetPosition = _targetPosition;
+            }
+            return result;
         }
         /// <summary>
         /// 移动至指定位置

+ 1 - 1
Framework/RTEquipmentLibrary/HardwareUnits/Robots/AsyncSocket.cs

@@ -195,7 +195,7 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot
             }
             catch (Exception e)
             {
-                string reason = string.Format("TCP连接发生错误:{0}", e.Message);
+                string reason = string.Format("TCP connect failed:{0}", e.Message);
                 OnErrorHappened(new ErrorEventArgs(reason)); 
                 if (_supportReconnect)
                 {