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:

Tooltable trouble


Recommended Posts

I have gotten myself a nice tooltable at the top of my programs. I thought I would need to be creating a buffer but by using some code from the Generic Fanuc 3X Mill post I got it without any buffers. (A bit over my head at this point)

 

( T01 | H01 | D01 | DIA = 1.500 | TOOL OAL = 2.010 | HOLDER MAX DIA = 2.375 | INGERSOLL # 24J1Q1581R01   )
( T02 | H02 | D02 | DIA = 0.500 | TOOL OAL = 2.010 | HOLDER MAX DIA = 2.375 |  1/2 BULL ENDMILL 0.0313 RAD   )
( T03 | H03 | D03 | DIA = 0.500 | TOOL OAL = 2.010 | HOLDER MAX DIA = 2.375 |  1/2 BULL ENDMILL 0.0625 RAD   )

 

The first 4 variables (and the last "pstrtool") are working great t$, tlngno$, tloffno$, and tldia$. (I noticed they all have the dollar sign at the end....if I put the dollar sign at the end of my new variables I get all kinds of errors...)

But the two variables I created (oa_len, and holddia) will not update for the 2nd 3rd ....tools, they are stuck on those values for the first tool. (2.010 & 2.375).

Although where the actual toolchanges take place it spits it out just fine...

 


N830 M00
( CONFIRM T02 H02 D02 DIA = 0.500 TOOL OAL = 2.000 HOLDER MAX DIA = 2.500 )
N832 G0 G17 G90 G54 X-39.8295 Y0. C0. B90. S100 M3



N1448 M00
( CONFIRM T03 H03 D03 DIA = 0.500 TOOL OAL = 3.000 HOLDER MAX DIA = 2.501 )
N1450 G0 G17 G90 G54 X0. Y-16.4903 C0. B0. S100 M3

 

 

Here is where I get the values from

 	if prmcode$ = 20007, oa_len = rparsngl(sparameter$, 3)

 	if prmcode$ = 20007, holddia = rparsngl(sparameter$, 6)

 

Here is where I format them


fmt "DIA = " 		8	tldia$  	# Note format
fmt "TOOL OAL = "	8	oa_len 	#Tool overall length
fmt "HOLDER MAX DIA = " 8 holddia	#holderdia	

 

Here is where they are output from

ptooltable  	#Tooltable output
 	sopen_prn, *t$, "|", *tlngno$, "|", *tloffno$, "|", *tldia$, "|", *oa_len, "|", *holddia, "|", pstrtool, sclose_prn, e$

 

And here is the pre read thingamajig...

pwrtt$      	#Pre-read NCI file
 	if t$ > 0, ptooltable

 

 

Any suggestions?

Link to comment
Share on other sites

Got it...

added this after pwrtt postblock, not sure but I think the pwrttparam "Pre-read parameter data" allows all the whole NCI to be parsed before any output is made. (Still a bit over my head):lol::lol:

 


pwrttparam$ 	#Pre-read parameter data
 	#"pwrttparam", ~prmcode$, ~sparameter$, e$
 	if prmcode$ = 20007, oa_len = rparsngl(sparameter$, 3) 
 	if prmcode$ = 20007, holddia = rparsngl(sparameter$, 6)  

 

( T01 | H01 | D01 | DIA = 1.500 | TOOL OAL = 2.010 | HOLDER MAX DIA = 2.375 | INGERSOLL # 24J1Q1581R01   )
( T02 | H02 | D02 | DIA = 0.500 | TOOL OAL = 2.000 | HOLDER MAX DIA = 2.500 |  1/2 BULL ENDMILL 0.0313 RAD   )
( T03 | H03 | D03 | DIA = 0.500 | TOOL OAL = 3.000 | HOLDER MAX DIA = 2.501 |  1/2 BULL ENDMILL 0.0625 RAD   )
( T04 | H04 | D04 | DIA = 0.188 | TOOL OAL = 1.000 | HOLDER MAX DIA = 2.000 |  3/16 BALL ENDMILL   )
( T05 | H05 | D05 | DIA = 0.375 | TOOL OAL = 1.250 | HOLDER MAX DIA = 2.500 |  3/8 BALL ENDMILL   )

 

Hope someone can benefit from my hair loss!!!

Link to comment
Share on other sites

Both variables you're looking for can be retrieved from one line. Change from this;

pwrttparam$ #Pre-read parameter data

#"pwrttparam", ~prmcode$, ~sparameter$, e$

if prmcode$ = 20007, oa_len = rparsngl(sparameter$, 3)

if prmcode$ = 20007, holddia = rparsngl(sparameter$, 6)

 

to this;

 

pwrttparam$ #Information from parameters

if prmcode$ = 20007, pilot_dia = rpar(sparameter$, 11)

 

 

and you can have this;

 

fmt 2 pilot_dia # 20007 Parameter line

fmt H 2 flute_len

fmt 2 oa_len

fmt 2 shldr_len

fmt 2 arbor_dia

fmt 2 hldr_dia

fmt 2 hldr_len

fmt 2 spindle_ccw

fmt 2 sfm

fmt 2 fpt

fmt 2 metric

 

This was already installed in my V9 MPMaster post so I would guess it's also in the X5 MPMaster.

 

Link to comment
Share on other sites
  • 1 year later...

Is it possible have mastercam post the stick out length of an endmill in the tool notes?

 

You mean like this?

Pretty sure the OAL is actually the stickout, if you can get one, you can get the other.

 

 


N830 M00
( CONFIRM T02 H02 D02 DIA = 0.500 TOOL OAL = 2.000 HOLDER MAX DIA = 2.500 )
N832 G0 G17 G90 G54 X-39.8295 Y0. C0. B90. S100 M3



N1448 M00
( CONFIRM T03 H03 D03 DIA = 0.500 TOOL OAL = 3.000 HOLDER MAX DIA = 2.501 )
N1450 G0 G17 G90 G54 X0. Y-16.4903 C0. B0. S100 M3

 

Link to comment
Share on other sites

My format may be different be rearranging the variable should get you what you need

 

%

O1548 (POST TEST)

(MCX FILE - C:\USERS\JOHN\DESKTOP\POST TEST.MCX-6)

(MATERIAL - ALUMINUM INCH - 2024)

(PROGRAM - POST TEST.NC)

(DATE - JUL-07-12)

(TIME - 08:42)

(T1 | 2" ALUMAHOG | H1 | D1 | D2.0000" | | FACING.....)

(HOLDER V40CT-E37)

(HOLDER GAGE LENGTH 2.46)

(TOOL LENGTH 2.858)

G10 G90 L10 P1 R5.318

(T2 | 1/2" 3FL VIPER CARBIDE ENDMILL | H2 | D2 | D0.5000" | | CONTOUR....)

(HOLDER C4006-0500)

(HOLDER GAGE LENGTH 2.462)

(TOOL LENGTH 1.25)

G10 G90 L10 P2 R3.712

(T3 | 1/4 X 90° SPOT DRILL | H3 | D3 | D0.2500" | | DRILL/CBORE)

(HOLDER C4006-0250)

(HOLDER GAGE LENGTH 2.462)

(TOOL LENGTH .763)

G10 G90 L10 P3 R3.225

(T4 | #25 130° MACHINE DRILL | H4 | D4 | D0.1495" | | PECK DRILL.)

(HOLDER C4007-0008 ER8)

(HOLDER GAGE LENGTH 2.513)

(TOOL LENGTH 1.1)

G10 G90 L10 P4 R3.613

(T5 | #10-32 CUTTING TAP | H5 | D5 | D0.1900" | | TAP........)

(HOLDER C40R5-0562)

(HOLDER GAGE LENGTH 3.174)

(TOOL LENGTH 1.75)

G10 G90 L10 P5 R4.924

(OVERALL MAX - Z2.)

(OVERALL MIN - Z-.6)

G00 G17 G40 G80 G90

 

pwrtt$      # Write tool table, scans entire file, null tools are negative
          if rotaxis$ > 0 | rotary_type$ > 0 | mill5$ <> 0,
            [
            rot_on_x = sav_rot_on_x
            output_z = no$
            ]
          #if vmc = 0 & tlplnno <> 2, rot_on_x = sav_rot_on_x
          #if vmc = 1 & tlplnno > 1, rot_on_x = sav_rot_on_x
          if tlplnno$ > 1, rot_on_x = sav_rot_on_x
          tlplnno$ = wbuf(3,wc3)  #Buffers out tool plane values
          t$ = wbuf(4,wc4)        #Buffers out tool number values
          if tool_table = 1, ptooltable,e$
          if tool_table = 2, ppredtool,e$
          if tool_table = 3, pmetatool,e$
          if t$ >= zero, tcnt = tcnt + one
          ptravel
          pwritbuf5
          pnote = t$
          if mi5$, g10_output = yes$
          if g10_output & pnote < 30,
          [
          tlo_val = hldr_len + oa_len
          hldr_gage = hldr_len
          tool_leng = oa_len
          spaces$=0
          if t$ >= 0, pbld, "(", "HOLDER", sspace, *schck_name ")", e$
          if t$ >= 0, pbld, "(",sholdlen, sspace, *hldr_gage,")", e$
          if t$ >= 0, pbld, "(",stoollen, sspace, *tool_leng,")", e$
          if t$ >= 0, pbld, "G10 G90 L10", sspace, "P", no_spc$, pnote, sspace, *tlo_val, e$
          if t$ >= 0, tcnt = tcnt + 1
          ]

 

Do the calculation in the same post block pwrtt but moving the output into the tooltable "should" achieve what you asked for in your question

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