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 add G28 to the first line of mt lathe post


Recommended Posts

Greetings Smith,

Open you post and search for lsof$  postblock.

 

Inside add what you want.

Just to remind you if you write g28 u0 w0

this will be posted only once, at the beginning of you file.

 

if you cant understand what I am talking about, PM and i will explain you.

 

Kind regards

Ivan.

Link to comment
Share on other sites

Thanks Ivan!
 

I found that variable it show up a lot in the post.  I added but it only shows up if there are no tools selected.  As in T0000.  I still need to find the right block that is at the top of the program so it the first thing it does.   A safety line so to speak no necessarily on tool change. 

Link to comment
Share on other sites

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

      if prv_spaces$ > zero, " ", e$
      #ptoolcomment
      comment$
      pop_desc, e$
      if prv_spaces$ > zero, " ", e$

      spaces$ = prv_spaces$
      pbld, n$, "G0", *sg40, "G80", sm24, [if nc_system_type = 0, *sg99], [if nc_system_type >= 1, *sg99_b], e$
      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." e$
          pbld, n$, *sg28ref, "W0." e$
          if tl_offset = 1,
            [
            if t$ <> tloffno$, tloffno$ = t$
            ]
          toolno = t$ * 100 + zero
          if home_type = m_one, pbld, n$, *sgcode, *toolno, e$
          else, pbld, n$, [if nc_system_type = 0, *sg50], [if nc_system_type > 1, *sg50_b], pfxout, pfyout, pfzout, e$
          ]
        pe_inc_calc #Update previous
        absinc$ = sav_absinc
        copy_x = vequ(sav_xh)
        ]
      if tl_offset = 1,
        [
        if t$ <> tloffno$, tloffno$ = t$
        ]        
      toolno = t$ * 100 + tloffno$
      if t$ <> tloffno$,  " ///// Tool No. and Offset No. aren't same ///// ", e$
ADD ONE OF THE BELOW LINES HERE
      pbld, n$, *sgcode, *toolno, e$  #G0 tool change----------------------------------------------------------> Here is your tool number Output

HERE MOVE YOUR G54

 

what will you do here just add new line
 n$, *sg28ref, "U0.", "W0.", e$

or 

n$, *sg28ref, "U0.", e$
n$, *sg28ref, "W0.", [if y_axis_mch = yes$, "V0."], e$

It depends which axis you want to move first

 

Structure of your post probably looks different so just search for those variables in your post and set them in order 
First reference position
Tool change
G54 output

If you have some more questions feel free to send me msg 
 

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