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

I've been working on a custom drill cycle for my post and I've almost got it but I can't get it to input the feed with the value I have given it in my custom drill parameters.

 

I can get a post of this:

 

T21 M06 (.385 GO DRILL KENNAMETAL# 4149277)

M11 (UNLOCK)

G90 G80 G49 G40 G17 G00 G54 B0. X0. Y.818 S2650 M03

M10 (LOCK)

G43 H21 Z8.3 M88

(DRILL PISTON BORE)

G94

G01 Z0. F0. <---------- custom line

Z7. F25. <---------- custom line

Z8.3 F0. <---------- custom line

M89

G91 G28 Z0. M05

 

With this in my post:

 

 

pdrlcst$ #Custom drill cycles 8 - 19 (user option)

#Use this postblock to customize drilling cycles 8 - 19

pdrlcommonb

#if drillcyc = 8, pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,

# prdrlout, dwell, *feed, strcantext, e$

if drillcyc$ = 8,

[

sub_prg_call = peck1$

pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$

pbld, n$, "M98", *sub_prg_call, e$

]

 

if drillcyc$ = 9,

[

refht_z = refht$

pdrlcommonb

pcan1, pbld, n$, *sg01, *drl_prm1, *drl_prm2, e$

pbld, n$, pfzout, *feed, e$

pbld, n$, *refht_z, *drl_prm3, e$

pcom_movea

]

 

else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$

pcom_movea

 

pdrlcst_2$ #Custom drill cycles 8 - 19, additional points (user option)

#Use this postblock to customize drilling cycles 8 - 19

pdrlcommonb

#if drillcyc = 8, pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, dwell,

# feed, strcantext, e$

if drillcyc$ = 8,

[

sub_prg_call = peck1$

pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$

pbld, n$, "M98", *sub_prg_call, e$

]

 

if drillcyc$ = 9,

[

refht_z = refht$

pdrlcommonb

pcan1, pbld, n$, *sg01, *drl_prm1, *drl_prm2, e$

pbld, n$, pfzout, *feed, e$

pbld, n$, *refht_z, *drl_prm3, e$

pcom_movea

]

 

 

else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$

pcom_movea

 

Or I can get this:

 

 

T21 M06 (.385 GO DRILL KENNAMETAL# 4149277)

M11 (UNLOCK)

G90 G80 G49 G40 G17 G00 G54 B0. X0. Y.818 S2650 M03

M10 (LOCK)

G43 H21 Z8.3 M88

(DRILL PISTON BORE)

G94

G01 drl_prm1$ 8. drl_prm2$ 10.

Z7. F25.

Z8.3 drl_prm3$ 60.

M89

G91 G28 Z0. M05

 

With this in my post:

 

 

pdrlcst$ #Custom drill cycles 8 - 19 (user option)

#Use this postblock to customize drilling cycles 8 - 19

pdrlcommonb

#if drillcyc = 8, pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,

# prdrlout, dwell, *feed, strcantext, e$

if drillcyc$ = 8,

[

sub_prg_call = peck1$

pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$

pbld, n$, "M98", *sub_prg_call, e$

]

 

if drillcyc$ = 9,

[

refht_z = refht$

pdrlcommonb

pcan1, pbld, n$, *sg01, *drl_prm1$, *drl_prm2$, e$

pbld, n$, pfzout, *feed, e$

pbld, n$, *refht_z, *drl_prm3$, e$

pcom_movea

]

 

else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$

pcom_movea

 

pdrlcst_2$ #Custom drill cycles 8 - 19, additional points (user option)

#Use this postblock to customize drilling cycles 8 - 19

pdrlcommonb

#if drillcyc = 8, pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, dwell,

# feed, strcantext, e$

if drillcyc$ = 8,

[

sub_prg_call = peck1$

pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$

pbld, n$, "M98", *sub_prg_call, e$

]

 

if drillcyc$ = 9,

[

refht_z = refht$

pdrlcommonb

pcan1, pbld, n$, *sg01, *drl_prm1$, *drl_prm2$, e$

pbld, n$, pfzout, *feed, e$

pbld, n$, *refht_z, *drl_prm3$, e$

pcom_movea

 

I have my custom drill parameters set as follows:

 

 

# --------------------------------------------------------------------------

# Custom drilling cycle 9, carbide drill drilling cycle

# --------------------------------------------------------------------------

fmt "Z" 2 drl_prm1 #starting Z depth

fmt "F" 2 drl_prm2 #starting feed rate

fmt "F" 2 drl_prm3 #retract feed rate

fmt "Z" 2 refht_z #for Z retract height output

# --------------------------------------------------------------------------

 

Seems like I can get it to either post the F or Z code I have assigned or post the numbers I have for my custom parameters in Mastercam.

 

What am I doing wrong??

Link to comment
Share on other sites

That did it.

 

Thank you very much for your help.

 

The only other thing I added was:

 

if drillcyc$ = 9,

[

refht_z = refht$

drl_prm1 = drl_prm1$

drl_prm2 = drl_prm2$

drl_prm3 = drl_prm3$

pdrlcommonb

pcan1, pdrlxy, e$ <---------------------------------------added this line so it will move to next hole location

pbld, n$, *sg01, *drl_prm1, *drl_prm2, e$

pbld, n$, pfzout, *feed, e$

pbld, n$, *refht_z, *drl_prm3, e$

pcom_movea

]

 

Thanks again.

Link to comment
Share on other sites

Just an observation, when I create a variable, I try not to use a name that could be confused with another variable. The naming rules are basic, and there is a lot of latitude to be creative. So, instead of drl_prm1, you could have defined InitialZDepth as a variable name. That makes it much easier to track what it is used for when you don't remember what you did with drl_prm1... :cheers:

Link to comment
Share on other sites

So when I create a variable for custom drilling cycle can I use more than the ten different variables that the custom drill parameters has?

 

That is not what he saying. He is saying you can define the variable you use in a different way. You can get real trick with the 10 and have millions of possibilities.

 

if drl_prm1 > 10,

if drl_prm1 > 1000, then inside of the block you break it down to what you want for a group of numbers. Not sure why 10 is not enough, but yes the sky is the limits with any variable on how to use it just up the post builder to decide how complex they want to make it.

 

HTH

Link to comment
Share on other sites

What I intended to illustrate was that I tend to be very descriptive with the names that I assign to variables. In your first post, you defined variables like this:

 

fmt "Z" 2 drl_prm1 #starting Z depth
fmt "F" 2 drl_prm2 #starting feed rate
fmt "F" 2 drl_prm3 #retract feed rate
fmt "Z" 2 refht_z #for Z retract height output

 

Had this been my post I would define variables with names like this:

 

fmt "Z" 2 InitialZDepth           #starting Z depth
fmt "F" 2 InitialFeedrate        #starting feed rate
fmt "F" 2 RetractFeedrate    #retract feed rate
fmt "Z" 2 RetractZHeight	  #for Z retract height output

 

This type of naming makes it easier to recognize what the variable is being used for. Especially when you are making more edits a year from now. I actually have some very long variable names in my post... like sErrorMessageWarningToolDcompDoesNotMatchHcomp (this is easy to recognize what it is for)

 

What Crazy^Millman refers to in his post is useful if you need to pass more information to the NCI than you have system variables. (The variables that end with $).

 

HTH :cheers:

  • Like 1
Link to comment
Share on other sites

This type of naming makes it easier to recognize what the variable is being used for. Especially when you are making more edits a year from now. I actually have some very long variable names in my post... like sErrorMessageWarningToolDcompDoesNotMatchHcomp (this is easy to recognize what it is for)

 

+1! ;)

 

We should make a championship here! "See who's have the longest!!!"

:laughing::smoke::lol:

Link to comment
Share on other sites

I guess the part that was confusing me was I thought if it wasn't named drl_prm1 etc, then the post would not know where to look in Mastercam to get the custom drill parameters input while programming. Where I was going with the only having ten variables was if drl_prm1 was for a "Z" value then any other custom parameters I would use the parameter 1 in mastercam would always have to be a "Z" value, but I guess that is not the case if you can create your own variables?

Link to comment
Share on other sites

Any variable (including system variables) can be formatted, have address assigned (Z, Y, Q, etc.), whenever you like.  As often as you like.

 

In your case, you need to understand....  drl_prm1 is not the same variable as drl_prm1$.  You created drl_prm1.  It is a user defined variable.  So, you can name it anything that you want.  And format it however you want.

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