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:

stage last tool as T0 in program


Recommended Posts

we have Makino cell system. At the end of a program run, i want spindle to be empty.

 

some thing like this

 

O0001

N10

T1M6

T2

G54 X.Y. S1000M3

.

.

.

G0G91G28Z0M5

M1

N20

T2M6

T1 >>>>>>>>>>>>>>>>>>>(I want to force "T0" at this point)

G54X.Y. S1000M3

.

.

.

G0G91G28Z0M5

M1

M6

M30

Link to comment
Share on other sites

Try this;

 

ptlchg$          #Tool change
     pcuttype
     toolchng = one
     toolcount = toolcount + 1
     if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)
     #else, nexttool = first_tool$ <<<<<<<<<<<<<<<<<<< replace this
     else, nexttool = 0 #<<<<<<<<<<<<<<with this

 

Edit: also here;

 

psof$            #Start of file for non-zero tool number
     ptravel
     pwritbuf5
     pcuttype
     toolchng = one
     if ntools$ = one,
       [
       #skip single tool outputs, stagetool must be on
       #stagetool = m_one
       !next_tool$
       ]
     tooltotal = rbuf(4,0)  #Reads total tool and null tool changes
     if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)
     #else, nexttool = first_tool$ <<<<<<<<<<<<<<<<<<< replace this
     else, nexttool = 0 #<<<<<<<<<<<<<<with this

 

and here;

 

ptlchg0$         #Call from NCI null tool change (tool number repeats)
     toolchng0 = one
     if op_id$ <> last_op_id,
       [
       rd_params$  # Read parameters - pparameter
       pmisccheck
       ]
     pcuttype
     toolcount = toolcount + 1
     if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)
     #else, nexttool = first_tool$ <<<<<<<<<<<<<<<<<<< replace this
     else, nexttool = 0 #<<<<<<<<<<<<<<with this

Link to comment
Share on other sites
At the end of a program run, i want spindle to be empty.

 

Forget altering the tool stageing stuff,

Just add these 2 lines to the peof postblock

 

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$
 pbld, n$, *sg28, "Y0.", protretinc, e$
 	rotretflg = 0
 	if lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$
 	comment$
 	if not(index), n$, *sg90, e$
 	n$, "T0", e$                                                   <<<<<<<<<<<<<<<<<<  add this
 	n$, "M06", e$                                                  	<<<<<<<<<<<<<<<<<< and this
 	n$, "M30", e$
 	mergesub$
 	clearsub$
 	mergeaux$
 	clearaux$
 	"%", e$

 	#Multi-post logic
 	spath_in  = spathnci$ + snamenci$
 	spath_set = spathpst$ + sset
 	spath_out = spathnc$ + snamenc$ + sextdoc
 	sparams = ssq + sdq + spath_in + sdq + sspace + sdq + spath_set + sdq + sspace + sdq + spath_out + sdq + ssq

 

This is better if you always want to empty the spindle at the end of the program, because altering the tool staging stuff like that causes problems if you use the first tool multiple times in the program.

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