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:

output tool lenght at post


stevieboy
 Share

Recommended Posts

I'm using a Generic Haas 4x mill. pst

I would like to be able to see the tool length

when I post.

( MATERIAL - ALUMINUM INCH - 7075 )

( T2 | 1 INCH ROUGHER | H2 )

( T3 | 1/4 FLAT ENDMILL | H3 )

( T9 | 1/2 FLAT ENDMILL | H9 )

( T10 | 1/2 LOLLIPOP MILL | H10 )

( T5 | 1/8 CENTERDRILL | H5 )

( T6 | 1/2 DRILL | H6 )

( T4 | 1 INCH BULL ENDMILL 0.125 RAD | H4 )

( T8 | 1/2 BULL ENDMILL 0.125 RAD | H8 )

The machine operator could set tool lenght or I could copy/paste right to my setup sheet.

thanks

Link to comment
Share on other sites

Tim, this what I found.

fmt T 4 t$ #Tool number

fmt T 4 first_tool$ #First tool used

fmt T 4 next_tool$ #Next tool used

fmt D 4 tloffno$ #Diameter offset number

fmt H 4 tlngno$ #Length offset number

fmt G 4 g_wcs #WCS G address

fmt P 4 p_wcs #WCS P address

fmt S 4 speed #Spindle Speed

fmt M 4 gear #Gear range

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

fmt N 21 n$ #Sequence number

fmt X 2 xabs #X position output

fmt Y 2 yabs #Y position output

fmt Z 2 zabs #Z position output

fmt X 3 xinc #X position output

fmt Y 3 yinc #Y position output

fmt Z 3 zinc #Z position output

fmt A 11 cabs #C axis position

fmt A 14 cinc #C axis position

fmt A 4 indx_out #Index position

fmt R 14 rt_cinc #C axis position, G68

fmt I 3 iout #Arc center description in X

fmt J 3 jout #Arc center description in Y

fmt K 3 kout #Arc center description in Z

fmt R 2 arcrad$ #Arc Radius

fmt F 9 feed #Feedrate

fmt P 11 dwell$ #Dwell

fmt M 5 cantext$ #Canned text

fmt F 2 pitch #Tap pitch (units per thread)

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

#Move comment (pound) to output colon with program numbers

fmt O 4 progno$ #Program number

#fmt ":" 4 progno$ #Program number

fmt O 7 main_prg_no$ #Program number

#fmt ":" 7 main_prg_no$ #Program number

fmt O 7 sub_prg_no$ #Program number

#fmt ":" 7 sub_prg_no$ #Program number

fmt X 2 sub_trnsx$ #Rotation point

fmt Y 2 sub_trnsy$ #Rotation point

fmt Z 2 sub_trnsz$ #Rotation point

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

fmt Q 2 peck1$ #First peck increment (positive)

fmt J 2 peck2$ #Descending peck value

fmt K 2 peckclr$ #Final peck value

fmt Q 2 shftdrl$ #Fine bore tool shift

fmt R 2 refht_a #Reference height

fmt R 2 refht_i #Reference height

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

fmt "TOOL - " 4 tnote #Note format

fmt "DIA. OFF. - " 4 toffnote #Note format

fmt "LEN. - " 4 tlngnote #Note format

fmt "TOOL DIA. - " 1 tldia$ #Note format

fmt "XY STOCK TO LEAVE - " 2 xy_stock #Note format

fmt "Z STOCK TO LEAVE - " 2 z_stock #Note format

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

fmt 4 year2 #Calculated year value

fmt 18 time2 #Capture 24-hour time value into 'time2' variable

fmt 19 hour #Hour

fmt 20 min #Minutes

Link to comment
Share on other sites

I used this in the mpmaster post to place notes that are in the "manufacturer's tool code" field of the tool parameters page into the posted program.

 

In the "misc strings" section of the post I added the last line...

code:

 # Misc strings

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

snull : "" # Null character string

sdot : "." # dot string

stilde : "~" # Tidle string

slbracket : "("

srbracket : ")"

sslash : "/"

ssemicolon : ";"

snocomm : "DEFINE TOOL NAMES"

stoper : "" # String for tool notes

spostname : "" # Post name

snullop : "UNDEFINED OPERATION"

slicense : "IN-HOUSE SOLUTIONS"

scomm_sav : ""

scomm_str : "("

scomm_end : ")"

slockcomm : "LOCK C"

sunlockcomm : "UNLOCK C"

slock2comm : "LOCK B" ##############################

sunlock2comm: "UNLOCK B" ##############################

stl_mfg_com : "" #'tool mfg comment' from tool


Then in the "parameter read postblocks" section of the post I added the last line...

code:

  

 

pwrttparam$ #Information from parameters

if prmcode$ = 10010, stock = rpar(sparameter$,1) # Stock to leave in Z

if prmcode$ = 10068, stock1 = rpar(sparameter$,1) # Stock to leave in XY

if prmcode$ = 12068, stock2 = rpar(sparameter$,1) # Stock to leave in Z facing

if prmcode$ = 15145, metvals = rpar(sparameter$,1)

if prmcode$ = 15346, comp_type = rpar(sparameter$,1)

if prmcode$ = 20004, slot = rpar(sparameter$,16)

if prmcode$ = 20006, cut_ability = rpar(sparameter$,8)

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

if prmcode$ = 12628,

[

hst_flg = 1

hststyle = rpar(sparameter$,1)

]

if prmcode$ = 20002, stl_mfg_com = sparameter$ #'manufacturer' data #######################

Then in the "tooltable output" section, I added the last few lines

 

code:

  

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

# Tooltable Output

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

pwrtt$ # Write tool table, scans entire file, null tools are negative

if rotaxis$ > 0 | rotary_type$ > 0 | mill5$ <> 0,

[

sav_rot_on_x = rot_on_x

output_z = no$

]

if vmc = 0 & tlplnno$ <> 2, sav_rot_on_x = rot_on_x

if vmc = 1 & tlplnno$ > 1, sav_rot_on_x = rot_on_x

sav_rot_on_x = rot_on_x #Uncomment this line to output rotary axis value even when it's not used

t$ = wbuf(4,wc4) #Buffers out tool number values

if tool_table = 1, ptooltable

if tool_table = 2, ppredtool

if tool_table = 3, pmetatool

if t$ >= zero, tcnt = tcnt + one

ptravel

pwritbuf5

spaces$ = 0 ###########################added this and next 7 lines

if t$ >= 0,

[

#"(", *t$, " ", pstrtool, ", ", *tldia$, " DIA)",e$ #already in tool table

#"(TOOL LENGTH:", *oa_len, " FLUTE LENGTH:", *flute_len, ")", e$ #commented out maybe use in future

"(VENDOR INFO:", *stl_mfg_com, ")", e$ #removed TOOL HOLDER:", *stl_chuck_com, "

If you don't have a "tooltable output" section, I would be willing to bet the same line would work in the psof section

Link to comment
Share on other sites

Here's what I'm seeing in my post

misc. strings....

#Misc. string definitions

sopen_prn : "(" #String for open parenthesis "("

sclose_prn : ")" #String for close parenthesis ")"

sdelimiter : "|" #String for delimiter

sg95 : "G95" #Feed per rotation

sm29 : "M29" #Rigid tapping preperation support function

sg80 : "G80" #Cancel canned drilling cycle

sg43 : "G43" #Tool length compensation

sg49 : "G49" #Tool length compensation cancel

sg92 : "G92" #Set work piece coordinate system

sm06 : "M6" #Toolchange

 

In the pwrttparm.... I see...

 

pwrttparam$ #Pre-read parameter data

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

if prmcode$ = 15346, comp_type = rpar(sparameter$, 1) #Cutter compensation type - 0=computer, 1=control, 2=wear, 3=reverse wear, 4=off

if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1) #Capture stock to leave (XY)

if prmcode$ = 10068, z_stock = rpar(sparameter$, 1) #Capture stock to leave (Z)

 

In the pwrtt.. I see..

 

 

pwrtt$ #Pre-read NCI file

if tool_info > 1 & t$ > 0 & gcode$ <> 1003, ptooltable

 

pwrttparam$ #Pre-read parameter data

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

if prmcode$ = 15346, comp_type = rpar(sparameter$, 1) #Cutter compensation type - 0=computer, 1=control, 2=wear, 3=reverse wear, 4=off

if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1) #Capture stock to leave (XY)

if prmcode$ = 10068, z_stock = rpar(sparameter$, 1) #Capture stock to leave (Z)

 

pparameter$ #Read operation parameters

#rd_params is used to call pparameter postblock and read the parameters of the operation specified in rd_param_op_no

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

if prmcode$ = 12025, rotary_axis2 = rpar(sparameter$, 1) #Capture the axis of rotation in Multiaxis

 

I'm using Generic Haas 4x mill. pst

I'm not sure about the mpmaster post ?

 

thanks

Link to comment
Share on other sites

Steve,

I played around with the generic haas post that your using. I am able to get the parameter needed into the tooltable at the top of the program. the only problem is I can only get the "required pilot dia." which is the 1st variable in the 20007 nci param line. the one you need is the 3rd variable in that nci line...

 

Any one know what I have to do to this line to get it to give me the 3rd variable of that nci line instead of the first???

 

code:

  

if prmcode$ = 20007, oa_len = rpar(sparameter$, 1)

Link to comment
Share on other sites

With the assumption you have or have added the 20007 parameter variable formats, try changing your line;

code:

           if prmcode$ = 20007, oa_len = rpar(sparameter$, 1)

to;

code:

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

This will get you all the data associated with parameter 20007.

 

Then just use the variable oa_len where it's needed.

Link to comment
Share on other sites

Tried that Tim, no luck, here is what I am getting:

code:

 %

O0( T )

( DATE=DD-MM-YY - 17-09-10 TIME=HH:MM - 07:06 )

( MCX FILE - A1SBSCOMPANYENGINEERINGMCAMX4HAAS.MCX )

( NC FILE - C:MCAMXMILLNCT.NC )

( MATERIAL - ALUMINUM INCH - 2024 )

( T1 | 1/2 FLAT ENDMILL | H1 | D1 |63.32 | WEAR COMP | TOOL DIA. - .5 )

N100 G20

N110 G0 G17 G40 G49 G80 G90

N120 T1 M6

The 63.32 is the number i put in the pilot dia. field.

 

here is what I added to the gen. haas post:

 

code:

 fmt "TOOL - "      4   tnote    #Note format

fmt "DIA. OFF. - " 4 toffnote #Note format

fmt "LEN. - " 4 tlngnote #Note format

fmt "TOOL DIA. - " 1 tldia$ #Note format

fmt "XY STOCK TO LEAVE - " 2 xy_stock #Note format

fmt "Z STOCK TO LEAVE - " 2 z_stock #Note format

# --------------------------------------------------------------------------#added following group

#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

I also added ", sdelimiter, *oa_len," in the following:

code:

 ptooltable      #Tooltable output

sopen_prn, *t$, sdelimiter, pstrtool, sdelimiter, *tlngno$,

[if comp_type > 0 & comp_type < 4, sdelimiter, *tloffno$, sdelimiter, *oa_len, sdelimiter, *scomp_type, sdelimiter, *tldia$],

[if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock],

sclose_prn, e$

And the last line here:

 

code:

 

pwrttparam$ #Pre-read parameter data

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

if prmcode$ = 15346, comp_type = rpar(sparameter$, 1) #Cutter compensation type - 0=computer, 1=control, 2=wear, 3=reverse wear, 4=off

if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1) #Capture stock to leave (XY)

if prmcode$ = 10068, z_stock = rpar(sparameter$, 1) #Capture stock to leave (Z)

if prmcode$ = 20007, oa_len = rpar(sparameter$, 1)

I know i'm close because in the nci file i see the 63.32 under the 20007 and the value i entered for the tool length is the 3rd number in that same nci line.....the 63.32 is the first value in that line.

 

I just need to know how to pull the 3rd value from the line, not the first... headscratch.gif

Link to comment
Share on other sites

I did, no dice...

here is what gets posted when that change is made.

code:

 %

O0( T )

( DATE=DD-MM-YY - 17-09-10 TIME=HH:MM - 08:07 )

( MCX FILE - A1SBSCOMPANYENGINEERINGMCAMX4HAAS.MCX )

( NC FILE - C:MCAMXMILLNCT.NC )

( MATERIAL - ALUMINUM INCH - 2024 )

( T1 | 1/2 FLAT ENDMILL | H1 | D1 |0. | WEAR COMP | TOOL DIA. - .5 )

Link to comment
Share on other sites

We've got a winner.

 

I shut it off yesterday when I noticed that was being output instead of the length.

I think you should be able to just switch the variable names to get it to make sense.

 

Thanks Tim.

 

Your good to go Stevieboy.

 

Another one bites the dust thanks to the "SUPERFORUM!!!!!!!!!!!!" cheers.gif

Link to comment
Share on other sites

Paul,

 

If you have a minute, could you explain the rparsngl vs. rpar?

 

And I am assuming the "3" after sparameter$, tells it to grab the third number in the 20007 nci parameter line? Is this correct or just a coincidence?

 

Thanks for spending the time you already have with us, it is greatly appreciated.

Link to comment
Share on other sites

I can do better than that Keith, you already have the information in your computer, you just need to look. Open up the McamX4_NCI_Parameter_Ref.pdf file (most likely located in C:McamX4documentation or C:McamXdocumentation) and do a search for rparsngl. Our doc guy (the amazing Rob Bernobich) has done a fantastic job explaining it and all of the methods for extracting parameter data (much better than I can do in a forum reply).

 

To quickly answer the first question however, the difference between rpar and rparsngl is that rparsngl will return to value for a single item, using rpar requires you to initialize an 'implied array' of variables to get to the same information if more than one item appears on a parameter line. For example, in this case you would need to initialize three variables in a row in order to get the value you are looking for (the third item on the parameter line). Using rparsngl requires only a single variable (MUCH simpler).

Link to comment
Share on other sites

Hahah

Ok.. Here smile.gif what I got so far, I'm hoping to get a chance this afternoon to look at what we got, but here's my update..

Output tool stick out in header

fmt 2 pilot_dia # 20007 Parameter line

fmt H 2 flute_len

fmt 2 oa_len #length stick out Varaible

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

 

pwrttparam$ #Information from parameters

if prmcode$ = 10010, stock = rpar(sparameter$,1) # Stock to leave in Z

if prmcode$ = 10068, stock1 = rpar(sparameter$,1) # Stock to leave in XY

if prmcode$ = 12068, stock2 = rpar(sparameter$,1) # Stock to leave in Z facing

if prmcode$ = 15145, metvals = rpar(sparameter$,1)

if prmcode$ = 15346, comp_type = rpar(sparameter$,1)

if prmcode$ = 20004, slot = rpar(sparameter$,16)

if prmcode$ = 20006, cut_ability = rpar(sparameter$,8)

if prmcode$ = 20007, oa_len = rparsngl(sparameter$, 3) ###add this to the “pwrttparam$”

#if prmcode$ = 20007, pilot_dia = rpar(sparameter$,15)

if prmcode$ = 12628,

[

hst_flg = 1

hststyle = rpar(sparameter$,1)

]

 

 

ptooltable # Write tool table, scans entire file, null tools are negative

tnote = t$

toffnote = tloffno$

tlngnote = tlngno$

spaces$=0

if t$ >= zero,

[

if tcr$>0, scomm_str, *t$, ptspace, " - ", plistcomm, " - ", *tlngno$, phspace, " - ", *tloffno$, pdspace, " - ", *tldia$, punit, pdiamspc, " - ", *tcr$, punit, scomm_end, e$

if tcr$=0, scomm_str, *t$, ptspace, " - ", plistcomm, " - ", *tlngno$, phspace, " - ", *tloffno$, pdspace, " - ", *tldia$,"-"," ","Min Length ="," ",*oa_len, punit, pdiamspc, scomm_end, e$

]

#if t$ >= zero,

# [

# if tcr$>0, scomm_str, *t$, ptspace, " - ", plistcomm, " - ", *tlngno$, phspace, " - ", *tloffno$, pdspace, " - ", *tldia$, punit, pdiamspc, " - ", *tcr$, punit, " - ", popnote, scomm_end, e$

# if tcr$=0, scomm_str, *t$, ptspace, " - ", plistcomm, " - ", *tlngno$, phspace, " - ", *tloffno$, pdspace, " - ", *tldia$, punit, pdiamspc, " - ", " - ", popnote, scomm_end, e$

# ]

#if $t >= zero,

# [

# scomm_str, *t$, ptspace, " - ", plistcomm, scomm_end, e$

# ]

#if t$ >= zero,

# [

# if tcr$>0, scomm_str, *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldia$, " ", *tcr, punit, " ", popnote, scomm_end, e$

# if tcr$=0, scomm_str, *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldia$, " ", popnote, scomm_end, e$

# ]

spaces$=sav_spc

Link to comment
Share on other sites

This is what I've got so far, maybe today I'll get a chance to look at the post.

 

O2152 (-005 STOPTEST)

(MCX FILE - Z:PROGRAMMINGSOURCEtttttt1410005-005 STOPPOST TEST.MCX)

(PROGRAM - -005 STOPTEST.NC)

(DATE - SEP-21-2010)

(TIME - 8:08 AM)

(T1 - 1/2 FLAT ENDMILL - H1 - D1 - Min Length = 3.")

(T2 - 1/8 CENTERDRILL - H2 - D2 - Min Length = 3.")

(T3 - NO. 21 DRILL - H3 - D3 - Min Length = 3.")

(T4 - NO. 10-32 TAPRH - H4 - D4 - Min Length = 3.")

(T5 - 1/4 BALL ENDMILL - H5 - D5 - Min Length = 2.5" - R0.1250")

(OVERALL MAX - Z6.)

(OVERALL MIN - Z-.3)

N100 G00 G17 G20 G40 G80 G90

N110 G91 G28 Z0.

N120 (COMPENSATION TYPE - COMPUTER)

N130 T1 M06 ( 1/2 FLAT ENDMILL)

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