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:

Recommended Posts

Hi.

I want to add in my post cycle Tap with Peck. I want to specify a depth of -20. peck 2 and I want to will recieve code code

( 5.00 - 0.8. TAP-RH SPIRAL YG-1  IPI )
T12 M6
G0 G90 G54 X-45.065 Y17.257 S300 M3
G43 H12 Z25.
M8
Z2.
G99 G84 R2. Z-10.  F240.
X-45.065 Y17.257 Z10.

 

or I want to specify a depth of -21. peck 3 and I want to will recieve

T12 M6
G0 G90 G54 X-45.065 Y17.257 S300 M3
G43 H12 Z25.
M8
Z2.
G99 G84 Z-7. R2. F240.
X-45.065 Y17.257 Z-14.
X-45.065 Y17.257 Z-21.

How I need to change my post?

Now i have post

pdrlcst11            #Canned Tap Cycle with Peck
      pdrlcommonb
	  result = nwadrs(striz1, peck1$)	
	  result = peck1$
	  result = nwadrs(striz2, peck2$)	
	  result = peck2$
      result = newfs(17, feed)  # Set for tapping Feedrate format
	  pcan1, pbld, n$, *sgdrlref, "G84", pxout, pyout, pzoutz, peck1$,
        prdrlout, *feed, strcantext, e$
		n$, [if dwell$ > 0, "M00"] e$
		n$, [if peck2$, *pfxout], [if peck2$, *pfyout], [if peck2$, *peck2$], e$
		n$, [if dwell$ > 0, "M00"] e$
		n$, pfxout, pfyout, pfzout, e$
		result = nwadrsval ("Q", peck1$)
		result = nwadrsval ("J", peck2$)
      pcom_movea
Link to comment
Share on other sites
  • 3 months later...

VK-8, do this...
========================
 

#Region, ptap$            #Canned Tap Cycle
ptap$            #Canned Tap Cycle
      MR1Value = opinfo(15200, 0)
      pdrlcommonb
      #RH/LH based on spindle direction
      [if (MR1Value = 1) & iRidgidMCode > 0, *iRidgidMCode, e$]          #Rigid Tapping
	  if (MR1Value = 1) & iBeginningPitchTapGCode > 0 & (tool_typ$ = 4 | tool_typ$ = 5), *iBeginningPitchTapGCode, no_spc$, scomm_str, no_spc$, "BEGINNING PITCH TAP", no_spc$, scomm_end, e$           #Rigid Tapping
      if use_pitch = 0, 
        [
          [if MR1Value = 1 | not(MR1Value = 2 & iPeck1field > 0) | MR1Value > 2, pcan1, *sgdrlref, *sgdrill, pfxout, pfyout, pfzout, prdrlout, [if iBeginningPitchTapGCode = 0, *feed], [if iPeck1field > 0, *peck1$]],
          #[if (MR1Value = 2 & iPeck1field > 0), pcan1, *sgdrlref, *sgdrill, pdrlxy, prdrlout],
          #[if iPeck1field > 0 & not(MR1Value = 2) & (tool_typ$ = 4 | tool_typ$ = 5), *peck1$], 
          [if (MR1Value = 1) & (iBeginningPitchTapGCode > 0 | iEndingPitchTapGCode > 0), pitch = 1/n_tap_thds$, *pitch], 
		  
		  [
           if MR1Value = 3, 
            use_pitch = 1,
            result = newfs(2, n_tap_thds$), 
            result = nwadrs("E",n_tap_thds$),
			*n_tap_thds$
		  ]
		  
          #[if not(MR1Value = 2 | MR1Value = 3) & peckclr$ = 0, *feed], 
		  [if MR1Value = 3, no_spc$, ", R1"], strcantext, e$
        ]
      else,
        [
        if metvals, pitch = n_tap_thds$  # Tap pitch (mm  per thread)
        else, pitch = 1/n_tap_thds$       # Tap pitch (inches per thread)
        pcan1, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
          prdrlout, [if peck1$, *peck1$], *pitch, !feed, strcantext, e$
        ]
		
      if MR1Value = 2 & iPeck1field > 0, pHaasPeckTap
      pcom_movea
#EndRegion, ptap$            #Canned Tap Cycle

++++++++++++++

#Region, ptap_2$          #Canned Tap Cycle
ptap_2$          #Canned Tap Cycle
      pdrlcommonb
      if (MR1Value = 2 & drillcyc$ = 3 & iPeck1field > 0), "(*)", e$
      if MR1Value = 1 | not(MR1Value = 2 & iPeck1field > 0) | MR1Value > 2, pdrlxy, e$
      #if MR1Value = 1 | not(MR1Value = 2 & iPeck1field > 0) | MR1Value > 2, pcan1, pdrlxy, pzout, pcout, pindexdrl, prdrlout, strcantext, e$
      if MR1Value = 2 & iPeck1field > 0, pHaasPeckTap2
      pcom_movea
#EndRegion, ptap_2$          #Canned Tap Cycle


#Region, pHaasPeckTap            #Canned Tap Cycle with Peck Inc
pHaasPeckTap            #Canned Tap Cycle with Peck Inc
      MR1Value = opinfo(15200, 0)
      pdrlcommonb #Maps and calculates XY, depth, R-height, etc.
      #RH/LH based on spindle direction
      result = newfs(12, feed)
	  if MR1Value = 2 & drillcyc$ = 3 & iPeck1field > 0,
        [
        result = force(refht_a, refht_i)
        #"REF HEIGHT:", ~refht$, e$
        #"TOS Z:", ~tosz$, e$
        #"DEPTH:", ~depth$, e$
        #Set zabs & zinc, from tosz minus peck1
        zabs = tosz$ - peck1$ #Set first peck depth
        zia = fmtrnd(zabs)
        zinc = zia - prv_xia
        #So, now we've set the first peck depth, for output in pfzout
        result = newfs(2, iPeck1field) # Text size
        result = nwadrs("Q",iPeck1field) # Text size word
		if MR1Value = 2 & iPeck1field > 0, *refht$, no_spc$, scomm_str, no_spc$, "HAAS PECK TAP MODE", no_spc$, scomm_end, e$
        *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, prdrlout, *feed, strcantext, no_spc$, scomm_str, no_spc$, *iPeck1field, no_spc$, scomm_end, e$
        total_depth = tosz$ - depth$ #Get total depth of hole
        full_pecks = int (total_depth / peck1$)
        total_depth = fmtrnd(total_depth) #round
        peck1$ = fmtrnd(peck1$) #round
        last_peck = frac(total_depth / peck1$)
        #result = mprint("Last Peck")
        #result = mprint(last_peck)
        #result = mprint("total depth")
        #result = mprint(total_depth)
        #exitpost$ #skip the while loops below temp.
        if full_pecks = one & last_peck > zero, #two or more pecks, remember 1st has already been output!
          [
          #output last peck only
          zabs = depth$ #Set peck depth
          zia = fmtrnd(zabs)
          zinc = zia - prv_xia
          pcan1, pbld, n$, sgdrlref, sgdrill, pxout, pyout, pfzout, pcout
          prdrlout, *feed, strcantext, e$
          ]
        if full_pecks > one & last_peck,
          [
          full_pecks = full_pecks - one #subtract 1st peck
          #while loop to output full pecks - one
          while full_pecks >= one,
            [
            #full_pecks is the counter for the loop, must evaluate to Zero eventually!
            zabs = zabs - peck1$
            zia = fmtrnd(zabs)
            zinc = zia - prv_xia
            sgdrlref, sgdrill, pdrlxy, pfzout, pcout, prdrlout, strcantext, e$ #SECOND
            full_pecks = full_pecks - one #decrement counter
            ]
          #output last peck only
          zabs = depth$ #Set last peck depth
          zia = fmtrnd(zabs)
          zinc = zia - prv_xia
          sgdrlref, sgdrill, pdrlxy, pfzout, pcout, prdrlout, strcantext, no_spc$, scomm_str, no_spc$, "ENDED", no_spc$, scomm_end, e$
          #after loop exit, output last_peck
          ]
        if full_pecks > one & not(last_peck),
          [
          full_pecks = full_pecks - one #subtract 1st peck
          #while loop to output full pecks - one
          while full_pecks >= one,
            [
            #full_pecks is the counter for the loop, must evaluate to Zero eventually!
            zabs = zabs - peck1$
            zia = fmtrnd(zabs)
            zinc = zia - prv_xia
            sgdrlref, sgdrill, pdrlxy, pcout, e$ #, no_spc$, "(STARTED)"
            #prdrlout, *feed, strcantext, e$
            full_pecks = full_pecks - one #decrement counter
            ]
          ]
        ]
      if MR1Value = 2 & iPeck1field > 0, *refht$, e$
	  if MR1Value = 2 & iPeck1field > 0, *initht$, e$
      pcom_movea
#EndRegion, pHaasPeckTap            #Canned Tap Cycle with Peck Inc

#Region, pHaasPeckTap2
pHaasPeckTap2
      MR1Value = opinfo(15200, 0)
      pdrlcommonb #Maps and calculates XY, depth, R-height, etc.
      #RH/LH based on spindle direction
      result = newfs(12, feed)
      if MR1Value = 2 & drillcyc$ = 3 & iPeck1field > 0,
        [
        result = force(refht_a, refht_i)
        #"REF HEIGHT:", ~refht$, e$
        #"TOS Z:", ~tosz$, e$
        #"DEPTH:", ~depth$, e$
        #Set zabs & zinc, from tosz minus peck1
        zabs = tosz$ - peck1$ #Set first peck depth
        zia = fmtrnd(zabs)
        zinc = zia - prv_xia
        #So, now we've set the first peck depth, for output in pfzout
	  ToolSequenceNumber = t$
	  ToolSquenceFirstTimeUsed = finc(3, t$)
	  PToolSquenceThirdTimeUsed
	  *ToolSequenceNumber, no_spc$, scomm_str, no_spc$, sOperationComment, no_spc$, ", CUT#", no_spc$, sToolPathNumber, no_spc$, scomm_end, e$ #Mid tool sequence
	  *t$, "M6", ptoolcomm, e$ #Mid tool sequence
      "G0 G90 G17", *g_wcs, "M19", e$
      pfxout, pfyout, *speed, *spindle, e$
        "G43", *tlngno$, *initht$, e$
        if MR1Value = 2 & iPeck1field > 0, *refht$, no_spc$, scomm_str, no_spc$, "HAAS PECK TAP MODE", no_spc$, scomm_end, e$
        *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, prdrlout, *feed, strcantext, no_spc$, scomm_str, no_spc$, *iPeck1field, no_spc$, scomm_end, e$
        total_depth = tosz$ - depth$ #Get total depth of hole
        full_pecks = int (total_depth / peck1$)
        total_depth = fmtrnd(total_depth) #round
        peck1$ = fmtrnd(peck1$) #round
        last_peck = frac(total_depth / peck1$)
        #result = mprint("Last Peck")
        #result = mprint(last_peck)
        #result = mprint("total depth")
        #result = mprint(total_depth)
        #exitpost$ #skip the while loops below temp.
        if full_pecks = one & last_peck > zero, #two or more pecks, remember 1st has already been output!
          [
          #output last peck only
          zabs = depth$ #Set peck depth
          zia = fmtrnd(zabs)
          zinc = zia - prv_xia
          pcan1, pbld, n$, sgdrlref, sgdrill, pxout, pyout, pfzout, pcout,
          prdrlout, *feed, strcantext, e$
          ]
        if full_pecks > one & last_peck,
          [
          full_pecks = full_pecks - one #subtract 1st peck
          #while loop to output full pecks - one
          while full_pecks >= one,
            [
            #full_pecks is the counter for the loop, must evaluate to Zero eventually!
            zabs = zabs - peck1$
            zia = fmtrnd(zabs)
            zinc = zia - prv_xia
            sgdrlref, sgdrill, pdrlxy, pfzout, pcout, prdrlout, strcantext, e$ #SECOND
            full_pecks = full_pecks - one #decrement counter
            ]
          #output last peck only
          zabs = depth$ #Set last peck depth
          zia = fmtrnd(zabs)
          zinc = zia - prv_xia
          sgdrlref, sgdrill, pdrlxy, pfzout, pcout, prdrlout, strcantext, no_spc$, "(ENDED)", e$
          #after loop exit, output last_peck
          ]
        if full_pecks > one & not(last_peck),
          [
          full_pecks = full_pecks - one #subtract 1st peck
          #while loop to output full pecks - one
          while full_pecks >= one,
            [
            #full_pecks is the counter for the loop, must evaluate to Zero eventually!
            zabs = zabs - peck1$
            zia = fmtrnd(zabs)
            zinc = zia - prv_xia
            sgdrlref, sgdrill, pdrlxy, pcout, e$
             #prdrlout, *feed, strcantext, e$
            full_pecks = full_pecks - one #decrement counter
            ]
          ]
        ]
      pcom_movea
#EndRegion, pHaasPeckTap2
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...