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:

getting prestaged tools working


Recommended Posts

I have asked several questions and have gotten great help, now I have a tougher one for you. 

 

I am modifying a HAAS post to use in our Mazak mill and mostly are simple modifications. Removing "%" at the beginning and end, same with "M05" as it will sit until the spindle stops them go to toolchange but with it removed, it decels while moving to toolchange position. So, things like that. I do not know C programming but I notice patterns and have figured a lot of things out where it posts correctly without any errors to report. ( not bad eh? )

So I am wanting to get the prestagged tool functioning but cannot get it working.  I am modifying the Generic Haas 3X mill.pst file and it looks as if no one has ever messed with it so it started at it comes usually with MCam. 

 

Here's where I'm at...

 

These are the settings. at the top.

stagetool    : 1     #SET_BY_CD 0 = Do not pre-stage tools, 1 =    
                   Stage tools
stagetltype  : 0     #0 = Do not stage 1st tool
                     #1 = Stage 1st tool at last tool change
                     #2 = Stage 1st tool at end of file (peof)

 

 

Tool change code...

pstagetool is in the code and if I change it to "DAN", it does output "DAN" in the G code

 

ptlchg$          #Tool change
      pcuttype
      toolchng = one
      if mi1$ = one, #Local Work coordinate system
        [
        pfbld, n$, *sg28ref, "X0.", "Y0.", e$
        pfbld, n$, sg92, *xh$, *yh$, *zh$, e$
        ]
      inhibit_probe$
      if mi1$ = three | mi1$ = four, #Work coordinate shift
        [
        pfbld, n$, *sg28ref, "Z0.", e$
        pbld, n$, sg52, *xh$, *yh$, *zh$, e$
        if xh$ | yh$ | zh$, shft_flg = one
        else, shft_flg = zero
        ]
      if prog_stop = 1, pbld, n$, *sm01, e$
      if prog_stop = 2, pbld, n$, *sm00, e$
      pcom_moveb
      pcheckaxis
      c_mmlt$ #Multiple tool subprogram call
      ptoolcomment
      comment$
      pcan
      pbld, n$, *t$, sm06, e$
      pindex
      phsm_accuracy  # Output G187 line for high speed machining
accuracy control
      sav_absinc = absinc$
      if mi1$ > one, absinc$ = zero
      if use_rot_lock & (cuttype <> zero | (index = zero & prv_cabs
<> fmtrnd(cabs))), prot_unlock
      if convert_rpd$, pconvert_rpd
      pcan1, pbld, n$, [if gcode$, *sgfeed], *sgcode, *sgabsinc,
pwcs, pfxout, pfyout, pfcout,
        *speed, *spindle, pgear, [if gcode$, *feed], strcantext, e$
      if use_rot_lock & cuttype = zero, prot_lock
      pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$ 
      pbld, n$, pscool,e$
      absinc$ = sav_absinc
      pbld, n$, sgabsinc, e$
      pcom_movea
      toolchng = zero
      c_msng$ #Single tool subprogram call
      !xnci$, !ynci$, !znci$

 

This is down further in the post...

 

pstagetool      #Pre-stage tools
      if stagetool = 1,
        [
        if ttblend$,  #Check for last toolchange
          [
          if stagetltype = 1, *next_tool$  #stage first tool at
last toolchange
          ]
        else, *next_tool$ #stage tool at every toolchange
        ]

 

If you can help, let me know where to start looking to get this feature going. Remember I am a C code dummy so you'll have to use layman's terms. 

 

Thanks. 

Dan

Link to comment
Share on other sites
57 minutes ago, DCOPE17 said:

stagetool    : 1     #SET_BY_CD 0 = Do not pre-stage tools, 1 =    
                   Stage tools

Go to your Machine Definition Manager, go into Control Definition using icon at top (roughly middle, looks like a control face), Tool tab, check the box that states Enable Staged Toll Routines.

No code change should be required in the .pst file

Link to comment
Share on other sites
11 minutes ago, DCOPE17 said:

Okay, set by CD meant set by Control Definition. I'll remember that

Similar situation with line numbers. Choices between the different outputs available in .pst, enabling them is a check box in CD. Whether X Coolant is output is an MD checkbox.

Link to comment
Share on other sites
  • 4 months later...

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