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:

How to move m09 after m05 using mpmaster X4


Ariel Gubatina
 Share

Recommended Posts

As always, back up your post before making any changes.

 

The easiest way is to move the m5 up before scoolantx and scoolant are output.

 

Look for #<-- for my changes.

 

pretract        #End of tool path, toolchange
     phsm_off
     sav_absinc = absinc$
     absinc$ = one
     sav_coolant = coolant$
     coolant$ = zero

     pbld, n$, *sm05, e$   #<-- Add M5 here (see below)

#      if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless
#        [                 #  explicitely turned off through a canned text edit
       if all_cool_off,
         [
         #all coolant off with a single off code here
         if coolant_on, pbld, n$, *sall_cool_off, e$
         coolant_on = zero
         ]
       else,
         [
         local_int = zero
         coolantx = zero
         while local_int < 20,
           [
           coolantx = and(2^local_int, coolant_on)
           local_int = local_int + one
           if coolantx > zero,
             [
             coolantx = local_int
             pbld, n$, scoolantx, e$
             ]
           coolantx = zero
           ]
         coolant_on = zero
         ]
#        ]

     #cc_pos is reset in the toolchange here
     cc_pos$ = zero
     if convert_rpd$ = one,
       [
       gcode$ = one
       feed = maxfeedpm
       ipr_type = zero
       ]
     else, gcode$ = zero

     #pbld, n$, sccomp, *sm05, psub_end_mny, e$ #<-- Commented out (original code)
     pbld, n$, sccomp, psub_end_mny, e$         #<-- M05 moved before M09 (see above)

     pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$          
     #if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
     #pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
     #if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
     if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),
       [
       if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$
       rotretflg = 1
       pbld, n$, `sg28, protretinc, e$
       rotretflg = 0
       if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$
       ]
     absinc$ = sav_absinc
     coolant$ = sav_coolant

 

HTH :rolleyes:

Link to comment
Share on other sites

Thanks for the reply but it still outputs the m09 then m05.

 

 

 

 

As always, back up your post before making any changes.

 

The easiest way is to move the m5 up before scoolantx and scoolant are output.

 

Look for #<-- for my changes.

 

pretract        #End of tool path, toolchange
     phsm_off
     sav_absinc = absinc$
     absinc$ = one
     sav_coolant = coolant$
     coolant$ = zero

     pbld, n$, *sm05, e$   #<-- Add M5 here (see below)

#      if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless
#        [                 #  explicitely turned off through a canned text edit
       if all_cool_off,
         [
         #all coolant off with a single off code here
         if coolant_on, pbld, n$, *sall_cool_off, e$
         coolant_on = zero
         ]
       else,
         [
         local_int = zero
         coolantx = zero
         while local_int < 20,
           [
           coolantx = and(2^local_int, coolant_on)
           local_int = local_int + one
           if coolantx > zero,
             [
             coolantx = local_int
             pbld, n$, scoolantx, e$
             ]
           coolantx = zero
           ]
         coolant_on = zero
         ]
#        ]

     #cc_pos is reset in the toolchange here
     cc_pos$ = zero
     if convert_rpd$ = one,
       [
       gcode$ = one
       feed = maxfeedpm
       ipr_type = zero
       ]
     else, gcode$ = zero

     #pbld, n$, sccomp, *sm05, psub_end_mny, e$ #<-- Commented out (original code)
     pbld, n$, sccomp, psub_end_mny, e$         #<-- M05 moved before M09 (see above)

     pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$          
     #if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
     #pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
     #if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
     if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),
       [
       if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$
       rotretflg = 1
       pbld, n$, `sg28, protretinc, e$
       rotretflg = 0
       if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$
       ]
     absinc$ = sav_absinc
     coolant$ = sav_coolant

 

HTH :rolleyes:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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...