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

Ted - If you're having trouble learning how to use the X3 Debugger, here's a link to get you started.

 

X3 Debugger

 

.

 

If you don't already have the V9 Post Reference Guide, you should.

I don't know what I would do without it.

Your reseller will usually provide a copy N/C.

 

.

 

There is also a pdf in your documentation directory in MC.

 

McamX2_Post_Parameter_Ref.pdf

 

 

Just thought I'd point you toward some invaluable tools. biggrin.gif

Link to comment
Share on other sites

This is were I'm at right now

code:

ptlchg$          #Tool change

pcuttype

toolchng = one

toolcount = toolcount + 1

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

if wcstype = one, #Work coordinate system

[

pfbld, n$, *sg28, "X0.", "Y0.", e$

pfbld, n$, "G92", *xh$, *yh$, *zh$, e$

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

]

 

if coolant$ = 3, sm09 = sm09_2

[

pbld, n$, "M52", "(AIR BLAST ON)", e$

pbld, n$, "G4P5.", "(DWELL)", e$

pbld, n$, "M53", "(AIR BLAST OFF)", e$

pbld, n$, "G40", "G49", e$

pbld, n$, *sm01, e$

pbld, n$, *sg90,"T0M6", "(BLOW OUT SPINDLE AFTER H.P.)", e$

pcan1, pbld, n$, *sgcode, *t$, e$ #next_tool$

pbld, n$, "M52", "(AIR BLAST ON)", e$

pbld, n$, "G4P5.", "(DWELL)", e$

pbld, n$, "M53", "(AIR BLAST OFF)", e$

]

 

pbld, n$, "G40", "G49", e$

if mi10$=one, n$, *sm00, e$

else, pbld, n$, *sm01, e$

ptlchg_com


and this is what I get a lot of extra code.

code:

N4G90T24M6(.1885 DIA, CARBIDE REAMER)

G0G94G17G90G54J2X3.32Y0.A0.S800M3T25

G43H24Z1.125M8

M21("A" CLAMP)

G98G81Z.37R.625F4.

G80

M22("A" UNCLAMP)

M9S200

G91G28Z0.M5

M52(AIR BLAST ON)<<remove

G4P5.(DWELL)<<remove

M53(AIR BLAST OFF)<<remove

G40G49<<remove

M1<<remove

G90T0M6(BLOW OUT SPINDLE AFTER H.P.)<<remove

G0T25<<remove

M52(AIR BLAST ON)<<remove

G4P5.(DWELL)<<remove

M53(AIR BLAST OFF)<<remove

G40G49<<remove

M1<<remove

N5G90T25M6(10MM DRILL)

G0G94G17G90G55X2.18Y0.A180.S2742M3T18<<"T0"

G43H25Z1.125M50

M21("A" CLAMP)

G98G81Z.2874R.525F5.4

G80

X3.32

G98G81Z-.5036R.525F5.4

G80

M22("A" UNCLAMP)

M9S200

G91G28Z0.M5

M52(AIR BLAST ON)<< remove

G4P5.(DWELL)<< remove

M53(AIR BLAST OFF)<< remove

G40G49

M1

G90T0M6(BLOW OUT SPINDLE AFTER H.P.)

G0T18

M52(AIR BLAST ON)

G4P5.(DWELL)

M53(AIR BLAST OFF)

G40G49

M1

N6G90T18M6(7/16 X .0625R ENDMILL)

G0G94G17G90G55X3.32Y0.A180.S4365M3T26

G43H18Z1.125M50

M21("A" CLAMP)

G98G81Z-.3925R.525F13.

G80

M22("A" UNCLAMP)

M9S200

G91G28Z0.M5

G40G49

M1

N7G90T26M6(3/8 X 1" ENDMILL 5FL)

G0G94G17G90G55X3.3215Y-.0075A180.S5093M3T23

G43H26Z1.25M8

M21("A" CLAMP)

GON(LOOK AHEAD ON)

Z.525


it's turning on before and after the "M50" call out I only need it after.

 

any help would be great because this would finish of this post for me!!!

 

TIA

Link to comment
Share on other sites

OK Ted I see what you're trying to do now. You want to blow out the spindle after using coolant thru.

 

I thought you wanted to do this between each toolchange. SRY

 

OK the easiest way to do this conditionally based on whether or not M50 was used is to put this code in its own postblock, then test for the M50 at each toolchange, then call the postblock if M50 is true.

 

Kinda looks like thats what you were trying to do. I'll assume coolant = 3 is your M50 coolant condition.

 

The if statement will execute what is directly after it if the condition is met. The [bracketed] implied postblock is executing outside of the conditional statement, whether the coolant = 1,2, or 3.

 

Try this way:

 

code:

	if coolant$ = 3, 

[

sm09 = sm09_2

pbld, n$, "M52", "(AIR BLAST ON)", e$

pbld, n$, "G4P5.", "(DWELL)", e$

pbld, n$, "M53", "(AIR BLAST OFF)", e$

pbld, n$, "G40", "G49", e$

pbld, n$, *sm01, e$

pbld, n$, *sg90,"T0M6", "(BLOW OUT SPINDLE AFTER H.P.)", e$

pcan1, pbld, n$, *sgcode, *t$, e$ #next_tool$

pbld, n$, "M52", "(AIR BLAST ON)", e$

pbld, n$, "G4P5.", "(DWELL)", e$

pbld, n$, "M53", "(AIR BLAST OFF)", e$

]

pbld, n$, "G40", "G49", e$

if mi10$=one, n$, *sm00, e$

else, pbld, n$, *sm01, e$

ptlchg_com

BTW - I posted a link to the X3 Debug tutorial, the debugger has to be enabled through the control panel applet first, then you will see a red thing that looks like a bug on your post dialog box when you post code. Click on the bug to open the debugger. X3 Debugger

Link to comment
Share on other sites

This is what I'm grtting now

code:

 

N4G90T24M6(.1885 DIA, CARBIDE REAMER)

G0G94G17G90G54J2X3.32Y0.A0.S800M3T25

G43H24Z1.125M8

M21("A" CLAMP)

G98G81Z.37R.625F4.

G80

M22("A" UNCLAMP)

M9S200

G91G28Z0.M5

M52(AIR BLAST ON)<<<remove

G4P5.(DWELL)<<<remove

M53(AIR BLAST OFF)<<<remove

G40G49<<<remove

M1<<<remove

G90T0M6(BLOW OUT SPINDLE AFTER H.P.)<<<remove

G0T25<<<remove

M52(AIR BLAST ON)<<<remove

G4P5.(DWELL)<<<remove

M53(AIR BLAST OFF)<<<remove

G40G49

M1

N5G90T25M6(10MM DRILL)

G0G94G17G90G55X2.18Y0.A180.S2742M3T18

G43H25Z1.125M50

M21("A" CLAMP)

G98G81Z.2874R.525F5.4

G80

X3.32

G98G81Z-.5036R.525F5.4

G80

M22("A" UNCLAMP)

M9S200

G91G28Z0.M5

M52(AIR BLAST ON)<<<good

G4P5.(DWELL)<<<good

M53(AIR BLAST OFF)<<<good

G40G49<<<good

M1<<<good

G90T0M6(BLOW OUT SPINDLE AFTER H.P.)<<<good

G0T18<<<good

M52(AIR BLAST ON)<<<good

G4P5.(DWELL)<<<good

M53(AIR BLAST OFF)<<<good

G40G49<<<good

M1<<<good

N6G90T18M6(7/16 X .0625R ENDMILL)

G0G94G17G90G55X3.32Y0.A180.S4365M3T26

G43H18Z1.125M50

M21("A" CLAMP)

G98G81Z-.3925R.525F13.

G80

M22("A" UNCLAMP)

M9S200

G91G28Z0.M5

<<<<need it here

<<<<need it here

<<<<need it here

G40G49

M1


any help is appreciated

Link to comment
Share on other sites

Ted:

I think I should have asked first if you were using X-style coolant or old style.

 

I will cover both methods here.

 

It seems that coolant=0 whenever we are testing for it in ptlchg$.

 

In your post the code should have never been posted at all as [ if coolant=3 ] was our condition.

 

Are you sure you don't have this code coming from more than one postblock?

 

 

Sorry, I had you running in circles. LOL

 

 

 

 

I have already tried this out and it is working fine.

 

 

code:

# Add this flag to initializations 

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

coolthru_flg : 0

 

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

Add a new postblock:

 

pcthru

pbld, n$, "M52", "(AIR BLAST ON)", e$

pbld, n$, "G4P5.", "(DWELL)", e$

pbld, n$, "M53", "(AIR BLAST OFF)", e$

pbld, n$, "G40", "G49", e$

pbld, n$, *sm01, e$

pbld, n$, *sg90,"T0M6", "(BLOW OUT SPINDLE AFTER H.P.)", e$

pcan1, pbld, n$, *sgcode, *t$, e$ #next_tool$

pbld, n$, "M52", "(AIR BLAST ON)", e$

pbld, n$, "G4P5.", "(DWELL)", e$

pbld, n$, "M53", "(AIR BLAST OFF)", e$

 

 

Change these postblocks:

 

 

ptlchg$ #Tool change

pcuttype

toolchng = one

toolcount = toolcount + 1

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

if wcstype = one, #Work coordinate system

[

pfbld, n$, *sg28, "X0.", "Y0.", e$

pfbld, n$, "G92", *xh$, *yh$, *zh$, e$

]

if scoolantx="M50", pcthru #<--------------------Here

if coolthru_flg=1, pcthru

coolthru_flg=0 #<-------------------to here

if mi10$=one, n$, *sm00, e$

else, pbld, n$, *sm01, e$

ptlchg_com

 

 

 

 

peof$ #End of file for non-zero tool

pretract

if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

rotretflg = 1

pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$

if scoolantx="M50", pcthru #<--------------------Here

if coolthru_flg=1, pcthru

coolthru_flg=0 #<-------------------to here

rotretflg = 0

if lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$

comment$

if not(index), n$, *sg90, e$

n$, "M30", e$

mergesub$

clearsub$

mergeaux$

clearaux$

"%", e$

 

 

 

Then find and all of these arguments:

 

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

if coolant$ = 3, coolthru_flg=1 #<------Add this

 

 

They should be in these 3 postblocks:

 

ptlchg_com

ptlchg0$

pncoutput

 

Works with X coolant or Old style coolant.


Link to comment
Share on other sites

Ted - Here it is:

 

Working fine for me so far, one caution though, this only reads the first coolant setting for each tool

 

if you have an M8 for the first operation, then M50 for another operation with the same tool,

 

it will fail to see the M50 coming. One way around it is to force a toolchange for the operation with an

 

M50 being used.(If it's that important to use more than one coolant type for the same tool).

 

Just a heads up.

 

 

code:

#

# Add this new postblock to previous post:

#

# Note: coolthru_flg is used again if you renamed the flag you are using,

# change here as well, and don't forget to initialize it.

#

#

 

pstage_t

if coolant$ = 3, coolthru_flg=1

if scoolantx="M50", coolthru_flg=1

if coolthru_flg=1, "T0"

else, next_tool$

#

#

#

#

#

 

Then change this postblock as shown:

(Look for the G43)

 

#

#

 

ptlchg_com #Tool change common blocks

if force_output | sof,

[

result = force(ipr_type,ipr_type)

result = force(absinc$,absinc$)

result = force(plane$,plane$)

]

pcom_moveb

pcheckaxis #Check for valid rotary axis

c_mmlt$ #Multiple tool subprogram call

#ptoolcomment

if sof & scomm_sav <> snull,

[

spaces$ = 0

n$, pspc, scomm_str, *scomm_sav, scomm_end, e$

spaces$ = sav_spc

]

if sof = 0, scomm_sav = snull

comment$

pcomment3

pmisccheck

pcan

if stagetool >= zero,

[

if omitseq$ = 1 & tseqno > 0,

[

if tseqno = 2, n$ = t$

pbld, *n$, *t$, "M06", ptoolcomm, e$

]

else, pbld, n$, *t$, "M06", ptoolcomm, e$

]

spaces$=0

if output_z = yes$,

[

preadbuf5

if (opcode$ > 0 & opcode$ < 16) | opcode$ = 19,

[

#n$, pspc, scomm_str, "MAX - ", *max_depth, scomm_end, e$

n$, pspc, scomm_str, "MIN - ", *min_depth, scomm_end, e$

]

]

spaces$=sav_spc

pstock

if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0

sav_absinc = absinc$

if wcstype > one, absinc$ = zero

pindex

if safe_index,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], pfcout, strcantext, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, pfspindleout, [if gcode$ = 1, *feed], e$

]

else,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,

pfspindleout, [if gcode$ = 1, *feed], strcantext, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

phsm1_on #must remain before G43

#pbld, n$, "G43", *tlngno$, pfzout, scoolant, next_tool$, e$ #<------Commented Out

pbld, n$, "G43", *tlngno$, pfzout, scoolant, pstage_t , e$ #<---------------Here

pcan2 #Added so M and G codes in canned text will output before phsm2_on

phsm2_on #must remain after G43

sav_coolant = coolant$

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

if coolant$ = 3, coolthru_flg=1

absinc$ = sav_absinc

pcom_movea

toolchng = zero

c_msng$ #Single tool subprogram call

plast

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