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:

mpmaster post question


Recommended Posts

This is a zmin/zmax post tooltable post question.

I'm using buffer #5 as per the orignal mpmaster and what i'm getting when I added min_depth and max_depth to the

 

code:

 ( T4     -   3/8 FLAT ENDMILL        -  H4     -  D4     -  D0.3750 "  -  CONTOUR.... Z99999. Z-99999. )  <= this is where the problem is

( T2 - 3/32 FLAT ENDMILL - H2 - D2 - D0.0938 " - CONTOUR.... Z-.5 Z2. ) <= this s/b tool 4

( T3 - 1/2 FLAT ENDMILL - H3 - D3 - D0.5000 " - CONTOUR.... Z-.1 Z.1 ) <= this s/b tool 2

Question - in the file the buffer outputs can I skip the first line?

code:

 

1001. 99999. -99999. <= skip this line

1002. -0.5 2. <= this be tool 4

1002. -0.1 0.1 <= this be tool 2

0. -0.5 2. <= this be tool 3


The min/max in the program is good

code:

T4 M06 ( 3/8 FLAT ENDMILL)

N130 (MAX - Z2.)

N140 (MIN - Z-.5)


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

 

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

tnote = t$

toffnote = tloffno$

tlngnote = tlngno$

min_depth = z_min$

max_depth = z_max$

spaces$=1

if t$ >= zero,

[

if output_z = yes$,

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

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

]

 

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

# Buffer 5 Read / Write Routines

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

pwritbuf5 # Write Buffer 1

b5_gcode = gcode$

b5_zmin = z_min$

b5_zmax = z_max$

b5_gcode = wbuf(5, wc5)

 

preadbuf5 # Read Buffer 1

size5 = rbuf(5,1)

b5_gcode = 1000

min_depth = 99999

max_depth = -99999

while rc5 <= size5 & b5_gcode = 1000,

[

if rc5 <= size5, b5_gcode = rbuf(5,rc5)

if b5_zmin < min_depth, min_depth = b5_zmin

if b5_zmax > max_depth, max_depth = b5_zmax

]

fmt Z 2 min_depth # Tool z_min

fmt Z 2 max_depth # Tool z_max


I can get any additional info if required.

 

Thank you for any and all help

Link to comment
Share on other sites

John and Simtech thank you for the responce. Sorry it took me so ling to get back to you guy's.

Thank you

 

John - I have the fbuf set to 5 1 1 0 and have opened the opened the *.tx5 file and have this

code:

 

1001. 99999. -99999.

1002. -0.5 2.

1002. -0.1 0.1

0. -0.5 2.

I did fix the rbuf line per Simtech suggestion

code:

size5=rbuf(5,1) 

now reads

size5=rbuf(5,0)

code:

pwritbuf5   # Write Buffer 1

b5_gcode = gcode$

b5_zmin = z_min$

b5_zmax = z_max$

b5_gcode = wbuf(5, wc5)

 

preadbuf5 # Read Buffer 1

size5 = rbuf(5,0)

b5_gcode = 1000

min_depth = 99999

max_depth = -99999

while rc5 <= size5 & b5_gcode = 1000,

[

if rc5 <= size5, b5_gcode = rbuf(5,rc5)

if b5_zmin < min_depth, min_depth = b5_zmin

if b5_zmax > max_depth, max_depth = b5_zmax

]

question #1 would be the wc5 : 1 be changed to wc5 :-1 and the the while statement would be changed from "while rc5 <= size5 & b5_gcode = 1000," to this "while rc5 < wc5,"

 

Thanks again for the help. If need be I can email the file over.

 

Chris

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