585,712 active members*
4,220 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > MadCAM > Post processor conditional statements
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2016
    Posts
    18

    Post processor conditional statements

    Can I use conditional statements in the post processor? If so, what is the syntax? My control does not support G17,G18,G19 commands, but instead has separate commands for arc interpolation; G02/G03 for XY, G102/G103 for XZ, and G202/G203 for YZ. I'm thinking something similar to:

    *CW_ARC_MOTION*
    if "plane" == G17 then G02
    if "plane" == G18 then G102
    if "plane" == G19 then G202

    Or is there a better way to do this?

  2. #2
    Join Date
    Feb 2006
    Posts
    183

    Re: Post processor conditional statements

    One way is to define the planes as 0, 10 and 20 and then use the "plane" variable for the arc motions.

    Define the planes as below.

    *PLANE_XY*
    0
    *PLANE_XZ*
    10
    *PLANE_YZ*
    20

    Then use the "plane" variable for the arc motions as below.

    *CW_ARC_MOTION*
    G"plane"2
    *CCW_ARC_MOTION*
    G"plane"3

    /Joakim

  3. #3
    Join Date
    Mar 2016
    Posts
    18

    Re: Post processor conditional statements

    Clever. Thanks!

  4. #4
    Join Date
    Mar 2016
    Posts
    18

    Re: Post processor conditional statements

    Using that method, I have the following:
    *PLANE_XY*
    0

    *PLANE_XZ*
    10

    *PLANE_YZ*
    20

    *ARC_RADIUS_CHAR*
    R

    *RAPID_MOTION*
    G00 "x" "y" "z"

    *LINEAR_MOTION*
    G01 "x" "y" "z"

    *CW_ARC_MOTION*
    G"plane"2 "x" "y" "z" "r"

    *CCW_ARC_MOTION*
    G"plane"3 "x" "y" "z" "r"

    *RAPID*
    N"lnbr" "motion";
    *END_SECTION*

    *RAPID_APPROACH*
    N"lnbr" "motion";
    *END_SECTION*

    *RAPID_RETRACT*
    N"lnbr" "motion";
    *END_SECTION*

    *APPROACH*
    N"lnbr" "motion" F"feedz";
    *END_SECTION*

    *FIRST_CUT*
    N"lnbr" "motion" F"feed";
    *END_SECTION*

    *CUT*
    N"lnbr" "motion";
    *END_SECTION*

    This outputs a G00/01/02/03 command for every movement. My control has limited memory and must drip feed so it'd be nice to keep the code as minimal as possible. I can strip out the extraneous commands in excel, but is there a better way of writing the post to do this?

Similar Threads

  1. Replies: 1
    Last Post: 01-02-2021, 11:05 PM
  2. if statements...
    By deadlykitten in forum Okuma
    Replies: 10
    Last Post: 11-07-2015, 01:46 AM
  3. Conditional looping. Is it possible?
    By zedodia in forum Mach Software (ArtSoft software)
    Replies: 6
    Last Post: 06-15-2015, 03:08 PM
  4. Conditional and Loop Statements in Mach3
    By Monotoba in forum Uncategorised MetalWorking Machines
    Replies: 5
    Last Post: 04-25-2010, 03:12 AM
  5. If / Then Statements
    By Nanker in forum G-Code Programing
    Replies: 6
    Last Post: 10-23-2004, 06:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •