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:

help? (on post switch/boolean)


kinglouie V
 Share

Recommended Posts

I'm trying to force a "W0" to limit motion on quill and not column. right now I'm working on the move going "home". not working out so good.

I can get the normal "Z0" and I can get both "W0" and "Z0" but can't switch between the two like I want. see below if interested.

 

code:

N820 M5                                 ptlchg1002$ p__9:928 872.$

N830 G91 G28 Z0. M9 ptlchg1002$ p__9:928 872.$

N840 G28 Y0. ptlchg1002$ p__9:928 872.$

N850 M5 ptlchg1002$ p__25:1063 872.$

N860 G0 G90 G54 G49 G80 W0 M9 ptlchg1002$ p__25:1063 872.$

N870 G91 G28 X0. Y0. ptlchg1002$ p__25:1063 872.$

N880 M00

post........

 

code:

 ptlchg1002$      #Call at actual toolchange, end last path here                        

if op_id$ <> prv_op_id$, pset_mach #Set rotary switches by reading machine def parameters

if cuttype <> one, sav_rev = rev #Axis Sub does not update to rev

pspindle

whatline$ = four #Required for vector toolpaths

if gcode$ = 1000,

[

#Null toolchange

]

else,

[

#Toolchange and Start of file

if gcode$ = 1002,

[

#Actual toolchange

pretract

[

else,

[

#Quill motion only at toolchange

if mi4$ = 1,

]

pbld, n$, sccomp, *sm05, psub_end_mny, e$

pbld, n$, *sgcode,*sgabsinc, *g_wcs, "G49", "G80", "W0", "M9", e$

pbld, n$, "G91", *sg28ref, "X0.", "Y0.", e$

absinc$ = sav_absinc

coolant$ = sav_coolant

]

if stagetool = one, prv_next_tool$ = m_one

prv_xia = vequ(xh$)

prv_feed = c9k

]

!op_id$

Link to comment
Share on other sites

Lou,

 

Try your changes in ptoolend;

code:

ptoolend$        #End of tool path, before reading new tool data

!speed, !spdir2

if nextop$ = 1002,

[

if mi4$ = 1,

[

pbld, n$, sccomp, *sm05, psub_end_mny, e$

pbld, n$, *sgcode,*sgabsinc, *g_wcs, "G49", "G80", "W0", "M9", e$

pbld, n$, "G91", *sg28ref, "X0.", "Y0.", e$

absinc$ = sav_absinc

coolant$ = sav_coolant

]

]

Link to comment
Share on other sites

quote:

is there a general "rule of thumb" I can look up?


If you are refering to "[ ]", every "[" needs a "]", also if you are not doing so Indent all of your "[" a few spaces, then when you close them, line it up vertically, it will make it much easier to follow, I have to do that plus add extra blank lines so all the "logic" looks kinda like a arrow pointing to the right, even then I usually end up with a headache and mumbling things to my self.

 

Jg

Link to comment
Share on other sites

Did you use "if nextop$ = 1002"? If you copy from the previous posting if should work just fine. Here's how the post I copied from looks;

 

code:

ptoolend$        #End of tool path, before reading new tool data

!speed, !spdir2

if nextop$ = 1000, prvtpsub = virt_tlplnno

if mi8$ = 1, pbld, n$, "G69", e$

pbld, n$, sgplane, e$

if nextop$ = 1002,

[

prvtpsub = 0

plane$ = 0

psub_end_s$

subout$ = 0 #main NC program

procesreturn, e$

pcoolantoff

sav_mac_tloffno = 0

sav_mi6 = 0

]

Link to comment
Share on other sites

You can create your own pretract and configure it how you want;

code:

ptlchg1002$      #Call at actual toolchange, end last path here

if op_id$ <> last_op_id,

[

#if cuttype <> one, sav_rev = rev #Axis Sub does not update to rev # CNC Mpfan V9.1

sav_rev = rev #Axis Sub does not update to rev

if one_rev = one | workofs$ <> prv_workofs$, sav_rev = 0

]

pspindle

whatline$ = four #Required for vector toolpaths

if gcode$ = 1000,

[

#Null toolchange

]

else,

[

#Toolchange and Start of file

if gcode$ = 1002,

[

#Actual toolchange

if mi4$ = 1, p_mi4_pretract #<<<<<<<<<<<<<

else, pretract #<<<<<<<<<<<<<<<<<<<<<<<

]

if stagetool = one, prv_next_tool$ = m_one

prv_xia = vequ(xh$)

prv_feed = c9k

]

Link to comment
Share on other sites

Kewl stuff for sure wink.gif

 

One of the reasons that I think MC posts just blow away the NX stuff that I have done.

 

If you can think it you can likely, fairly easily, sometimes, code and customize it.

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