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:

P11, P12, and P13 in tool change


Recommended Posts

Hello friends,

 

I am beginning to dabble in simple post processor edits to better serve our shop.

 

For our fanuc post processor I would like to have it put either a P11, P12, or P13 out with the tool change line in order tell the machine which spindle to use.

P11 = Main spindle

P12 = Sub spindle

P13 = live tooling 

(I may have 12 and 13 mixed up)

 

I'm fairly certain that this change would be in the ltlchg and mtlchg blocks but I need confirmation on that.

 

I don't know what variable is used based on which spindle is being used. I'm guessing it's "spindle_no"

 

I'm thinking my code would be something like:

if spindle_no =1

     [

     "P11", e$

     ]

if spindle_no=2

     [

     "P12", e$

     ]

if spindle_no=3

     [

     "P13", e$

     ]

 

Am I on the right track? What is the proper way to do this?

 

Many thanks from a noob

  • Like 1
Link to comment
Share on other sites

What post are you using? The MPLMASTER post already has some logic like this already built into it.

 

Yes you are on the right track, but need to know what version you are on. There have been some issues with certain versions when it comes to this function.

 

You could also handle this with a string variable like most G and M codes are handled like I believe the MPLMASTER post does it.

Link to comment
Share on other sites

We have the generic fanuc 4x lathe post.

 

I would love to do this with strings so that I could have the if statements define the string before hand and then just have that inserted in the line with the tool number, but I'm not sure how to properly define a string either.

 

I thought it would be:

string11 = "p11"

 

and then later call:

*string11, e$

 

But that didn't work.

 

We are running on MX6

Link to comment
Share on other sites

I got it to work:

string11 = "P11"
string12 = "P12"
string13 = "P13"

ltlchg$          #Toolchange, lathe
      toolchng = one
      gcode$ = zero
      copy_x = vequ(x$)
      pcc_capture   #Capture LCC ends, stop output RLCC
      c_rcc_setup$  #Setup LCC on first 60000
      plcc_lead_begin  #Save original in sav_xa and shift copy_x for LCC comp.
      pcom_moveb    #Get machine position, set inc. from c1_xh
      c_mmlt$       #Position multi-tool sub, sets inc. current if G54...
      ptoolcomment
      comment$
      if home_type < two, #Toolchange G50/home/reference position
        [
        sav_xh = vequ(copy_x)
        sav_absinc = absinc$
        absinc$ = zero
        pmap_home   #Get home position, xabs
        ps_inc_calc #Set start position, not incremental
        #Toolchange home position
        if home_type = one,
          pbld, n$, *sgcode, pfxout, pfyout, pfzout, e$
        else,
          [
          #Toolchange g50 position
          pbld, n$, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.", e$
          toolno = t$ * 100 + zero
          if home_type = m_one, pbld, n$, *sgcode, *toolno, e$
          else, pbld, n$, *sg50, pfxout, pfyout, pfzout, e$
          ]
        pe_inc_calc #Update previous
        absinc$ = sav_absinc
        copy_x = vequ(sav_xh)
        ]
      toolno = t$ * 100 + tloffno$
      if spindle_no = 1,
      	[
      	pbld, n$, *sgcode, *toolno, string11, e$
      	else,
      	[
      	pbld, n$, *sgcode, *toolno, string13, e$
      	]
      	]


mtlchg$          #Toolchange, mill
      toolchng = one
      gcode$ = zero
      copy_x = vequ(x$)
      pcom_moveb    #Get machine position, set inc. from c1_xh
      c_mmlt$        #Position multi-tool sub, sets inc. current if G54...
      ptoolcomment
      comment$

      if home_type < two, #Toolchange G50/home/reference position
        [
        sav_xh = vequ(copy_x)
        sav_absinc = absinc$
        absinc$ = zero
        pmap_home   #Get home position, xabs
        ps_inc_calc #Set start position, not incremental
        #Toolchange home position
        if home_type = one,
          pbld, n$, *sgcode, pfxout, pfyout, pfzout, e$
        else,
          [
          #Toolchange g50 position/reference
          pbld, n$, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.", e$
          toolno = t$ * 100 + zero
          if home_type = m_one, pbld, n$, *sgcode, *toolno, e$
          else, pbld, n$, *sg50, pfxout, pfyout, pfzout, e$
          ]
        pe_inc_calc #Update previous
        absinc$ = sav_absinc
        copy_x = vequ(sav_xh)
        ]
      toolno = t$ * 100 + tloffno$
      if millcc, cabs = zero, cinc = zero  #Force C0 if G12.1/G07.1
      pbld, n$, *sgcode, *toolno, "P12", e$

Now the next task is to do the same thing for the mtlchg so that I can have it select between the top turret live tooling and the bottom turret live tooling.

 

Does anyone know what variable that would be? it's not still spindle_no is it?

Link to comment
Share on other sites

 

Now the next task is to do the same thing for the mtlchg so that I can have it select between the top turret live tooling and the bottom turret live tooling.

 

Does anyone know what variable that would be? it's not still spindle_no is it?

 

Nope the Axis Combinations will be the control not the Spindle. The Upper and Lower could use the same spindle. That is where the Axis Combinations come into play. 

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