Postprocessor development
  • Postprocessor development
v3.0.3
Search Results for

    Show / Hide Table of Contents

    EDMMOVE - EDM movement

    Command caption

    How the command appears in the CLData command list:

    EDMMOVE MODE: RAPID(0) | 2AXIS(1) | TAPER(2) | MULTIPROF(3)| 4AXIS(4),
    SPAN1: CUT(0) | ARC(1), SPAN2: CUT(0) | ARC(1),
    EP1: (X x; Y y; Z z), EP2: (X x; Y y; Z z),
    PC1: (X x; Y y), PC2: (X x; Y y), R1 r1, R2 r2, A a,
    ROLLMODE: OFF(0) | SHARP(1) | CONICAL(2) | CYLINDRICAL(3) |
    FIXED(4),
    ROLLR1 rollr1, ROLLR2 rollr2
    

    EDM movement command is generated by the Wire EDM operations of the CAM system. The command specifies the wire movement coordinates and sets the movement interpolation modes.

    Access from sppx

    Handler: program EDMMove

    Parameter CLD array CLD name Description
    Movement mode CLD[1] CLD.Mode RAPID(0) – Rapid movement, 2AXIS(1) – 2 axis movement, TAPER(2) – 2 axis movement with taper, MULTIPROF(3) – multiprofile movement (arcs and lines), 4AXIS(4) – 4 axis movement (lines only)
    Lower contour element type CLD[2] CLD.Span1 CUT(0) – a line, ARC(1) – an arc
    Upper contour element type CLD[3] CLD.Span2 CUT(0) – a line, ARC(1) – an arc
    Lower contour element endpoint, EP1 CLD[4]
    CLD[5]
    CLD[6]
    CLD.Ep1X
    CLD.Ep1Y
    CLD.Ep1Z
    X, Y and Z coordinates of the lower contour element endpoint
    Upper contour element endpoint, EP2 CLD[7]
    CLD[8]
    CLD[9]
    CLD.Ep2X
    CLD.Ep2Y
    CLD.Ep2Z
    X, Y and Z coordinates of the upper contour element endpoint
    Lower contour arc center point, PC1 CLD[10]
    CLD[11]
    CLD.Pc1X
    CLD.Pc1Y
    X and Y coordinates of the lower contour arc center point, if this element is an arc.
    Upper contour arc center point, PC2 CLD[12]
    CLD[13]
    CLD.Pc2X
    CLD.Pc2Y
    X and Y coordinates of the upper contour arc center point, if this element is an arc.
    Lower contour arc radius, R1 CLD[14] CLD.R1 If the lower contour element is an arc, then the parameter specifies the signed arc radius: R > 0 – the arc is counterclockwise, R < 0 – the arc is clockwise.
    Upper contour arc radius, R2 CLD[15] CLD.R2 If the upper contour element is an arc, then the parameter specifies the signed arc radius: R > 0 – the arc is counterclockwise, R < 0 – the arc is clockwise.
    Taper angle, A CLD[16] CLD.A In the TAPER(2) movement mode the parameter specifies signed taper angle: A > 0 – right taper, A < 0 – left taper.
    Sharp angle rolling mode, ROLLMODE CLD[17] CLD.RollMode This parameter specifies sharp angle roll mode for the 2 axis and taper machining (CornerR function): OFF(0) – the corner rolling is off (R1 = 0, R2 = 0); SHARP(1) – in this mode only the lower contour angles are rolled (R1 = R1, R2 = 0); CONICAL(2) – both lower and upper contour angles are rolled, rounding radiuses are derived from taper angle (R1 = R1, R2 = R1 + Taper offset); CYLINDRICAL(3) – lower and upper contour angles are rounded, rounding radiuses are equal (R1 = R1, R2 = R1); FIXED(4) – lower and upper contour angles are rounded, rounding radiuses are independent (R1 = R1, R2 = R2)
    Lower contour element roll radius, ROLLR1 CLD[18] CLD.RollR1 This parameter specifies the rolling radius of the sharp angle of the lower contour element
    Upper contour element roll radius, ROLLR2 CLD[19] CLD.RollR2 This parameter specifies the rolling radius of the sharp angle of the upper contour element

    Example (from the AgieCharmilles (ROBOFIL)_WireEDM postprocessor):

    program EDMMove
    
      ! Set LCS
      if LCSSet<>1 then begin
        LCSSet = 1
        GCS = 92;        GCS@ = MaxReal
        X1  = XOrigin;   X1@  = MaxReal
        Y1  = YOrigin;   Y1@  = MaxReal
        ITop    = TopLevel;  ITop@    = MaxReal
        JBottom = BaseLevel; JBottom@ = MaxReal
        OutBlock
      end
    
      RollModeChanged = 0
      if (cld.RollMode<>0) and (RollOn<>48) then begin
        GRoll  = 48
        RollOn = 48
        RollModeChanged = 1
        GRoll@ = MaxReal
      end else
      if (cld.RollMode=0) and (RollOn<>49) then begin
        GRoll  = 49
        RollOn = 49
        GRoll@ = MaxReal
      end
    
      ! Insert and break wire commands
      if (cld.Mode<>0) and (WireInserted=0) and (MainProg=1) then begin
        call InsertWire
      end
      if (cld.Mode=0) and (WireInserted=1) and (MainProg=1) then begin
        if (cld.Ep1X<>Fp1X) or (cld.Ep1Y<>Fp1Y) then begin
          call BreakWire
        end
      end
    
      ! Output pass technology number
      if (cld.Mode<>0) and (WireInserted=1) then begin
        If OldSCode<>SCode then begin
          OldSCode  = SCode
          STechCode = SCode
          STechCode@ = MaxReal
          OUTBLOCK
        end
      end
      
      ! Start conical machining mode
      if (Cld.Mode=2) and (TaperMode<>60) then begin
        TaperMode  = 60
        TaperMode@ = MaxReal
        OUTBLOCK
      end
    
      ! Compensation turn on
      if (CompensNeedOut>0) and (GCompens<>40) then begin
        GCompens@ = MaxReal
        CompensNeedOut = 0
      end
    
      ! Motion mode turn on
      if cld.Mode=3 then G2Contour = 51 else ! 2Contour
      if cld.Mode=4 then GUV = 74            ! 4Axis_UV
    
    !  if (G2Contour<>G2Contour@) or (GUV<>GUV@) then begin
    !    OutBlock
    !    GInterp1  = 0;
    !    GInterp1@ = GInterp1;
    !  end
    
      ! Compensation turn off
      if (CompensNeedOut>0) and (GCompens=40) then begin
        GCompens@ = MaxReal
        CompensNeedOut = 0
      end
    
      ! Coordinates output
      X1 = cld.Ep1X
      Y1 = cld.Ep1Y
      OUTG = 0
      case cld.Mode of
        0: begin ! Rapid
          if (Abs(X1-X1@)>Toler) or (Abs(Y1-Y1@)>Toler) then
            GInterp1 = 0 ! Rapid movement
        end
        1, 2, 3, 4: begin ! 2D Axis, Taper, 4D
          if (Abs(X1-X1@)>Toler) or (Abs(Y1-Y1@)>Toler) then begin
            if cld.Span1=1 then begin ! Arc
              if cld.R1>0 then GInterp1 = 3
                          else GInterp1 = 2
              I1 = cld.Pc1X - Fp1X;  I1@ = MaxReal
              J1 = cld.Pc1Y - Fp1Y;  J1@ = MaxReal
            end else begin ! Cut
                GInterp1 = 1
            end
            GInterp1@ = MaxReal
            OUTG = GInterp1
          end
          if cld.Mode=2 then begin      ! Taper
            if cld.A>0 then GTaper = 52
                       else GTaper = 51
            A = abs(cld.A);
          end else
          if cld.Mode=3 then begin ! 4D
            U = cld.Ep2X; U@ = MaxReal
            V = cld.Ep2Y; V@ = MaxReal
            if cld.Span2=1 then begin ! Arc
              if cld.R2>0 then begin
                if (OutG=0) or (OutG<>3) then begin
                  GInterp2 = 3
                end
              end else begin
                if (OutG=0) or (OutG<>2)  then begin
                  GInterp2 = 2
                end
              end
              K = cld.Pc2X - Fp2X;  K@ = MaxReal
              L = cld.Pc2Y - Fp2Y;  L@ = MaxReal
            end else begin ! Cut
              if (Abs(U-U@)>Toler) or (Abs(V-V@)>Toler) then begin
                if (OutG=0) or (OutG<>1) then begin
                  GInterp2 = 1
                  GInterp2@ = MaxReal
                end
              end
            end
          end
          if ((cld.Mode=1) or (cld.Mode=2)) and
             (cld.RollMode>0)
          then begin  ! CornerR
            RollR1 = cld.RollR1;
            if RollModeChanged=1 then begin
              RollR1@ = MaxReal
              RollModeChanged =0
            end
          end
        end
      end
    
      ! Motion mode turn off
      if (cld.Mode<>2) and (GTaper<>50) then begin
        GTaper = 50
        !TaperMode = MaxReal;
      end
      if (cld.Mode<>4) and (GUV<>75) then begin
        U = 0; V = 0
      end
      OutBlock
      if (cld.Mode<>4) and (GUV<>75) then begin
        GUV = 75
        U = MaxReal; U@ = U
        V = MaxReal; V@ = V
      end
      OutBlock
      
      ! Remember current coordinates
      Fp1X = cld.Ep1X
      Fp1Y = cld.Ep1Y
      if cld.Mode<3 then begin ! 2D
        Fp2X = Fp1X
        Fp2Y = Fp1Y
      end else begin           ! 4D
        Fp2X = cld.Ep2X
        Fp2Y = cld.Ep2Y
      end
    end
    

    Access from .NET

    Handlers:

    public override void OnBeforeMovement(ICLDMotionCommand cmd, CLDArray cld)   // group handler - before any motion command
    public override void OnEDMMove(ICLDEDMMoveCommand cmd, CLDArray cld)
    public override void OnAfterMovement(ICLDMotionCommand cmd, CLDArray cld)   // group handler - after any motion command
    

    Inheritance: ICLDEDMMoveCommand : ICLDMotionCommand : ICLDCommand.

    Read the parameters from the strongly-typed cmd object (recommended); the raw cld[i] array (same indices as in sppx) and the named cmd["..."] helpers are available too. The table lists the command's members, including those inherited from its base interfaces; the common ICLDCommand members (navigation, CLD, CLDFile, TechOperation, ...) are described in the CLData access model.

    Member Type Description
    cmd.MotionMode CLDEDMMotionMode Mode of the motion: Rapid, Plain2D, Taper2D, MultiProf4D or CutsOnly4D.
    cmd.IsRapidMove bool Returns "True" if the motion mode is Rapid, otherwise returns "False".
    cmd.IsPlain2DMove bool Returns "True" if the motion mode is Plain2D, otherwise returns "False".
    cmd.IsTaper2DMove bool Returns "True" if the motion mode is Taper2D, otherwise returns "False".
    cmd.IsMultiProf4DMove bool Returns "True" if the motion mode is MultiProf4D, otherwise returns "False".
    cmd.IsCutsOnly4DMove bool Returns "True" if the motion mode is CutsOnly4D, otherwise returns "False".
    cmd.Lower ICLDEDMMoveSpan Parameters of the lower guide motion (type, coordinates and radius).
    cmd.Upper ICLDEDMMoveSpan Parameters of the upper guide motion (type, coordinates and radius).
    cmd.TaperAngle double In the Taper2D movement mode the parameter specifies signed taper angle: "A > 0" – right taper, "A < 0" – left taper.
    cmd.RollMode EDMRollMode Sharp corners rounding mode for the 2 axis and taper machining (CornerR function, off, sharp, conical, cylindrical or fixed).
    cmd.EP TInp3DPoint End point (X, Y, Z) of the movement

    Example - OnEDMMove (from the AgieCharmilles_WireEDM_DN postprocessor):

    public override void OnEDMMove(ICLDEDMMoveCommand cmd, CLDArray cld)
    {
        // Insert and break wire commands
        if (!cmd.IsRapidMove && !wireInserted)
        {
            InsertWire();
        }
        if (cmd.IsRapidMove && wireInserted)
        {
            if (cmd.Lower.EP != previousLowerPoint)
                BreakWire();
        }
    
        // Cutting conditions selection
        if (conditionsNeedOut)
        {
            nc.C.Show();
            nc.Block.Out();
            conditionsNeedOut = false;
        }
    
        // Compensation turn on
        if (compensNeedOut && nc.GCompens != 40)
        {
            nc.GCompens.Show();
            nc.H.Show();
            nc.Block.Out();
            compensNeedOut = false;
        }
    
        // Motion mode turn on
        if (cmd.IsMultiProf4DMove)
        {
            nc.G2Contour.v = 61;
        }
        else if (cmd.IsCutsOnly4DMove)
        {
            nc.GUV.v = 74;
        }
        if (nc.G2Contour.ValuesDiffer || nc.GUV.ValuesDiffer)
        {
            nc.Block.Out();
            nc.GInterp1.RestoreDefaultValue(false);
            nc.GInterp2.RestoreDefaultValue(false);
        }
    
        // Compensation turn off
        if (compensNeedOut && nc.GCompens == 40)
        {
            nc.GCompens.Show();
            compensNeedOut = false;
        }
    
        // Coordinates output
        nc.X1.v = cmd.Lower.EP.X;
        nc.Y1.v = cmd.Lower.EP.Y;
        nc.Z1.v = cmd.Lower.EP.Z;
        switch (cmd.MotionMode)
        {
            case CLDEDMMotionMode.Rapid:
                if (nc.X1.ValuesDiffer || nc.Y1.ValuesDiffer || nc.Z1.ValuesDiffer)
                {
                    nc.GInterp1.v = 0;
                }
                break;
            case CLDEDMMotionMode.Plain2D:
            case CLDEDMMotionMode.Taper2D:
            case CLDEDMMotionMode.MultiProf4D:
                if (cmd.Lower.IsArc)
                {
                    nc.GInterp1.v = cmd.Lower.ArcR > 0d ? 3 : 2;
                    nc.I1.Show(cmd.Lower.Center.X - previousLowerPoint.X);
                    nc.J1.Show(cmd.Lower.Center.Y - previousLowerPoint.Y);
                }
                else // Cut
                {
                    nc.GInterp1.v = 1;
                }
                if (cmd.IsTaper2DMove)
                {
                    nc.GTaper.v = cmd.TaperAngle > 0 ? 52 : 51;
                    nc.A.Show(Abs(cmd.TaperAngle));
                }
                else if (cmd.IsMultiProf4DMove)
                {
                    nc.Colon.Show();
                    nc.X2.v = cmd.Upper.EP.X;
                    nc.Y2.v = cmd.Upper.EP.Y;
                    nc.Z2.v = cmd.Upper.EP.Z;
                    if (cmd.Upper.IsArc)
                    {
                        nc.GInterp2.v = cmd.Upper.ArcR > 0d ? 3 : 2;
                        nc.I2.Show(cmd.Upper.Center.X - previousUpperPoint.X);
                        nc.J2.Show(cmd.Upper.Center.Y - previousUpperPoint.Y);
                    }
                    else // Cut
                    {
                        nc.GInterp2.v = 1;
                    }
                    // CornerR
                    if ((cmd.IsPlain2DMove || cmd.IsTaper2DMove) && cmd.RollMode != EDMRollMode.Off)
                    {
                        nc.RollR1.Show(cmd.Lower.RollR);
                        nc.RollR2.Show(cmd.Upper.RollR);
                    }
                }
                break;
            case CLDEDMMotionMode.CutsOnly4D:
                nc.GInterp1.v = 1;
                var d = (T3DPoint)cmd.Upper.EP - cmd.Lower.EP;
                nc.U.v = d.X;
                nc.V.v = d.Y;
                nc.W.v = d.Z;
                break;
        }
    
        // Motion mode turn off
        if (!cmd.IsTaper2DMove && nc.GTaper != 50)
        {
            nc.GTaper.v = 50;
        }
        if (!cmd.IsMultiProf4DMove && nc.G2Contour != 60)
        {
            nc.G2Contour.v = 60;
        }
        if (!cmd.IsCutsOnly4DMove && nc.GUV != 75)
        {
            nc.U.v = 0;
            nc.V.v = 0;
        }
        nc.Block.Out();
        if (!cmd.IsCutsOnly4DMove && nc.GUV != 75)
        {
            nc.GUV.v = 75;
            nc.U.Hide();
            nc.V.Hide();
        }
        nc.Block.Out();
    
        // Remember current coordinates
        previousLowerPoint = cmd.Lower.EP;
        if (!cmd.IsMultiProf4DMove && !cmd.IsCutsOnly4DMove) // 2D
        {
            previousUpperPoint = previousLowerPoint;
        }
        else // 4D
        {
            previousUpperPoint = cmd.Upper.EP;
        }
    }
    

    See also

    • CLData access model
    In this article