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 A MISC INTEGER COMMENT IN POSTED CODE


Recommended Posts

      pcan
      #pbld,  *sgcode, *sgabsinc, sg80, e$ #ADDED
      pbld,  sg43, *tlngno$, pfxout, pfyout, pfzout,  [if nextdc$ <> 7, *speed, *spindle], e$ # G43 with spindle start
      if mi4$,
       [
       no_spc$, "G91 Z#612 (BLADE THICKNESS ADJUST)", no_spc$, e$
       pbld, "G90", e$
       ]

GETS ME THIS:

G0 G90 X.1035 Y4.8144
G43 H99 Z.15 S9000 M3
G91 Z#612 (BLADE THICKNESS ADJUST)
G90

Z.057
G1 Z.047 F50.
G41 D99 X.0156 Y4.8621 F27.

THIS IS WHAT I NEED:

G0 G90 X.1035 Y4.8144
G43 H99 Z.15 S9000 M3
Z.057
G1 Z.047 F50.
G91 Z#612 (BLADE THICKNESS ADJUST)
G90

G41 D99 X.0156 Y4.8621 F27.
 

Link to comment
Share on other sites

Do you want the two lines of code inserted every time there is a z move? If so, I think you would need to copy your mi4 if statement to right before the G41 cutter comp line.

In the MPFAN post the G41 cutter comp line is in the following postblocks:

prapidout 
plinout
pcirout

I believe you'll get what you're looking for if you paste the mi4 if statement right before the cutter comp line.

Link to comment
Share on other sites
3 hours ago, Jake L said:

Do you want the two lines of code inserted every time there is a z move? If so, I think you would need to copy your mi4 if statement to right before the G41 cutter comp line.

In the MPFAN post the G41 cutter comp line is in the following postblocks:

prapidout 
plinout
pcirout

I believe you'll get what you're looking for if you paste the mi4 if statement right before the cutter comp line.

The issue is the 'misc values' get reset when you aren't processing a 'Tool Change'.

You can setup a 'flag variable' to track the status of 'mi4$', and delay the output until processing in 'plinout'.

G0 G90 X.1035 Y4.8144             < OUTPUT FROM TOOL CHANGE (Either 'psof$' or 'ptlchg$)
G43 H99 Z.15 S9000 M3            < OUTPUT FROM TOOL CHANGE (Either 'psof$' or 'ptlchg$)
Z.057                                             < OUTPUT FROM 'prapidout' (G-code 0)
G1 Z.047 F50.                               < OUTPUT FROM 'plinout'      (G-code 1)
G41 D99 X.0156 Y4.8621 F27.   < OUTPUT FROM 'plinout'      (G-code 1)

Start by initializing a variable, near the top of your Post:

mi4_flag           : 0

Then, capture if the value is '1' during Tool Change (need to put this in 'psof$' and in 'ptlchg$'):

      pcan
      #pbld,  *sgcode, *sgabsinc, sg80, e$ #ADDED
      pbld,  sg43, *tlngno$, pfxout, pfyout, pfzout,  [if nextdc$ <> 7, *speed, *spindle], e$ # G43 with spindle start
      if mi4$, mi4_flag = yes$ #Set flag
      else, mi4_flag = no$   #Reset if necessary

Now, add your logic to 'plinout':


 plinout         #Output to NC of linear movement - feed
      pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pwcs, pccdia,
        pxout, pyout, pzout, pcout, [if motst$, feed], strcantext, pscool, e$
      #Modify following line to customize output for high-speed toolpath
      #tool inspection/change points
      if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$
      if mi4_flag,
        [
        "G91 Z#612 (BLADE THICKNESS ADJUST)", e$
        pbld, "G90", e$
        mi4_flag = no$ #Reset Flag, to prevent output on every "linear move"
        ]
 

 

 

  • Thanks 1
  • Like 1
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...