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:

need help on editing Post file


Recommended Posts

Hell, everyone.

I am a starter on mastercam post file editing. I updated Mazak Post file from V9 to X5, and redefined control and machine file. Most of CNC code created by these new files look right, but the sequence number has problem. please see the red mark.

----------------------------------------------------------------

N100 (DATE -  02-07-15  TIME -  20:04 )
N20
N110 G20
N120 G0 G40 G80 G90 G94 G98
N130 G0 G28 G91 Z0.
N140 G0 G28 X0. Y0.
N150 ( N150 3" FACE MILL   TOOL - 20  DIA. OFF. - 20  LEN. - 20  DIA. - 3. )
N160 T20 M6
N170 G0 G54 G90 X-3.3 Y3.7499 S1500 M3 M41
N180 G43 H20 Z2.
N190 Z.6
N200 G1 Z.45 F20.
N210 X6.3
N220 Y2.75
N230 X-1.8
N240 Y1.75
N250 X6.3
N260 Y.7501
N270 X-3.3
N280 G0 Z2.
N290 M5
N300 G0 G28 G91 Z0.
N310 M01
N8
N320 G0 G40 G80 G90 G94 G98
N330 G0 G28 G91 Z0

 

------------------------------------------------------------------

In the post file, I have

omitseq$     : no$   #Omit sequence numbers?
seqmax$      : 9999  #Max. sequence number.

----------------------------------------------------------------

I do not know where I am wrong. Please help me this problem.

Thanks for help.

Link to comment
Share on other sites

It is hard to say without looking at your post, or more of your NC code, but it appears that you have some logic in your post to create a Sequence Number that matches your Tool Number at the Tool Change. That is why you are getting a "N20" before the "T20". My guess is that your second tool change calls up "T8", which is why you are getting "N8" before the next tool change...

Link to comment
Share on other sites

Colin G. My friend.

you are so smart. I checked my NC code. Before tool change there is the sequence number which is same with Tool number.

I do not know how to upload my post. Just paste some of post which are related with tool change. Please help me check and find where I am wrong. Thanks a lot.

-----------------------------------------------------------------------

# Tool Comment / Manual Entry Section
# --------------------------------------------------------------------------
ptoolcomment    #Comment for tool
      tnote = t$
      toffnote = tloffno$
      tlngnote = tlngno$
      pbld, n$, "(", pstrtool, *tnote, *toffnote, *tlngnote, *tldia$, ")", e$

pstrtool        #Comment for tool
      if strtool$ <> sblank,
        [
        strtool$ = ucase(strtool$)
        pbld, n$, *strtool$, " "
        ]

pcomment$        #Comment from manual entry
      scomm$ = ucase (scomm$)
      if gcode$ = 1007, "(", scomm$, ")",e$
      else, pbld, n$, "(", scomm$, ")", e$

# --------------------------------------------------------------------------
# Start of File and Toolchange Setup
# --------------------------------------------------------------------------
psof0$           #Start of file for tool zero                       
      psof$

psof$            #Start of file for non-zero tool number            
      pcuttype
      toolchng = one
      if ntools$ = one,
        [
        #skip single tool outputs, stagetool must be on
        stagetool = m_one
        !next_tool$
        ]
      if progno$ = zero, progno$ = one
      sav_progno = progno$
      *progno$, "(PROGRAM - ", sprogname$, ")", e$
      pbld, n$, "(DATE - ", date$, " TIME - ", time$, ")", e$
      *tseqno, e$    --------------------------------------------------------------delete this line?
      pbld, n$, *smetric, e$
      pbld, n$, "G0", sgplane, "G40", pg49, "G80", "G90", *sgfeed, "G98", e$
      sav_absinc = absinc$
      absinc$ = one
      prefreturn
      absinc$ = sav_absinc
      if mi1$ <= one, pfbld, n$, "G92", *xh$, *yh$, *zh$, e$
      pcom_moveb
      c_mmlt$ #Multiple tool subprogram call
      ptoolcomment
      comment$
      pcan
      if stagetool = zero, pbld, n$, *t$, "M6", e$
      if stagetool = one,
        [
        if r2100bitde, pbld, n$, *t$, "M6", e$
        else,  pbld, n$, *t$, *next_tool$, "M6", e$
        ]
      pindex
      if mi1$ > one, absinc$ = zero
      pcan1, pbld, n$, *sgcode, pwcs, *sgabsinc, pfxout, pfyout,
        pfcout, *speed, *spindle, pgear, strcantext, e$
      if stagetool = one & r2100bitde, pbld, n$, *next_tool$, e$
      pbld, n$, "G43", ptlngno, pfzout, scoolant, e$
      absinc$ = sav_absinc
      pcom_movea
      toolchng = zero
      c_msng$ #Single tool subprogram call

ptlchg0$         #Call from NCI null tool change (tool number repeats)                       
      pcuttype
      pcom_moveb
      c_mmlt$ #Multiple tool subprogram call
      comment$
      pcan
      pbld, n$, sgplane, e$
      pspindchng
      pbld, n$, scoolant, e$
      if mi1$ > one & workofs$ <> prv_workofs$,
        [
        sav_absinc = absinc$
        absinc$ = zero
        pbld, n$, pwcs, sgabsinc, pfxout, pfyout, pfzout, pfcout, e$
        pe_inc_calc
        ps_inc_calc
        absinc$ = sav_absinc
        ]
      if cuttype = zero, ppos_cax_lin
      if gcode$ = one, plinout
      else, prapidout
      pcom_movea
      c_msng$ #Single tool subprogram call

ptlchg$          #Tool change                                       
      pcuttype
      toolchng = two
      pbld, n$, "M01", e$
      *tseqno, e$
      pbld, n$, "G0", sgplane, "G40", pg49, "G80", "G90", *sgfeed, "G98", e$
      sav_absinc = absinc$
      absinc$ = one
      prefreturn
      absinc$ = sav_absinc
      if mi1$ = one, pfbld, n$, "G92", *xh$, *yh$, *zh$, e$
      pcom_moveb
      c_mmlt$ #Multiple tool subprogram call
      ptoolcomment
      comment$
      pcan
      if stagetool = zero, pbld, n$, *t$, "M6", e$
      if stagetool = one,
        [
        if r2100bitde, pbld, n$, *t$, "M6", e$
        else,  pbld, n$, *t$, *next_tool$, "M6", e$
        ]
      pindex
      sav_absinc = absinc$
      if mi1$ > one, absinc$ = zero
      pcan1, pbld, n$, *sgcode, pwcs, *sgabsinc, pfxout, pfyout, pfzout,
        pfcout, *speed, *spindle, pgear, strcantext, e$
      if stagetool = one & r2100bitde, pbld, n$, *next_tool$, e$
      pbld, n$, "G43", ptlngno, pfzout, scoolant, e$
      absinc$ = sav_absinc
      pcom_movea
      toolchng = zero
      c_msng$ #Single tool subprogram call

pretract        #End of tool path, toolchange             
      sav_absinc = absinc$
      absinc$ = one
      sav_coolant = coolant$
      coolant$ = zero
      cc_pos$ = zero
      gcode$ = zero
      pbld, n$, scoolant, e$
      pbld, n$, sccomp, *sm05, psub_end_mny, e$
      if f93bit3, pbld, n$, sccomp, pg49, e$
      prefreturn
      if rot_on_x, pbld, n$, *sgcode, *sg28, protretinc, e$
      absinc$ = sav_absinc
      coolant$ = sav_coolant

Link to comment
Share on other sites

Don't delete it, just put a "pound sign" or "Hashtag" '#' in front of the line.

 

A # sign marks anything to the right of the character as a "comment", and it won't be read by the post. You have '*tseqno' on several lines. In 'psof$', which is the "start of file", and in 'ptlchg$' which is the "Tool Change" post block.

 

My question though would be "Why do you want to get rid of these sequence numbers?". The way your post is setup, it looks like someone set the Control Definition to start at "100". That would mean "N100", then "N110", then "N120", and so on. The "Tool Sequence Numbers", which someone added to your post, would always match the tool number. If you were going to restart the tool, you could search for "N11", and it would call up the program for a restart, just before that tool change.

 

Since you just want to get rid of that extra output, adding pound signs (#) will do the trick...

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