Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Chris McIntosh

Members
  • Posts

    153
  • Joined

  • Last visited

Posts posted by Chris McIntosh

  1. There is documentation on the debugger that is installed with Mastercam. In your start menu, under mastercam X3/X4/X5/X6 > Documentation you should see the post debugger users guide.

     

    Regarding the edit you are looking to make, look for the post block ltlchg$. You'll need to search for the tool output, which will vary based on the post you are using. Search for toolno or t$ in your post.

     

    Above the line where the toolno or t$ is output, you will need to add the line:

     

    pbld, n$, "G28", "U0.", W0.", e$
    

     

    This will output the home position move before the start of every lathe tool change.

  2. Sounds like you are starting from the generic CNC post provided and have the wcs_mode set to 2. There is a post block called pretract that contains the move causing the issue. At the bottom of the post block are the following lines:

      if wcs_mode = two,  # 'E' fixture offset mode
        pcan1, pbld, n$, *sgabsinc, sgcode, "H0", "Z0.", strcantext, e$ # Retract Z w/ tool length cancel
      else, # 'G28' retract mode
        [
        absinc$ = one
        pcan1, pbld, n$, "G28", "Z0.", strcantext, e$
        if nextop$ = 1003 | tlchg_home, pbld, n$, *sg28ref, "X0.", "Y0.", protretinc, e$
        else, pbld, n$, protretinc, e$
        ]
    

     

    To output using the G53 Z0 method, you need to change the above code to the following:

     

      #if wcs_mode = two,  # 'E' fixture offset mode
      #  pcan1, pbld, n$, *sgabsinc, sgcode, "H0", "Z0.", strcantext, e$ # Retract Z w/ tool length cancel
      #else, # 'G28' retract mode
      #  [
        absinc$ = zero
        pcan1, pbld, n$, "G53", "Z0.", strcantext, e$
      # if nextop$ = 1003 | tlchg_home, pbld, n$, *sg28ref, "X0.", "Y0.", protretinc, e$
      #  else, pbld, n$, protretinc, e$
      #  ]
    

     

    Note this will only retract the Z-axis as you requested, the XY and rotary axis home positioning will not be output.

     

    HTH

  3. The feed rate being output is deg/min rather than units/min. If your machine automatically performs the calculation for you, you can modify the post to output the programmed feed rate rather than performing the calculation.

     

    Basically at the bottom of the pfclc_deg_inv you could add a feed = fr_pos$ line if that's what you need.

  4. There are some General rules for pulling parameters. First, you need to pull the parameters in pparameter$ or pwrttparam$.

     

    There you need to use the prmcode that matches with the output value you are looking for:

     

    if prmcode$ = XXXXXX, slongname = ucase(sparameter$) <-- used for when a parameter holds a single string

    or

    if prmcode$ = XXXXXX, slongname = rpar(sparameter$,Y) <-- used for when a parameter holds Y values seperated by single spaces

     

    Hopefully this should give you enough information to do what you need. There is likely examples of the parameter pulls in the post already

     

    HTH

  5. Just for giggles I tested in previous versions to see if anything has changed, and no, it's consistent back through X3 at least.

     

    As far as the -1 setting, I have always treated this as a "Mastercam automatically selects your work offset" setting. So as I see it, if you set the Top plane to 3, and the other operations use the same plane with a work offset of -1, Mastercam sees you have set the work offset to 3 later, and will link the two operations together since they are using the same plane.

  6. Well you can do anything you want...but it would require some work after the posting to stitch all your files together. When ever you have multiple NC names, it will trigger the setup sheet to run multiple times.

     

    You could then generate all the data you need during the multi-file processing and after all the NC files have been processed, construct the setup sheet based on this data. The only trouble is you would need to have a specific pattern to the NC file names or someway of indicating that the last NC file was in fact the last file to be processed, say through a prompt, to tell the .set file to assemble the data.

     

    HTH

  7. If you are performing a cut on the side of a part, ensure that the WCS and tool plane do not use the same planes, otherwise you will get no rotation. The wcs represents how the part is sitting in real world coordinates, the tool plane is used to control the tool vector for simple 3-axis cuts.

     

    We really need to know what kind of operation you're programming with to determine what the issue is...

  8. make sure the parameters in your post are update to the following parameter numbers:

     

    17605 min_speed #Minimum spindle speed

    17058 maxfrinv #Maximum feedrate - inverse time - inch - Minimum value from MD as this is inverse time

    17066 maxfrinv_m #Maximum feedrate - inverse time - metric - Minimum value from MD as this is inverse time

    17992 maxfrdeg #Maximum feedrate deg/min

    17055 maxfeedpm #Limit for feed in inch/min

    17063 maxfeedpm_m #Limit for feed in mm/min

     

    You should have a table using some of the same variables.

  9. when you did the update were there any errors in the update log? Alternatively you can open up the post and search for the string "#CNC". This would mark any errors that were encountered during the update.

     

    Was this an mpmaster based post, a base post from the install or a custom post developed for you?

     

    My guess is the post is reading the wrong parameter number from X4 based on the X2 parameter number. Have a look in the post for something close to this:

    # Machine Definition Parameters

    fprmtbl 17000 14 #Table Number, Size

    # Param Variable to load value into

    17391 axis_label #Axis label - 1=X,2=Y,3=Z

    17397 srot_label #Rotary Axis label (Generally A, B or C) - Not yet available.

    17401 rot_zero #Rotary zero degree position

    17402 rot_dir #Rotary direction

    17408 rot_index #Index or continuous

    17409 rot_angle #Index step

    17410 rot_type #Rotary type

    17605 min_speed #Minimum spindle speed

    17058 maxfrinv #Maximum feedrate - inverse time - inch - Minimum value from MD as this is inverse time

    17066 maxfrinv_m #Maximum feedrate - inverse time - metric - Minimum value from MD as this is inverse time

    17992 maxfrdeg #Maximum feedrate deg/min

    17055 maxfeedpm #Limit for feed in inch/min

    17063 maxfeedpm_m #Limit for feed in mm/min

    17101 all_cool_off #First coolant off command shuts off ALL coolant options

  10. from the code above it looks like this is the line that outputs your tool:

     

    pbld,"N",t$,ptoolcomment

     

    so you would need to change this to:

     

    t$ = 900 + t$

    pbld,"N",t$,ptoolcomment

     

    format statements define how the variables are being output. You can search for "fmt" to find where the variables are formatted. Copy the format for the t$ and replace the t$ with toolno:

    fmt "#" 4 t$ #Tool No

    fmt "#" 4 toolno #Tool No

  11. It's tough to give you exact code without seeing the specific post blocks, but you need to add code in your toolchange post block and in your pwrtt$ post block.

     

    In pwrtt$, something like this:

    toolno = 900 + t$

    *toolno, "=00(", *t$, "=)", e$

     

    then in ptlchg_com, ptlchg$ or ptoolcall (where ever *t$ is found):

    t$ = t$ + 900

     

    You will also need to copy the format statement for t$ and apply it to toolno for this to work.

  12. Are you just trying to flip the sign on your X-axis output?

     

    At the top of the post are the parameters for controlling coordinate output based on the cuttype:

     

    #Columns- ABCDEFGH.IJKLMNOPQ #Turret/Spindle #Path Type

    scase_tl_c1 : "10000222.100100100" #Top turret/Left spindle, Turning cut

    scase_tl_c2 : "10000012.000000000" #Top turret/Left spindle, Right Face cut

    scase_tl_c_2 : "10110012.000000000" #Top turret/Left spindle, Left Face cut

    scase_tl_c3 : "10010102.000000000" #Top turret/Left spindle, Cross cut (cuttype = 3)

    scase_tl_c3r : "10001102.000000000" #Top turret/Left spindle, Reverse Cross cut (cuttype = -3)

    scase_tl_c4c : "10000222.000000000" #Top turret/Left spindle, Y axis subs. Cycle

    scase_tl_c4 : "10000122.000000000" #Top turret/Left spindle, Y axis subs.

    scase_tl_c5 : "10000222.000000000" #Top turret/Left spindle, Multisurf Rotary

     

    Specifically you will need to look at the I,L,O parameters as they are tied to the X-axis direction:

    # I - Plane 0, X axis, 0 = normal, 1 = switch sign from basic

    # L - Plane 1, X axis, 0 = normal, 1 = switch sign from basic

    # O - Plane 2, X axis, 0 = normal, 1 = switch sign from basic

  13. define the buffer and necessary variables (size1, rc1, wc1, tcount, tseqno)

     

    in ptlchg$ or ptlchg_com (where ever you are outputting the tool change)

     

    size1 = rbuf(1,0)

    rc1 = t$

    if rc1<= size1, tcount = rbuf(1,rc1)

    else, tcount = 0

    if tcount = 0, tseqno = t$

    else, tseqno = t$ * 100 + (tcount-1)

    tcount = tcount + 1

    wc1 = t$

    tcount = wbuf(1,wc1)

     

    then force out the sequence number (tseqno) where you need it output

  14. you would need to build a buffer to track the number of times you are using a given tool.

     

    First you need to check if the tool has been used already by reading the buffer, then you would output the sequence number based on how many times the tool has been called. Finally you would need to write to the buffer to indicate that the tool has been called again.

  15. Open up the pst file (mpmaster.pst) in notepad or another text editor. Your tool change code should look like this (search for M06 in the file):

     

         if stagetool >= zero,
           [
           if omitseq$ = 1 & tseqno > 0,
             [
             if tseqno = 2, n$ = t$
             pbld, *n$, *t$, "M06", ptoolcomm, e$
             ]
           else, pbld, n$, *t$, "M06", ptoolcomm, e$
           ]
    

     

    Should be changed to this (also adding in the M19):

     

         if stagetool >= zero,
           [
           pbld, n$, "M19", e$
           if omitseq$ = 1 & tseqno > 0,
             [
             if tseqno = 2, n$ = t$
             pbld, *n$, *t$, ptoolcomm, e$
             ]
           else, pbld, n$, *t$, ptoolcomm, e$
           pbld, n$, "M06", e$
           ]
    

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...