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:

Adding Safety Lines to the Header Section


mayu
 Share

Recommended Posts

Is it a bad practice to add safety lines to the header section of a pst file?

In this specific case, we have a simple 2-axis lathe that will never have any additional axes or axis combos.

We want our post to generate the following safety line:

"G00 G40 G80 G99"

It comes out pretty clean when added to the header.

Please let me know if there is anything inappropriate in this post.

post_header.jpg.94ca00dcc707442ad5646b528baa9ce7.jpg

 

Link to comment
Share on other sites

I would do it this instead...doing it in the header, it will only ever come out at the start of the program...

I prefer safety blocks at the start of each tool..so I would move it to the toolchange section as I show it below

ltlchg$          #Toolchange, lathe
      toolchng = one
      gcode$ = zero
      copy_x = vequ(x$)
      "G00 G40 G80 G99", e$<------------HERE INSTEAD
      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, pfzout, e$
        else,
          [
          #Toolchange g50 position
          pbld, n$, *sg28ref, "U0", "W0", e$
          toolno = t$ * 100 + zero
          if home_type = m_one, pbld, n$, *sgcode, *toolno, e$
          else, pbld, n$, *sg50, pfxout, pfzout, e$
          ]
        pe_inc_calc #Update previous
        absinc$ = sav_absinc
        copy_x = vequ(sav_xh)
        ]
      toolno = t$ * 100 + tloffno$
      pbld, n$, *toolno, e$
      pcom_moveb    #Reset machine position, set inc. from last position
      pcan
      pspindle
      #Added for 'css_start_rpm' logic
      if css_actv$,
        [
        if css_start_rpm,
          prpm # Direct RPM startup for programmed CSS
        else,
          pcssg50, pcss # NO RPM start - just output the CSS
        ]
      else, # Direct RPM was programmed
        [
        prpm # Output programmed RPM
        ]
      sav_absinc = absinc$
      if home_type > one, absinc$ = zero
      pcan1, pbld, n$, psccomp, *sgcode, pwcs, pfxout, pfzout,
        pscool, strcantext, e$
      plcc_lead_end #Use sav_xa to position with comp. LCC
      pcom_movea    #Update previous, pcan2
      ps_inc_calc   #Reset current
      absinc$ = sav_absinc
      #Added for 'css_start_rpm' logic
      if css_start_rpm,
        pcssg50, pcss # CSS output AFTER a G97S???? RPM spindle startup
      c_msng$        #Position single-tool sub, sets inc. current if G54...
      toolchng = zero

 

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