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:

Spindle speed question


ckwhite
 Share

Recommended Posts

Hey guys, I did a search and couldn't find anything. So here is my question.

 

I have setup my machine (fanuc 16i) to probe using custom drill cycles. Problem is the post always comes out with

"S0 M5"

And the machine doesn't like that. So I was wanting to put an if/then statement in the post that says

If speed = zero

then M5 (without S0)

 

Here is the section of the post that outputs the spindle speed

 

 

if n_tpln_mch > m_one, #Toolplane mapping mode

[

#Enter your mapping scheme here...

pg68_map

pbld, n$, "G43", *tlngno$, *zabs_s, e$

pbld, n$, *sg00, pwcs, "X0.", "Y0.", *zabs_s, e$

pcan1, pbld, n$, *sgcode, *xabs_s, *yabs_s, *p_out, *s_out, strcantext, e$

]

else, #5 axis and regular mode ( n_tpln_mch = -2)

[

if cut_ra_head & use_g45, #Swap xout and yout based on offset axis

[

tloffno2 = tlngno$ + g45_of_add

pcan1, pbld, *speed, *spindle, pgear, strcantext, e$

n$, *sgcode, pwcs, *sgabsinc, *yout, *p_out, *s_out, e$

 

pbld, n$, "G45", *tloffno2, *xout, e$

]

else,

[

pcan1, pbld, *speed, *spindle, pgear, strcantext, e$

n$, *sgcode, pwcs, *sgabsinc, *xout, *yout, *p_out, *s_out, e$

#if *speed = zero

]

I moved the S0 M5 to a line by itself thinking that I could isolate it then maybe apply a if/then statement, but I may be on the wrong track..... Thanks

Link to comment
Share on other sites

Toward the bottom of the quoted text above....

 

pcan1, pbld, *speed, *spindle, pgear, strcantext, e$

 

 

the asterisk means force output (ignore modality)

taking that out wont fix it for you since the speed is probably different than it was previously.

What you need is....

 

if speed = zero,

[

pcan1, pbld, *spindle, pgear, strcantext, e$

]

else,

[

pcan1, pbld, *speed, *spindle, pgear, strcantext, e$

]

 

 

 

edit, now that I see the tool is always # 50, you could replace "if speed = zero" with "if t$ = 50"

should work either way.

 

You may need to put this in at multiple locations in the post....

i.e. null toolchange, start of file, toolchange, toolchange common.....

Start with one place, then if you see the S being output, just use the debugger to find the next location that requires this change in the post.

  • Like 1
Link to comment
Share on other sites

That did it! I moved the "*speed, *spindle, pgear, strcantext, e$" line back to where it was originally and added what you said.

 

Here is the code for any future reference.

 

if n_tpln_mch > m_one, #Toolplane mapping mode

[

#Enter your mapping scheme here...

pg68_map

pbld, n$, "G43", *tlngno$, *zabs_s, e$

pbld, n$, *sg00, pwcs, "X0.", "Y0.", *zabs_s, e$

pcan1, pbld, n$, *sgcode, *xabs_s, *yabs_s, *p_out, *s_out, strcantext, e$

]

else, #5 axis and regular mode ( n_tpln_mch = -2)

[

if cut_ra_head & use_g45, #Swap xout and yout based on offset axis

[

tloffno2 = tlngno$ + g45_of_add

pcan1, pbld, *speed, *spindle, pgear, strcantext, e$

n$, *sgcode, pwcs, *sgabsinc, *yout, *p_out, *s_out, e$

 

pbld, n$, "G45", *tloffno2, *xout, e$

]

else,

[

if T$ = 50,

[

pcan1, pbld, n$, *sgcode, pwcs, *sgabsinc, *xout, *yout, *p_out, *s_out,

*spindle, pgear, strcantext, e$

]

else,

[

pcan1, pbld, n$, *sgcode, pwcs, *sgabsinc, *xout, *yout, *p_out, *s_out,

*speed, *spindle, pgear, strcantext, e$

]

 

but what does this mean?

if cut_ra_head & use_g45, #Swap xout and yout based on offset axis

should I put it there too?

 

I don't have any S0's when I post so is this line not being used?

Link to comment
Share on other sites

If you probe in what I'm guessing G45, then yes you will need to.

 

else,
 [						 #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 if T$ = 50,
  [
  pcan1, pbld, n$, *sgcode, pwcs, *sgabsinc, *xout, *yout, *p_out, *s_out,
*spindle, pgear, strcantext, e$
  ]
else,
  [
  pcan1, pbld, n$, *sgcode, pwcs, *sgabsinc, *xout, *yout, *p_out, *s_out,
*speed, *spindle, pgear, strcantext, e$
  ]

 

You may or may not have an extra "[" in the noted line.

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