Exemple #1
0
        public bool SetInscriptionSegmentPath(List <System.Windows.Media.Media3D.Point3D> pts, double dwellms)
        {
            try
            {
                Axis[]   axes   = { Axis.ACSC_AXIS_0, Axis.ACSC_AXIS_1, Axis.ACSC_AXIS_2, Axis.ACSC_NONE };
                double[] points = { 0, 0, 0 };
                // Create multi-point motion of axis 0 and 1 with default
                // velocity without
                // dwell in the points
                //wait for GO command
                _ACS.MultiPointM(MotionFlags.ACSC_AMF_WAIT, axes, dwellms);
                // Add some points
                for (int index = 0; index < pts.Count; index++)
                {
                    points[0] = pts[index].X;
                    points[1] = pts[index].Y;
                    points[2] = pts[index].Z;
                    _ACS.AddPointM(axes, points);
                }

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("MotorManager exception: " + ex.Message);
            }

            return(false);
        }
Exemple #2
0
 public void MultPoint(int[] axis, List <double> axis1, List <double> axis2)
 {
     ACS.SPiiPlusNET.Axis[] axisGroup = new ACS.SPiiPlusNET.Axis[axis.Length + 1];
     for (int i = 0; i < axis.Length; i++)
     {
         axisGroup[i] = (ACS.SPiiPlusNET.Axis)axis[i];
         if (!IsMotorEnable(axis[i]))
         {
             throw new AcsMotionException("<MoveArc2>", string.Format("{0}轴未上使能,请先上使能", ((AxisIndex)axis[i]).ToString()));
         }
         if (IsMotorMoving(axis[i]))
         {
             throw new AcsMotionException("<MoveArc2>", string.Format("{0}轴还在运动中,请稍后再试", ((AxisIndex)axis[i]).ToString()));
         }
         if (!IsMotorHome(axis[i]))
         {
             throw new AcsMotionException("<MoveArc2>", string.Format("{0}轴还没回过原点,请回原点后再试", ((AxisIndex)axis[i]).ToString()));
         }
     }
     axisGroup[axis.Length] = ACS.SPiiPlusNET.Axis.ACSC_NONE;
     _acs_api.EnableM(axisGroup);
     _acs_api.MultiPointM(MotionFlags.ACSC_AMF_WAIT, axisGroup, 0);
     double[] poit = { 0, 0 };
     for (int i = 0; i < axis1.Count; i++)
     {
         poit[0] = axis1[i];
         poit[1] = axis2[i];
         try
         {
             // _acs_api.ExtAddPointM(axisGroup, poit, 0.1);
             _acs_api.AddPointM(axisGroup, poit);
         }
         catch (Exception e)
         {
             MessageBox.Show($"第{i}点:" + e.Message);
             _acs_api.DisableM(axisGroup);
             goto Flag;
         }
     }
     _acs_api.EndSequenceM(axisGroup);
     _acs_api.GoM(axisGroup);
     Flag :;
 }