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:

Post Help


Recommended Posts

I need to add a line into my post for broken tool detection.  I have done that but I have one problem.  I want the post to fill in some values.  I need to have the post output this line.  G600 D? R? H.01 V.01 U3.  I want mastercam to fill the D value and R value.  D value for the dia offset and the R value for the radius of the tool.  I got the line into the post put I do not know how to get it to fill in the D an R value.  Any help would be great.

Link to comment
Share on other sites
3 hours ago, JAMES GABEL said:

I need to add a line into my post for broken tool detection.  I have done that but I have one problem.  I want the post to fill in some values.  I need to have the post output this line.  G600 D? R? H.01 V.01 U3.  I want mastercam to fill the D value and R value.  D value for the dia offset and the R value for the radius of the tool.  I got the line into the post put I do not know how to get it to fill in the D an R value.  Any help would be great.

James you need to make a format statement with a new variable. Then make a condition statement at the place your waiting to invoke or output this value. Then it should work. I don't like changing the default variables in a post and when I need to do something like this always make new ones. 

Link to comment
Share on other sites
26 minutes ago, MIL-TFP-41 said:

tcr$ should get you what you are looking for

He will need to see how it is defined if used else where. Why I suggested the method I did. Define a new variable and then have the original variable equal the new variable. You keep the original use and method in tact and then can do what you need. Only time I will change the predefined variables output in a post is if I know it will never be needed like it was originally. 

Link to comment
Share on other sites

I added some new variables and tried adding them in the callout at the location i need it.  That got me close.  I need it to output a D and the dia of the tool and it is putting out just the number zero.  How can I get it to put out the dia of the tool in decimal form?  Below is a sample of what it is putting out right now and what I need.

 

G600 D0 H.01 V.01 U3-------As you can see it is putting out a D0 and I need it to be D.3937(dia of tool).  Right after the this value I need the corner rad of the tool which would be the value R(decimal value of the corner radius.  This example is based on a 10 mm endmill with .5mm corner rad

 

Needs to look like this.

G600 D.3937 R.0196 H.01 V.01 U3

 

 

 

Link to comment
Share on other sites
  • 3 weeks later...

I have changed the way I am going to call the broken tool detection.  Using the G600 D.3937 R.0196 H.01 V.01 U3 would use the touch censor and I would have to turn spindle off run the code and then turn spindle back on.  I decided to to use the laser for the broken tool detection.  Doing this i can leave the spindle on and check the tool.  My post posts out a main and subs.  I use the misc values to tel the post how many work offsets I want it to post out for and post.  I have it checking the tool before and after each tool runs.  Now that I added this code to the post when it goes to check the tool after it runs it picks up the spindle speed for the next tool.  I can not figure out how to fix this.   I the next tool it is also adding 1 to the H value in the code.   Any help would be appreciated.

Link to comment
Share on other sites

I suspect that you call your line for the tool inspection after the tool has retracted.

If that is the case, you will need to create previous variables.  In our post we have a post block called plast where we put the information we need to use in the next operation.   This should take care of the problems.

Link to comment
Share on other sites
On 9/23/2019 at 6:57 AM, JAMES GABEL said:

I have changed the way I am going to call the broken tool detection.  Using the G600 D.3937 R.0196 H.01 V.01 U3 would use the touch censor and I would have to turn spindle off run the code and then turn spindle back on.  I decided to to use the laser for the broken tool detection.  Doing this i can leave the spindle on and check the tool.  My post posts out a main and subs.  I use the misc values to tel the post how many work offsets I want it to post out for and post.  I have it checking the tool before and after each tool runs.  Now that I added this code to the post when it goes to check the tool after it runs it picks up the spindle speed for the next tool.  I can not figure out how to fix this.   I the next tool it is also adding 1 to the H value in the code.   Any help would be appreciated.

The reason you were getting a "0" D value, was likely due to "rounding". If you have a diameter that is "0.375" for example, and the formatting for your variable is "integer", then the Post will "round down", as expected.

You need to format your output variable as "decimal, 4 place", in order to get the proper output from your actual tool diameter.

my_tldia : 0  #Initialize variable for Tool Diameter output
my_tcr   : 0  #Initialize variable for Tool Corner Rad

fmt  "D"  2  my_tldia    #Assign "decimal output, 4/3 place", to 'my_tldia'
fmt  "R"  2  my_tcr      #Assign "decimal output, 4/3 place", to 'my_tcr'

############################

       #Inside 'pretract', above where you want output
      my_tldia = tldia$ #Get current tool diameter
      my_tcr = fmtrnd(tcr$)
      if last_mi6 = 1, #Read "last" misc. integer value, to choose TBD output, or not
        [
        pbld, n$, "G600", *my_tldia, [if my_tcr >= .0001, *my_tcr], "H.01", "V.01", "U3.", e$
        ]

 

-------------------------------------

You should be tracking the "last variables", as Martin mentioned in his post below.

What Post are you editing? (What was the "base" Post, that your Post Processor was created from? Is it "MPMaster", or one of the "Generic _____ 4X Mill Posts" from CNC Software?

In MPMaster, 'plast' is only called in two places:

  1. At the end of 'ptlchg_com' (the "common tool change Post Block").
  2. At the end of 'ptlchg0$ ("null tool change", tool number repeats, can be a "new operation in Mastercam, but using the "same tool number", or can be a "Depth Cut" or "Multi-Pass". Every "pass" is output as a Null Tool Change event.

Both the MPMaster Post and the "Generic _____ 4X Mill Posts" (substitute "______" for Fanuc, Haas, Okuma, etc.), use the same type of architecture to control "the call to 'pretract'".

  • Both MPMaster and the CNC Software Generic Posts, each have a Post Block named 'ptlchg_1002$'. This Post Block is called "before the actual Tool Change", which could be 'psof$' (1st tool), 'ptlchg$ (actual tool change), or 'ptlchg0$' (null tool change).
  • 'ptlchg_1002$ is called with the 'tlchng_aft' strategy. This allows the Post to read the first "NCI Gcode 0" move, after the tool change block, so we can get the "first move", and then call the Tool Change.
  • It is inside 'ptlchg_1002$', where the decision is made to "retract the tool before the tool change, or not". 

Here is a copy of the 'ptlchg_1002$' Post Block, from MPMaster:

ptlchg1002$      #Call at actual toolchange, end last path here
      if op_id$ <> last_op_id,  #This Post Block checks to see "is this a NEW Operation". If "New", it reads the Machine Settings in 'pset_mach'.
        [
        pset_mach   #Set rotary switches by reading machine def parameters
        if cuttype = 1, sav_rev = rev * m_one  #Save the current rev value so Axis Sub doesn't start again at 0 (avoid unwind)
        ]
      pspindle #Here, we capture the Spindle Values (CW vs. CCW, and RPM. Also, flags if the spindle is on/off vs. last Op) Does not output data here!
      whatline$ = four #Required for vector toolpaths
      if gcode$ = 1000, #Here, we test for "null tool change". If "null", we basically don't do anything, except flag the Probe internally if used...
        [
        #Null toolchange
        uninhibit_probe$
        ]
      else, #This is where we test for "actual tool change". This is 'NCI Gcode 1002', and is only "false" at the 1st tool change (NCI Gcode = 1001).
        [
        #Toolchange and Start of file
        if gcode$ = 1002,
          [
          #Actual toolchange
          pretract #Here is where we actually call "pretract". This is "after the last path has completed", and "Before the start of the next path event".
          ]
        if stagetool = one, prv_next_tool$ = m_one
        prv_xia = vequ(xh$)
        prv_feed = c9k
        ]

 

1 hour ago, Mgrenier said:

I suspect that you call your line for the tool inspection after the tool has retracted.

If that is the case, you will need to create previous variables.  In our post we have a post block called plast where we put the information we need to use in the next operation.   This should take care of the problems.

Yes, 'plast' is the best place to capture the "previous" tool data. Then, in 'pretract', we can create the logic to read "last_mi5", or whatever "MI" or "MR" value you are using, to initiate the Broken Tool Detection.

 

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