Ejemplo n.º 1
0
 public int RelLine_P(int[] axisList, double[] posList, JFMotionParam mp)
 {
     _CheckAxisEnable(axisList, "RelLine_P");
     if (posList == null || posList.Count() != axisList.Count())
     {
         throw new ArgumentException("RelLine_P(int[] axisList, double[] posList) failed By: posList.Count() != axisList.Count()");
     }
     lock (ml)
     {
         HTM.MOTION_PARA _mp = new HTM.MOTION_PARA()
         {
             vStart  = mp.vs,
             vMax    = mp.vm,
             vEnd    = mp.ve,
             acc     = mp.acc,
             dec     = mp.dec,
             sFactor = mp.curve,
             timeout = double.MaxValue
         };
         int opt = HTM.Line(axisList, axisList.Count(), posList, 1.0, HTM.MotionMode.RS, ref _mp);
         if (opt != 0)
         {
             return((int)ErrorDef.InvokeFailed);
         }
         return((int)ErrorDef.Success);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 已相对方式做直线插补运动
 /// </summary>
 /// <param name="axisList"></param>
 /// <param name="posList"></param>
 /// <returns></returns>
 public int RelLine(int[] axisList, double[] posList)
 {
     _CheckAxisEnable(axisList, "RelLine");
     if (posList == null || posList.Count() != axisList.Count())
     {
         throw new ArgumentException("RelLine(int[] axisList, double[] posList) failed By: posList.Count() != axisList.Count()");
     }
     lock (ml)
     {
         int opt = HTM.Line(axisList, axisList.Count(), posList, 1.0, HTM.MotionMode.RS);
         if (opt != 0)
         {
             return((int)ErrorDef.InvokeFailed);
         }
         return((int)ErrorDef.Success);
     }
 }