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:

Gettin jiggy with my mplmaster!


kunfuzed
 Share

Recommended Posts

In my ongoing effort to please the operators, I've been slicing and dicing an mplmaster (with quite a bit of forum help cheers.gif )

 

I've got the spindle start and toolchange both on one line now (thanks Roger), but now I also need to move the comment down to the same line.

 

From this:

code:

G40 G99                       lsof$ lsof$ 84.

G50 S1500 F.015 lsof$ lsof$ 84.

(ROUGH DRILL) lsof$ pcomment2 84.

N1 G97 S100 M03 T0707 lsof$ p__9:1686 84.

M8 lsof$ p__241:4318 84.

G4 P2000 lsof$ p__242:4325 84.

G0 X0. Z.275 lsof$ ltlchg$ 84.

G99 G1 Z-1.3395 F.25 llin$ p__104:2484 88.

G0 Z.275 lrapid$ p__102:2469 88.

G0 X10. Z10. T0 ptoolend$ p__39:1961 98.


To this:

code:

G40 G99             

G50 S1500 F.015

N1 G97 S100 M03 T0707 (ROUGH DRILL)

M8

G4 P2000

G0 X0. Z.275

G99 G1 Z-1.3395 F.25

G0 Z.275

G0 X10. Z10. T0


Here's my modified ltlchg$ postblock if it helps:

code:

ltlchg$          #Toolchange, lathe

toolchng = one

gcode$ = zero

copy_x = vequ(x$)

pcc_capture #Capture LCC ends, stop output RLCC

c_rcc_setup$ #Save original in sav_xa and shift copy_x for LCC comp.

pcom_moveb #Get machine position, set inc. from c1_xh

c_mmlt$ #Position multi-tool sub, sets inc. current if G54...

ptoolcomment

comment$

if home_type < two, #Toolchange G50/home/reference position

[

sav_xh = vequ(copy_x)

sav_absinc = absinc$

absinc$ = zero

start_xh = vequ(xh$)

pmap_home #Get home position, xabs

ps_inc_calc #Set start position, not incremental

#Toolchange home position

if home_type = one,

#pbld, *tn, *sgcode, pfxout, pfyout, pfzout, comment$, e$ # Removed 'pwcs,'

else,

[

#Toolchange g50 position

pbld, n$, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.", e$

if home_type = zero, pbld, n$, *sg50, pfxout, pfyout, pfzout, e$

]

pe_inc_calc #Update previous

absinc$ = sav_absinc

copy_x = vequ(sav_xh)

]

else,

[

pbld, n$, pwcs, e$

]

#toolno = t$ * 100 + tloffno$

#tn = tn + 1 # [ADDED] Increment 'tn' (the toolchange 'N' number)

#if not(synch_flg & tool_op$ = 67), #Suppress tool output if cutoff during part xfer

# [

# if omitseq$ = 1 & tseqno > 0,

# [

# if tseqno = 2, n$ = t$

# pbld, *n$, [if home_type = -1, *sgcode], *toolno, comment$, e$

# ]

# else, pbld, *tn, [if home_type = -1, *sgcode], *sg00, *toolno, comment$, e$ # Changed 'n$' to '*tn' added 'comment$,' and '*sg00,'

# ]

#ipr_actv$ = c1_ipr_actv

#pbld, n$, pfsgplane, pfsgfeed, e$

#pcaxis_off_l #Postblock for lathe transition

pcom_moveb #Reset machine position, set inc. from last position

#pcan # Moved further down

pspindle

# This code has be 'relocated' further down in this postblock

#Added for 'css_start_rpm' logic (09/05/01)

#if css_actv$,

# [

# if css_start_rpm,

# prpm # Direct RPM startup for programmed CSS

# else,

# pcssg50, pcss # NO RPM start - just output the CSS

# ]

#else, # Direct RPM was programmed

# [

# prpm # Output programmed RPM

# ]

toolno = t$ * 100 + tloffno$

tn = tn + 1 # [ADDED] Increment 'tn' (the toolchange 'N' number)

# Moved from above to 'here' - and altered to combine spindle with toolchange

if css_actv$,

[

if css_start_rpm, # Direct RPM startup for programmed CSS

pbld, *tn, prpm, sgcode, *toolno, e$

else,

[

#pbld, pcssg50, e$ # NO RPM start - just output the CSS

pbld, *tn, pcss, sgcode, *toolno, e$

]

]

else, # Direct RPM was programmed

[

pbld, *tn, prpm, sgcode, *toolno, e$

]

pcan # $Moved from above to 'here'

 

sav_absinc = absinc$

if home_type > one, absinc$ = zero

pcan1, pbld, n$, *sgcode, pfxout, pyout, pfzout, pscool, strcantext, e$

if lcc_cc_pos, plcc_cc_pos #Use sav_xa to position with comp. LCC

pcom_movea #Update previous, pcan2

ps_inc_calc #Reset current

absinc$ = sav_absinc

#Added for 'css_start_rpm' logic (09/05/01)

if css_start_rpm,

pcssg50, pcss # CSS output AFTER a G97S???? RPM spindle startup

c_msng$ #Position single-tool sub, sets inc. current if G54...

toolchng = zero

plast

Thanks!

Link to comment
Share on other sites

So you are looking for something like this then?

 

code:

N1 G50 S1500

N2 T0909 M42( FACE + ROUGH OD - CNMG543 )

N3 G96 S700 M04

N4 G0 G54 X1.793 Z.2679

N5 G1 Z.1679 F.015

N6 Z-1.3957

N7 X1.9344 Z-1.325

N8 G0 X1.9844

N9 G28 U0.

N10 G0 W8.

N11 M30

Obviously the rest of my code doesnt match... but I moved my ptoolcomment from where it was at default to the same line line as the tool.

 

I see you are starting with rpm instead of css, so it's likely you would need to change it here

 

code:

prpm            #Output for start spindle

if rmill <> 1, pbld, n$, *sg50, *maxss$, e$

n$, *toolno, [if rmill <> 1, pgear], [if rmill = 1, ptoolcomment], e$

speed = speedrpm

if posttype$ = two, #Lathe mode spindle

[

if speed = zero,

pbld, n$, pfspindle_l, e$ #RPM = '0', output just an 'M05'

else,

[

if (opcode$ = 3 | opcode$ = 16 | opcode$ = 105) & nextdc$ = 3 & rigid_tap = 1,

[

#pbld, n$, pgear, e$

pbld, n$, *sg97, e$

]

else,

[

#pbld, n$, pgear, e$

pbld, n$, *sg97, *speed, [if toolchng, pfspindle_l], e$

]

]

]

else, #Milling mode spindle

[

#result = nwadrs(strp, speed) #Different letter than 'S' for mill spindle?

if (opcode$ = 3 | opcode$ = 16 | opcode$ = 105) & nextdc$ = 3 & rigid_tap = 1, pbld, n$, *sg97, e$

else, pbld, n$, *sg97, *speed, *spindle_m, ptoolcomment, e$ <------------- LIKELY PTOOLCOMMENT ON THIS LINE

result = nwadrs(strs, speed) #Reset to 'S' for next single speeed output

]

!css_actv$ #Added (8/27/2002)

I changed mine here (since I start in G96 only, unless drilling)

 

code:

pcss            #Output Constant surface speed

speed = g_speed

n$, *toolno, pgear, ptoolcomment, e$ <----- ADDED PTOOLCOMMENT ON THIS LINE (for G96)

if css_actv$,

[

if css_start_rpm, pbld, n$, *sg9697, *speed, pspindle_l, !css_actv$, e$

else, pbld, n$, *sg9697, *speed, pfspindle_l, !css_actv$, e$ #Force if not called after G97

]

!speed

Link to comment
Share on other sites

Thanks for the response.

 

I think however I may have the tool comments turned off:

code:

tool_info    : 2     #Output tool information?

#0 = Off - Do not output any tool comments or tool table

#1 = Tool comments only

#2 = Tool table only

#3 = Tool comments and tool table

I got it to work before by adding a 'comment$' like so:

code:

ltlchg$          #Toolchange, lathe

toolchng = one

gcode$ = zero

copy_x = vequ(x$)

pcc_capture #Capture LCC ends, stop output RLCC

c_rcc_setup$ #Save original in sav_xa and shift copy_x for LCC comp.

pcom_moveb #Get machine position, set inc. from c1_xh

c_mmlt$ #Position multi-tool sub, sets inc. current if G54...

ptoolcomment

#comment$ <--------------------------------- Commented out and moved down

if home_type < two, #Toolchange G50/home/reference position

[

sav_xh = vequ(copy_x)

sav_absinc = absinc$

absinc$ = zero

start_xh = vequ(xh$)

pmap_home #Get home position, xabs

ps_inc_calc #Set start position, not incremental

#Toolchange home position

if home_type = one,

#pbld, *tn, *sgcode, pfxout, pfyout, pfzout, comment$, e$ # Removed 'pwcs,' <---------------------------------------- Moved here (not using this line anymore now though)

else,

[

#Toolchange g50 position

pbld, n$, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.", e$

if home_type = zero, pbld, n$, *sg50, pfxout, pfyout, pfzout, e$

]

So now I'm trying to figure out where this 'comment$' is outputing now, and how to get it to output down on the toolchange line. (which was merged with spindle start.

 

The coment I want is the comment on the tool path parameters page.

 

THank you very much.

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